local w=require(script.Parent:WaitForChild("\078\117\109\098\101\114"))local function j(w,j)local i={}for w in string.gmatch(w,j)do i[#i+1]=w end return i end local i={}i.Name="\086\101\099\116\111\114\051"i.Default="\048\044 \048\044 \048"function i.Process(j,w)return w end function i.Verify(b,i)local c=i:find("\091\094\037\100\046\044 -\093")if not c then local b=#string.split(i,"\044")if b==3 then local b=j(i,"\037-\042\037\100\091\037\100\046\093\042")if#b==3 then for j,i in next,b do if not w:Verify(i)then return false end end return true end end end return false end function i.ToType(j,w)w=j:Verify(w)and w or j.Default local i=string.split(w,"\044 ")for w,j in next,i do i[w]=tonumber(j)end return Vector3.new(unpack(i))end return i
local NumberMask = require(script.Parent:WaitForChild("Number"))

local function matchArray(str, pattern)
	local arr = {}
	for sub in string.gmatch(str, pattern) do
		arr[#arr + 1] = sub
	end
	return arr
end

local Mask = {}

Mask.Name = "Vector3"
Mask.Default = "0, 0, 0"

function Mask:Process(text)
	return text
end

function Mask:Verify(text)
	local find = text:find("[^%d., -]") -- find any non number, decimal, comma, space or negative
	if (not find) then
		local nCommas = #string.split(text, ",")
		if (nCommas == 3) then
			local nums = matchArray(text, "%-*%d[%d.]*")
			if (#nums == 3) then
				for i, num in next, nums do
					if (not NumberMask:Verify(num)) then
						return false
					end
				end
				return true
			end
		end
	end
	return false
end

function Mask:ToType(text)
	text = self:Verify(text) and text or self.Default
	
	local components = string.split(text, ", ")
	for i, c in next, components do
		components[i] = tonumber(c)
	end
	
	return Vector3.new(unpack(components))
end

return Mask