{"version":3,"file":"Analytics.DbmPcdlI.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/yZK61XkOIZJL9dEaic8u/85CmEX9zbLWwo4wVChNw/Analytics.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{useRef,useEffect}from\"react\";import{useInView}from\"framer-motion\";import{useTrackClickComponent,useTrackViewComponent}from\"https://asset.29cm.co.kr/contents/framer/components/canvas/ComponentEventTracker/ComponentEventTracker.hooks.event.js\";import{useTrackClickButtonEvent}from\"https://asset.29cm.co.kr/contents/framer/components/modules/hooks.js\";const getComponent=(props,Component)=>{return props[\"name\"]||Component[\"displayName\"]||props[\"data-framer-name\"];};// prettier-ignore\nconst mergeRefs=(...refs)=>{return value=>{refs.forEach(ref=>{if(typeof ref===\"function\"){ref(value);}else if(ref!=null){ref.current=value;}});};};export function withViewEventTracker(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const component=getComponent(props,Component);const containerRef=useRef(null);const isInView=useInView(containerRef);const{trackViewComponent}=useTrackViewComponent();useEffect(()=>{if(!isInView){return;}trackViewComponent(component);},[isInView]);return /*#__PURE__*/_jsx(Component,{...props,ref:mergeRefs(ref,containerRef)});});}export function withClickEventTracker(Component){return props=>{const component=getComponent(props,Component);const{trackClickComponent}=useTrackClickComponent();const handleClick=e=>{if(e.isTriggered){return;}e.isTriggered=true;trackClickComponent(component);/**\n             * 자식 컴포넌트 안에 onTap, onClick 핸들러가 달려 있으면 그대로 수행하도록 수정.\n             */props.onTap?.(e);props.onClick?.(e);};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}export function withViewClickEventTracker(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const component=getComponent(props,Component);const containerRef=useRef(null);const isInView=useInView(containerRef);const{trackViewComponent}=useTrackViewComponent();const{trackClickComponent}=useTrackClickComponent();useEffect(()=>{if(!isInView){return;}trackViewComponent(component);},[isInView]);const handleClick=e=>{if(e.isTriggered){return;}e.isTriggered=true;trackClickComponent(component);/**\n             * 자식 컴포넌트 안에 onTap, onClick 핸들러가 달려 있으면 그대로 수행하도록 수정.\n             */props.onTap?.(e);props.onClick?.(e);};return /*#__PURE__*/_jsx(Component,{ref:mergeRefs(ref,containerRef),...props,onClick:handleClick});});}export function withSnowplowClickButtonEventTracker(Component){return props=>{const component=getComponent(props,Component);const trackClickButtonEvent=useTrackClickButtonEvent();const handleClick=e=>{if(e.isTriggered){return;}e.isTriggered=true;trackClickButtonEvent({type:\"more\",name:\"상품 전체보기\"});};return /*#__PURE__*/_jsx(Component,{...props,onTap:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withViewClickEventTracker\":{\"type\":\"reactHoc\",\"name\":\"withViewClickEventTracker\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withViewEventTracker\":{\"type\":\"reactHoc\",\"name\":\"withViewEventTracker\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withClickEventTracker\":{\"type\":\"reactHoc\",\"name\":\"withClickEventTracker\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSnowplowClickButtonEventTracker\":{\"type\":\"reactHoc\",\"name\":\"withSnowplowClickButtonEventTracker\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Analytics.map"],"mappings":"udACmJ,SAAgB,EAAqB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAU,EAAa,EAAM,EAAU,CAAO,EAAaA,EAAO,KAAK,CAAO,EAAS,EAAU,EAAa,CAAM,CAAC,sBAAoB,GAAuB,CAAkF,OAAjF,MAAc,CAAK,GAAkB,EAAmB,EAAU,EAAG,CAAC,EAAS,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,IAAI,EAAU,EAAI,EAAa,CAAC,CAAC,EAAG,CAAE,SAAgB,EAAsB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAU,EAAa,EAAM,EAAU,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