{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/f7SIqZdJkKHDa6N8CxRP/m24K5Unm1KvmcqFOaXPY/HubspotForm.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function HubSpotForm({portalId,formId,redirectUrl,hubspotFormSelectorId,hubspotCustomStyles}){useEffect(()=>{const loadHubSpotForm=()=>{if(window.hbspt){window.hbspt.forms.create({portalId:portalId,formId:formId,target:\"#hubspotForm\"+hubspotFormSelectorId,onFormSubmit:function(response){console.log(\"submit\");window.location.href=redirectUrl;},onFormReady:()=>{// Wait until the form is ready, then apply styles\napplyCustomStyles();}});}};const applyCustomStyles=()=>{const hubspotForm=document.getElementById(`hubspotForm${hubspotFormSelectorId}`);const iframe=hubspotForm.getElementsByTagName(\"iframe\")[0];// const iframe = document.getElementById(\n//     `hubspotForm${hubspotFormSelectorId}`\n// ) as HTMLIFrameElement\nif(iframe){var _iframe_contentWindow;const iframeDocument=(_iframe_contentWindow=iframe.contentWindow)===null||_iframe_contentWindow===void 0?void 0:_iframe_contentWindow.document;if(iframeDocument){// Add custom styles to the iframe's document\nconst styleTag=iframeDocument.createElement(\"style\");styleTag.innerHTML=`${hubspotCustomStyles}`;// Append the style tag to the iframe's head\niframeDocument.head.appendChild(styleTag);}}};const script=document.createElement(\"script\");script.src=\"https://js.hsforms.net/forms/v2.js\";script.onload=loadHubSpotForm;document.body.appendChild(script);return()=>{document.body.removeChild(script);};},[portalId,formId,redirectUrl]);return /*#__PURE__*/_jsx(\"div\",{id:`hubspotForm${hubspotFormSelectorId}`,style:{width:\"100%\",height:\"100%\"}});}addPropertyControls(HubSpotForm,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"YOUR_PORTAL_ID\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"YOUR_FORM_ID\"},redirectUrl:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"https://stllrgold.com\"},hubspotFormSelectorId:{type:ControlType.String,title:\"Form Selector Id\",defaultValue:\"1\"},hubspotCustomStyles:{type:ControlType.String,title:\"Form Custom Styles\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"HubSpotForm\":{\"type\":\"reactComponent\",\"name\":\"HubSpotForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HubspotForm.map"],
  "mappings": "yIAAmI,SAASA,EAAY,CAAC,SAAAC,EAAS,OAAAC,EAAO,YAAAC,EAAY,sBAAAC,EAAsB,oBAAAC,CAAmB,EAAE,CAAC,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAgB,IAAI,CAAIC,EAAO,OAAOA,EAAO,MAAM,MAAM,OAAO,CAAC,SAASP,EAAS,OAAOC,EAAO,OAAO,eAAeE,EAAsB,aAAa,SAASK,EAAS,CAAC,QAAQ,IAAI,QAAQ,EAAED,EAAO,SAAS,KAAKL,CAAY,EAAE,YAAY,IAAI,CAC5eO,EAAkB,CAAE,CAAC,CAAC,CAAG,EAAQA,EAAkB,IAAI,CAAkF,IAAMC,EAArE,SAAS,eAAe,cAAcP,GAAuB,EAA2B,qBAAqB,QAAQ,EAAE,CAAC,EAGlM,GAAGO,EAAO,CAAC,IAAIC,EAAsB,IAAMC,GAAgBD,EAAsBD,EAAO,iBAAiB,MAAMC,IAAwB,OAAO,OAAOA,EAAsB,SAAS,GAAGC,EAAe,CACtM,IAAMC,EAASD,EAAe,cAAc,OAAO,EAAEC,EAAS,UAAU,GAAGT,IAC3EQ,EAAe,KAAK,YAAYC,CAAQ,GAAI,EAAQC,EAAO,SAAS,cAAc,QAAQ,EAAE,OAAAA,EAAO,IAAI,qCAAqCA,EAAO,OAAOR,EAAgB,SAAS,KAAK,YAAYQ,CAAM,EAAQ,IAAI,CAAC,SAAS,KAAK,YAAYA,CAAM,CAAE,CAAE,EAAE,CAACd,EAASC,EAAOC,CAAW,CAAC,EAAsBa,EAAK,MAAM,CAAC,GAAG,cAAcZ,IAAwB,MAAM,CAAC,MAAM,OAAO,OAAO,MAAM,CAAC,CAAC,CAAE,CAACa,EAAoBjB,EAAY,CAAC,SAAS,CAAC,KAAKkB,EAAY,OAAO,MAAM,YAAY,aAAa,gBAAgB,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,aAAa,cAAc,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,aAAa,uBAAuB,EAAE,sBAAsB,CAAC,KAAKA,EAAY,OAAO,MAAM,mBAAmB,aAAa,GAAG,EAAE,oBAAoB,CAAC,KAAKA,EAAY,OAAO,MAAM,qBAAqB,aAAa,EAAE,CAAC,CAAC",
  "names": ["HubSpotForm", "portalId", "formId", "redirectUrl", "hubspotFormSelectorId", "hubspotCustomStyles", "ue", "loadHubSpotForm", "window", "response", "applyCustomStyles", "iframe", "_iframe_contentWindow", "iframeDocument", "styleTag", "script", "p", "addPropertyControls", "ControlType"]
}
