{"version":3,"file":"HubSpotNewsletterForm.hUNBvLS4.mjs","names":[],"sources":["https:/framerusercontent.com/modules/oHrFuXVqKJdntS15jUUh/fq6mCjFKTg4kEqzIDEp2/HubSpotNewsletterForm.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";/**\n * HubSpot newsletter form, using the current HubSpot embed script.\n *\n * The older HubSpotForm component renders through the legacy forms API, which\n * does not pick up styling configured on the form inside HubSpot. This uses the\n * embed snippet instead: one script per portal scans the document for\n * .hs-form-frame elements and renders each form into them, so the form appears\n * exactly as it is styled in HubSpot.\n *\n * Deliberately NOT wrapped in a Framer HTML embed. That would nest HubSpot own\n * iframe inside a second, fixed-height iframe, trapping the postMessage resize\n * handshake and clipping the form. The script has to run in the real page DOM.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 480\n * @framerIntrinsicHeight 260\n */export default function HubSpotNewsletterForm(props){const{portalId,formId,region,minHeight,style}=props;useEffect(()=>{// globalThis rather than a bare window reference: Framer compiles bare\n// window into a lazily-initialised module import that is not safe to\n// rely on. Same pattern as the viewport measurement in HeroSection.\nconst g=typeof globalThis!==\"undefined\"?globalThis:undefined;const doc=g?.document;if(!doc?.head||!portalId||!region)return;const src=`https://js-${region}.hsforms.net/forms/embed/${portalId}.js`;// One script serves every form on the portal, so only inject it once.\nif(doc.querySelector(`script[src=\"${src}\"]`))return;const script=doc.createElement(\"script\");script.src=src;script.defer=true;doc.head.appendChild(script);},[portalId,region]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",...style},children:/*#__PURE__*/_jsx(\"div\",{className:\"hs-form-frame\",\"data-region\":region,\"data-form-id\":formId,\"data-portal-id\":portalId,style:{width:\"100%\",// HubSpot injects its iframe with height:100%, so this box\n// needs a definite height or the form renders at zero and\n// is invisible. Tune this to the real form height.\nminHeight:`${minHeight}px`}})});}addPropertyControls(HubSpotNewsletterForm,{portalId:{type:ControlType.String,title:\"Portal ID\",defaultValue:\"27102750\"},formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"9b5ccdf0-7fd8-48ae-a6ca-3a4e26152b59\"},region:{type:ControlType.String,title:\"Region\",defaultValue:\"eu1\"},minHeight:{type:ControlType.Number,title:\"Min height\",defaultValue:260,min:0,max:900,step:10,description:\"Reserved height for the embedded form.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotNewsletterForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"260\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"480\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HubSpotNewsletterForm.map"],"mappings":"qKAiBG,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,WAAS,SAAO,SAAO,YAAU,SAAO,EAI0E,OAJpE,MAAc,CAG7D,IAAM,GAA3D,OAAO,WAAa,IAAY,WAAW,IAAA,GAAA,EAAuB,SAAS,GAAG,CAAC,GAAK,MAAM,CAAC,GAAU,CAAC,EAAO,OAAO,IAAM,EAAI,cAAc,EAAO,2BAA2B,EAAS,KAC/L,GAAG,EAAI,cAAc,eAAe,EAAI,GAAG,EAAE,OAAO,IAAM,EAAO,EAAI,cAAc,QAAQ,EAAE,EAAO,IAAI,EAAI,EAAO,MAAM,GAAK,EAAI,KAAK,YAAY,CAAM,CAAE,EAAE,CAAC,EAAS,CAAM,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAK,EAAE,SAAsB,EAAK,MAAM,CAAC,UAAU,gBAAgB,cAAc,EAAO,eAAe,EAAO,iBAAiB,EAAS,MAAM,CAAC,MAAM,OAG5X,UAAU,GAAG,EAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,iBAxBU,IAAoD,IAA6B,EAwB1F,EAAoB,EAAsB,CAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,UAAU,EAAE,OAAO,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,aAAa,sCAAsC,EAAE,OAAO,CAAC,KAAK,EAAY,OAAO,MAAM,SAAS,aAAa,KAAK,EAAE,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,IAAI,IAAI,EAAE,IAAI,IAAI,KAAK,GAAG,YAAY,wCAAwC,CAAC,CAAC"}