{"version":3,"file":"Custom_Form_trial.Cm6eLP5n.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/6XSwPosoz6hBf3UV6GTt/eNkhQavU9scDgqWiw2CG/Custom_Form_trial.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";const FORM_IDS={en:\"df832f21-cf3d-4240-8a30-d7906352c574\",se:\"22bd3a89-1446-4fa0-ac3d-a06237d81c0b\",no:\"f7d436c4-811b-4fe7-8634-ca2464199850\",fi:\"ecdb6287-4a49-49fb-84b8-a2bc9eb1ccdf\",de:\"648c2fd3-d5cd-4355-b2b1-c3e38e973e80\"};const FALLBACK_FORM_ID=\"df832f21-cf3d-4240-8a30-d7906352c574\";function detectLocale(){const path=window.location.pathname;const match=path.match(/^\\/([a-z]{2})(\\/|$)/);if(match){const slug=match[1];if(slug in FORM_IDS){return slug;}}return\"en\";}export default function HubSpotForm(){const formRef=useRef(null);const scriptLoaded=useRef(false);useEffect(()=>{if(scriptLoaded.current)return;scriptLoaded.current=true;const locale=detectLocale();const formId=FORM_IDS[detectLocale()]??FALLBACK_FORM_ID;console.log(\">>>>\",formId,detectLocale());const script=document.createElement(\"script\");script.src=\"//js.hsforms.net/forms/v2.js\";script.charset=\"utf-8\";script.type=\"text/javascript\";script.onload=()=>{if(!window.hbspt)return;window.hbspt.forms.create({region:\"na1\",portalId:\"8208707\",formId,target:\"#hubspot-form-wrapper\",onFormSubmit:function(){function getValue(name){try{return document.getElementsByName(name)[0]?.value?.toString()||\"\";}catch{return\"\";}}function getChecked(name){try{return document.getElementsByName(name)[0]?.checked?.toString()||\"\";}catch{return\"\";}}window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:`trial_period_form_${locale.toUpperCase()}`,action:\"Submitted\",firstname:getValue(\"firstname\"),lastname:getValue(\"lastname\"),jobtitle:getValue(\"jobtitle\"),email:getValue(\"email\"),phone:getValue(\"phone\"),company:getValue(\"company\"),country:getValue(\"country\"),website:getValue(\"website\"),want_to_subscribe_for_our_english_newsletter:getChecked(\"want_to_subscribe_for_our_english_newsletter\")});}});};document.body.appendChild(script);return()=>{if(document.body.contains(script)){document.body.removeChild(script);}};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:formRef,id:\"hubspot-form-wrapper\",style:{width:\"100%\",height:\"100%\"}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HubSpotForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Custom_Form_trial.map"],"mappings":"uIAAgX,SAAS,GAAc,CAAqC,IAAM,EAA/B,EAAO,SAAS,SAA0B,MAAM,sBAAsB,CAAC,GAAG,EAAM,CAAC,IAAM,EAAK,EAAM,GAAG,GAAG,KAAQ,EAAU,OAAO,EAAO,MAAM,KAAM,SAAwB,GAAa,CAAC,IAAM,EAAQA,EAAO,KAAK,CAAO,EAAaA,EAAO,GAAM,CAAyyC,OAAxyC,MAAc,CAAC,GAAG,EAAa,QAAQ,OAAO,EAAa,QAAQ,GAAK,IAAM,EAAO,GAAc,CAAO,EAAO,EAAS,GAAc,GAAG,EAAiB,QAAQ,IAAI,OAAO,EAAO,GAAc,CAAC,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAA49B,MAA39B,GAAO,IAAI,+BAA+B,EAAO,QAAQ,QAAQ,EAAO,KAAK,kBAAkB,EAAO,WAAW,CAAK,EAAO,OAAa,EAAO,MAAM,MAAM,OAAO,CAAC,OAAO,MAAM,SAAS,UAAU,SAAO,OAAO,wBAAwB,aAAa,UAAU,CAAC,SAAS,EAAS,EAAK,CAAC,GAAG,CAAC,OAAO,SAAS,kBAAkB,EAAK,CAAC,IAAI,OAAO,UAAU,EAAE,QAAS,CAAC,MAAM,IAAK,SAAS,EAAW,EAAK,CAAC,GAAG,CAAC,OAAO,SAAS,kBAAkB,EAAK,CAAC,IAAI,SAAS,UAAU,EA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