{"version":3,"file":"EvoEquityAnalytics.BZ4eRELK.mjs","names":[],"sources":["https:/framerusercontent.com/modules/J7H7SMPUTX5iOT63Yz6w/qBVtoOwhcTHy7dqgxQ5Y/EvoEquityAnalytics.js"],"sourcesContent":["// EvoEquityAnalytics.tsx — named event instrumentation for the EvoEquity pages\n//\n// Per EvoEquity_Website_Implementation_Spec.md section 14:\n//   - uses the site's existing analytics only (window.posthog); installs nothing\n//   - no names, email addresses, form values or other personal information are sent\n//   - no-ops silently if PostHog is not present\n//\n// Uses delegated listeners rather than per-button handlers, because the CTAs are\n// Framer design components whose click handlers are not editable from code.\n//\n// Classifier notes, validated against the live DOM before shipping:\n//   - the demo booking URL is shared with \"Book a Product Demo\" and a nav item, so the\n//     EvoEquity demo event additionally requires the approved \"Book an EvoEquity demo\"\n//     label from spec 8.2\n//   - only elements with an href are classified; the early-access form's submit button\n//     carries the same label but is covered by the form success/error events instead\n//\n// Events emitted:\n//   evoequity_hero_early_access_click\n//   evoequity_hero_demo_click\n//   evoequity_header_early_access_click\n//   evoequity_safes_click\n//   evoequity_role_card_click        { role }\n//   evoequity_early_access_form_success\n//   evoequity_early_access_form_error\n//\n// Renders no visible output.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const SUCCESS_MARKER=\"your request has been received\";const ERROR_MARKERS=[\"couldn’t send your request\",\"couldn't send your request\"];function capture(event,props={}){const ph=window.posthog;if(!ph||typeof ph.capture!==\"function\")return;try{ph.capture(event,{...props,page:window.location.pathname});}catch(e){// analytics must never break the page\n}}// True when the element sits inside the site header: a <header>/<nav> landmark,\n// or any ancestor that is fixed or sticky.\nfunction inSiteHeader(el){let node=el;let depth=0;while(node&&depth<25){const tag=node.tagName;if(tag===\"HEADER\"||tag===\"NAV\")return true;const pos=window.getComputedStyle(node).position;if(pos===\"fixed\"||pos===\"sticky\")return true;node=node.parentElement;depth++;}return false;}function classify(el){const href=el.getAttribute(\"href\")||\"\";if(!href)return null;const text=(el.textContent||\"\").trim().toLowerCase();const path=el.href?el.pathname:\"\";if(href.indexOf(\"outlook\")!==-1&&text.indexOf(\"evoequity demo\")!==-1){return{event:\"evoequity_hero_demo_click\"};}if(href.indexOf(\"#evoequity-register\")!==-1||href.indexOf(\"#early-access\")!==-1||text===\"request early access\"){return{event:inSiteHeader(el)?\"evoequity_header_early_access_click\":\"evoequity_hero_early_access_click\"};}const role=path.match(/\\/products\\/evoequity\\/for-([a-z-]+)\\/?$/);if(role)return{event:\"evoequity_role_card_click\",role:role[1]};if(/\\/products\\/evoequity\\/safes\\/?$/.test(path))return{event:\"evoequity_safes_click\"};return null;}export default function EvoEquityAnalytics({enabled=true}){useEffect(()=>{if(!enabled||typeof window===\"undefined\")return;const onClick=e=>{const target=e.target;if(!target||typeof target.closest!==\"function\")return;const el=target.closest(\"a, button\");if(!el)return;const hit=classify(el);if(!hit)return;capture(hit.event,hit.role?{role:hit.role}:{});};document.addEventListener(\"click\",onClick,true);// Form outcome: the early-access form swaps in its own success or error copy.\n// Watch for the approved strings rather than reading any field value.\nlet reported=false;const scan=()=>{if(reported)return;const scope=document.getElementById(\"evoequity-register\")||document.body;const text=(scope.textContent||\"\").toLowerCase();if(text.indexOf(SUCCESS_MARKER)!==-1){reported=true;capture(\"evoequity_early_access_form_success\");return;}for(const marker of ERROR_MARKERS){if(text.indexOf(marker)!==-1){reported=true;capture(\"evoequity_early_access_form_error\");return;}}};const observer=new MutationObserver(scan);observer.observe(document.body,{childList:true,subtree:true,characterData:true});return()=>{document.removeEventListener(\"click\",onClick,true);observer.disconnect();};},[enabled]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",\"data-evoequity-analytics\":enabled?\"on\":\"off\",style:{position:\"absolute\",width:0,height:0,overflow:\"hidden\"}});}EvoEquityAnalytics.defaultProps={enabled:true};addPropertyControls(EvoEquityAnalytics,{enabled:{type:ControlType.Boolean,title:\"Tracking\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EvoEquityAnalytics\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EvoEquityAnalytics.map"],"mappings":"yLA2BkQ,SAAS,EAAQ,EAAM,EAAM,CAAC,EAAE,CAAC,IAAM,EAAG,EAAO,QAAW,MAAC,GAAI,OAAO,EAAG,SAAU,YAAkB,GAAG,CAAC,EAAG,QAAQ,EAAM,CAAC,GAAG,EAAM,KAAK,EAAO,SAAS,QAAQ,CAAC,CAAE,MAAS,CACjb,CAAC,CAED,SAAS,EAAa,EAAG,CAAC,IAAI,EAAK,EAAO,EAAM,EAAE,KAAM,GAAM,EAAM,IAAG,CAAC,IAAM,EAAI,EAAK,QAAQ,GAAG,IAAM,UAAU,IAAM,MAAM,MAAO,GAAK,IAAM,EAAI,EAAO,iBAAiB,CAAI,CAAC,CAAC,SAAS,GAAG,IAAM,SAAS,IAAM,SAAS,MAAO,GAAK,EAAK,EAAK,cAAc,GAAQ,CAAC,MAAO,EAAM,CAAC,SAAS,EAAS,EAAG,CAAC,IAAM,EAAK,EAAG,aAAa,MAAM,GAAG,GAAG,GAAG,CAAC,EAAK,OAAO,KAAK,IAAM,GAAM,EAAG,aAAa,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,EAAQ,EAAK,EAAG,KAAK,EAAG,SAAS,GAAG,GAAG,EAAK,QAAQ,SAAS,IAAI,IAAI,EAAK,QAAQ,gBAAgB,IAAI,GAAI,MAAM,CAAC,MAAM,2BAA2B,EAAG,GAAG,EAAK,QAAQ,qBAAqB,IAAI,IAAI,EAAK,QAAQ,eAAe,IAAI,IAAI,IAAO,uBAAwB,MAAM,CAAC,MAAM,EAAa,CAAE,EAAE,sCAAsC,mCAAmC,EAAG,IAAM,EAAK,EAAK,MAAM,0CAA0C,EAAwJ,OAAnJ,EAAW,CA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