1import{a as D}from"./chunk-T6EXKGY2-dd11b59904.js";import{a as L}from"./chunk-M2XJ75SP-dd11b59904.js";import{a as Z}from"./chunk-FGIZYI7D-dd11b59904.js";import{a as Q}from"./chunk-75DIZHNM-dd11b59904.js";import"./chunk-ZBRKOKDC-dd11b59904.js";import{b as X}from"./chunk-LTLRCGON-dd11b59904.js";import{a as _,c as W,d as A,e as x,f as P,g as G}from"./chunk-5UZZMMMB-dd11b59904.js";import{g as F,m as j,n as O,p as z,q as Y,r as q}from"./chunk-BI2OUMOP-dd11b59904.js";import{a as v}from"./chunk-KTTPAWML-dd11b59904.js";import{a as b}from"./chunk-UOQWDWNV-dd11b59904.js";import"./chunk-IIET3LBA-dd11b59904.js";import"./chunk-FSWCFVNX-dd11b59904.js";import"./chunk-JSH3PFYE-dd11b59904.js";import"./chunk-T76KE36H-dd11b59904.js";import{a as m}from"./chunk-QU7MDXGQ-dd11b59904.js";import"./chunk-YSY7J76D-dd11b59904.js";import{C as K,M as N,a as I,b as S,d as V,f as H,q as R}from"./chunk-MRJZQG62-dd11b59904.js";import{a as n,b as k,d as U}from"./chunk-HU6DUUP4-dd11b59904.js";var $=(r,i=[],t)=>{let l=[],c={path:void 0,nearestFields:{},get targets(){return l.length?l:[t.runtime.v2Target]},hasButton:!1,hasLink:!1};if(!r)return c;if(r===window)return c.path="window",c;if(r===document)return c.path="document",c;let f="",e=tt(r);try{for(;r?.tagName;){let s=r.tagName.toLowerCase();c.hasLink||=s==="a",c.hasButton||=s==="button"||s==="input"&&r.type.toLowerCase()==="button",i.forEach(u=>{c.nearestFields[et(u)]||=r[u]?.baseVal||r[u]});let o=r?.dataset;o.nrMfeId&&l.push(...j(o.nrMfeId,t)),f=J(r,f),r=r.parentNode}}catch{}return c.path=f?e?"".concat(f,":nth-of-type(").concat(e,")"):f:void 0,c};function J(r,i){let{id:t,localName:l}=r;return[l,t?"#".concat(t):"",i?">".concat(i):""].join("")}function tt(r){try{let i=1,{tagName:t}=r;for(;r.previousElementSibling;)r.previousElementSibling.tagName===t&&i++,r=r.previousElementSibling;return i}catch{}}function et(r){return r==="tagName"&&(r="tag"),r==="className"&&(r="class"),"nearest".concat(r.charAt(0).toUpperCase()+r.slice(1))}var M=class{constructor(i,t){this.event=i,this.count=1,this.originMs=Math.floor(i.timeStamp),this.relativeMs=[0],this.selectorPath=t.path,this.rageClick=void 0,this.nearestTargetFields=t.nearestFields,this.currentUrl=v(""+location),this.deadClick=!1,this.errorClick=!1,this.targets=t.targets}aggregate(i){this.count++,this.relativeMs.push(Math.floor(i.timeStamp-this.originMs)),this.isRageClick()&&(this.rageClick=!0)}isRageClick(){let i=this.relativeMs.length;return this.event.type==="click"&&i>=A&&this.relativeMs[i-1]-this.relativeMs[i-A]<x}};var w=class{#t=void 0;#e="";#r=void 0;#i=void 0;#s=void 0;constructor(i){this.agentRef=i,K().o.MO&&(this.#i=new MutationObserver(this.isLiveClick.bind(this)))}get aggregationEvent(){let i=this.#t;return this.#e="",this.#t=void 0,i}process(i,t){if(!i)return;let l=W.includes(i.type)?window:i.target,c=$(l,t,this.agentRef),f=rt(i,c.path);if(f&&f===this.#e)this.#t.aggregate(i);else{let e=this.#t;return this.#a(),this.#n(),this.#e=f,this.#t=new M(i,c),i.type==="click"&&(c.hasButton||c.hasLink)&&(this.#u(this.#t),this.#c()),e}}markAsErrorClick(){this.#t&&this.#s&&(this.#t.errorClick=!0,this.#n())}#c(){this.#s=new L({onEnd:()=>{this.#n()}},P)}#n(){this.#s?.clear(),this.#s=void 0}#u(i){this.#o()||!this.#i||(this.#i.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.#r=new L({onEnd:()=>{i.deadClick=!0,this.#a()}},P))}#a(){this.#i?.disconnect(),this.#r?.clear(),this.#r=void 0}#o(){return this.#r!==void 0}isLiveClick(){this.#o()&&this.#a()}};function rt(r,i){let t=r.type;return r.type!=="scrollend"&&(t+="-"+i),t}var At=(()=>{class r extends Q{static featureName=_;#t;constructor(t){super(t,_),this.referrerUrl=S&&document.referrer?v(document.referrer):void 0,this.obfuscator=new X(t),this.waitForFlags(["ins"]).then(([l])=>{if(!l){this.blocked=!0,this.deregisterDrain();return}this.#r(),m("api-recordCustomEvent",(e,s,o,u)=>{if(G.includes(s))return R(46);this.addEvent(n({eventType:s,timestamp:this.#e(e)},o),u)},this.featureName,this.ee),t.init.page_action.enabled&&m("api-addPageAction",(e,s,o,u)=>{this.addEvent(n(k(n({},o),{eventType:b.PA,timestamp:this.#e(e),timeSinceLoad:e/1e3,actionName:s,referrerUrl:this.referrerUrl}),S&&{browserWidth:window.document.documentElement?.clientWidth,browserHeight:window.document.documentElement?.clientHeight}),u)},this.featureName,this.ee);let c=()=>{};S&&t.init.user_actions.enabled&&(this.#t=new w(this.agentRef),this.harvestOpts.beforeUnload=()=>c?.(this.#t.aggregationEvent),c=e=>{try{if(e?.event){let{target:s,timeStamp:o,type:u}=e.event;
1e.targets.forEach(E=>{let p=n(n(n(n(n({eventType:b.UA,timestamp:this.#e(o),action:u,actionCount:e.count,actionDuration:e.relativeMs[e.relativeMs.length-1],actionMs:e.relativeMs,rageClick:e.rageClick,target:e.selectorPath,currentUrl:e.currentUrl},Z(window)&&{iframe:!0}),this.agentRef.init.user_actions.elementAttributes.reduce((h,a)=>(g(a)&&(h[d(a)]=String(s[a]).trim().slice(0,128)),h),{})),e.nearestTargetFields),e.deadClick&&{deadClick:!0}),e.errorClick&&{errorClick:!0});this.addEvent(p,E),this.#i(p);function d(h){return h==="tagName"&&(h="tag"),h==="className"&&(h="class"),"target".concat(h.charAt(0).toUpperCase()+h.slice(1))}function g(h){return!!(e.selectorPath!=="window"&&e.selectorPath!=="document"&&s instanceof HTMLElement&&s?.[h])}})}}catch{}},m("ua",e=>{c(this.#t.process(e,this.agentRef.init.user_actions.elementAttributes))},this.featureName,this.ee),m("navChange",()=>{this.#t.isLiveClick()},this.featureName,this.ee),m("uaXhr",()=>{this.#t.isLiveClick()},this.featureName,this.ee),m("uaErr",()=>this.#t.markAsErrorClick(),this.featureName,this.ee));let f=[...t.init.performance.capture_marks?["mark"]:[],...t.init.performance.capture_measures?["measure"]:[]];if(f.length)try{f.forEach(e=>{PerformanceObserver.supportedEntryTypes.includes(e)&&new PerformanceObserver(o=>{o.getEntries().forEach(u=>{try{let d=function(g){if(g==null)return{};return D(g)?h(g):{entryDetail:g};function h(a,y="entryDetail"){let T={};return a==null||Object.keys(a).forEach(C=>{let B=y+"."+C;D(a[C])?Object.assign(T,h(a[C],B)):a[C]!==null&&a[C]!==void 0&&(T[B]=a[C])}),T}};var E=d;this.reportSupportabilityMetric("Generic/Performance/"+e+"/Seen");let p=t.init.performance.capture_detail?d(u.detail):{};this.addEvent(k(n({},p),{eventType:b.BP,timestamp:this.#e(u.startTime),entryName:u.name,entryDuration:u.duration,entryType:e}))}catch{}})}).observe({buffered:!0,type:e})})}catch{}S&&t.init.performance.resources.enabled&&m("browserPerformance.resource",e=>{try{let s=e.toJSON(),{name:o,duration:u}=s,E=U(s,["name","duration"]),p=!1;try{let a=new URL(o).hostname,y=a.includes("newrelic.com")||a.includes("nr-data.net")||a.includes("nr-local.net");if(this.agentRef.init.performance.resources.ignore_newrelic&&y||this.agentRef.init.performance.resources.asset_types.length&&!this.agentRef.init.performance.resources.asset_types.includes(E.initiatorType))return;p=a===V?.location.hostname||t.init.performance.resources.first_party_domains.includes(a),p&&this.reportSupportabilityMetric("Generic/Performance/FirstPartyResource/Seen"),y&&this.reportSupportabilityMetric("Generic/Performance/NrResource/Seen")}catch{}this.reportSupportabilityMetric("Generic/Performance/Resource/Seen");let d=k(n({},E),{eventType:b.BP,timestamp:this.#e(E.startTime),entryName:v(o),entryDuration:u,firstParty:p}),g=O(o,this.agentRef);if(g.length){g.forEach(a=>this.addEvent(n({},d),a));return}this.addEvent(n({},d),void 0);let h=F(v(o));if(h?.dom.value&&!h.dom.end){let a=()=>{O(o,this.agentRef).forEach(y=>this.addEvent(n({},d),y))};["load","error"].forEach(y=>h.dom.value.addEventListener(y,a,{once:!0}))}}catch(o){this.ee.emit("internal-error",[o,"GenericEvents-Resource"])}},this.featureName,this.ee),m("api-measure",(e,s,o)=>{let{start:u,duration:E,customAttributes:p}=e,d=k(n({},p),{eventType:b.BP,timestamp:this.#e(u),entryName:s,entryDuration:E,entryType:"measure"});this.addEvent(d,o)},this.featureName,this.ee),(t.init.feature_flags.includes("websockets")||t.init.web_sockets?.enabled)&&m("ws-complete",(e,s=[t.runtime.v2Target])=>{s.forEach(o=>{let u=k(n({},e),{eventType:b.WS,timestamp:this.#e(e.timestamp),openedAt:this.#e(e.openedAt),closedAt:this.#e(e.closedAt)});this.reportSupportabilityMetric("WebSocket/Completed/Seen"),this.reportSupportabilityMetric("WebSocket/Completed/Bytes",N(u).length),this.addEvent(u,o)})},this.featureName,this.ee),t.init.feature_flags.includes("no_spv")||m("spv",(e,s)=>{this.addEvent(n({eventType:b.SPV,timestamp:this.#e(s)},e))},this.featureName,this.ee),this.drain()})}addEvent(t={},l){if(!t||!Object.keys(t).length)return;if(!t.eventType){R(44);return}for(let e in t){let s=t[e];t[e]=s&&typeof s=="object"?N(s):s}let c={timestamp:this.#e(I()),pageUrl:v(""+H),currentUrl:v(""+location)},f=n(n(n({},this.agentRef.info.jsAttributes||{}),c),t);this.events.add(n(n({},f),z(l,this))),q(l,this)&&this.addEvent(n(n({},f),Y(l,this)))}serializer(t){return this.obfuscator.traverseAndObfuscateEvents({ins:t})}queryStringsBuilder(){return{ua:this.agentRef.info.userAttributes,at:this.agentRef.info.atts}}#e(t){return Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(t))}#r(){let t="Config/Performance/";this.agentRef.init.performance.capture_marks&&this.reportSupportabilityMetric(t+"CaptureMarks/Enabled"),this.agentRef.init.performance.capture_measures&&this.reportSupportabilityMetric(t+"CaptureMeasures/Enabled"),this.agentRef.init.performance.resources.enabled&&this.reportSupportabilityMetric(t+"Resources/Enabled"),this.agentRef.init.performance.resources.asset_types?.length!==0&&this.reportSupportabilityMetric(t+"Resources/AssetTypes/Changed"),this.agentRef.init.performance.resources.first_party_domains?.length!==0&&this.reportSupportabilityMetric(t+"Resources/FirstPartyDomains/Changed"),this.agentRef.init.performance.resources.ignore_newrelic===!1&&this.reportSupportabilityMetric(t+"Resources/IgnoreNewrelic/Changed")}#i(t){t.rageClick&&this.reportSupportabilityMetric("UserAction/RageClick/Seen"),t.deadClick&&this.reportSupportabilityMetric("UserAction/DeadClick/Seen"),t.errorClick&&this.reportSupportabilityMetric("UserAction/ErrorClick/Seen")}}return r})();export{At 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.