{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/e40uXZbiDF4v3OxInDmN/HnmiRf1QhOLZJFamt6CP/HubSpot_Form.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsOnFramerCanvas}from\"framer\";function EmbedHTML({html,style}){const ref=useRef();const onCanvas=useIsOnFramerCanvas();const[iframeHeight,setIframeHeight]=useState(0);const hasAutoHeight=!style.height;const hasScript=html.includes(\"</script>\");useEffect(()=>{var _this;const iframeWindow=(_this=ref.current)===null||_this===void 0?void 0:_this.contentWindow;function handleMessage(event){if(event.source!==iframeWindow)return;const data=event.data;if(typeof data!==\"object\"||data===null)return;const height=data.embedHeight;if(typeof height!==\"number\")return;setIframeHeight(height);}window.addEventListener(\"message\",handleMessage);iframeWindow===null||iframeWindow===void 0?void 0:iframeWindow.postMessage(\"getEmbedHeight\",\"*\");return()=>{window.removeEventListener(\"message\",handleMessage);};},[]);if(hasScript){const srcDoc=`\n      <html>\n        <head>\n          <style>body { margin: 0; }</style>\n        </head>\n        <body>\n          ${html}\n          <script type=\"module\">\n            let height = 0\n\n            function sendEmbedHeight() {\n              window.parent.postMessage({\n                embedHeight: height\n              }, \"*\")\n            }\n\n            const observer = new ResizeObserver((entries) => {\n              if (entries.length !== 1) return\n              const entry = entries[0]\n              if (entry.target !== document.body) return\n\n              height = entry.contentRect.height\n              sendEmbedHeight()\n            })\n\n            observer.observe(document.body)\n\n            window.addEventListener(\"message\", (event) => {\n              if (event.source !== window.parent) returna\n              if (event.data !== \"getEmbedHeight\") return\n              sendEmbedHeight()\n            })\n          </script>\n        </body>\n      </html>\n    `;const currentStyle={width:\"100%\",height:\"100%\",border:\"none\",...style};if(hasAutoHeight){currentStyle.height=iframeHeight+\"px\";}return /*#__PURE__*/_jsx(\"iframe\",{ref:ref,style:currentStyle,srcDoc:srcDoc});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",...style},dangerouslySetInnerHTML:{__html:html}});}const Placeholder=()=>{const containerStyle={minWidth:\"100%\",minHeight:\"100%\",maxWidth:\"480px\",maxHeight:\"300px\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",border:\"1px dashed #FF7A59\",borderRadius:\"8px\",padding:\"20px\",boxSizing:\"border-box\",backgroundColor:\"rgba(255, 122, 89, 0.3)\"};const headingStyle={fontSize:\"12px\",fontWeight:600,margin:0,marginBottom:\"5px\",color:\"#FF7A59\"};const paragraphStyle={fontSize:\"12px\",margin:0,color:\"#FF7A59\",maxWidth:\"200px\",textAlign:\"center\"};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"h1\",{style:headingStyle,children:\"HubSpot\"}),/*#__PURE__*/_jsx(\"p\",{style:paragraphStyle,children:\"Set the HubSpot properties in the Properties panel.\"})]});};/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 500\n * @framerDisableUnlink\n */export default function HubSpot_Form({portalId,dataHostingLocation,formId}){const isAllPropertiesAdded=portalId&&dataHostingLocation&&formId;if(!isAllPropertiesAdded){return /*#__PURE__*/_jsx(Placeholder,{});}const html=`<script charset=\"utf-8\" type=\"text/javascript\" src=\"//js-${dataHostingLocation}.hsforms.net/forms/embed/v2.js\"></script><script>hbspt.forms.create({ region: \"${dataHostingLocation}\", portalId: \"${portalId}\", formId: \"${formId}\" }); </script>`;return /*#__PURE__*/_jsx(EmbedHTML,{html:html,style:{width:\"100%\",height:\"100%\"}});}HubSpot_Form.displayName=\"HubSpot Form\";addPropertyControls(HubSpot_Form,{portalId:{type:ControlType.String,title:\"Portal ID\"},dataHostingLocation:{type:ControlType.String,title:\"Location\"},formId:{type:ControlType.String,title:\"Form ID\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpot_Form\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerIntrinsicHeight\":\"500\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HubSpot_Form.map"],
  "mappings": "iKAA8K,SAASA,EAAU,CAAC,KAAAC,EAAK,MAAAC,CAAK,EAAE,CAAC,IAAMC,EAAIC,EAAO,EAAQC,EAASC,EAAoB,EAAO,CAACC,EAAaC,CAAe,EAAEC,EAAS,CAAC,EAAQC,EAAc,CAACR,EAAM,OAAaS,EAAUV,EAAK,SAAS,YAAW,EAA+iB,GAA7iBW,EAAU,IAAI,CAAC,IAAIC,EAAM,IAAMC,GAAcD,EAAMV,EAAI,WAAW,MAAMU,IAAQ,OAAO,OAAOA,EAAM,cAAc,SAASE,EAAcC,EAAM,CAAC,GAAGA,EAAM,SAASF,EAAa,OAAO,IAAMG,EAAKD,EAAM,KAAK,GAAG,OAAOC,GAAO,UAAUA,IAAO,KAAK,OAAO,IAAMC,EAAOD,EAAK,YAAe,OAAOC,GAAS,UAAgBV,EAAgBU,CAAM,CAAE,CAAC,OAAAC,EAAO,iBAAiB,UAAUJ,CAAa,EAAoDD,GAAa,YAAY,iBAAiB,GAAG,EAAQ,IAAI,CAACK,EAAO,oBAAoB,UAAUJ,CAAa,CAAE,CAAE,EAAE,CAAC,CAAC,EAAKJ,EAAU,CAAC,IAAMS,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAMh8BnB,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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,MAAM,OAAO,OAAO,MAAM,CAAC,CAAC,CAAE,CAACwB,EAAa,YAAY,eAAeI,EAAoBJ,EAAa,CAAC,SAAS,CAAC,KAAKK,EAAY,OAAO,MAAM,WAAW,EAAE,oBAAoB,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,MAAM,SAAS,CAAC,CAAC",
  "names": ["EmbedHTML", "html", "style", "ref", "pe", "onCanvas", "useIsOnFramerCanvas", "iframeHeight", "setIframeHeight", "ye", "hasAutoHeight", "hasScript", "ue", "_this", "iframeWindow", "handleMessage", "event", "data", "height", "window", "srcDoc", "currentStyle", "p", "Placeholder", "u", "HubSpot_Form", "portalId", "dataHostingLocation", "formId", "addPropertyControls", "ControlType"]
}
