{"version":3,"file":"CTA_Buttons.Bl2AqUFF.mjs","names":[],"sources":["https:/framerusercontent.com/modules/b9M0FMhruPlFIom3qbHh/CmE88oF65qB1wvDJAXu3/CTA_Buttons.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";// Allowlist for button types to prevent XSS\nconst ALLOWED_BUTTON_TYPES=new Set([\"SignUp\",\"LogIn\",\"SignUpViaStarter\",\"SignUpViaPro\",\"SignUpViaTeam\",\"SignUpViaBusiness\",\"Download\"]);// ======================\n// LOCATION DETECTION\n// ======================\nfunction detectLocation(button){let element=button.parentElement;let hasHeader=false;let hasHero=false;let hasFooter=false;let hasPricing=false;// Early return optimization - stop when Pricing is found\nwhile(element&&element!==document.body){const framerName=element.getAttribute(\"data-framer-name\");if(framerName){const nameLower=framerName.toLowerCase().trim();if(nameLower.includes(\"pricing\"))return\"Pricing\"// Immediate return\n;if(nameLower.includes(\"hero\"))hasHero=true;if(nameLower.includes(\"footer\"))hasFooter=true;if(nameLower.includes(\"header\"))hasHeader=true;}element=element.parentElement;}if(hasHero)return\"Hero\";if(hasFooter)return\"Footer\";if(hasHeader)return\"Header\";try{const rect=button.getBoundingClientRect();const scrollTop=window.scrollY||window.pageYOffset||0;const absoluteTop=rect.top+scrollTop;const viewportHeight=window.innerHeight;if(absoluteTop<viewportHeight*.9)return\"Hero\";const pageHeight=document.documentElement.scrollHeight;if(absoluteTop>pageHeight-viewportHeight*1.5)return\"Footer\";}catch(e){// Silent failure - position detection is a fallback\n}return\"Section\";}// Sanitize button text to prevent XSS\nfunction sanitizeButtonText(text){const trimmed=text.trim().substring(0,100);const sanitized=trimmed.replace(/[<>\"'&]/g,\"\");return ALLOWED_BUTTON_TYPES.has(sanitized)?sanitized:\"UnknownButton\";}// ======================\n// CTA BUTTONS\n// ======================\nfunction createTrackingOverride(Component,ctaButtonType){const Wrapped=props=>{const{onClick:originalOnClick,...rest}=props;const handleClick=event=>{const button=event?.currentTarget;const location=detectLocation(button);window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:\"cta-button-pressed\",ctaButtonType:ctaButtonType,ctaLocation:location});// Forward event to original handler\nif(originalOnClick){originalOnClick(event);}};return /*#__PURE__*/_jsx(Component,{...rest,onClick:handleClick});};// Add displayName for React DevTools\nWrapped.displayName=`withTrack${ctaButtonType}(${Component.displayName||Component.name||\"Component\"})`;return Wrapped;}// ======================\n// AUTO-TRACKING\n// ======================\nexport function withAutoTracking(Component){const Wrapped=props=>{const{onClick:originalOnClick,...rest}=props;const handleClick=event=>{const button=event?.currentTarget;if(button){const buttonText=(button.textContent||\"\").trim();const sanitizedButtonType=sanitizeButtonText(buttonText);const location=detectLocation(button);window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:\"cta-button-pressed\",ctaButtonType:sanitizedButtonType,ctaLocation:location});}// Forward event to original handler\nif(originalOnClick){originalOnClick(event);}};return /*#__PURE__*/_jsx(Component,{...rest,onClick:handleClick});};// Add displayName for React DevTools\nWrapped.displayName=`withAutoTracking(${Component.displayName||Component.name||\"Component\"})`;return Wrapped;}// ======================\n// ALL CTA OVERRIDES\n// ======================\nexport function withTrackSignUp(Component){return createTrackingOverride(Component,\"SignUp\");}export function withTrackLogIn(Component){return createTrackingOverride(Component,\"LogIn\");}export function withTrackSignUpViaStarter(Component){return createTrackingOverride(Component,\"SignUpViaStarter\");}export function withTrackSignUpViaPro(Component){return createTrackingOverride(Component,\"SignUpViaPro\");}export function withTrackSignUpViaTeam(Component){return createTrackingOverride(Component,\"SignUpViaTeam\");}export function withTrackSignUpViaBusiness(Component){return createTrackingOverride(Component,\"SignUpViaBusiness\");}export function withTrackEnterpriseFormSubmit(Component){return createTrackingOverride(Component,\"EnterpriseFormSubmit\");}\nexport const __FramerMetadata__ = {\"exports\":{\"withAutoTracking\":{\"type\":\"reactHoc\",\"name\":\"withAutoTracking\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaStarter\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaStarter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaBusiness\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaBusiness\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUp\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackLogIn\":{\"type\":\"reactHoc\",\"name\":\"withTrackLogIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackEnterpriseFormSubmit\":{\"type\":\"reactHoc\",\"name\":\"withTrackEnterpriseFormSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaPro\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaPro\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTrackSignUpViaTeam\":{\"type\":\"reactHoc\",\"name\":\"withTrackSignUpViaTeam\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CTA_Buttons.map"],"mappings":"kHAIA,SAAS,EAAe,EAAO,CAAC,IAAI,EAAQ,EAAO,cAAkB,EAAU,GAAU,EAAQ,GAAU,EAAU,GACrH,KAAM,GAAS,IAAU,SAAS,MAAK,CAAC,IAAM,EAAW,EAAQ,aAAa,kBAAkB,EAAE,GAAG,EAAW,CAAC,IAAM,EAAU,EAAW,YAAY,CAAC,CAAC,KAAK,EAAE,GAAG,EAAU,SAAS,SAAS,EAAE,MAAM,UACpM,EAAU,SAAS,MAAM,IAAE,EAAQ,IAAQ,EAAU,SAAS,QAAQ,IAAE,EAAU,IAAQ,EAAU,SAAS,QAAQ,IAAE,EAAU,GAAK,CAAC,EAAQ,EAAQ,aAAc,CAAC,GAAG,EAAQ,MAAM,OAAO,GAAG,EAAU,MAAM,SAAS,GAAG,EAAU,MAAM,SAAS,GAAG,CAAC,IAAM,EAAK,EAAO,sBAAsB,EAAQ,EAAU,EAAO,SAAS,EAAO,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