1import{g as y,n as A,a as S,b as f}from"./bel-serializer-CjgxehL7.js";import{i as l,C as T,t as m,D as g,G as h,k as v,p as E,F as C}from"./browser-agent-BoSClcZG.js";import{A as I}from"./aggregate-base-Bh_nSTi7.js";import{V as u,a as d,D as F,r as N,o as R,b as D,c as L}from"./first-paint-DE0sl0Ui.js";import{e as U}from"./event-origin-Bb7irpQQ.js";import{l as _}from"./load-time-DLs7gzsq.js";import"./main-DyjxXpTK.js";import"./event-buffer-iHMgVxEW.js";const o=new u(d.CUMULATIVE_LAYOUT_SHIFT,r=>r);l&&F(({value:r,attribution:e,id:i})=>{const t={metricId:i,largestShiftTarget:e.largestShiftTarget,largestShiftTime:e.largestShiftTime,largestShiftValue:e.largestShiftValue,loadState:e.loadState};o.update({value:r,attrs:t})},{reportAllChanges:!0});const p=new u(d.INTERACTION_TO_NEXT_PAINT);l&&N(({value:r,attribution:e,id:i})=>{const t={metricId:i,eventTarget:e.interactionTarget,eventTime:e.interactionTime,interactionTarget:e.interactionTarget,interactionTime:e.interactionTime,interactionType:e.interactionType,inputDelay:e.inputDelay,nextPaintTime:e.nextPaintTime,processingDuration:e.processingDuration,presentationDelay:e.presentationDelay,loadState:e.loadState};p.update({value:r,attrs:t})});const c=new u(d.LARGEST_CONTENTFUL_PAINT);l&&R(({value:r,attribution:e})=>{if(T||c.isValid)return;let i;const t=e.lcpEntry;t&&(i={size:t.size,eid:t.id,element:e.element,timeToFirstByte:e.timeToFirstByte,resourceLoadDelay:e.resourceLoadDelay,resourceLoadDuration:e.resourceLoadDuration,resourceLoadTime:e.resourceLoadDuration,elementRenderDelay:e.elementRenderDelay,...e.navigationEntry&&{pageUrl:m(e.navigationEntry.name)}},e.url&&(i.elUrl=m(e.url)),t.element?.tagName&&(i.elTag=t.element.tagName)),c.update({value:r,attrs:i})});class z extends I{static featureName=g;#e=({name:e,value:i,attrs:t})=>{this.addTiming(e,i,t)};constructor(e){super(e,g),this.curSessEndRecorded=!1,this.firstIxnRecorded=!1,super.customAttributesAreSeparate=!0,h("docHidden",i=>this.endCurrentSession(i),this.featureName,this.ee),h("winPagehide",i=>this.addTiming("unload",i,null),this.featureName,this.ee),this.waitForFlags([]).then(()=>{D.subscribe(this.#e),L.subscribe(this.#e),c.subscribe(this.#e),p.subscribe(this.#e),_.subscribe(({name:i,value:t})=>{this.addTiming(i,Math.round(t))}),v(()=>{const{name:i,value:t,attrs:n}=o.current;t!==void 0&&this.addTiming(i,t*1e3,n)},!0,!0),this.drain()})}endCurrentSession(e){this.curSessEndRecorded||(this.addTiming("pageHide",e,null),this.curSessEndRecorded=!0)}addTiming(e,i,t){t=t||{},k(t),e!==d.CUMULATIVE_LAYOUT_SHIFT&&o.current.value>=0&&(t.cls=o.current.value);const n={name:e,value:i,attrs:t};return this.events.add(n),E("pvtAdded",[e,i,t],void 0,C.sessionTrace,this.ee),this.checkForFirstInteraction(),n}checkForFirstInteraction(){if(this.firstIxnRecorded||T||!performance)return;const e=performance.getEntriesByType("first-input")[0];e&&(this.firstIxnRecorded=!0,this.addTiming("fi",e.startTime,{type:e.name,eventTarget:U(e.target),loadState:document.readyState}))}appendGlobalCustomAttributes(e){var i=e.attrs||{},t=["size","eid","cls","type","fid","elTag","elUrl","net-type","net-etype","net-rtt","net-dlink"];Object.entries(this.agentRef.info.jsAttributes||{}).forEach(([n,a])=>{t.indexOf(n)<0&&(i[n]=a)})}preHarvestChecks(){return this.checkForFirstInteraction(),super.preHarvestChecks()}serializer(e){if(!e?.length)return"";for(var i=y(this.agentRef.runtime.obfuscator),t="bel.6;",n=0;n<e.length;n++){var a=e[n];t+="e,",t+=i(a.name)+",",t+=A(a.value,f,!1)+",",this.appendGlobalCustomAttributes(a);var s=S(a.attrs,i);s&&s.length>0&&(t+=f(s.length)+";"+s.join(";")),n+1<e.length&&(t+=";")}return t}}function k(r){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;e&&(e.type&&(r["net-type"]=e.type),e.effectiveType&&(r["net-etype"]=e.effectiveType),e.rtt&&(r["net-rtt"]=e.rtt),e.downlink&&(r["net-dlink"]=e.downlink))}export{z as Aggregate};
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.