{"version":3,"file":"ImmigrationAI_iframe.DbWfLRK_.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/dcXiuZjZ1PQg1cw2LZkQ/nxs4eC9GfLwmkRqVC6Ly/ImmigrationAI_iframe.js"],"sourcesContent":["\"use client\";import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";const useLocaleFromUrl=()=>{const[currentLocale,setCurrentLocale]=React.useState(\"en\");React.useEffect(()=>{// Only access window.location inside useEffect\nif(typeof window!==\"undefined\"){const currentUrl=window.location.href;const urlPath=window.location.pathname;// Check if the URL contains 'pt'\nif(urlPath.includes(\"/pt/\")||currentUrl.includes(\"/pt\")){setCurrentLocale(\"pt\");}else{setCurrentLocale(\"en\");}}},[]);return currentLocale;};export default function ImmigrationAIPopup(){const currentLocale=useLocaleFromUrl();const[currentPath,setCurrentPath]=React.useState(\"\");const[affiliateCode,setAffiliateCode]=React.useState(\"\");// Get the current path and affiliate code\nReact.useEffect(()=>{if(typeof window!==\"undefined\"){// Get the path from the URL\nconst path=window.location.pathname;setCurrentPath(path);// Get the affiliate code from query parameter\nconst queryParam=new URLSearchParams(window.location.search).get(\"r\");// If there's a query parameter 'r', use that as the affiliate code\nif(queryParam){setAffiliateCode(queryParam);}else{const pathCode=path.split(\"/\").filter(Boolean)[0];if(pathCode&&/^[a-z0-9]{6}$/.test(pathCode)){setAffiliateCode(pathCode);}}}},[]);const buildImmigrationUrl=locale=>{// Base URL with appropriate locale\nconst baseUrl=`https://immigration.jumpstartfinance.ai/${locale}`;// Add affiliate code as query parameter if it exists\nreturn`${baseUrl}${affiliateCode?`?r=${affiliateCode}`:\"\"}`;};return /*#__PURE__*/_jsx(\"div\",{style:{minHeight:\"300px\",width:\"100%\",height:\"100%\",border:\"none\",padding:0,margin:0,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"iframe\",{src:buildImmigrationUrl(currentLocale),style:{width:\"100%\",height:\"100%\",border:\"none\",display:\"block\"},title:\"Immigration AI Assistant\"})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImmigrationAIPopup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImmigrationAI_iframe.map"],"mappings":"2MAE4I,SAAwB,GAAoB,CAAC,IAAM,EAAc,GAAkB,CAAM,CAAC,EAAY,GAAgBA,EAAe,GAAG,CAAM,CAAC,EAAc,GAAkBA,EAAe,GAAG,CAM/Q,OAL9D,MAAoB,CAAC,GAAU,IAAS,OAAY,CACpD,IAAM,EAAK,EAAO,SAAS,SAAS,EAAe,EAAK,CACxD,IAAM,EAAW,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,IAAI,IAAI,CACrE,GAAG,EAAY,EAAiB,EAAW,KAAM,CAAC,IAAM,EAAS,EAAK,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC,GAAM,GAAU,gBAAgB,KAAK,EAAS,EAAE,EAAiB,EAAS,IAAM,EAAE,CAAC,CAElG,EAAK,MAAM,CAAC,MAAM,CAAC,UAAU,QAAQ,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,QAAQ,EAAE,OAAO,EAAE,SAAS,SAAS,CAAC,SAAsB,EAAK,SAAS,CAAC,KAF5B,GAEzM,GADQ,2CAA2C,MACtC,EAAc,MAAM,IAAgB,MAA4M,EAAc,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,QAAQ,QAAQ,CAAC,MAAM,2BAA2B,CAAC,CAAC,CAAC,wBAR/T,IAA4B,CAAM,MAAqB,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAe,KAAK,CAErD,OAFsD,MAAoB,CAC/L,GAAU,IAAS,OAAY,CAAC,IAAM,EAAW,EAAO,SAAS,KAAmB,EAAO,SAAS,SACzF,SAAS,OAAO,EAAE,EAAW,SAAS,MAAM,CAAE,EAAiB,KAAK,CAAO,EAAiB,KAAK,GAAK,EAAE,CAAC,CAAQ"}