{"version":3,"file":"Tracking_Code.CPQCqoGh.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/8CP4qoxRpM8h2XaznGDe/gvL9RCbCxtTGP3GUpabd/Tracking_Code.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import*as React from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";let isFirst=true;const INTERNET_PATHNAME=\"/mkt/bm/internet\";const BLOCKED_PHONE_NUMBER=\"01038483696\";const normalizePhoneNumber=value=>value.replace(/\\D/g,\"\");const useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function trackingViewContent(){return{onClick:()=>{const w=window;if(typeof w.fbq!==\"undefined\"){w.fbq(\"track\",\"ViewContent\");w.karrotPixel.track(\"ViewContent\");}else{console.log(\"fbq is not loaded\");}}};}// 당근·네이버 전송 조건은 기존과 동일하게 유지\nfunction trackOtherLead(){const w=window;if(typeof w.fbq!==\"undefined\"){w.karrotPixel.track(\"Lead\");if(w.wcs){if(!w.wcs_add){w.wcs_add={};}w.wcs_add[\"wa\"]=\"s_15fd45fd1810\";w.wcs.trans({type:\"lead\"});}}else{console.log(\"fbq is not loaded\");}}// 팝업 클릭에서는 메타 Lead를 보내지 않음\nexport function trackingLead(){return{onClick:()=>{trackOtherLead();}};}export function trackingContact(){return{onClick:()=>{const w=window;if(typeof w.fbq!==\"undefined\"){w.fbq(\"track\",\"Contact\");}else{console.log(\"fbq is not loaded\");}}};}// 팝업 표시 시 당근·네이버만 전송\nfunction trackLead(){if(!isFirst){trackOtherLead();}}function anyChildVisible(overlay){if(!overlay||overlay.childElementCount===0){return false;}for(const el of Array.from(overlay.children)){const style=getComputedStyle(el);const visible=style.display!==\"none\"&&style.visibility!==\"hidden\"&&parseFloat(style.opacity||\"1\")>0;if(visible){return true;}}return false;}export function fireLeadWhenPopupOpens(){React.useEffect(()=>{// 메타: 문의하기 클릭 시 세 칸의 입력 여부 확인\nconst onInquiryClick=event=>{const target=event.target;if(!(target instanceof Element)){return;}const button=target.closest('button[name=\"submitBtn\"][type=\"submit\"]');if(!(button instanceof HTMLButtonElement)){return;}if(button.disabled){return;}const form=button.form;if(!form){return;}const requiredNames=[\"매장명\",\"연락처\",\"지역/업종\"];const complete=requiredNames.every(name=>{const field=form.querySelector(`input[name=\"${name}\"]`);return field!==null&&field.value.trim()!==\"\";});if(!complete){return;}if(window.location.pathname===INTERNET_PATHNAME){const phoneField=form.elements.namedItem(\"연락처\");const phoneValue=phoneField instanceof HTMLInputElement||phoneField instanceof HTMLTextAreaElement?phoneField.value:\"\";if(normalizePhoneNumber(phoneValue)===BLOCKED_PHONE_NUMBER){return;}}const w=window;if(typeof w.fbq===\"function\"){console.log(\"메타 Lead: 문의하기 클릭에서 전송\");w.fbq(\"track\",\"Lead\");}else{console.log(\"fbq is not loaded\");}};document.addEventListener(\"click\",onInquiryClick,true);// 당근·네이버: 기존 팝업 표시 감지 유지\nconst overlay=document.getElementById(\"overlay\");let observer;let timer;if(overlay){let fired=false;const check=()=>{const open=anyChildVisible(overlay);if(open&&!fired){trackLead();fired=true;}if(!open&&fired){fired=false;}};observer=new MutationObserver(check);observer.observe(overlay,{childList:true,subtree:true,attributes:true,attributeFilter:[\"style\",\"class\",\"data-framer-variant\"]});timer=window.setInterval(check,250);check();}return()=>{document.removeEventListener(\"click\",onInquiryClick,true);observer?.disconnect();if(timer!==undefined){window.clearInterval(timer);}};},[]);return{onClick:()=>{if(isFirst){isFirst=false;}}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withtrackingViewContent(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...trackingViewContent(props)});};}withtrackingViewContent.displayName=\"trackingViewContent\";export function withtrackingLead(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...trackingLead(props)});};}withtrackingLead.displayName=\"trackingLead\";export function withtrackingContact(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...trackingContact(props)});};}withtrackingContact.displayName=\"trackingContact\";export function withfireLeadWhenPopupOpens(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...fireLeadWhenPopupOpens(props)});};}withfireLeadWhenPopupOpens.displayName=\"fireLeadWhenPopupOpens\";\nexport const __FramerMetadata__ = {\"exports\":{\"trackingViewContent\":{\"type\":\"override\",\"name\":\"trackingViewContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withtrackingContact\":{\"type\":\"reactHoc\",\"name\":\"withtrackingContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withfireLeadWhenPopupOpens\":{\"type\":\"reactHoc\",\"name\":\"withfireLeadWhenPopupOpens\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fireLeadWhenPopupOpens\":{\"type\":\"override\",\"name\":\"fireLeadWhenPopupOpens\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withtrackingViewContent\":{\"type\":\"reactHoc\",\"name\":\"withtrackingViewContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackingLead\":{\"type\":\"override\",\"name\":\"trackingLead\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackingContact\":{\"type\":\"override\",\"name\":\"trackingContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withtrackingLead\":{\"type\":\"reactHoc\",\"name\":\"withtrackingLead\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Tracking_Code.map"],"mappings":"6RAA8iC,SAAgB,GAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAM,EAAE,EAAiB,EAAE,MAAM,OAAmF,QAAQ,IAAI,mBAAmB,GAArG,EAAE,IAAI,QAAQ,aAAa,EAAE,EAAE,YAAY,MAAM,aAAa,EAA0C,CAAC,CAAE,CACjwC,SAAS,GAAgB,CAAC,IAAM,EAAE,EAAiB,EAAE,MAAM,OAAmJ,QAAQ,IAAI,mBAAmB,GAArK,EAAE,YAAY,MAAM,MAAM,EAAK,EAAE,MAAK,AAAe,EAAE,UAAQ,CAAC,EAAG,EAAE,QAAQ,GAAM,iBAAiB,EAAE,IAAI,MAAM,CAAC,KAAK,MAAM,CAAC,GAA2C,CAChP,SAAgB,GAAc,CAAC,MAAM,CAAC,YAAY,CAAC,EAAe,CAAE,CAAC,CAAE,CAAC,SAAgB,GAAiB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAM,EAAE,EAAiB,EAAE,MAAM,OAA4C,QAAQ,IAAI,mBAAmB,EAA9D,EAAE,IAAI,QAAQ,SAAS,CAA0C,CAAC,CAAE,CAChP,SAAS,GAAW,CAAK,GAAS,EAAe,CAAG,CAAC,SAAS,EAAgB,EAAQ,CAAC,GAAG,CAAC,GAAS,EAAQ,oBAAoB,EAAG,M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