{"version":3,"file":"OneStepBookDemoForm.BNWdwUSZ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/mUyjRlDdmNm0wX9OjbJw/K0yUAPb3IKClyIIgmtwL/OneStepBookDemoForm.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// embed_domain and embed_type make Calendly post its events (calendly.event_scheduled…)\n// to the page, where jimo.ai's analytics reads them (jimo-landing: public/landing/jimo-analytics.js).\nconst BASE_CALENDLY_URL=\"https://calendly.com/thomas-747/jimo-intro-call?hide_gdpr_banner=1&hide_event_type_details=1&embed_domain=jimo.ai&embed_type=Inline\";const useStore=createStore({formFieldsValid:false,firstName:\"\",companyName:\"Jimo\",calendlyLink:BASE_CALENDLY_URL});// ─── HELPER: Extract company name from email domain ───────────────────────────\n// e.g. thomas@jimo.ai → \"Jimo\" | sarah@usejimo.com → \"Usejimo\"\nconst extractCompanyName=email=>{const domain=email.split(\"@\")[1];if(!domain)return\"\";const base=domain.split(\".\")[0];return base.charAt(0).toUpperCase()+base.slice(1).toLowerCase();};// ─── HELPER: The visit's campaign tags, passed on to Calendly ────────────────\n// From the URL first, else from the cookie Framer sets on the landing page.\n// Calendly stores utm_* on the booking (it ignores other keys, so no gclid).\nconst UTM_KEYS=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_content\",\"utm_term\"];const getUtms=()=>{const out={};if(typeof window===\"undefined\")return out;const qs=new URLSearchParams(window.location.search);UTM_KEYS.forEach(k=>{const v=qs.get(k);if(v)out[k]=v;});if(Object.keys(out).length)return out;try{const m=document.cookie.match(/(?:^|; )framerFormsUTMTags=([^;]+)/);const c=m?JSON.parse(decodeURIComponent(m[1])):{};UTM_KEYS.forEach(k=>{if(c[k])out[k]=String(c[k]);});}catch{}return out;};// ─── withNextButton ───────────────────────────────────────────────────────────\nexport function withNextButton(Component){return props=>{const[store]=useStore();const variant=store.formFieldsValid?\"Default\":\"Disabled\";return /*#__PURE__*/_jsx(Component,{...props,variant:variant});};}// ─── withCalendly ─────────────────────────────────────────────────────────────\nexport function withCalendly(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,calendlylink:store.calendlyLink});};}function capitalize(word){if(!word)return\"\";return word[0].toUpperCase()+word.slice(1).toLowerCase();}// ─── withFirstName ────────────────────────────────────────────────────────────\nexport function withFirstName(Component){return props=>{const[store]=useStore();const textCapital=capitalize(store.firstName);const text=store.firstName?`Welcome ${textCapital}, let's have a quick chat!`:\"Welcome, let's have a quick chat!\";return /*#__PURE__*/_jsx(Component,{...props,text:text});};}// ─── withCompanyName ──────────────────────────────────────────────────────────\nexport function withCompanyName(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,text:store.companyName});};}// ─── withCompanyInitial ───────────────────────────────────────────────────────\nexport function withCompanyInitial(Component){return props=>{const[store]=useStore();const initial=store.companyName?store.companyName.charAt(0):\"\";return /*#__PURE__*/_jsx(Component,{...props,text:initial});};}// ─── withCompanyVariant ───────────────────────────────────────────────────────\nexport function withCompanyVariant(Component){return props=>{const[store]=useStore();const isJimo=store.companyName.toLowerCase()===\"jimo\"||store.companyName.toLowerCase()===\"usejimo\";const variant=isJimo?\"default\":\"filled\";return /*#__PURE__*/_jsx(Component,{...props,variant:variant});};}// ─── withFormValidation ───────────────────────────────────────────────────────\nexport function withFormValidation(Component){return props=>{const[,setStore]=useStore();useEffect(()=>{// Some pages render several <form> elements — the Main CTA Input\n// (email only), this One-Step Demo form, and both of those again\n// inside the modal. A bare document.querySelector would bind to\n// whichever lands first in the DOM, so scope every lookup to the\n// form this override is actually applied to.\nconst className=typeof props.className===\"string\"?props.className.trim():\"\";const scopedForm=className?document.querySelector(`form.${className.split(/\\s+/).join(\".\")}`):null;// Fallback for the rare case Framer does not hand us a className:\n// this is the only form on the page carrying a first-name field.\nconst formElement=scopedForm??Array.from(document.querySelectorAll(\"form\")).find(form=>form.querySelector(\"[name='first-name']\"));if(!formElement)return;// `channel` is a textarea, so the selector must not be tag-qualified.\nconst field=name=>formElement.querySelector(`[name='${name}']`);const emailInput=field(\"email\");const nameInput=field(\"first-name\");const lastNameInput=field(\"last-name\");const channelInput=field(\"channel\");const buildCalendlyLink=()=>{const name=nameInput?.value.trim()??\"\";const email=emailInput?.value.trim()??\"\";const utms=Object.entries(getUtms()).map(([k,v])=>`&${k}=${encodeURIComponent(v)}`).join(\"\");return`${BASE_CALENDLY_URL}&name=${encodeURIComponent(name)}&email=${encodeURIComponent(email)}${utms}`;};const checkFormValidity=()=>{const isEmailValid=emailInput&&emailInput.value.trim()!==\"\"&&emailInput.checkValidity()&&emailInput.validationMessage===\"\";const isNameValid=nameInput&&nameInput.value.trim()!==\"\";const isLastNameValid=lastNameInput&&lastNameInput.value.trim()!==\"\";const isChannelValid=channelInput&&channelInput.value.trim()!==\"\";const allValid=!!isEmailValid&&!!isNameValid&&!!isLastNameValid&&!!isChannelValid;const firstName=nameInput?.value.trim()??\"\";const extracted=extractCompanyName(emailInput?.value.trim()??\"\");const companyName=extracted!==\"\"?extracted:\"Jimo\";const calendlyLink=buildCalendlyLink();setStore({formFieldsValid:allValid,firstName,companyName,calendlyLink});return allValid;};const handleEmailInput=()=>{if(!emailInput)return;const blockedEmailDomains=[\"gmail\",\"yahoo\",\"hotmail\",\"outlook\",\"live\",\"aol\",\"icloud\",\"mail\",\"protonmail\",\"zoho\",\"test\",\"gmai\",\"msn\",\"yandex\",\"gmx\",\"aim\",\"inbox\",\"example\",\"gmail.com\",\"10minutemail\",\"guerrillamail\",\"mailinator\",\"tempmail\",\"maildrop\",\"yopmail\",\"trashmail\",\"getnada\",\"mailnesia\",\"fakemail\",\"throwawaymail\",\"sharklasers\",\"spamgourmet\",\"moakt\",\"dispostable\",\"mailcatch\",\"mintemail\",\"mytempemail\",\"tempinbox\",\"spam4.me\",\"qq\",\"163\",\"bhuxp.org\",\"volku.org\",\"laxiw.org\",\"tst\",\"xxx\"];const emailPattern=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;const value=emailInput.value.trim();const domain=value.split(\"@\")[1];if(value===\"\"){emailInput.setCustomValidity(\"\");}else if(!emailPattern.test(value)){emailInput.setCustomValidity(\"Please input your email in the valid format.\");}else if(domain&&blockedEmailDomains.some(d=>domain.toLowerCase().includes(d.toLowerCase()))){emailInput.setCustomValidity(\"Please only enter your work email.\");}else{emailInput.setCustomValidity(\"\");}emailInput.reportValidity();setTimeout(checkFormValidity,100);};const handleFieldChange=()=>{setTimeout(checkFormValidity,100);};const handleSubmit=()=>{checkFormValidity();};emailInput?.addEventListener(\"input\",handleEmailInput);emailInput?.addEventListener(\"blur\",handleEmailInput);nameInput?.addEventListener(\"input\",handleFieldChange);nameInput?.addEventListener(\"blur\",handleFieldChange);lastNameInput?.addEventListener(\"input\",handleFieldChange);lastNameInput?.addEventListener(\"blur\",handleFieldChange);channelInput?.addEventListener(\"input\",handleFieldChange);channelInput?.addEventListener(\"blur\",handleFieldChange);formElement.addEventListener(\"submit\",handleSubmit);setTimeout(checkFormValidity,200);return()=>{emailInput?.removeEventListener(\"input\",handleEmailInput);emailInput?.removeEventListener(\"blur\",handleEmailInput);nameInput?.removeEventListener(\"input\",handleFieldChange);nameInput?.removeEventListener(\"blur\",handleFieldChange);lastNameInput?.removeEventListener(\"input\",handleFieldChange);lastNameInput?.removeEventListener(\"blur\",handleFieldChange);channelInput?.removeEventListener(\"input\",handleFieldChange);channelInput?.removeEventListener(\"blur\",handleFieldChange);formElement.removeEventListener(\"submit\",handleSubmit);};},[props.className]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCompanyInitial\":{\"type\":\"reactHoc\",\"name\":\"withCompanyInitial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalendly\":{\"type\":\"reactHoc\",\"name\":\"withCalendly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompanyName\":{\"type\":\"reactHoc\",\"name\":\"withCompanyName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFormValidation\":{\"type\":\"reactHoc\",\"name\":\"withFormValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFirstName\":{\"type\":\"reactHoc\",\"name\":\"withFirstName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNextButton\":{\"type\":\"reactHoc\",\"name\":\"withNextButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompanyVariant\":{\"type\":\"reactHoc\",\"name\":\"withCompanyVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OneStepBookDemoForm.map"],"mappings":"oLASA,SAAgB,EAAa,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,EAAS,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,aAAa,EAAM,YAAY,CAAC,CAAE,CAAE,CAAC,SAAS,EAAW,EAAK,CAAmB,OAAd,EAAqB,EAAK,EAAE,CAAC,YAAY,EAAE,EAAK,MAAM,CAAC,CAAC,CAAC,YAAY,EAA1D,EAA4D,CACtQ,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,EAAS,EAAQ,EAAY,EAAW,EAAM,SAAS,EAAQ,EAAK,EAAM,UAAU,WAAW,EAAY,4BAA4B,oCAAoC,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAW,MAAI,CAAC,CAAE,CAAE,CAC3S,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,EAAS,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAM,WAAW,CAAC,CAAE,CAAE,CAC1J,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,GAAO,EAAS,EAAQ,EAAQ,EAAM,YAAY,EAAM,YAAY,OAAO,C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