{"version":3,"file":"PaperformEmbed.DOhmsjTH.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/dlNQNj8lkJfw7Nz2C5ni/FH6lJtRHxrlHgQwsz6zM/PaperformEmbed.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function PaperformEmbed(props){const{formId=\"yrsqkvgh\",formHeight=500}=props;const containerRef=useRef(null);useEffect(()=>{if(typeof document===\"undefined\")return;const w=window;try{function getCookie(name){const cn=name+\"=\";const parts=decodeURIComponent(document.cookie).split(\";\");for(let i=0;i<parts.length;i++){let c=parts[i];while(c.charAt(0)===\" \")c=c.substring(1);if(c.indexOf(cn)===0)return c.substring(cn.length);}return\"\";}const utms=JSON.parse(getCookie(\"utm_parameters\")||\"{}\");let data=\"\";for(const key in utms){if(Object.prototype.hasOwnProperty.call(utms,key)&&utms[key]){data+=key+\"=\"+utms[key]+\"&\";}}data=data.slice(0,-1);const el=containerRef.current?containerRef.current.querySelector(\"[data-paperform-id]\"):null;if(el&&data)el.setAttribute(\"prefill\",data);}catch(e){}const SRC=\"https://paperform.co/__embed.min.js\";function initForms(){try{if(w.Paperform&&typeof w.Paperform.populateAll===\"function\")w.Paperform.populateAll();}catch(e){}}const existing=document.querySelector('script[src=\"'+SRC+'\"]');if(!existing){const script=document.createElement(\"script\");script.src=SRC;script.async=true;script.onload=initForms;document.body.appendChild(script);}else{initForms();}},[formId]);// Stop the embedded form from stealing focus on load and yanking the page.\nuseEffect(()=>{if(typeof window===\"undefined\")return;const root=containerRef.current;if(!root)return;let engaged=false;const markEngaged=()=>{engaged=true;};root.addEventListener(\"mousedown\",markEngaged);root.addEventListener(\"touchstart\",markEngaged,{passive:true});const onBlur=()=>{if(engaged)return;const el=document.activeElement;if(el&&el.tagName===\"IFRAME\"&&root.contains(el)){const y=window.scrollY;el.blur();window.focus();window.scrollTo(0,y);}};window.addEventListener(\"blur\",onBlur);const stop=window.setTimeout(()=>{engaged=true;},1e4);return()=>{window.clearTimeout(stop);window.removeEventListener(\"blur\",onBlur);root.removeEventListener(\"mousedown\",markEngaged);root.removeEventListener(\"touchstart\",markEngaged);};},[formId]);const paperAttrs={\"no-scroll\":\"1\",lazy:\"true\",height:formHeight+\"px\"};return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\"},children:/*#__PURE__*/_jsx(\"div\",{\"data-paperform-id\":formId,...paperAttrs},formId)});}addPropertyControls(PaperformEmbed,{formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"yrsqkvgh\"},formHeight:{type:ControlType.Number,title:\"Height\",defaultValue:500,min:300,max:1200,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PaperformEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PaperformEmbed.map"],"mappings":"+LAGG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,SAAO,WAAW,aAAW,KAAK,EAAY,EAAaA,EAAO,IAAI,EACgrB,OAD9qB,MAAc,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAM,EAAE,EAAO,GAAG,CAAC,SAAS,EAAU,EAAK,CAAC,IAAM,EAAG,EAAK,IAAU,EAAM,mBAAmB,SAAS,MAAM,CAAC,CAAC,MAAM,GAAG,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,EAAM,OAAO,IAAI,CAAC,IAAI,EAAE,EAAM,GAAG,KAAM,EAAE,OAAO,CAAC,IAAI,KAAI,EAAE,EAAE,UAAU,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAE,IAAI,EAAE,OAAO,EAAE,U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