{"version":3,"file":"FlowFirstVisitTrigger.BtH90w7n.mjs","names":[],"sources":["https:/framerusercontent.com/modules/uz997WstdDzbX6GD7nvQ/aczdfd0gPM2izNMQpIMx/FlowFirstVisitTrigger.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function EthrFirstVisitTrigger(props){const{storageKey,triggerLayerName,delayMs,enabled}=props;useEffect(()=>{if(!enabled)return;if(typeof window===\"undefined\")return;let alreadySeen=false;try{alreadySeen=window.localStorage.getItem(storageKey)===\"true\";}catch(_){}if(alreadySeen)return;const t=window.setTimeout(()=>{const triggerLayer=document.querySelector(`[data-framer-name=\"${triggerLayerName}\"]`);if(!triggerLayer){if(typeof console!==\"undefined\"){console.warn(`[ethr-first-visit] Trigger layer \"${triggerLayerName}\" not found.`);}return;}const rect=triggerLayer.getBoundingClientRect();const x=rect.left+rect.width/2;const y=rect.top+rect.height/2;const base={bubbles:true,cancelable:true,view:window,clientX:x,clientY:y};const pointerBase={...base,pointerType:\"mouse\",isPrimary:true};try{triggerLayer.dispatchEvent(new PointerEvent(\"pointerdown\",pointerBase));triggerLayer.dispatchEvent(new PointerEvent(\"pointerup\",pointerBase));}catch(_){}triggerLayer.dispatchEvent(new MouseEvent(\"mousedown\",base));triggerLayer.dispatchEvent(new MouseEvent(\"mouseup\",base));triggerLayer.dispatchEvent(new MouseEvent(\"click\",base));try{window.localStorage.setItem(storageKey,\"true\");}catch(_){}},delayMs);return()=>window.clearTimeout(t);},[storageKey,triggerLayerName,delayMs,enabled]);return /*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{display:\"inline-block\",width:1,height:1,opacity:0,pointerEvents:\"none\"}});}EthrFirstVisitTrigger.defaultProps={storageKey:\"ethr-flow-intro-played\",triggerLayerName:\"Info\",delayMs:500,enabled:true};addPropertyControls(EthrFirstVisitTrigger,{storageKey:{type:ControlType.String,title:\"Storage Key\",placeholder:\"ethr-flow-intro-played\"},triggerLayerName:{type:ControlType.String,title:\"Trigger Layer\",placeholder:\"Info\"},delayMs:{type:ControlType.Number,title:\"Delay\",min:0,max:5e3,step:50,unit:\"ms\"},enabled:{type:ControlType.Boolean,title:\"Enabled\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EthrFirstVisitTrigger\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FlowFirstVisitTrigger.map"],"mappings":"wLAA4H,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,aAAW,mBAAiB,UAAQ,WAAS,EAAyqC,OAAnqC,MAAc,CAAoB,GAAhB,CAAC,GAAyB,IAAS,OAAY,OAAO,IAAI,EAAY,GAAM,GAAG,CAAC,EAAY,EAAO,aAAa,QAAQ,CAAU,IAAI,MAAO,MAAS,CAAC,CAAC,GAAG,EAAY,OAAO,IAAM,EAAE,EAAO,eAAe,CAAC,IAAM,EAAa,SAAS,cAAc,sBAAsB,EAAiB,GAAG,EAAE,GAAG,CAAC,EAAa,CAAI,OAAO,QAAU,KAAa,QAAQ,KAAK,qCAAqC,EAAiB,aAAa,EAAG,MAAO,CAAC,IAAM,EAAK,EAAa,sBAAsB,EAAsE,EAAK,CAAC,QAAQ,GAAK,WAAW,GAAK,KAAK,EAAO,QAA3G,EAAK,KAAK,EAAK,MAAM,EAAgG,QAAtF,EAAK,IAAI,EAAK,OAAO,CAA0E,EAAQ,EAAY,CAAC,GAAG,EAAK,YAAY,QAAQ,UAAU,EAAI,EAAE,GAAG,CAAC,EAAa,cAAc,IAAI,aAAa,cAAc,CAAW,CAAC,EAAE,EAAa,cAAc,IAAI,aAAa,YAAY,CAAW,CAAC,CAAE,MAAS,CAAC,CAAC,EAAa,cAAc,IAAI,WAAW,YAAY,CAAI,CAAC,EAAE,EAAa,cAAc,IAAI,WAAW,UAAU,CAAI,CAAC,EAAE,E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