{"version":3,"file":"JotForm_Embed.C8prFn04.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","window","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","RenderTarget","addPropertyControls","init_framer_D6uXRwWs","ControlType","FormEmbed","ref","height","setHeight","minHeight","gotHeight","setGotHeight","loaded","setLoaded","slow","setSlow","mounted","setMounted","ready","formUrl","id","phoneDigits","slowPhone","phoneHref","onMessage","event","origin","command","value","formId","nextHeight","timer","style","loadingColor","loadingText","slowText","JotFormEmbed","props","init_JotForm_Embed"],"sources":["https:/framerusercontent.com/modules/MA0kAiJGcdPLJujS0Cbn/ZGc8VeIsIoTJ6y7Jt6UJ/JotForm_Embed.js"],"sourcesContent":["// JotForm embed with automatic height adjustment.\n// Reveals the form after a valid height message OR the iframe load event.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";function FormEmbed({id,title,minHeight,loadingText,loadingColor,slowText,slowPhone,style}){const ref=useRef(null);const[height,setHeight]=useState(minHeight);const[gotHeight,setGotHeight]=useState(false);const[loaded,setLoaded]=useState(false);const[slow,setSlow]=useState(false);const[mounted,setMounted]=useState(false);const ready=gotHeight||loaded;const formUrl=`https://form.jotform.com/${id}`;const phoneDigits=slowPhone.replace(/\\D/g,\"\");const phoneHref=slowPhone.trim().startsWith(\"+\")?`tel:+${phoneDigits}`:phoneDigits.length===10?`tel:+1${phoneDigits}`:`tel:${phoneDigits}`;useEffect(()=>{const onMessage=event=>{// Only accept messages from this iframe.\nif(event.source!==ref.current?.contentWindow)return;if(typeof event.data!==\"string\")return;let origin;try{origin=new URL(event.origin);}catch{return;}if(origin.protocol!==\"https:\"||!/(^|\\.)jotform\\.com$/i.test(origin.hostname)){return;}const[command,value,formId]=event.data.split(\":\");if(formId&&formId!==id)return;if(command===\"setHeight\"){const nextHeight=Number(value);if(!Number.isFinite(nextHeight)||nextHeight<=0)return;setHeight(Math.max(Math.ceil(nextHeight),200));setGotHeight(true);}else if(command===\"scrollIntoView\"){ref.current?.scrollIntoView({behavior:\"smooth\",block:\"start\"});}};window.addEventListener(\"message\",onMessage);// Create the iframe only after the message listener is attached.\nsetMounted(true);return()=>{window.removeEventListener(\"message\",onMessage);};},[id]);useEffect(()=>{if(!mounted||ready)return;const timer=window.setTimeout(()=>setSlow(true),8e3);return()=>window.clearTimeout(timer);},[mounted,ready]);useEffect(()=>{if(!gotHeight)setHeight(minHeight);},[minHeight,gotHeight]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes jfLoadBar {\n                    0% { transform: translateX(-100%); }\n                    100% { transform: translateX(250%); }\n                }\n\n                @media (prefers-reduced-motion: reduce) {\n                    .jf-loading-bar {\n                        animation: none !important;\n                    }\n                }\n            `}),!ready&&/*#__PURE__*/_jsxs(\"div\",{role:\"status\",\"aria-live\":\"polite\",style:{position:\"absolute\",inset:0,zIndex:1,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:16,padding:24,boxSizing:\"border-box\",color:loadingColor,fontFamily:'Lato, \"Lato Placeholder\", sans-serif',fontSize:15,letterSpacing:\"0.02em\"},children:[/*#__PURE__*/_jsx(\"span\",{children:loadingText}),slow&&/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:12,fontSize:14,textAlign:\"center\",maxWidth:320,lineHeight:1.5},children:[slowPhone&&/*#__PURE__*/_jsxs(\"span\",{children:[slowText,\" \",/*#__PURE__*/_jsx(\"a\",{href:phoneHref,style:{color:\"inherit\",textDecoration:\"underline\"},children:slowPhone})]}),/*#__PURE__*/_jsx(\"a\",{href:formUrl,target:\"_blank\",rel:\"noopener noreferrer\",style:{color:\"inherit\",textDecoration:\"underline\"},children:\"Open form directly\"})]}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"relative\",width:160,height:2,overflow:\"hidden\",background:\"rgba(127,127,127,0.25)\"},children:/*#__PURE__*/_jsx(\"span\",{className:\"jf-loading-bar\",style:{position:\"absolute\",inset:0,width:\"40%\",background:loadingColor,animation:\"jfLoadBar 1.2s ease-in-out infinite\"}})})]}),mounted&&/*#__PURE__*/_jsx(\"iframe\",{ref:ref,id:`JotFormIFrame-${id}`,title:title,src:formUrl,scrolling:\"no\",onLoad:()=>setLoaded(true),\"aria-hidden\":!ready,tabIndex:ready?undefined:-1,style:{width:\"100%\",height:\"100%\",border:\"none\",display:\"block\",visibility:ready?\"visible\":\"hidden\",opacity:ready?1:0,transition:\"opacity 150ms ease\"}})]});}export default function JotFormEmbed(props){const{formId=\"\",title=\"Request form\",minHeight=600,loadingText=\"Loading secure form…\",loadingColor=\"rgba(255, 255, 255, 0.7)\",slowText=\"Taking longer than usual. You can also call us at\",slowPhone=\"(515) 222-0550\",style}=props;const id=String(formId).trim();if(!id){if(RenderTarget.current()===RenderTarget.canvas){return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",padding:24,border:\"1px dashed rgba(0,0,0,0.3)\",fontFamily:\"Inter, sans-serif\",fontSize:13,opacity:.6},children:\"JotForm embed — set a form ID\"});}return null;}return /*#__PURE__*/_jsx(FormEmbed,{id:id,title:title,minHeight:minHeight,loadingText:loadingText,loadingColor:loadingColor,slowText:slowText,slowPhone:slowPhone,style:style},id);}addPropertyControls(JotFormEmbed,{formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Request form\"},minHeight:{type:ControlType.Number,title:\"Initial Height\",defaultValue:600,min:200,max:4e3,step:10,unit:\"px\"},loadingText:{type:ControlType.String,title:\"Loading Text\",defaultValue:\"Loading secure form…\"},loadingColor:{type:ControlType.Color,title:\"Loading Color\",defaultValue:\"rgba(255, 255, 255, 0.7)\"},slowText:{type:ControlType.String,title:\"Slow Text\",defaultValue:\"Taking longer than usual. You can also call us at\"},slowPhone:{type:ControlType.String,title:\"Slow Phone\",defaultValue:\"(515) 222-0550\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"JotFormEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./JotForm_Embed.map"],"mappings":"A,qNAEuK,SAASgB,EAAU,CAAC,KAAG,QAAM,YAAU,cAAY,eAAa,WAAS,YAAU,SAAO,CAAC,IAAMC,EAAIjB,EAAO,IAAI,EAAO,CAACkB,EAAOC,GAAWlB,EAASmB,CAAS,EAAO,CAACC,EAAUC,GAAcrB,EAAS,EAAK,EAAO,CAACsB,EAAOC,GAAWvB,EAAS,EAAK,EAAO,CAACwB,EAAKC,GAASzB,EAAS,EAAK,EAAO,CAAC0B,EAAQC,GAAY3B,EAAS,EAAK,EAAQ4B,EAAMR,GAAWE,EAAaO,EAAQ,4BAA4BC,IAAWC,EAAYC,EAAU,QAAQ,MAAM,EAAE,EAAQC,EAAUD,EAAU,KAAK,CAAC,CAAC,WAAW,GAAG,EAAE,QAAQD,IAAcA,EAAY,SAAS,GAAG,SAASA,IAAc,OAAOA,IAE1a,OAFwbvB,MAAc,CAAC,IAAM0B,EAAU,GAAO,CACjuB,GAAjDC,EAAM,SAASnB,EAAI,SAAS,eAAwB,OAAOmB,EAAM,MAAO,SAAS,OAAO,IAAIC,EAAO,GAAG,CAAC,EAAO,IAAI,IAAID,EAAM,MAAM,CAAE,MAAM,CAAC,MAAO,CAAC,GAAGC,EAAO,WAAW,UAAU,CAAC,uBAAuB,KAAKA,EAAO,QAAQ,EAAG,OAAQ,GAAK,CAACC,EAAQC,EAAMC,GAAQJ,EAAM,KAAK,MAAM,GAAG,EAAE,GAAG,KAAQI,IAAST,GAAU,IAAGO,IAAU,YAAY,CAAC,IAAMG,EAAW,OAAOF,CAAK,EAAE,GAAG,CAAC,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