{"version":3,"file":"PhoneEmailLinkTracking.CsOCeK0f.mjs","names":["p","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/Xx7aFqBkyY0JbpKAdstw/LIRVf6lLoyxrCmDIS3js/PhoneEmailLinkTracking.js"],"sourcesContent":["// contactTracking.ts\n// Framer Code Overrides to track tel:/mailto: clicks via Plausible custom events\n// Apply to any layer/component that has a Link set to tel: or mailto:\n//   - For a single, specific number/address: use trackContact() (auto-detects tel/mailto)\n//   - If you want to force a specific event name: use trackPhone() or trackEmail()\nimport{jsx as _jsx}from\"react/jsx-runtime\";// Small helper to safely call plausible()\nfunction sendPlausible(event,props){const p=window.plausible;if(typeof p===\"function\"){p(event,{props});}}// Extract the href from either the element itself or a nested <a>\nfunction getHrefFromTarget(target){let el=target;while(el&&el!==document.body){// If this node is an <a> with href, use it\nif(el instanceof HTMLAnchorElement&&el.getAttribute(\"href\")){return el.getAttribute(\"href\");}// Some Framer components render an <a> inside; keep climbing\nel=el.parentElement;}return null;}// Shared click handler factory\nfunction onClickFactory(opts){return evt=>{const href=getHrefFromTarget(evt.target)||\"\";const isTel=href.startsWith(\"tel:\");const isMail=href.startsWith(\"mailto:\");if(!isTel&&!isMail)return;// Not a contact link — do nothing\n// Choose event name: explicit override or auto\nconst eventName=opts?.eventName??(isTel?\"Phone: Click\":\"Email: Click\");// You can add more props (placement, variant, etc.) via data attributes if desired\n// Example: add data-plausible-area=\"Header\" on your layer; we’ll capture it here.\nconst host=evt.currentTarget||null;const area=host?.getAttribute?.(\"data-plausible-area\")??null;sendPlausible(eventName,{url:href,text:(host?.textContent||\"\").trim()||null,area:area});// Let the browser proceed immediately with dialing / opening the email client\n};}/** Auto-detect tel:/mailto: and send \"Phone: Click\" or \"Email: Click\". */export function trackContact(){return{onClick:onClickFactory()};}/** Force the event to be \"Phone: Click\" (still requires the layer to link to tel:). */export function trackPhone(){return{onClick:onClickFactory({eventName:\"Phone: Click\"})};}/** Force the event to be \"Email: Click\" (still requires the layer to link to mailto:). */export function trackEmail(){return{onClick:onClickFactory({eventName:\"Email: Click\"})};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withtrackContact(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...trackContact(props)});};}withtrackContact.displayName=\"trackContact\";export function withtrackPhone(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...trackPhone(props)});};}withtrackPhone.displayName=\"trackPhone\";export function withtrackEmail(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...trackEmail(props)});};}withtrackEmail.displayName=\"trackEmail\";\nexport const __FramerMetadata__ = {\"exports\":{\"withtrackPhone\":{\"type\":\"reactHoc\",\"name\":\"withtrackPhone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackEmail\":{\"type\":\"override\",\"name\":\"trackEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withtrackContact\":{\"type\":\"reactHoc\",\"name\":\"withtrackContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackContact\":{\"type\":\"override\",\"name\":\"trackContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackPhone\":{\"type\":\"override\",\"name\":\"trackPhone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withtrackEmail\":{\"type\":\"reactHoc\",\"name\":\"withtrackEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PhoneEmailLinkTracking.map"],"mappings":"iLAMA,SAAS,EAAc,EAAM,EAAM,CAAC,IAAMA,EAAE,EAAO,UAAa,OAAOA,GAAI,YAAY,EAAE,EAAM,CAAC,QAAM,CAAC,CACvG,SAAS,EAAkB,EAAO,CAAC,IAAI,EAAG,EAAO,KAAM,GAAI,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