{"version":3,"file":"Phone_Number.CSFINGZM.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/ZzGpDr5gEJYqDK5S1eDt/ayyzwN7GqfADa0Sarq8i/Phone_Number.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function PhoneNumberWithCountryCode(){const containerRef=useRef(null);const itiRef=useRef(null);useEffect(()=>{const isArabic=window.location.pathname.includes(\"/ar/\")||window.location.pathname.includes(\"/ar\");/* ------------------------------\n           Inject intl-tel-input CSS\n        ------------------------------- */const cssLink=document.createElement(\"link\");cssLink.rel=\"stylesheet\";cssLink.href=\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/css/intlTelInput.css\";document.head.appendChild(cssLink);/* ------------------------------\n           Custom styles\n        ------------------------------- */const customStyle=document.createElement(\"style\");customStyle.innerHTML=`\n        .custom-phone-wrapper {\n          overflow: visible;\n          display: flex;\n          transition: all 0.3s ease;\n          direction: ${isArabic?\"rtl\":\"ltr\"};\n        }\n\n        .custom-phone-wrapper.invalid {\n          border-color: red;\n          background-color: #ffe6e6;\n        }\n\n        .custom-phone-wrapper .iti {\n          width: 100%;\n        }\n\n        .custom-phone-wrapper .iti input {\n          border: none;\n          outline: none;\n          background: transparent;\n          width: 100%;\n          font-size: 16px;\n          text-align: ${isArabic?\"right\":\"left\"};\n        }\n\n        .iti--allow-dropdown .iti__flag-container {\n          right: ${isArabic?0:\"auto\"};\n          left: ${isArabic?\"auto\":0};\n        }\n\n        .iti--allow-dropdown input[type=tel] {\n          padding-right: ${isArabic?\"52px\":\"6px\"};\n          padding-left: ${isArabic?\"6px\":\"52px\"};\n        }\n        `;document.head.appendChild(customStyle);/* ------------------------------\n           Load JS\n        ------------------------------- */const script=document.createElement(\"script\");script.src=\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/intlTelInput.min.js\";script.onload=()=>{const input=containerRef.current?.querySelector(\"input\");if(!input||!window.intlTelInput)return;itiRef.current=window.intlTelInput(input,{initialCountry:\"ae\",nationalMode:false,allowExtensions:true,utilsScript:\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/utils.js\"});window.phoneInput=itiRef.current;const wrapper=input.closest(\".framer-form-input-wrapper\");if(wrapper)wrapper.classList.add(\"custom-phone-wrapper\");const form=input.closest(\"form\");if(!form)return;form.addEventListener(\"submit\",e=>{const iti=itiRef.current;const isValid=iti.isValidNumber();if(!isValid){e.preventDefault();e.stopPropagation();wrapper?.classList.add(\"invalid\");return;}wrapper?.classList.remove(\"invalid\");const fullNumber=iti.getNumber()// +9665...\n;const extension=iti.getExtension()// e.g. 123\n;// ✅ Append extension cleanly\ninput.value=extension?`${fullNumber} x${extension}`:fullNumber;});};document.body.appendChild(script);return()=>{document.head.removeChild(cssLink);document.head.removeChild(customStyle);document.body.removeChild(script);};},[]);return{ref:containerRef};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withPhoneNumberWithCountryCode(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...PhoneNumberWithCountryCode(props)});};}withPhoneNumberWithCountryCode.displayName=\"PhoneNumberWithCountryCode\";\nexport const __FramerMetadata__ = {\"exports\":{\"PhoneNumberWithCountryCode\":{\"type\":\"override\",\"name\":\"PhoneNumberWithCountryCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPhoneNumberWithCountryCode\":{\"type\":\"reactHoc\",\"name\":\"withPhoneNumberWithCountryCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Phone_Number.map"],"mappings":"2LAA+E,SAAgB,GAA4B,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAO,EAAOA,EAAO,KAAK,CA4CgD,OA5C/C,MAAc,CAAC,IAAM,EAAS,EA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