{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/smEZ4yWUM8QAGswPD86N/kpq4JySZ3DUI1N0yWsmX/Validation.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function withPhoneMaskAndValidation(Component){return props=>{useEffect(()=>{const applyPhoneMask=event=>{const matrix=\"+__ (___) ___-__-__\";let i=0;const def=matrix.replace(/\\D/g,\"\");let currentValue=event.target.value.replace(/\\D/g,\"\");if(def.length>=currentValue.length){currentValue=def;}const newValue=matrix.replace(/./g,function(a){return/[_\\d]/.test(a)&&i<currentValue.length?currentValue.charAt(i++):i>=currentValue.length?\"\":a;});event.target.value=newValue;};const handleBlur=event=>{const currentValue=event.target.value;if(currentValue.length<=2){event.target.value=\"\";const customEvent=new Event(\"change\");event.target.dispatchEvent(customEvent);}};const phoneFields=document.querySelectorAll('input[type=\"tel\"]');phoneFields.forEach(phoneField=>{phoneField.addEventListener(\"input\",applyPhoneMask);phoneField.addEventListener(\"blur\",handleBlur);});// Cleanup\nreturn()=>{phoneFields.forEach(phoneField=>{phoneField.removeEventListener(\"input\",applyPhoneMask);phoneField.removeEventListener(\"blur\",handleBlur);});};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPhoneMaskAndValidation\":{\"type\":\"reactHoc\",\"name\":\"withPhoneMaskAndValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Validation.map"],
  "mappings": "gDAA+E,SAASA,EAA2BC,EAAU,CAAC,OAAOC,IAAQC,EAAU,IAAI,CAAC,IAAMC,EAAeC,GAAO,CAAC,IAAMC,EAAO,sBAA0BC,EAAE,EAAQC,EAAIF,EAAO,QAAQ,MAAM,EAAE,EAAMG,EAAaJ,EAAM,OAAO,MAAM,QAAQ,MAAM,EAAE,EAAKG,EAAI,QAAQC,EAAa,SAAQA,EAAaD,GAAK,IAAME,EAASJ,EAAO,QAAQ,KAAK,SAASK,EAAE,CAAC,MAAM,QAAQ,KAAKA,CAAC,GAAGJ,EAAEE,EAAa,OAAOA,EAAa,OAAOF,GAAG,EAAEA,GAAGE,EAAa,OAAO,GAAGE,CAAE,CAAC,EAAEN,EAAM,OAAO,MAAMK,CAAS,EAAQE,EAAWP,GAAO,CAAuC,GAAnBA,EAAM,OAAO,MAAsB,QAAQ,EAAE,CAACA,EAAM,OAAO,MAAM,GAAG,IAAMQ,EAAY,IAAI,MAAM,QAAQ,EAAER,EAAM,OAAO,cAAcQ,CAAW,CAAE,CAAC,EAAQC,EAAY,SAAS,iBAAiB,mBAAmB,EAAE,OAAAA,EAAY,QAAQC,GAAY,CAACA,EAAW,iBAAiB,QAAQX,CAAc,EAAEW,EAAW,iBAAiB,OAAOH,CAAU,CAAE,CAAC,EACt6B,IAAI,CAACE,EAAY,QAAQC,GAAY,CAACA,EAAW,oBAAoB,QAAQX,CAAc,EAAEW,EAAW,oBAAoB,OAAOH,CAAU,CAAE,CAAC,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsBI,EAAKf,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAI",
  "names": ["withPhoneMaskAndValidation", "Component", "props", "ue", "applyPhoneMask", "event", "matrix", "i", "def", "currentValue", "newValue", "a", "handleBlur", "customEvent", "phoneFields", "phoneField", "p"]
}
