{"version":3,"file":"CustomSendServices.CmECohnZ.mjs","names":["useRef","__legacyOverrideHOC_DataObserverContext","_jsx","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/lfLRQ0ww20O2XWHLLDfJ/viRSGioDA6MBInZ9TZCT/Phone_Number_Override.js","https:/framerusercontent.com/modules/KmkO7wU0h1XULR28Td5L/nnf1bvwIsgqaWRoIyMb9/CustomSendServices.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 loadAssets=async()=>{const isArabic=window.location.pathname.includes(\"/ar/\");// Inject intl-tel-input CSS\nconst 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);// Inject custom styles based on language\nconst 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);// Load intl-tel-input JS\nconst 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){itiRef.current=window.intlTelInput(input,{initialCountry:\"ae\",nationalMode:false,utilsScript:\"https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/utils.js\"});const wrapper=input.closest(\".framer-form-input-wrapper\");if(wrapper){wrapper.classList.add(\"custom-phone-wrapper\");}const form=input.closest(\"form\");if(form){form.addEventListener(\"submit\",e=>{const isValid=itiRef.current.isValidNumber();if(!isValid){e.preventDefault();e.stopPropagation();if(wrapper)wrapper.classList.add(\"invalid\");}else{if(wrapper)wrapper.classList.remove(\"invalid\");input.value=itiRef.current.getNumber();}});}}};document.body.appendChild(script);return()=>{document.head.removeChild(cssLink);document.head.removeChild(customStyle);document.body.removeChild(script);};};loadAssets();},[]);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\":{\"withPhoneNumberWithCountryCode\":{\"type\":\"reactHoc\",\"name\":\"withPhoneNumberWithCountryCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PhoneNumberWithCountryCode\":{\"type\":\"override\",\"name\":\"PhoneNumberWithCountryCode\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Phone_Number_Override.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";export function HoneypotOverrideCustom(){useEffect(()=>{const form=document.querySelector(\"form\");if(!form)return;// Create honeypot field (invisible to humans, visible to bots)\nconst honeypot=document.createElement(\"input\");honeypot.type=\"text\";honeypot.name=\"last_name\";honeypot.style.position=\"absolute\";honeypot.style.left=\"-9999px\";honeypot.style.opacity=\"0\";honeypot.setAttribute(\"tabIndex\",\"-1\");honeypot.setAttribute(\"autoComplete\",\"off\");form.appendChild(honeypot);////\nasync function getClientIp(){try{const res=await fetch(\"https://api.ipify.org?format=json\");const data=await res.json();return data.ip;}catch(err){return\"unknown\";}}function getUTMParameters(){const urlParamsForm=new URLSearchParams(window.location.search);const utmLeadSource=urlParamsForm.get(\"utm_lead_source\")||sessionStorage.getItem(\"utm_lead_source\");const utmSourceLvl1=urlParamsForm.get(\"utm_source_lvl_1\")||sessionStorage.getItem(\"utm_source_lvl_1\");const utmSourceLvl2=urlParamsForm.get(\"utm_source_lvl_2\")||sessionStorage.getItem(\"utm_source_lvl_2\");const utmSourceLvl3=urlParamsForm.get(\"utm_source_lvl_3\")||sessionStorage.getItem(\"utm_source_lvl_3\");const gadSource=urlParamsForm.get(\"gad_source\")||sessionStorage.getItem(\"gad_source\");const gclid=urlParamsForm.get(\"gclid\")||sessionStorage.getItem(\"gclid\");return{utmLeadSource,utmSourceLvl1,utmSourceLvl2,utmSourceLvl3,gadSource,gclid};}// Intercept submission\nconst handler=async e=>{e.preventDefault();e.stopImmediatePropagation()// block Framer’s normal submission\n;const submitButton=document.getElementById(\"submitBtnForm\");const loaderIcon=document.getElementById(\"loaderIcon\");const buttonText=document.querySelector(\".button-text\");const info=document.getElementById(\"info\");const error=document.getElementById(\"error\");console.log(\"herew\");if(buttonText&&loaderIcon&&submitButton){buttonText.style.display=\"none\";loaderIcon.style.display=\"inline-block\";submitButton.disabled=true;}console.log(\"here\");const formData=new FormData(form);formData.append(\"honeypot\",honeypot.value);formData.append(\"url\",window?.location?.href);formData.append(\"timestamp\",new Date().toISOString());const utmParams=getUTMParameters();const clientIp=await getClientIp();const phoneInput=window.phoneInput;const phoneInputField=window.phoneInputField;const phoneNumber=phoneInput?.getNumber?.()||\"\";const payload={};formData.append(\"lead_source\",utmParams.utmLeadSource||\"Online\");formData.append(\"lead_source_lv1\",utmParams.utmSourceLvl1||\"https://executivecentre.sa/\");formData.append(\"lead_source_lv2\",utmParams.utmSourceLvl2||\"Organic Traffic\");formData.append(\"lead_source_lv3\",utmParams.utmSourceLvl3||\"Arena\");formData.append(\"phone\",phoneNumber);formData.append(\"url\",parent?.window?.location?.href);formData.append(\"client_ip\",clientIp);formData.forEach((value,key)=>{payload[key]=String(value);});// Convert FormData → JSON\n// if (honeypot.value.trim() !== \"\") {\n//     //  update zapier link\n//     try {\n//         const zapierRequest = await fetch(\n//             \"https://hooks.zapier.com/hooks/catch/4438683/uhegqw2/\",\n//             {\n//                 method: \"POST\",\n//                 headers: { \"Content-Type\": \"application/json\" },\n//                 mode: \"no-cors\", // bypass CORS restriction\n//                 body: JSON.stringify(payload),\n//             }\n//         )\n//         console.log(zapierRequest)\n//     } catch (err) {\n//         console.log(err)\n//         console.error(\"Honeypot call failed:\", err)\n//     }\n//     window.location.href = \"/thank-you\"\n// } else {\ntry{const zapierRequest=await fetch(\"https://hooks.zapier.com/hooks/catch/4438683/us8zwtp/\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},mode:\"no-cors\",body:JSON.stringify(payload)});console.log(zapierRequest);}catch(err){console.log(err);console.error(\"Honeypot call failed:\",err);}window.location.href=\"/thank-you\";};console.log(\"go throuh\");// return\n// else → do nothing, Framer continues normally\n// }\nform.addEventListener(\"submit\",handler,true);return()=>{form.removeEventListener(\"submit\",handler,true);};},[]);return null;}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withHoneypotOverrideCustom(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...HoneypotOverrideCustom(props)});};}withHoneypotOverrideCustom.displayName=\"HoneypotOverrideCustom\";\nexport const __FramerMetadata__ = {\"exports\":{\"HoneypotOverrideCustom\":{\"type\":\"override\",\"name\":\"HoneypotOverrideCustom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHoneypotOverrideCustom\":{\"type\":\"reactHoc\",\"name\":\"withHoneypotOverrideCustom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomSendServices.map"],"mappings":"sLAA+E,SAAgB,GAA4B,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAO,EAAOA,EAAO,KAAK,CAsC00B,OAtCz0B,MAAc,EAAkB,SAAS,CAAC,IAAM,EAAS,EAAO,SAAS,SAAS,SAAS,OAAO,CAClR,EAAQ,SAAS,cAAc,OAAO,CAAC,EAAQ,IAAI,aAAa,EAAQ,KAAK,gFAAgF,SAAS,KAAK,YAAY,EAAQ,CACrM,IAAM,EAAY,SAAS,cAAc,QAAQ,CAAC,EAAY,UAAU;;;;;uBAKjD,EAAS,MAAM,MAAM;;;;;;;;;;;;;;;;;;wBAkBpB,EAAS,QAAQ,OAAO;;;;oBAI5B,EAAS,EAAE,OAAO;oBAClB,EAAS,OAAO,EAAE;;;;iCAIL,EAAS,OAAO,MAAM;gCACvB,EAAS,MAAM,OAAO;;QAE9C,SAAS,KAAK,YAAY,EAAY,CAC9C,IAAM,EAAO,SAAS,cAAc,SAAS,CAAo0B,MAAn0B,GAAO,IAAI,kFAAkF,EAAO,WAAW,CAAC,IAAM,EAAM,EAAa,SAAS,cAAc,QAAQ,CAAC,GAAG,GAAO,EAAO,aAAa,CAAC,EAAO,QAAQ,EAAO,aAAa,EAAM,CAAC,eAAe,KAAK,aAAa,GAAM,YAAY,uEAAuE,CAAC,CAAC,IAAM,EAAQ,EAAM,QAAQ,6BAA6B,CAAI,GAAS,EAAQ,UAAU,IAAI,uBAAuB,CAAE,IAAM,EAAK,EAAM,QAAQ,OAAO,CAAI,GAAM,EAAK,iBAAiB,SAAS,GAAG,CAAe,EAAO,QAAQ,eAAe,EAA0G,GAAQ,EAAQ,UAAU,OAAO,UAAU,CAAC,EAAM,MAAM,EAAO,Q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