{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/qvk47a3TrgpUCG7Kvpmq/9wUDCLnMROZ3rdHIko6u/Form.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function WebAppEmbed({label,lang}){const[domain,setDomain]=React.useState(\"\");const[iframeHeight,setIframeHeight]=React.useState(\"100%\");React.useEffect(()=>{// This code runs only on the client.\nconst hostname=window.location.hostname;const cleanHostname=hostname.replace(/^www\\./,\"\");const extractedDomain=cleanHostname.split(\".\")[0];setDomain(extractedDomain);console.log(\"Hostname:\",hostname);console.log(\"Cleaned Hostname:\",cleanHostname);console.log(\"Extracted Domain:\",extractedDomain);const handleMessage=event=>{if(event.data?.type===\"heightUpdate\"){setIframeHeight(event.data.height+\"px\");}};window.addEventListener(\"message\",handleMessage);return()=>{window.removeEventListener(\"message\",handleMessage);};},[]);React.useEffect(()=>{if(domain){const url=`https://forms.scaile.it/?label=${label}&lang=${lang}&port=${domain}`;const iframe=document.getElementById(\"embeddedWebApp\");if(iframe){iframe.onload=()=>{// Post message to the iframe to request height\niframe.contentWindow.postMessage({type:\"requestHeight\"},\"*\");};}}},[domain,label,lang]);// Only render iframe if domain is computed.\nif(!domain)return null;const url=`https://forms.scaile.it/?label=${label}&lang=${lang}&port=${domain}`;console.log(\"Constructed URL:\",url);return /*#__PURE__*/_jsx(\"iframe\",{id:\"embeddedWebApp\",src:url,style:{width:\"100%\",height:iframeHeight,border:\"none\"},title:\"Embedded Web App\"});}WebAppEmbed.defaultProps={label:\"general\",lang:\"EN\"};addPropertyControls(WebAppEmbed,{label:{type:ControlType.String,title:\"Label\"},lang:{type:ControlType.String,title:\"Lang\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"WebAppEmbed\":{\"type\":\"reactComponent\",\"name\":\"WebAppEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}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,MAAM,UAAU,KAAK,IAAI,EAAEkB,EAAoBlB,EAAY,CAAC,MAAM,CAAC,KAAKmB,EAAY,OAAO,MAAM,OAAO,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,MAAM,MAAM,CAAC,CAAC",
  "names": ["WebAppEmbed", "label", "lang", "domain", "setDomain", "ye", "iframeHeight", "setIframeHeight", "ue", "hostname", "window", "cleanHostname", "extractedDomain", "handleMessage", "event", "url", "iframe", "p", "addPropertyControls", "ControlType"]
}
