PageSourceSearch

https://app.coresportsai.com/_next/static/chunks/38580-a821ff23c923e799.js

js coresportsai.com collected 2026-10-09 22:59:28 UTC 6,798 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38580],{38580:(e,t,a)=>{a.d(t,{$i:()=>S,Gx:()=>E,J0:()=>k,KC:()=>F,Tv:()=>O,Xc:()=>P,aD:()=>W,ck:()=>L,ix:()=>j,ky:()=>I,oe:()=>C,rC:()=>N,x$:()=>x});var n=a(19708),i=a(3619),o=a(33885),r=a(66340);function s(e){return"/"===e||""===e?"home":e.startsWith("/report/")?"report":e.startsWith("/admin/analytics")?"admin_analytics":e.startsWith("/admin")?"admin":e.startsWith("/coach")?"coach":e.startsWith("/signin")?"signin":e.startsWith("/shared")?"shared_report":e.startsWith("/u/")?"core_card":"other"}let c=null,l=0,u="",d="",p="",g=0,h="",v=0,m=0,f=0,w=null,y=[],b=0;function _(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substring(2,9))}function D(){try{return(0,o.getAuth)(i.app).currentUser}catch(e){return null}}async function T(){try{if("1"===sessionStorage.getItem("core:geo"))return;let e=(0,o.getAuth)(i.app).onAuthStateChanged(async t=>{if(t&&"1"!==sessionStorage.getItem("core:geo")){sessionStorage.setItem("core:geo","1"),e();try{let e=await t.getIdToken();await fetch("/api/me/geo",{method:"POST",headers:{Authorization:"Bearer ".concat(e)},keepalive:!0})}catch(e){}}})}catch(e){}}function k(){var e,t;c=_(),l=Date.now(),z({eventType:"session_start",page:(null==(t=window)||null==(e=t.location)?void 0:e.pathname)||"/"}),T(),w&&clearInterval(w),w=setInterval(X,15e3),window.addEventListener("beforeunload",M),window.addEventListener("visibilitychange",A)}function I(){var e,t;c&&(B(),p&&H(),h&&$(),z({eventType:"session_end",page:u||(null==(t=window)||null==(e=t.location)?void 0:e.pathname)||"/",durationMs:Date.now()-l}),X(),w&&clearInterval(w),c=null)}function M(){B(),p&&H(),h&&$(),X()}function A(){"hidden"===document.visibilityState?M():"visible"===document.visibilityState&&(p&&(g=Date.now()),h&&(v=Date.now()),u&&(f=Date.now()))}function C(e,t){B(),p&&(H(),p=""),h&&($(),h=""),u=e,d=s(e),f=Date.now(),m=0,z({eventType:"page_view",page:e,matchId:t})}function S(e){B(),p&&(H(),p="");let t={home:"home","core-insights":"insights",dashboard:"dashboard",matches:"matches",upload:"upload","how-it-works":"how_it_works","core-academy":"academy",profile:"profile","core-card":"core_card",help:"help","interactive-lab":"interactive_lab"}[e]||e;u="/#".concat(e),d=t,f=Date.now(),m=0,z({eventType:"page_view",page:"/#".concat(e),pageCategory:t,metadata:{viewType:"in_app",view:e}})}function x(e,t){p&&g>0&&H(),p=e,g=Date.now(),m=0,z({eventType:"tab_switch",page:u,tab:e,matchId:t})}function E(e,t,a){h&&v>0&&$(),h=e,v=Date.now(),z({eventType:"section_view",page:u,tab:t||p,section:e,matchId:a})}function W(e,t){if(!isFinite(e)||e<0)return;let a=25*Math.floor(Math.min(100,Math.max(0,e))/25);a>m&&a>0&&(m=a,z({eventType:"scroll_depth",page:u,tab:p||void 0,scrollDepth:a,matchId:t}))}function N(e,t,a){z({eventType:"story",page:u||window.location.pathname,feature:e,matchId:t,metadata:a})}function P(){z({eventType:"chatbot_open",page:u,feature:"chatbot"})}function L(e,t){z({eventType:"chatbot_message",page:u,feature:"chatbot",matchId:e,metadata:{promptLength:(null==t?void 0:t.length)||0,promptPreview:null==t?void 0:t.substring(0,60)}})}function O(e){z({eventType:"chatbot_close",page:u,feature:"chatbot",durationMs:e})}function F(e,t){z({eventType:"report_export",page:u,matchId:e,feature:"pdf_export",metadata:{format:t||"pdf"}})}function J(e,t,a){z({eventType:"click",page:u,tab:p||void 0,section:e,matchId:t,metadata:a})}function j(){document.addEventListener("click",e=>{let t=e.target;if(!t)return;let a=t.closest("[data-track]");if(a){let e=a.getAttribute("data-track")||"";J(e,void 0,{category:a.getAttribute("data-track-category")||""||void 0,detail:a.getAttribute("data-track-meta")||void 0});return}let n=t.closest("button, a, [role='button']");if(n){let e=(n.textContent||"").trim().substring(0,60),t=n.getAttribute("aria-label")||"",a=n.getAttribute("href")||"";(e||t)&&J(t||e,void 0,{tag:n.tagName.toLowerCase(),href:a||void 0})}},{passive:!0,capture:!0})}function B(){if(!u||f<=0)return;let e=Date.now()-f;e>1e3&&z({eventType:"page_view",page:u,durationMs:e,metadata:{type:"duration",maxScroll:m}}),f=0}function H(){if(!p||g<=0)return;let e=Date.now()-g;e>500&&z({eventType:"tab_switch",page:u,tab:p,durationMs:e,metadata:{type:"duration"}}),g=0}function $(){if(!h||v<=0)return;let e=Date.now()-v;e>500&&z({eventType:"section_view",page:u,tab:p||void 0,section:h,durationMs:e,metadata:{type:"duration"}}),v=0}function z(e){var t,a;let o=D();if(!o||(e.page||u||(null==(a=window)||null==(t=a.location)?void 0:t.pathname)||"").startsWith("/admin"))return;let l={userId:o.uid,userEmail:o.email||"",eventType:e.eventType||"page_view",page:e.page||u,pageCategory:e.pageCategory||d||s(e.page||u),timestamp:Date.now()};
1if(e.matchId&&(l.matchId=e.matchId),e.tab&&(l.tab=e.tab),e.section&&(l.section=e.section),e.feature&&(l.feature=e.feature),e.durationMs&&e.durationMs>0&&(l.durationMs=e.durationMs),void 0!==e.scrollDepth&&isFinite(e.scrollDepth)&&(l.scrollDepth=e.scrollDepth),e.metadata){let t={};for(let[a,n]of Object.entries(e.metadata))void 0!==n&&(t[a]=n);Object.keys(t).length>0&&(l.metadata=t)}if(c&&(l.sessionId=c),y.push(l),y.length>=40&&X(),["page_view","tab_switch","session_start","feature_use","navigation"].includes(l.eventType)){let e=Date.now();e-b>=3e4&&(b=e,function(e,t){try{let a=(0,n.getFirestore)(i.app),o={userId:e,email:t.userEmail||"",lastSeen:Date.now(),currentPage:t.page||"",pageCategory:t.pageCategory||"",eventType:t.eventType||""};t.tab&&(o.currentTab=t.tab),t.feature&&(o.feature=t.feature),c&&(o.sessionId=c),o.sport=(0,r.H3)(),(0,n.setDoc)((0,n.doc)(a,"user_presence",e),o,{merge:!0}).catch(()=>{})}catch(e){}}(o.uid,l))}}let G=null,K=0,U=0;async function X(){var e,t,o,s;if(!y.length||!c){y=[];return}let l=y;y=[];let u=D();if(!u)return;G&&G!==u.uid&&(c=_(),K=0,U=0),G=u.uid,U||(U=Number(null==(e=l[0])?void 0:e.timestamp)||Date.now());let d=Math.max(0,500-K),p=l.slice(0,d).map(e=>{let{userId:t,userEmail:a,sessionId:n,...i}=e;return JSON.parse(JSON.stringify(i))});K+=p.length;let g=Number(null==(t=l[l.length-1])?void 0:t.timestamp)||Date.now(),h=Array.from(new Set(l.map(e=>e.page).filter(Boolean)));try{let{arrayUnion:e,increment:t}=await Promise.resolve().then(a.bind(a,19708)),d=(0,n.getFirestore)(i.app),v="undefined"!=typeof navigator?navigator.userAgent:"",m=(0,r.H3)();await (0,n.setDoc)((0,n.doc)(d,"user_sessions",c),{userId:u.uid,userEmail:u.email||"",sport:m,sports:e(m),startedAt:U,lastAt:g,durationMs:Math.max(0,g-U),eventCount:t(l.length),device:/Mobi|Android|iPhone|iPad/i.test(v)?"mobile":"desktop",standalone:null==(o=(s=window).matchMedia)?void 0:o.call(s,"(display-mode: standalone)").matches,...h.length?{pages:e(...h.slice(0,20))}:{},...p.length?{events:e(...p)}:{},expireAt:new Date(g+31536e6)},{merge:!0})}catch(e){}}}}]);

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.