{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/mvnywLQcUoYZICIT3pGv/QOZM4XgWaPAN1c8k8YGV/WithId.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,forwardRef}from\"react\";export function withMenuId(Component){return props=>{let classes=props.className||\"\";classes+=\" close-menu-icon\";return /*#__PURE__*/_jsx(Component,{...props,id:\"close-menu-icon\",className:classes,\"data-id\":\"close-menu-icon\"});};}export function withHeroImageId(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,id:\"hero-image\"});};}export function withCookieProBtn(Component){const addBtn=()=>{const cookieProButton=document.createElement(\"button\");cookieProButton.setAttribute(\"class\",\"ot-sdk-show-settings d-none\");document.body.appendChild(cookieProButton);};const addScript=()=>{const cookieProScript=document.createElement(\"script\");cookieProScript.setAttribute(\"src\",\"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js\");cookieProScript.setAttribute(\"type\",\"text/javascript\");cookieProScript.setAttribute(\"charset\",\"UTF-8\");cookieProScript.setAttribute(\"data-domain-script\",\"2d50dacc-42f8-4449-bfe2-bd85fbbc160a\");document.head.appendChild(cookieProScript);window.OptanonWrapper=function(){};};const handleClick=()=>{const cookieProButton=document.querySelector(\".ot-sdk-show-settings\");const cookieProScript=document.querySelector(\"[data-domain-script='2d50dacc-42f8-4449-bfe2-bd85fbbc160a']\");cookieProButton?cookieProButton?.click():addBtn();// !cookieProScript && addScript()\n};return props=>{return /*#__PURE__*/_jsx(Component,{...props,id:\"cookieProBtn\",onClick:handleClick});};}function getHostAndPath(input){try{if(!input)return null;const url=new URL(input);// Full URL, return origin + pathname\nreturn url.origin+url.pathname;}catch{// Not a full URL, assume it's a path\nreturn input.startsWith(\"/\")?input:\"/\"+input;}}export function withGetStartedButtonId(Component){return props=>{const handleClick=e=>{// const flagVariant =\n//     window?.posthog?.getFeatureFlag(\"survey-experiment\")\n// console.log(\"handling button click\")\nconst buttonText=e.currentTarget?.text;const url=getHostAndPath(e.currentTarget?.href);window?.posthog.capture(\"Clicked Get Started\",{buttonText,targetUrl:url});// if (flagVariant && flagVariant === \"test\") {\n// window.location.assign(\"https://go.divorce.com/s/start\")\n// return\n// }\nprops.onClick?.();};return /*#__PURE__*/_jsx(Component,{\"data-class\":\"lead-form-get-started\",...props,onClick:handleClick});};}// code override to track clicks on the get started button\nexport function withGetStartedButtonExperiment(Component){return props=>{const handleClick=()=>{window?.posthog.capture(\"Clicked Get Started\");// window.location.assign(\"https://go.divorce.com/s/start\")\n};// useEffect(() => {\n//     const flagVariant =\n//         window?.posthog?.getFeatureFlag(\"survey-experiment\")\n//     if (!flagVariant) return\n//     console.log(\"get started button flag variant\", flagVariant)\n//     setVariant(flagVariant)\n// }, [])\n// console.log(\"rendered flag variant\", variant)\nreturn /*#__PURE__*/_jsx(Component,{onTap:handleClick,onClick:handleClick});};}export function withSurveyExperimentLeadFormButton(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const flagVal=window?.posthog?.getFeatureFlag?.(\"survey-experiment\");const[data,setData]=useState({flagVariant:flagVal,flagsLoaded:!!flagVal});useEffect(()=>{if(!window?.posthog)return;if(data.flagsLoaded){// console.log(\"flags already loaded, returning\")\nreturn;}window?.posthog?.onFeatureFlags(()=>{const variant=window?.posthog?.getFeatureFlag(\"survey-experiment\");// console.log(\"setting flagVariant in store\", variant)\nsetData({flagVariant:variant,flagsLoaded:true});// console.log(\"[hideLeadForm] POSTHOG FLAGS LOADED\")\n});},[]);// console.log(\"[hideLeadForm] data.flagVariant\", data.flagVariant)\n// console.log(\"[hideLeadForm] props\", props)\nlet cstyle={};if(props[\"aria-label\"]===\"get-started\"){cstyle={display:data.flagVariant===\"control\"?\"none\":\"block\",height:\"auto\",opacity:\"1\"};}else if(props[\"aria-label\"]===\"lead-form\"){cstyle={display:data.flagVariant===\"control\"?\"block\":\"none\"};}return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props?.style,...cstyle}});});}// selectively hides the child lead form if we need to show the get started button instead\nexport function withSurveyLeadFormWrapper(Component){return /*#__PURE__*/forwardRef((props,ref)=>{// after the first page load, this should immediately available\nconst flagVal=window?.posthog?.getFeatureFlag?.(\"survey-experiment\");const[data,setData]=useState({flagVariant:flagVal,flagsLoaded:!!flagVal});// console.log(\"state\", data)\n// console.log(\"props\", props)\nconst handleClick=()=>{console.log(\"handle click\");};const hideGetStarted=()=>{if(!window?.document)return;var getStartedBtn=window?.document?.querySelector(\"[aria-label='survey-experiment-wrapper'] [aria-label='get-started']\");if(getStartedBtn){setTimeout(()=>{console.log(\"hiding get started btn\");getStartedBtn.style.display=\"none\";},1);}};useEffect(()=>{if(!window?.posthog)return;if(data.flagsLoaded){console.log(\"flags already loaded, returning\");return;}// console.log(\"running on featue flag loaded effect hook\")\n// console.log(\"store\", store)\n// console.log(\"flagsLoaded ref\", data.flagsLoaded)\nwindow?.posthog?.onFeatureFlags(()=>{const variant=window?.posthog?.getFeatureFlag(\"survey-experiment\");console.log(\"setting flagVariant in store\",variant);// setStore({ flagsLoaded: true, flagVariant: variant })\n// setFlagsLoaded(true)\n// setFlagVariant(variant)\nsetData({flagVariant:variant,flagsLoaded:true});// flagsLoaded.current = true\nconsole.log(\"POSTHOG FLAGS LOADED\");});},[]);// if flags aren't loaded, hide the wrapper\nconst cstyle={...props?.style,opacity:data.flagsLoaded?\"1\":\"0\",// this transition is delayed by 100ms to give the above setTimeout enough time to run to hide the form\ntransition:\"opacity 0.3s ease-in-out 200ms\"};// console.log(\"cstyle\", cstyle)\nreturn /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:cstyle});});}export function withGetStartedClickTrack(Component){return props=>{const handleClick=()=>{console.log(\"handling button click\");window?.posthog.capture(\"Clicked Lead Form Get Started\");props.onTap?.()||props.onClick?.();};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSurveyExperimentLeadFormButton\":{\"type\":\"reactHoc\",\"name\":\"withSurveyExperimentLeadFormButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGetStartedClickTrack\":{\"type\":\"reactHoc\",\"name\":\"withGetStartedClickTrack\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGetStartedButtonExperiment\":{\"type\":\"reactHoc\",\"name\":\"withGetStartedButtonExperiment\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCookieProBtn\":{\"type\":\"reactHoc\",\"name\":\"withCookieProBtn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSurveyLeadFormWrapper\":{\"type\":\"reactHoc\",\"name\":\"withSurveyLeadFormWrapper\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeroImageId\":{\"type\":\"reactHoc\",\"name\":\"withHeroImageId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMenuId\":{\"type\":\"reactHoc\",\"name\":\"withMenuId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGetStartedButtonId\":{\"type\":\"reactHoc\",\"name\":\"withGetStartedButtonId\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithId.map"],
  "mappings": "mHAAAA,IAAmG,SAASC,EAAWC,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAIC,EAAQD,EAAM,WAAW,GAAG,OAAAC,GAAS,mBAAuCC,EAAKH,EAAU,CAAC,GAAGC,EAAM,GAAG,kBAAkB,UAAUC,EAAQ,UAAU,iBAAiB,CAAC,CAAE,CAAE,CAAQ,SAASE,EAAgBJ,EAAU,CAAC,OAAOC,GAA4BE,EAAKH,EAAU,CAAC,GAAGC,EAAM,GAAG,YAAY,CAAC,CAAI,CACpV,SAASI,EAAeC,EAAM,CAAC,GAAG,CAAC,GAAG,CAACA,EAAM,OAAO,KAAK,IAAMC,EAAI,IAAI,IAAID,CAAK,EACzL,OAAOC,EAAI,OAAOA,EAAI,QAAS,MAAM,CACrC,OAAOD,EAAM,WAAW,GAAG,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AAQ,QAAQ,+BAA+B,EAAED,EAAM,QAAQ,GAAGA,EAAM,UAAU,CAAE,EAAE,OAAoBE,EAAKH,EAAU,CAAC,GAAGC,EAAM,QAAQC,EAAY,MAAMA,CAAW,CAAC,CAAE,CAAE",
  "names": ["init_ssg_sandbox_shims", "withMenuId", "Component", "props", "classes", "p", "withHeroImageId", "getHostAndPath", "input", "url", "withGetStartedButtonId", "Component", "props", "p", "e", "buttonText", "withSurveyExperimentLeadFormButton", "Component", "Y", "props", "ref", "flagVal", "data", "setData", "ye", "ue", "variant", "cstyle", "p", "withGetStartedClickTrack", "Component", "props", "handleClick", "p"]
}
