{"version":3,"file":"Phone_valid.CWCiY73v.mjs","names":["React.useState","__legacyOverrideHOC_DataObserverContext","_jsx","__esmMin","init_npm_react_18_3_1","oe","c","init_jsx_runtime","_e","init_framer_BL70qLPA","OnlyTenDigits","value","setValue","digits","withOnlyTenDigits","DataObserverContext","C","props","init_Phone_valid"],"sources":["https:/framerusercontent.com/modules/wnn635GSSgCHbDNHkaoR/ik6Ke7drqcQxTnOURyt8/Phone_valid.js"],"sourcesContent":["// PhoneNumberOverride.tsx\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";/**\n * Attach this override to any Input component.\n * It strips non-digits on every keystroke and caps the length at 10.\n * When the field loses focus you can optionally validate (see BlurHandler below).\n */export function OnlyTenDigits(){const[value,setValue]=React.useState(\"\");return{value,// Sanitize & enforce length on every change\nonChange:e=>{const digits=e.target.value.replace(/\\D/g,\"\")// keep numbers only\n;setValue(digits.slice(0,10))// cap at 10\n;},// Block any non-digit key (still allow arrows, backspace, etc.)\nonKeyDown:e=>{const allowed=[\"Backspace\",\"Delete\",\"ArrowLeft\",\"ArrowRight\",\"Tab\"];if(!allowed.includes(e.key)&&!/^\\d$/.test(e.key)){e.preventDefault();}},// Optional: flag the field when it isn’t exactly 10 digits on blur\nonBlur:()=>{if(value.length!==10){alert(\"Please enter a 10-digit phone number.\");}},// UX sugar\nplaceholder:\"(___) ___-____\"};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withOnlyTenDigits(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...OnlyTenDigits(props)});};}withOnlyTenDigits.displayName=\"OnlyTenDigits\";\nexport const __FramerMetadata__ = {\"exports\":{\"OnlyTenDigits\":{\"type\":\"override\",\"name\":\"OnlyTenDigits\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOnlyTenDigits\":{\"type\":\"reactHoc\",\"name\":\"withOnlyTenDigits\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Phone_valid.map"],"mappings":"A,qKAKG,SAAgBU,GAAe,CAAC,GAAK,CAACC,EAAMC,GAAUZ,EAAe,EAAE,EAAE,MAAM,CAAC,QACnF,SAAS,GAAG,CAAC,IAAMa,EAAO,EAAE,OAAO,MAAM,QAAQ,MAAM,EAAE,EACxDD,EAASC,EAAO,MAAM,EAAE,EAAE,CAAC,CAC3B,EACD,UAAU,GAAG,CAAwE,CAAC,CAAzD,YAAY,SAAS,YAAY,aAAa,KAAiB,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG,CAAC,OAAO,KAAK,EAAE,GAAG,GAAG,EAAE,eAAe,CAAG,EACxJ,WAAW,CAAIF,EAAM,SAAS,IAAI,MAAM,uCAAuC,CAAG,EAClF,YAAY,gBAAgB,CAAE,CAAoJ,SAAgBG,EAAkB,EAAE,CAAC,MAAO,KAAQT,EAA+BJ,CAAuC,EAASC,EAAKc,EAAE,CAAC,GAAGC,EAAM,GAAGP,EAAcO,CAAK,CAAC,CAAC,EAAI,C,0CAAC,EAAkB,YAAY,e"}