{"version":3,"file":"FormButtonOverrides.ejVkMf9f.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/fXdkq7gZXa9GMoCsWiCg/5jwQzYbWxObkOZW4RjkK/FormButtonOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{useIsStaticRenderer}from\"framer\";// User request: Update success detection to redirect only when the native form submit button exposes success as variant name \"Success\" or exact variant id \"Zx14BENM0\", fail-closed when variant is not exposed, preserve native form behavior, keep download override, and run browser-only (not canvas/SSR).\n/**\n * Override for a native Framer form submit button.\n * Redirects only when Framer exposes `props.variant` as either:\n * - native success variant name: \"Success\"\n * - exact success variant id: \"Zx14BENM0\"\n * If `variant` is not exposed, no redirect is attempted.\n */export function withTrialSuccessRedirect(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const isStatic=useIsStaticRenderer();const warnedRef=useRef(false);const hasRedirectedRef=useRef(false);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;if(!(\"variant\"in props)){if(!warnedRef.current){warnedRef.current=true;console.warn(\"[withTrialSuccessRedirect] No `variant` prop exposed by wrapped submit instance. Success-state redirect cannot be reliably detected, so redirect is disabled.\");}return;}const variantValue=String(props.variant);const isSuccessVariant=variantValue===\"Success\"||variantValue===\"Zx14BENM0\";if(isSuccessVariant&&!hasRedirectedRef.current){hasRedirectedRef.current=true;window.location.assign(\"/free-trial/thank-you\");}},[props,isStatic]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}/**\n * Override for a native link/download button instance.\n * Keeps destination/styling/handlers untouched and only forces new-tab behavior.\n */export function withOpenLinkInNewTab(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,target:\"_blank\",rel:props.rel??\"noopener noreferrer\"});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withOpenLinkInNewTab\":{\"type\":\"reactHoc\",\"name\":\"withOpenLinkInNewTab\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrialSuccessRedirect\":{\"type\":\"reactHoc\",\"name\":\"withTrialSuccessRedirect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormButtonOverrides.map"],"mappings":"iMAOG,SAAgB,EAAyB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAS,EAAoB,EAAQ,EAAUA,EAAO,EAAK,EAAQ,EAAiBA,EAAO,EAAK,EAAglB,OAA9kB,MAAc,CAAoB,GAAhB,GAA0B,IAAS,OAAY,OAAO,GAAG,EAAE,YAAY,GAAO,CAAK,EAAU,UAAS,EAAU,QAAQ,GAAK,QAAQ,KAAK,+JAA+J,GAAG,MAAO,CAAC,IAAM,EAAa,OAAO,EAAM,OAAO,GAAyB,IAAe,WAAW,IAAe,cAAiC,CAAC,EAAiB,UAAS,EAAiB,QAAQ,GAAK,EAAO,SAAS,OAAO,uBAAuB,EAAG,EAAE,CAAC,EAAM,CAAQ,CAAC,EAAsB,EAAK,EAAU,CAAK,MAAI,GAAG,CAAK,CAAC,CAAE,CAAC,CAAE,CAGj1B,SAAgB,EAAqB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAA2B,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,OAAO,SAAS,IAAI,EAAM,KAAK,qBAAqB,CAAC,CAAG,CAAE,qBAVrK,IAA+C,IAAwC"}