1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3612],{23612:function(e,t,n){n.r(t),n.d(t,{AnalyticsDebuggerInternal:function(){return u},default:function(){return i}});var s=n(95627),a=n(67294),l=n(73935);function i(){return"browser"!==(0,s.g)().name||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,(0,l.createPortal)(s.j.jsx(u,{}),document.body))}const o=(e,t)=>{const n=[];let s=e;for(;null!=s&&s.parentElement;)s=s.parentElement.closest(t),s&&n.push(s);return n},c={},r="YA_NO_SCOPE",d=(e,t,n,s)=>{c.hasOwnProperty(e)?c[e].events.map((e=>e.el)).includes(s)||(c[e].events=[...c[e].events,{eventData:t,el:s}]):c[e]={scopeEl:n||s,events:[{eventData:t,el:s}]}};function u(){const[e,t]=(0,a.useState)(),[n,l]=(0,a.useState)([]),[i,u]=(0,a.useState)(!1),g=n=>{t(e===n?void 0:n)};return(0,a.useEffect)((()=>{let e=null;const t=()=>{e&&e.abort(),e=new AbortController;const t=e.signal;document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach(((e,n)=>{const s=e.closest("[data-ya-scope]"),a=null==s?void 0:s.dataset.yaScope,i=((e,t)=>{const n=e.dataset.yaAction,s=e.dataset.yaScopeoverride,a=e.dataset.yaEventname,l=s||t;return{action:n,originalEventName:l?`${l}_${a}`:a,scope:l}})(e,a);e.addEventListener("mouseenter",(()=>{l([{elem:e,key:`${i.originalEventName}_${n}`,action:i.action,originalEventName:i.originalEventName,scope:i.scope}])}),{signal:t}),e.addEventListener("mouseleave",(()=>{l([])}),{signal:t});const c=e.dataset.yaScopeoverride;c?d(c,i,s,e):[a,...o(e,"[data-ya-scope]").map((e=>e.dataset.yaScope))].forEach((t=>{d(t||r,i,s,e)}))})),u(!0)};t();const n=new MutationObserver(t);return n.observe(document,{childList:!0,subtree:!0}),()=>{document.documentElement.classList.remove("xYextDebug"),n.disconnect(),null==e||e.abort()}}),[]),i?s.j.jsxs(s.j.Fragment,{children:[s.j.jsxs("div",{className:"analytics-debugger",children:[s.j.jsxs("div",{className:"analytics-debugger-toggles",children:[s.j.jsx("button",{className:(0,s.c)("analytics-debugger-toggle",{"is-active":"Events"===e}),onClick:()=>g("Events"),children:"Events"}),s.j.jsx("button",{className:(0,s.c)("analytics-debugger-toggle",{"is-active":"Scopes"===e}),onClick:()=>g("Scopes"),children:"Scopes"})]}),e&&s.j.jsx("div",{className:"analytics-debugger-tabs",children:"Events"===e?s.j.jsx(p,{data:c,setTooltips:l}):s.j.jsx(m,{data:c,setTooltips:l})})]}),s.j.jsx(b,{tooltips:n})]}):null}const g=()=>{const e={};return Object.values(c).forEach((t=>{t.events.forEach((t=>{const{originalEventName:n}=t.eventData;e[n]||(e[n]=[]),!e[n].find((e=>e.el===t.el))&&e[n].push(t)}))})),e};function p(e){const{setTooltips:t}=e,[n,l]=(0,a.useState)([]),[i,o]=(0,a.useState)("");return s.j.jsxs("div",{className:"analytics-debugger-tab",children:[s.j.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),s.j.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(g()).map((([e,a],c)=>{const r=`${e}_${c}`;return s.j.jsx("li",{className:"analytics-debugger-listItem",children:s.j.jsx("button",{className:(0,s.c)("analytics-debugger-button",{"is-active":r===i}),onClick:()=>((e,s)=>{n.forEach((e=>e.classList.remove("analytics-event-highlight")));const a=e.map((e=>(e.el.scrollIntoView({behavior:"smooth",block:"nearest"}),e.el.classList.add("analytics-event-highlight"),e.el)));l(a),o(s),t(e.map(((e,t)=>({elem:e.el,key:`${e.eventData.originalEventName}_${t}`,action:e.eventData.action,originalEventName:e.eventData.originalEventName,scope:e.eventData.scope}))))})(a,r),children:e})},r)}))})]})}function m(e){const{data:t,setTooltips:n}=e,[l,i]=(0,a.useState)("");return s.j.jsxs("div",{className:"analytics-debugger-tab",children:[s.j.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),s.j.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(t).map(((e,a)=>{if(e!==r)return s.j.jsx("li",{className:"analytics-debugger-listItem",children:s.j.jsx("button",{className:(0,s.c)("analytics-debugger-button",{"is-active":e===l}),onClick:()=>(e=>{const s=t[e];s.scopeEl&&(s.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),i(e),n(s.events.map(((e,t)=>{const n=e.eventData;return{elem:e.el,key:`${n.originalEventName}_${t}`,action:n.action,originalEventName:n.originalEventName,scope:n.scope}}))))})(e),children:e})},e+a)}
1))})]})}function b(e){const t=(0,a.useRef)({});return(0,a.useEffect)((()=>{if(t.current)for(const e of Object.values(t.current)){const n=Object.values(t.current).map((e=>e.el)).filter((t=>t!==e.el));v(e,n),e.el.style.visibility="visible"}}),[e.tooltips]),s.j.jsx(s.j.Fragment,{children:e.tooltips.map((e=>s.j.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:n=>{n?t.current[e.key]={el:n,tooltip:e}:delete t.current[e.key]},children:[s.j.jsxs("span",{children:["Action: ",e.action]}),s.j.jsx("br",{}),s.j.jsxs("span",{children:["Scope: ",e.scope]}),s.j.jsx("br",{}),s.j.jsxs("span",{children:["Original Event Name: ",e.originalEventName]})]},e.key)))})}function v(e,t){for(let n=0;n<9;n++){const s=f(e.tooltip.elem.getBoundingClientRect(),e.el,n);if(e.el.style.inset=`${s.top} auto auto ${s.left}`,j(e.el.getBoundingClientRect().left,e.el.getBoundingClientRect().top+window.scrollY,e.el.getBoundingClientRect().right,e.el.getBoundingClientRect().bottom+window.scrollY))continue;let a=!0;for(let n=0;n<t.length;n++){const s=t[n];h(e.el,s)&&(a=!1)}if(a)break}}function h(e,t){const n=e.getBoundingClientRect().top+window.scrollY,s=e.getBoundingClientRect().left,a=n+e.clientHeight,l=s+e.clientWidth,i=t.getBoundingClientRect().top+window.scrollY,o=t.getBoundingClientRect().left,c=i+t.clientHeight,r=o+t.clientWidth,d=(e,t,n,s,a,l,i,o)=>n<=a&&a<=i&&s<=l&&l<=o||n<=e&&e<=i&&s<=t&&t<=o||n<=e&&e<=i&&s<=l&&l<=o||n<=a&&a<=i&&s<=t&&t<=o;return d(s,n,o,i,l,a,r,c)||d(o,i,s,n,r,c,l,a)}function j(e,t,n,s){return e<0||n>window.innerWidth||t<0||s>document.documentElement.scrollHeight}function f(e,t,n){const s=t.clientHeight,a=t.clientWidth;let l,i;switch(n){case 0:i=window.scrollY+e.top-s+"px",l=e.left-a+"px";break;case 1:i=window.scrollY+e.top-s+"px",l=e.left+"px";break;case 2:i=window.scrollY+e.top-s+"px",l=e.right+"px";break;case 3:i=window.scrollY+e.top-s+"px",l=e.right-a+"px";break;case 4:i=window.scrollY+e.bottom+"px",l=e.left-a+"px";break;case 5:i=window.scrollY+e.bottom+"px",l=e.left+"px";break;case 6:i=window.scrollY+e.bottom+"px",l=e.right-a+"px";break;case 7:i=window.scrollY+e.bottom+"px",l=e.right+"px";break;default:i=0,l=0}return{top:i,left:l}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.