{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/jZU9mmmml35g2nANfNSz/sUihqslzf7Fi1x92o6uG/CustomForm.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{AnimatePresence,motion}from\"framer-motion\";const calendlyURL=`https://calendly.com/standardfusion-sales/quick-call`;const restrictedDomains=[\"gmail.com\",\"gmail.us\",\"yahoo.com\",\"hotmail.com\",\"aol.com\",\"hotmail.co.uk\",\"hotmail.fr\",\"msn.com\",\"yahoo.fr\",\"wanadoo.fr\",\"orange.fr\",\"comcast.net\",\"yahoo.co.uk\",\"yahoo.com.br\",\"yahoo.co.in\",\"live.com\",\"outlook.com\",\"live.ca\",\"yahoo.ca\",\"mailinator.com\",\"binkmail.com\",\"bobmail.info\",\"chammy.info\",\"devnullmail.com\",\"letthemeatspam.com\",\"mailinater.com\",\"mailinator.net\",\"mailinator2.com\",\"notmailinator.com\",\"reallymymail.com\",\"reconmail.com\",\"safetymail.info\",\"sendspamhere.com\",\"sogetthis.com\",\"spambooger.com\",\"spamherelots.com\",\"spamhereplease.com\",\"spamthisplease.com\",\"streetwisemail.com\",\"suremail.info\",\"thisisnotmyrealemail.com\",\"tradermail.info\",\"veryrealemail.com\",\"zippymail.info\"];const useCalendlyStore=createStore({calendlyInstance:null,submitData:null,name:null,email:null,company:null,phone:null});export function SFCustomForm(props){const[showDownload,setShowDownload]=useState(false);const[showCalendly,setShowCalendly]=useState(false);const[showForm,setShowForm]=useState(true);const[formKey,setFormKey]=useState(0);const breakpoints=props.breakpoints;const[emailError,setEmailError]=useState(\"\");function validateEmail(email){if(!email||email==\"\")return\"Invalid Email\";const domain=email.split(\"@\")[1].toLowerCase();if(restrictedDomains.includes(domain)){return\"Please use a business email.\";}return\"\";}function updateCalendly(data){if(!props.calendlyInstance||props.calendlyInstance.length<1)return;let calendly=props.calendlyInstance[0].props.children.props.children;let container=props.calendlyInstance[0].props.children.props;setTimeout(()=>{let containerElement=document.getElementsByClassName(container.className)[0];containerElement.style.width=\"auto\";},200);// Clear existing query params\nlet calendarUrl=calendly.props.calendar.split(\"?\")[0];calendarUrl+=`?name=${data.name}&email=${data.email}`;calendly.props.calendar=calendarUrl;setShowForm(false);setShowCalendly(true);}function triggerLuckyOrange(data){if(typeof LO==\"undefined\")return;LO.events.track(\"Form Submit\",data);}function triggerLeadBoxer(data){if(typeof OTMap!=\"undefined\"&&typeof OTLogService!==\"undefined\"){var map=new OTMap;map.put(\"name\",data.name);map.put(\"email\",data.email);// TODO: Company?\nmap.put(\"company\",data.company);OTLogService.sendEvent(\"Form Submit\",map);}}function triggerGTM(data){if(typeof dataLayer==\"undefined\")return;dataLayer.push({event:\"sf-framer-form-submitted\",detail:{form:window.location.href,name:data.name,email:data.email}});}function onFormSubmit(data){console.log(\"Custom form submit!\");const name=data.target[0].value;const email=data.target[1].value;const company=data.target[1].value;const error=validateEmail(email);const userData={name:name,email:email,company:company};if(error!=\"\"){console.log(\"Invalid email detected\");// setEmailError(error)\nreturn true;}setEmailError(\"\");// These needs to happen after form submits (this function returns true)\nsetTimeout(()=>{triggerGTM(userData);triggerLeadBoxer(userData);updateCalendly(userData);updateDownload();triggerLuckyOrange(userData);},100);return true;}function updateDownload(){if(!props.pdfPath||props.pdfPath==\"\")return;setShowDownload(true);}function bindForm(){var form=props.desktopForm[0];if(form){let formInst=document.querySelector(`#${props.id} form`);if(!formInst){console.error(\"Could not find form\");return;}formInst.addEventListener(\"submit\",onFormSubmit);console.log(\"Form bound\");}}useEffect(()=>{setTimeout(()=>{bindForm();},100);},[]);if(RenderTarget.current()==RenderTarget.canvas&&props.desktopForm.length<1){return /*#__PURE__*/_jsx(\"div\",{style:{padding:15,fontSize:20,border:2,borderWidth:2,borderColor:\"#333\",backgroundColor:\"rgba(3, 3, 3, .1)\"},children:\"Connect a Form to this Component\"});}function Form(){let currentForm=props.desktopForm;return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\"},id:\"sf-custom-form\",children:showForm&&currentForm});}useEffect(()=>{if(typeof window==\"undefined\"){setTimeout(()=>{setFormKey(k=>k+1);},50);}});return /*#__PURE__*/_jsxs(\"div\",{id:props.id,children:[/*#__PURE__*/_jsx(Form,{},formKey),/*#__PURE__*/_jsx(\"div\",{children:showCalendly&&props.calendlyInstance}),/*#__PURE__*/_jsx(\"div\",{id:\"sf-custom-form__download\",children:/*#__PURE__*/_jsx(\"a\",{hidden:!showDownload,target:\"_blank\",href:props.pdfPath,children:\"Download\"})})]});}SFCustomForm.defaultProps={id:\"\",desktopForm:null,breakpoints:{tablet:1400,phone:810},pdfPath:\"\",onFormSubmit:null};addPropertyControls(SFCustomForm,{id:{type:ControlType.String,description:\"ID of the wrapper\",defaultValue:\"sfcustomform\"},breakpoints:{type:ControlType.Object,optional:true,controls:{tablet:{type:ControlType.Number,defaultValue:1400},phone:{type:ControlType.Number,defaultValue:810}}},desktopForm:{type:ControlType.ComponentInstance,description:\"Form to bind on desktop size\"},tabletForm:{type:ControlType.ComponentInstance,description:\"Form to bind on tablet size\"},phoneForm:{type:ControlType.ComponentInstance,description:\"Form to bind on phone size\"},calendlyInstance:{type:ControlType.ComponentInstance,description:\"Calendly Instance\"},pdfPath:{type:ControlType.File,allowedFileTypes:[\"pdf\"]}});export function variantOverride(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,variant:\"Tablet\"});};}// const Overlay = ({ children, blockDocumentScrolling, enabled = true }) => {\n//     const [visible, setVisible] = useOverlayState({\n//         blockDocumentScrolling,\n//     })\n//     return children({\n//         hide: () => setVisible(false),\n//         show: () => setVisible(true),\n//         toggle: () => setVisible(!visible),\n//         visible: enabled && visible,\n//     })\n// }\nexport function withCustomOverlay(Component){return props=>{const[showOverlay,setShowOverlay]=useState(true);return /*#__PURE__*/_jsx(AnimatePresence,{children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{position:\"fixed\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"rgba(0,0,0,0.5)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},children:/*#__PURE__*/_jsx(Component,{...props})})});};}export function withDefaultBehavor(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props});};}export function withAutoSizing(Component){return props=>{return /*#__PURE__*/_jsx(Component,{style:{width:\"100%\",position:\"relative\"},...props});};}// Validate email input in a form\nexport function withEmailValidation(Component){const restrictedDomains=[\"gmail.com\",\"yahoo.com\",\"hotmail.com\"];function validateEmail(email){if(!email||email==\"\")return\"\";const domain=email.split(\"@\")[1];if(restrictedDomains.includes(domain)){return\"Please use a business email\";}return\"\";}return props=>{function onInputChange(event){setErrorMsg(validateEmail(event.target.value));}const[errorMsg,setErrorMsg]=useState(\"\");return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,onChange:onInputChange}),/*#__PURE__*/_jsx(\"div\",{hidden:errorMsg===\"\",children:/*#__PURE__*/_jsx(\"div\",{children:errorMsg})})]});};}export function withURLValue(Component){let url=window?window.location.href:\"\";return props=>{setTimeout(()=>{let targetInput=document.querySelector(`.${props.className} input`);if(targetInput&&targetInput.value){targetInput.value=url;}},50);return /*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsx(\"input\",{name:\"url\",type:\"hidden\",value:url})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"SFCustomForm\":{\"type\":\"reactComponent\",\"name\":\"SFCustomForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withURLValue\":{\"type\":\"reactHoc\",\"name\":\"withURLValue\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDefaultBehavor\":{\"type\":\"reactHoc\",\"name\":\"withDefaultBehavor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailValidation\":{\"type\":\"reactHoc\",\"name\":\"withEmailValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAutoSizing\":{\"type\":\"reactHoc\",\"name\":\"withAutoSizing\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"variantOverride\":{\"type\":\"reactHoc\",\"name\":\"variantOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCustomOverlay\":{\"type\":\"reactHoc\",\"name\":\"withCustomOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomForm.map"],
  "mappings": "gPAAsX,IAAMA,EAAkB,CAAC,YAAY,WAAW,YAAY,cAAc,UAAU,gBAAgB,aAAa,UAAU,WAAW,aAAa,YAAY,cAAc,cAAc,eAAe,cAAc,WAAW,cAAc,UAAU,WAAW,iBAAiB,eAAe,eAAe,cAAc,kBAAkB,qBAAqB,iBAAiB,iBAAiB,kBAAkB,oBAAoB,mBAAmB,gBAAgB,kBAAkB,mBAAmB,gBAAgB,iBAAiB,mBAAmB,qBAAqB,qBAAqB,qBAAqB,gBAAgB,2BAA2B,kBAAkB,oBAAoB,gBAAgB,EAAQC,EAAiBC,EAAY,CAAC,iBAAiB,KAAK,WAAW,KAAK,KAAK,KAAK,MAAM,KAAK,QAAQ,KAAK,MAAM,IAAI,CAAC,EAAS,SAASC,EAAaC,EAAM,CAAC,GAAK,CAACC,EAAaC,CAAe,EAAEC,EAAS,EAAK,EAAO,CAACC,EAAaC,CAAe,EAAEF,EAAS,EAAK,EAAO,CAACG,EAASC,CAAW,EAAEJ,EAAS,EAAI,EAAO,CAACK,EAAQC,CAAU,EAAEN,EAAS,CAAC,EAAQO,EAAYV,EAAM,YAAiB,CAACW,EAAWC,CAAa,EAAET,EAAS,EAAE,EAAE,SAASU,EAAcC,EAAM,CAAC,GAAG,CAACA,GAAOA,GAAO,GAAG,MAAM,gBAAgB,IAAMC,EAAOD,EAAM,MAAM,GAAG,EAAE,CAAC,EAAE,YAAY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C,MAAM,CAAC,MAAM,OAAO,SAAS,UAAU,EAAE,GAAGC,CAAK,CAAC,CAAI,CACxsB,SAASG,EAAoBJ,EAAU,CAAC,IAAMK,EAAkB,CAAC,YAAY,YAAY,aAAa,EAAE,SAASC,EAAcC,EAAM,CAAC,GAAG,CAACA,GAAOA,GAAO,GAAG,MAAM,GAAG,IAAMC,EAAOD,EAAM,MAAM,GAAG,EAAE,CAAC,EAAE,OAAGF,EAAkB,SAASG,CAAM,EAAS,8BAAqC,EAAG,CAAC,OAAOP,GAAO,CAAC,SAASQ,EAAcC,EAAM,CAACC,EAAYL,EAAcI,EAAM,OAAO,KAAK,CAAC,CAAE,CAAC,GAAK,CAACE,EAASD,CAAW,EAAEE,EAAS,EAAE,EAAE,OAAoBC,EAAMC,EAAU,CAAC,SAAS,CAAcb,EAAKF,EAAU,CAAC,GAAGC,EAAM,SAASQ,CAAa,CAAC,EAAeP,EAAK,MAAM,CAAC,OAAOU,IAAW,GAAG,SAAsBV,EAAK,MAAM,CAAC,SAASU,CAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAE,CAAQ,SAASI,EAAahB,EAAU,CAAC,IAAIiB,EAAIC,EAAOA,EAAO,SAAS,KAAK,GAAG,OAAOjB,IAAQ,WAAW,IAAI,CAAC,IAAIkB,EAAY,SAAS,cAAc,IAAIlB,EAAM,SAAS,QAAQ,EAAKkB,GAAaA,EAAY,QAAOA,EAAY,MAAMF,EAAK,EAAE,EAAE,EAAsBf,EAAK,MAAM,CAAC,SAAsBA,EAAK,QAAQ,CAAC,KAAK,MAAM,KAAK,SAAS,MAAMe,CAAG,CAAC,CAAC,CAAC,EAAI",
  "names": ["restrictedDomains", "useCalendlyStore", "createStore", "SFCustomForm", "props", "showDownload", "setShowDownload", "ye", "showCalendly", "setShowCalendly", "showForm", "setShowForm", "formKey", "setFormKey", "breakpoints", "emailError", "setEmailError", "validateEmail", "email", "domain", "updateCalendly", "data", "calendly", "container", "containerElement", "calendarUrl", "triggerLuckyOrange", "triggerLeadBoxer", "map", "triggerGTM", "window", "onFormSubmit", "name", "company", "error", "userData", "updateDownload", "bindForm", "form", "formInst", "ue", "RenderTarget", "p", "Form", "currentForm", "k", "u", "addPropertyControls", "ControlType", "withDefaultBehavor", "Component", "props", "p", "withAutoSizing", "withEmailValidation", "restrictedDomains", "validateEmail", "email", "domain", "onInputChange", "event", "setErrorMsg", "errorMsg", "ye", "u", "l", "withURLValue", "url", "window", "targetInput"]
}
