@arun-shop/shell-stub 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -2
- package/bin/shell-stub.js +2 -0
- package/dist/client/assets/agent-constants-BslZEhou.js +1 -0
- package/dist/client/assets/agent-session-2M_DVJq5.js +1 -0
- package/dist/client/assets/aggregate-C76dzdTw.js +11 -0
- package/dist/client/assets/aggregate-CqgcP5Hx.js +1 -0
- package/dist/client/assets/aggregate-D-ytGxcq.js +1 -0
- package/dist/client/assets/aggregate-DJzRhEj1.js +1 -0
- package/dist/client/assets/aggregate-DOVdETK5.js +1 -0
- package/dist/client/assets/aggregate-DVyFcjNo.js +1 -0
- package/dist/client/assets/aggregate-DXhlyhDi.js +1 -0
- package/dist/client/assets/aggregate-DbIbIhBX.js +1 -0
- package/dist/client/assets/aggregate-bZsMpKHl.js +1 -0
- package/dist/client/assets/aggregate-base-CCQ66xCP.js +1 -0
- package/dist/client/assets/aggregate-qz9mb3wS.js +1 -0
- package/dist/client/assets/aggregate_v2-CrSfjfrK.js +1 -0
- package/dist/client/assets/browser-BjVZNN8H.js +1 -0
- package/dist/client/assets/clean-url-PIxP5rIW.js +1 -0
- package/dist/client/assets/connector-Bkdjz1Xs.js +1 -0
- package/dist/client/assets/constants-B39wMiCG.js +1 -0
- package/dist/client/assets/constants-BCcBZ5XF.js +1 -0
- package/dist/client/assets/constants-BR-VOpyY.js +1 -0
- package/dist/client/assets/constants-BWRO9jlX.js +1 -0
- package/dist/client/assets/constants-CDnI58H4.js +1 -0
- package/dist/client/assets/constants-CMEXhPvr.js +1 -0
- package/dist/client/assets/constants-CZf-nsH0.js +1 -0
- package/dist/client/assets/constants-CdX3b0L1.js +1 -0
- package/dist/client/assets/constants-CvitFm-l.js +1 -0
- package/dist/client/assets/constants-Dx9_fT4n.js +1 -0
- package/dist/client/assets/deny-list-DB7HzON3.js +1 -0
- package/dist/client/assets/drain-Ci6kjtHo.js +1 -0
- package/dist/client/assets/encode-Cu2qrKlv.js +1 -0
- package/dist/client/assets/env.npm-BosvNi0g.js +1 -0
- package/dist/client/assets/event-buffer-BNK4YVB0.js +1 -0
- package/dist/client/assets/event-listener-opts-S1G6uDJo.js +1 -0
- package/dist/client/assets/event-origin-NoP9qGzT.js +1 -0
- package/dist/client/assets/events-BqJgC3Et.js +1 -0
- package/dist/client/assets/feature-base-DCxEqhTo.js +1 -0
- package/dist/client/assets/feature-flags-C-2g43g2.js +1 -0
- package/dist/client/assets/feature-gates-D617h-o3.js +1 -0
- package/dist/client/assets/harvester-Bvz5k-cn.js +1 -0
- package/dist/client/assets/iframe-CbOKKvMF.js +1 -0
- package/dist/client/assets/iframe-constants-C6xKQhrH.js +1 -0
- package/dist/client/assets/iframe-message-handler-9YQHSlPu.js +1 -0
- package/dist/client/assets/index-BGzTufKJ.js +2 -0
- package/dist/client/assets/index-CVD68-I6.css +1 -0
- package/dist/client/assets/inter-latin-wght-italic-DpCbqKDY.woff2 +0 -0
- package/dist/client/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/client/assets/invoke-yXE5uxEq.js +1 -0
- package/dist/client/assets/load-1XXgLaBh.js +1 -0
- package/dist/client/assets/load-time-CDLVHe97.js +1 -0
- package/dist/client/assets/monitoring-BrrZzYzN.js +3 -0
- package/dist/client/assets/nav-timing-Clx3l32R.js +1 -0
- package/dist/client/assets/obfuscate-DGKOc6ON.js +1 -0
- package/dist/client/assets/page-visibility-CPUGlMvF.js +1 -0
- package/dist/client/assets/parse-url-BjQzQUGD.js +1 -0
- package/dist/client/assets/payloads-DVvDS7kd.js +1 -0
- package/dist/client/assets/preload-helper-DqzGtu2i.js +1 -0
- package/dist/client/assets/recorder-C9lL7cAC.js +128 -0
- package/dist/client/assets/register-handler-Do-e4XFS.js +1 -0
- package/dist/client/assets/send-DAQlgypB.js +1 -0
- package/dist/client/assets/sharedHandlers-WNAr8J3U.js +1 -0
- package/dist/client/assets/stringify-Dzp3UIiC.js +1 -0
- package/dist/client/assets/stylesheet-evaluator-B7HZp4zF.js +1 -0
- package/dist/client/assets/time-to-first-byte-DrD5gGoY.js +1 -0
- package/dist/client/assets/timer-De0Ampht.js +1 -0
- package/dist/client/assets/type-check-DkLJNuCs.js +1 -0
- package/dist/client/assets/utils-BCGlS8lK.js +1 -0
- package/dist/client/assets/utils-ByvlpCaG.js +1 -0
- package/dist/client/assets/utils-HjH2zvlh.js +2 -0
- package/dist/client/assets/webdriver-detection-CgM1lSqf.js +1 -0
- package/dist/client/index.html +22 -0
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -0
- package/dist/server/app.js +36 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/cli.js +57 -0
- package/dist/server/cli.js.map +1 -0
- package/package.json +44 -3
package/README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @arun-shop/shell-stub
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Runs one micro frontend of the shop platform standalone: the
|
|
4
|
+
[Shell's](https://github.com/arun9483/shop-shell) page setup, without the Shell app. The MFE runs
|
|
5
|
+
unchanged, through the same single-spa lifecycles and `domElement` prop as in the Shell.
|
|
6
|
+
|
|
7
|
+
The stub page loads what the Shell loads for every MFE: the Arun design system's CSS with the `arun`
|
|
8
|
+
brand, the Inter font, the Shell's base styles and single-spa. Its server proxies the MFE's files and
|
|
9
|
+
API to the MFE's own FES, so the browser talks to one origin.
|
|
10
|
+
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
In an MFE repository:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add -D @arun-shop/shell-stub
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"scripts": {
|
|
22
|
+
"standalone": "shell-stub --name catalog --mfe-url http://localhost:3002 --port 3102"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Start the MFE's FES and backend (`pnpm start`), then `pnpm standalone`, and open
|
|
28
|
+
http://localhost:3102/catalog.
|
|
29
|
+
|
|
30
|
+
| Option | Meaning | Default |
|
|
31
|
+
| ------------ | -------------------------------------------------------------- | --------- |
|
|
32
|
+
| `--name` | The MFE's name: files at `/mfe/<name>/`, API at `/api/<name>/` | required |
|
|
33
|
+
| `--mfe-url` | The MFE's FES | required |
|
|
34
|
+
| `--port` | The stub's port | `3100` |
|
|
35
|
+
| `--route` | The MFE's route | `/<name>` |
|
|
36
|
+
| `--env-file` | A `.env` with New Relic browser keys, to report errors | none |
|
|
37
|
+
|
|
38
|
+
New Relic is off unless the env file sets all of `NEW_RELIC_ACCOUNT_ID`, `NEW_RELIC_TRUST_KEY`,
|
|
39
|
+
`NEW_RELIC_AGENT_ID`, `NEW_RELIC_BROWSER_LICENSE_KEY` and `NEW_RELIC_BROWSER_APPLICATION_ID`. These are
|
|
40
|
+
the Shell's public browser keys.
|
|
41
|
+
|
|
42
|
+
The stub uses the same `@arun-dev/ui` and `@arun-dev/tokens` versions as the Shell, so an MFE looks the
|
|
43
|
+
same standalone as in the Shell. Requires Node 24.22.1 or newer.
|
|
44
|
+
|
|
45
|
+
## Release
|
|
46
|
+
|
|
47
|
+
From `shop-shell`: bump `version` in `packages/shell-stub/package.json`, commit, then push the tag
|
|
48
|
+
`shell-stub-v<version>`. `.github/workflows/release-shell-stub.yml` publishes it with npm trusted
|
|
49
|
+
publishing.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=16e3,n=1e6,r=n/2,i=`SESSION_ERROR`,a={[e.logging]:!0,[e.genericEvents]:!0,[e.jserrors]:!0,[e.ajax]:!0};export{a,i,t as n,n as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,n as t,s as n,t as r,w as i,y as a}from"./stringify-Dzp3UIiC.js";import{r as o}from"./event-listener-opts-S1G6uDJo.js";import{r as s}from"./constants-B39wMiCG.js";import{n as c}from"./page-visibility-CPUGlMvF.js";import{t as l}from"./register-handler-Do-e4XFS.js";import{n as u}from"./drain-Ci6kjtHo.js";import{t as d}from"./invoke-yXE5uxEq.js";import{t as f}from"./timer-De0Ampht.js";import{a as p,i as m,n as h,o as g,t as _}from"./constants-CdX3b0L1.js";import{v}from"./constants-BR-VOpyY.js";import{c as y,l as b,o as x,s as S,t as C}from"./sharedHandlers-WNAr8J3U.js";var w=class extends f{constructor(t,n){super(t,n),this.onPause=typeof t.onPause==`function`?t.onPause:()=>{},this.onRefresh=typeof t.onRefresh==`function`?t.onRefresh:()=>{},this.onResume=typeof t.onResume==`function`?t.onResume:()=>{},this.readStorage=t.readStorage,this.remainingMs=void 0,t.refreshEvents||=[`click`,`keydown`,`scroll`];try{this.abortController=new AbortController}catch{}if(e&&t.ee){if(t.ee){this.ee=t.ee;let e=d(this.refresh.bind(this),500,{leading:!0});this.refreshHandler=n=>{t.refreshEvents.includes(n?.[0]?.type)&&e()},t.ee.on(`fn-end`,this.refreshHandler)}c(e=>{e===`hidden`?this.pause():this.resume()},!1,this.abortController?.signal)}}abort(){this.clear(),this.abortController?.abort(),this.refreshHandler&&=(this.ee.removeEventListener(`fn-end`,this.refreshHandler),this.ee=null)}pause(){this.onPause(),clearTimeout(this.timer),this.remainingMs=this.initialMs-(Date.now()-this.startTimestamp)}resume(){try{let t=this.readStorage(),n=typeof t==`string`?JSON.parse(t):t;e(n.expiresAt)||e(n.inactiveAt)?this.end():(this.refresh(),this.onResume())}catch{this.end()}function e(e){return Date.now()>e}}refresh(e,t){this.clear(),this.timer=this.create(e,t),this.startTimestamp=Date.now(),this.remainingMs=void 0,this.onRefresh()}},T={value:``,inactiveAt:0,expiresAt:0,updatedAt:Date.now(),sessionReplayMode:null,sessionReplaySentFirstChunk:!1,sessionTraceMode:null,traceHarvestStarted:!1,loggingMode:null,logApiMode:null,serverTimeDiff:null,custom:{},numOfResets:0,consent:!1,cachedRumResponse:null},E=class{constructor(t){let{agentRef:n,key:r,storage:i}=t;if(!n||!r||!i)throw Error(`Missing required field(s):${n?``:` agentRef`}${r?``:` key`}${i?``:` storage`}`);this.agentRef=n,this.storage=i,this.state={},this.key=r,this.ee=n.ee,b(this.ee,n),this.setup(t),e&&o(`storage`,e=>{if(e.key===this.lookupKey){let t=typeof e.newValue==`string`?JSON.parse(e.newValue):e.newValue;this.sync(t),this.ee.emit(m.UPDATE,[p.CROSS_TAB,this.state])}})}setup({value:e=n(16),expiresMs:t=_,inactiveMs:r=h,numOfResets:i=0}){let a={serverTimeDiff:this.state.serverTimeDiff||T.serverTimeDiff,consent:this.state.consent||T.consent};this.state={},this.sync({...T,...a}),this.state.value=e,this.expiresMs=t,this.inactiveMs=r;let o=this.read();t?(this.state.expiresAt=o?.expiresAt||this.getFutureTimestamp(t),this.state.numOfResets=o?.numOfResets||i,this.expiresTimer=new f({onEnd:()=>{this.collectSM(`expired`),this.collectSM(`duration`),this.reset()}},this.state.expiresAt-Date.now())):this.state.expiresAt=1/0,r?(this.state.inactiveAt=o?.inactiveAt||this.getFutureTimestamp(r),this.inactiveTimer=new w({onEnd:()=>{this.collectSM(`inactive`),this.collectSM(`duration`),this.reset()},onRefresh:this.refresh.bind(this),onResume:()=>{this.ee.emit(m.RESUME)},onPause:()=>{this.initialized&&this.ee.emit(m.PAUSE),this.write(y(this.state,T))},ee:this.ee,refreshEvents:[`click`,`keydown`,`scroll`],readStorage:()=>this.storage.get(this.lookupKey)},this.state.inactiveAt-Date.now())):this.state.inactiveAt=1/0,this.isNew||=!Object.keys(o).length,this.isNew?this.write(y(this.state,T),!0):this.sync(o),this.initialized=!0,this.ee.emit(m.STARTED,[this.isNew])}get lookupKey(){return`${g}${this.key}`}sync(e){Object.assign(this.state,e)}read(){try{let e=this.storage.get(this.lookupKey);if(!e)return{};let t=typeof e==`string`?JSON.parse(e):e;return this.isInvalid(t)?{}:this.isExpired(t.expiresAt)?(this.collectSM(`expired`),this.collectSM(`duration`,t,!0),this.reset()):this.isExpired(t.inactiveAt)?(this.collectSM(`inactive`),this.collectSM(`duration`,t,!0),this.reset()):t}catch(e){return a(10,e),{}}}write(e){try{return!e||typeof e!=`object`?void 0:(e.updatedAt=Date.now(),this.sync(e),this.storage.set(this.lookupKey,r(this.state)),this.ee.emit(m.UPDATE,[p.SAME_TAB,this.state]),e)}catch(e){return a(11,e),null}}reset(){try{return a(66),this.initialized&&(this.ee.emit(m.RESET),this.state.numOfResets++),this.storage.remove(this.lookupKey),this.inactiveTimer?.abort?.(),this.expiresTimer?.clear?.(),delete this.isNew,this.setup({key:this.key,storage:this.storage,expiresMs:this.expiresMs,inactiveMs:this.inactiveMs,numOfResets:this.state.numOfResets}),this.read()}catch{return{}}}refresh(){let e=this.read();this.write({...e,inactiveAt:this.getFutureTimestamp(this.inactiveMs)})}isExpired(e){return Date.now()>e}isInvalid(e){return!Object.keys(T).every(t=>Object.keys(e).includes(t))}collectSM(e,n,r){let a,o;e===`duration`&&(a=this.getDuration(n,r),o=`Session/Duration/Ms`),e===`expired`&&(o=`Session/Expired/Seen`),e===`inactive`&&(o=`Session/Inactive/Seen`),o&&t(s,[o,a],void 0,i.metrics,this.ee)}getDuration(e=this.state,t){let n=e.expiresAt-this.expiresMs;return(t?Date.now():e.updatedAt)-n}getFutureTimestamp(e){return Date.now()+e}syncCustomAttribute(t,n){if(e){if(n===null){let e=this.read();e.custom&&(delete e.custom[t],this.write({...e}))}else{let e=this.read();this.custom={...e?.custom||{},[t]:n},this.write({...e,custom:this.custom})}}}},D=class{get(e){try{return localStorage.getItem(e)||void 0}catch{return``}}set(e,t){try{return t==null?this.remove(e):localStorage.setItem(e,t)}catch{}}remove(e){try{localStorage.removeItem(e)}catch{}}};function O(e,t){let n=e[t]??={},i={bytes:Object.keys(n).reduce((e,t)=>e+t.length+r(n[t]).length,0)};return e[t]=new Proxy(n,{set(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)&&(i.bytes-=t.length+r(e[t]).length),i.bytes+=t.length+r(n).length,e[t]=n,!0},deleteProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&(i.bytes-=t.length+r(e[t]).length),delete e[t]}}),i}function k(e){if(e.runtime.session)return e.runtime.session;let n=e.init.session,r=S(e.info.licenseKey,e.info.applicationID);e.runtime.session=new E({agentRef:e,key:r,storage:new D,expiresMs:n?.expiresMs,inactiveMs:n?.inactiveMs});let a=e.runtime.session.state.custom;a&&Object.keys(a).length&&(e.info=x({...e.info,jsAttributes:{...a,...e.info.jsAttributes}})),e.runtime.jsAttributesMetadata=O(e.info,`jsAttributes`);let o=e.ee;return l(`api-setCustomAttribute`,(t,n,r)=>{e.runtime.session.syncCustomAttribute(n,r)},`session`,o),l(`api-setUserId`,(t,n,r)=>{e.runtime.session.syncCustomAttribute(n,r)},`session`,o),l(`api-setUserIdAndResetSession`,n=>{e.runtime.session.reset(),t(s,[`API/`+v+`/resetSession/called`],void 0,i.metrics,o),C(e,`enduser.id`,n,v,!0)},`session`,o),l(`api-consent`,t=>{e.runtime.session.write({consent:t===void 0||t})},`session`,o),u(e,`session`),e.runtime.session}export{k as setupAgentSession};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{N as e,j as t,n,t as r,w as i,z as a}from"./stringify-Dzp3UIiC.js";import{t as o}from"./clean-url-PIxP5rIW.js";import{t as s}from"./obfuscate-DGKOc6ON.js";import{t as c}from"./register-handler-Do-e4XFS.js";import{t as l}from"./aggregate-base-CCQ66xCP.js";import{_ as u,b as d,c as f,g as p,l as m,o as h,r as g,s as _,v,y}from"./utils-HjH2zvlh.js";import{t as b}from"./events-BqJgC3Et.js";import{t as x}from"./constants-BCcBZ5XF.js";import{a as S,i as C}from"./constants-CdX3b0L1.js";var w=/([a-z0-9]+)$/i;function T(e){if(!e)return;let t=e.match(w);if(t)return t[1]}var E=/^\n+|\n+$/g,D=65530;function O(e){return k(e).replace(E,``)}function k(e){var t;if(e.length>100){var n=e.length-100;t=e.slice(0,50).join(`
|
|
2
|
+
`),t+=`
|
|
3
|
+
< ...truncated `+n+` lines... >
|
|
4
|
+
`,t+=e.slice(-50).join(`
|
|
5
|
+
`)}else t=e.join(`
|
|
6
|
+
`);return t}function A(e){return e.length>D?e.substr(0,D):e}function j(t){if(typeof t!=`string`)return``;let n=o(t);return n===o(e)?`<inline>`:n}function M(e){var t=null;try{if(t=N(e),t)return t}catch{}try{if(t=I(e),t)return t}catch{}try{if(t=L(e),t)return t}catch{}return{mode:`failed`,stackString:``,frames:[]}}function N(e){if(!e.stack)return null;var t=e.stack.split(`
|
|
7
|
+
`).reduce(P,{frames:[],stackLines:[],wrapperSeen:!1});return t.frames.length?{mode:`stack`,name:e.name||R(e),message:e.message,stackString:O(t.stackLines),frames:t.frames}:null}function P(e,t){let n=F(t);if(!n)return e.stackLines.push(t),e;if(z(n.func)&&(e.wrapperSeen=!0),!e.wrapperSeen){let r=j(n.url);r!==n.url&&(t=t.replace(n.url,r),n.url=r),e.stackLines.push(t),e.frames.push(n)}return e}function F(e){var t=e.match(y);if(t||=e.match(p),t)return{url:t[2],func:t[1]!==`Anonymous function`&&t[1]!==`global code`&&t[1]||null,line:+t[3],column:t[4]?+t[4]:null};if(e.match(u)||e.match(d)||e===`anonymous`)return{func:`evaluated code`}}function I(e){if(!(`line`in e))return null;var t=e.name||R(e);if(!e.sourceURL)return{mode:`sourceline`,name:t,message:e.message,stackString:t+`: `+e.message+`
|
|
8
|
+
in evaluated code`,frames:[{func:`evaluated code`}]};var n=j(e.sourceURL),r=t+`: `+e.message+`
|
|
9
|
+
at `+n;return e.line&&(r+=`:`+e.line,e.column&&(r+=`:`+e.column)),{mode:`sourceline`,name:t,message:e.message,stackString:r,frames:[{url:n,line:e.line,column:e.column}]}}function L(e){var t=e.name||R(e);return t?{mode:`nameonly`,name:t,message:e.message,stackString:t+`: `+e.message,frames:[]}:null}function R(e){var t=v.exec(String(e.constructor));return t&&t.length>1?t[1]:`unknown`}function z(e){return e&&e.indexOf(`nrWrapper`)>=0}function B(e){var t=0,n;if(!e||!e.length)return t;for(var r=0;r<e.length;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t}var V=`Rrweb`;function H(e,t,n){let r={shouldSwallow:t||!1,reason:n||`Other`},i=e.frames?.[0];if(!i||typeof e?.message!=`string`)return r;let a=i?.url?.match(/nr-(.*)-recorder.min.js/),o=i?.url?.match(/rrweb/),s=i?.url?.match(/recorder/),c=e.message.toLowerCase().match(/an attempt was made to break through the security policy of the user agent/);return a||o?(r.shouldSwallow=!0,r.reason=V,c&&(r.reason+=`-Security-Policy`)):s&&c&&(r.shouldSwallow=!0,r.reason=`Rrweb-Security-Policy`),r}function U(e){let t=``;if(!e?.cause)return t;if(e.cause instanceof Error){let n=M(e.cause);t=n.stackString||e.cause.stack,n.message&&!t.includes(n.message)&&(t=n.message+`
|
|
10
|
+
`+t),n.name&&!t.includes(n.name)&&(t=n.name+`: `+t)}else t=typeof e.cause==`string`?e.cause:r(e.cause);return t||=e.cause.toString(),t}var W=class extends Error{},G=class extends l{static featureName=x;constructor(e){super(e,x),this.harvestOpts.aggregatorTypes=[`err`,`ierr`,`xhr`],this.stackReported={},this.observedAt={},this.pageviewReported={},this.errorOnPage=!1,this.errorObfuscator=new s(e,b.JSE),this.xhrObfuscator=new s(e,b.AJAX),c(`err`,this.processError.bind(this),this.featureName,this.ee),c(`ierr`,this.processError.bind(this),this.featureName,this.ee),c(`returnJserror`,(e,t)=>this.#a(e,t),this.featureName,this.ee);let t=()=>{this.stackReported={},this.observedAt={}},n=this.agentRef.runtime.session?.state?.value;this.ee.on(C.RESET,t),this.ee.on(C.UPDATE,(e,r)=>{r?.value&&(e===S.CROSS_TAB&&n&&r.value!==n&&t(),n=r.value)}),this.waitForFlags([`err`]).then(([e])=>{e?this.drain():(this.blocked=!0,this.deregisterDrain())})}serializer(e){return{err:this.errorObfuscator.traverseAndObfuscateEvents(e.err),ierr:this.errorObfuscator.traverseAndObfuscateEvents(e.ierr),xhr:this.xhrObfuscator.traverseAndObfuscateEvents(e.xhr)}}queryStringsBuilder(e){let t={},n=r(this.agentRef.runtime.releaseIds);return n!==`{}`&&(t.ri=n),e?.err?.length&&(this.errorOnPage||=(t.pve=`1`,!0),this.agentRef.features?.[i.sessionReplay]?.featAggregate?.replayIsActive()||e.err.forEach(e=>delete e.params.hasReplay)),t}processError(e,t,n,r,i,o,s){if(e){t||=a();try{let a=this.#e(e,n),c=M(e);this.#t(c,n,o),this.#n(c,s).forEach(n=>{this.#r(e,t,c,a,r,i,n)})}catch(e){if(!(e instanceof W))throw e}}}#e(e,t){let n;if(!t&&this.agentRef.runtime.onerror&&(n=this.agentRef.runtime.onerror(e),n&&!(typeof n.group==`string`&&n.group.length)))throw new W;return n}#t(e,t,n){let{shouldSwallow:r,reason:i}=H(e,t,n);if(r)throw this.reportSupportabilityMetric(`Internal/Error/`+i),new W}#n(e,t){let n=[];if(t)n.push(t);else{if(this.harvestEndpointVersion===2){for(let t of e.frames)if(n.push(...g(t.url,this.agentRef)),n.length)break}n.length||n.push(this.agentRef.runtime.v2Target)}return n}#r(e,a,o,s,c,l,u){var d=this.#i(o);let p=U(e),m={stackHash:B(d),exceptionClass:o.name,request_uri:t?.location.pathname,...p&&{cause:p}};o.message&&(m.message=``+o.message),s?.group&&(m.errorGroup=s.group),l&&!f(u)&&(m.hasReplay=l);var h=B(`${o.name}_${o.message}_${o.stackString}_${+!!m.hasReplay}_${u?.id||`container`}_${u?.instance||``}`);this.stackReported[h]?m.browser_stack_hash=B(A(o.stackString)):(this.stackReported[h]=!0,m.stack_trace=A(o.stackString),this.observedAt[h]=Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(a))),m.releaseIds=r(this.agentRef.runtime.releaseIds),this.pageviewReported[h]||(m.pageview=1,this.pageviewReported[h]=!0),m.firstOccurrenceTimestamp=this.observedAt[h],m.timestamp=Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(a));let g=[`err`,h,m,{time:a},c];f(u)||n(`trace-jserror`,g,void 0,i.sessionTrace,this.ee),!this.blocked&&(e.__newrelic?.socketId&&(c.socketId=e.__newrelic.socketId),f(u)||(this.agentRef.features?.[i.softNav]?n(`jserror`,[g],void 0,i.softNav,this.ee):this.#a(g)),f(u)&&this.#a(g,{},u))}#i(e){for(var t=``,n=0;n<e.frames.length;n++){var r=e.frames[n],i=T(r.func);t&&(t+=`
|
|
11
|
+
`),i&&(t+=i+`@`),typeof r.url==`string`&&(t+=r.url),r.line&&(t+=`:`+r.line)}return t}#a(e,t={},n){let[i,a,o,s,c]=e,l={...h(n,this)};Object.entries(this.agentRef.info.jsAttributes).forEach(([e,t])=>f(e,t)),Object.entries(t).forEach(([e,t])=>f(e,t)),o.browserInteractionId&&(a+=o.browserInteractionId),c&&Object.entries(c).forEach(([e,t])=>f(e,t));let u=B(r(l)),d=a+`:`+u;this.events.add([i,d,o,s,l]),m(n,this)&&this.#a([i,a,{...o},{...s},c&&{...c}],_(n,this));function f(e,t){l[e]=t&&typeof t==`object`?r(t):t}}};export{G as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./preload-helper-DqzGtu2i.js";import{j as t,t as n,y as r,z as i}from"./stringify-Dzp3UIiC.js";import{n as a,t as o}from"./env.npm-BosvNi0g.js";import{t as s}from"./clean-url-PIxP5rIW.js";import{t as c}from"./encode-Cu2qrKlv.js";import{t as l}from"./obfuscate-DGKOc6ON.js";import{t as u}from"./register-handler-Do-e4XFS.js";import"./agent-constants-BslZEhou.js";import{t as d}from"./aggregate-base-CCQ66xCP.js";import{t as f}from"./events-BqJgC3Et.js";import{a as p,i as m,r as h}from"./constants-CdX3b0L1.js";import{a as g,c as _,i as v,o as y,s as b,t as x}from"./constants-CDnI58H4.js";import{t as S}from"./feature-gates-D617h-o3.js";import{t as C}from"./stylesheet-evaluator-B7HZp4zF.js";import{l as w}from"./constants-BR-VOpyY.js";var T,E=new Promise(e=>{T=e}),D=Object.freeze({onReplayReady:T,sessionReplayInitialized:E}),O=class extends d{static featureName=g;mode=null;constructor(e,t){super(e,g),this.obfuscator=new l(e,f.SR),this.initialized=!1,this.blocked=!1,this.gzipper=void 0,this.u8=void 0,this.shouldCompress=!0,this.entitled=!1,this.timeKeeper=void 0,this.instrumentClass=t,this.recorder=this.instrumentClass?.recorder,this.harvestOpts.raw=!0,this.isSessionTrackingEnabled=S(e.init)&&!!e.runtime.session,this.reportSupportabilityMetric(`Config/SessionReplay/Enabled`),this.ee.on(m.RESET,()=>{this.abort(x.RESET)}),this.ee.on(m.PAUSE,()=>{this.recorder?.stopRecording()}),this.ee.on(m.RESUME,()=>{this.recorder&&(this.mode=e.runtime.session.state.sessionReplayMode,this.initialized&&this.mode!==h.OFF&&this.mode&&this.recorder?.startRecording(_.RESUME,this.mode))}),this.ee.on(m.UPDATE,(e,t)=>{this.recorder&&this.initialized&&!this.blocked&&e===p.CROSS_TAB&&(this.mode!==h.OFF&&t.sessionReplayMode===h.OFF&&this.abort(x.CROSS_TAB),this.mode=t.sessionReplayMode)}),u(w,()=>{this.forceStop(this.mode===h.FULL)},this.featureName,this.ee),u(v,e=>{this.handleError(e)},this.featureName,this.ee);let{error_sampling_rate:n,sampling_rate:r,autoStart:i,block_selector:a,mask_text_selector:o,mask_all_inputs:s,inline_images:c,collect_fonts:d}=e.init.session_replay;this.waitForFlags([`srs`,`sr`]).then(([e,t])=>{this.entitled=!!t,this.entitled?this.initializeRecording(e).then(()=>{this.drain()}):(this.mode=h.OFF,this.#e({sessionReplayMode:this.mode}),this.deregisterDrain(),this.agentRef.runtime.isRecording&&(this.abort(x.ENTITLEMENTS),this.reportSupportabilityMetric(`SessionReplay/EnabledNotEntitled/Detected`)))}).then(()=>{if(!this.mode)for(this.recorder?.stopRecording();this.recorder?.getEvents().events.length;)this.recorder?.clearBuffer?.();D.onReplayReady(this.mode)}),i||this.reportSupportabilityMetric(`Config/SessionReplay/AutoStart/Modified`),d===!0&&this.reportSupportabilityMetric(`Config/SessionReplay/CollectFonts/Modified`),c===!0&&this.reportSupportabilityMetric(`Config/SessionReplay/InlineImages/Modifed`),s!==!0&&this.reportSupportabilityMetric(`Config/SessionReplay/MaskAllInputs/Modified`),a!==`[data-nr-block]`&&this.reportSupportabilityMetric(`Config/SessionReplay/BlockSelector/Modified`),o!==`*`&&this.reportSupportabilityMetric(`Config/SessionReplay/MaskTextSelector/Modified`),this.reportSupportabilityMetric(`Config/SessionReplay/SamplingRate/Value`,r),this.reportSupportabilityMetric(`Config/SessionReplay/ErrorSamplingRate/Value`,n)}replayIsActive(){return!!(this.recorder&&this.mode===h.FULL&&!this.blocked&&this.entitled)}handleError(e){this.recorder&&(this.recorder.events.hasError=!0),this.mode===h.ERROR&&t?.document.visibilityState===`visible`&&this.switchToFull()}switchToFull(){if(!this.entitled||this.blocked)return;let e=this.mode;this.mode=h.FULL,this.#e({sessionReplayMode:this.mode}),this.recorder&&this.initialized?(e===h.ERROR&&this.agentRef.runtime.harvester.triggerHarvestFor(this),this.agentRef.runtime.isRecording||this.recorder.startRecording(_.SWITCH_TO_FULL,this.mode)):this.initializeRecording(h.FULL,!0,_.SWITCH_TO_FULL)}async initializeRecording(e,t,n=_.INITIALIZE){if(this.initialized=!0,!this.entitled)return;let{session:r,timeKeeper:i}=this.agentRef.runtime;if(this.timeKeeper=i,this.mode=this.recorder?.trigger===_.API&&this.agentRef.runtime.isRecording?h.FULL:r.state.sessionReplayMode!==null&&!t?r.state.sessionReplayMode:e,this.mode!==h.OFF){try{this.recorder??=await this.instrumentClass.importRecorder()}catch(e){return this.abort(x.IMPORT,e)}this.mode===h.ERROR&&this.instrumentClass.errorNoticed&&(this.mode=h.FULL),await this.prepUtils(),this.agentRef.runtime.isRecording||this.recorder.startRecording(n,this.mode)}this.#e({sessionReplayMode:this.mode})}async prepUtils(){try{let{gzipSync:t,strToU8:n}=await e(async()=>{let{gzipSync:e,strToU8:t}=await import(`./browser-BjVZNN8H.js`);return{gzipSync:e,strToU8:t}},[]);this.gzipper=t,this.u8=n}catch{this.shouldCompress=!1}}makeHarvestPayload(){if(this.isRetrying)return this.recorder.retryPayload;if(this.mode!==h.FULL||this.blocked||this.shouldCompress&&!this.gzipper||!this.recorder||!this.timeKeeper?.ready||!(this.recorder.hasSeenSnapshot&&this.recorder.hasSeenMeta))return;let e=this.recorder.getEvents();if(!e.events.length)return;let t=this.getHarvestContents(e);if(!t.body.length){this.recorder.clearBuffer();return}this.reportSupportabilityMetric(`SessionReplay/Harvest/Attempts`);let i=0;if(this.gzipper&&this.u8)t.body=this.gzipper(this.u8(`[${t.body.map(({__serialized:e})=>e).join(`,`)}]`)),i=t.body.length;else{for(let e in t.body)delete t.body[e].__serialized;i=n(t.body).length}if(i>1e6)this.abort(x.TOO_BIG,i);else return this.agentRef.runtime.session.state.sessionReplaySentFirstChunk||this.#e({sessionReplaySentFirstChunk:!0}),this.recorder.clearBuffer(),this.agentRef.runtime.session.state.traceHarvestStarted||r(59,JSON.stringify(this.agentRef.runtime.session.state)),this.recorder.retryPayload=t,t}getFirstAndLastNodes(e=[]){let t={firstEvent:e[0],lastEvent:e[e.length-1]};return e.forEach(e=>{let n=e?.timestamp;(!t.firstEvent?.timestamp||(n||1/0)<t.firstEvent.timestamp)&&(t.firstEvent=e),(!t.lastEvent?.timestamp||(n||-1/0)>t.lastEvent.timestamp)&&(t.lastEvent=e)}),t}getHarvestContents(e){e??=this.recorder.getEvents();let t=e.events,n=this.agentRef.runtime,r=this.agentRef.info.jsAttributes?.[`enduser.id`];t?.[0]?.type===b.FullSnapshot&&this.recorder.lastMeta&&(e.hasMeta=!0,t.unshift(this.recorder.lastMeta),this.recorder.lastMeta=void 0),t[t.length-1]?.type===b.Meta&&(this.recorder.lastMeta=t[t.length-1],t=t.slice(0,t.length-1),e.hasMeta=!!t.find(e=>e.type===b.Meta));let l=i(),{firstEvent:u,lastEvent:d}=this.getFirstAndLastNodes(t),p=u?.timestamp||Math.floor(this.timeKeeper.correctAbsoluteTimestamp(e.cycleTimestamp)),m=d?.timestamp||Math.floor(this.timeKeeper.correctRelativeTimestamp(l)),h=n.appMetadata?.agents?.[0]||{};return{qs:{browser_monitoring_key:this.agentRef.info.licenseKey,type:f.SR,app_id:this.agentRef.info.applicationID,protocol_version:`0`,timestamp:p,attributes:c({...!!this.gzipper&&!!this.u8&&{content_encoding:`gzip`},...h.entityGuid&&{entityGuid:h.entityGuid},harvestId:[n.session?.state.value,n.ptid,n.harvestCount].filter(e=>e).join(`_`),"replay.firstTimestamp":p,"replay.lastTimestamp":m,"replay.nodes":t.length,"session.durationMs":n.session.getDuration(),agentVersion:n.version,session:n.session.state.value,rst:l,hasMeta:e.hasMeta||!1,hasSnapshot:e.hasSnapshot||!1,hasError:e.hasError||!1,isFirstChunk:n.session.state.sessionReplaySentFirstChunk===!1,decompressedBytes:e.payloadBytesEstimation,invalidStylesheetsDetected:C.invalidStylesheetsDetected,inlinedAllStylesheets:e.inlinedAllStylesheets,"rrweb.version":o+`@`+a,"payload.type":e.type,...r&&{"enduser.id":this.obfuscator.obfuscateString(r)},currentUrl:this.obfuscator.obfuscateString(s(``+location))},y).substring(1)},body:t}}postHarvestCleanup(e){e.sent&&(e.retry?(r(70),this.isRetrying=!0,this.forceStop()):(this.recorder.retryPayload=void 0,this.isRetrying&&(this.isRetrying=!1,this.switchToFull())))}forceStop(e){e&&this.agentRef.runtime.harvester.triggerHarvestFor(this),this.mode=h.OFF,this.recorder?.stopRecording?.(),this.#e({sessionReplayMode:this.mode})}abort(e={},t){for(r(33,e.message),this.reportSupportabilityMetric(`SessionReplay/Abort/${e.sm}`,t),this.blocked=!0,this.mode=h.OFF,this.recorder?.stopRecording?.(),this.#e({sessionReplayMode:this.mode}),this.recorder?.clearTimestamps?.();this.recorder?.getEvents().events.length;)this.recorder?.clearBuffer?.()}#e(e={}){this.isSessionTrackingEnabled&&this.agentRef.runtime.session.write(e)}};export{O as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,F as t,R as n,T as r,j as i,t as a,w as o,y as s,z as c}from"./stringify-Dzp3UIiC.js";import{n as l,t as u}from"./send-DAQlgypB.js";import{n as d,t as f}from"./feature-flags-C-2g43g2.js";import{t as p}from"./obfuscate-DGKOc6ON.js";import{t as m}from"./aggregate-base-CCQ66xCP.js";import{t as h}from"./events-BqJgC3Et.js";import{t as g}from"./feature-gates-D617h-o3.js";import{n as _,t as v}from"./nav-timing-Clx3l32R.js";import{t as y}from"./constants-CMEXhPvr.js";import{n as b,t as x}from"./time-to-first-byte-DrD5gGoY.js";import{n as S,r as C,t as w}from"./webdriver-detection-CgM1lSqf.js";var T=class extends m{static featureName=y;constructor(e){if(super(e,y),this.isSessionTrackingEnabled=g(e.init)&&!!e.runtime.session,this.sentRum=!1,this.timeToFirstByte=0,this.firstByteToWindowLoad=0,this.firstByteToDomContent=0,this.retries=0,this.obfuscator=new p(e,h.PVE),e.runtime.timeKeeper=new d(e.runtime.session),t){let t=this.isSessionTrackingEnabled&&e.runtime.session?.state.cachedRumResponse;if(t){let{app:n,...r}=t;Object.keys(this.agentRef.runtime.appMetadata).length||(e.runtime.appMetadata=n),this.drain(),e.runtime.harvester.startTimer(),f(r,e)}x.subscribe(({value:e,attrs:t})=>{let n=t.navigationEntry;this.timeToFirstByte=Math.max(e,this.timeToFirstByte),this.firstByteToWindowLoad=Math.max(Math.round(n.loadEventEnd-this.timeToFirstByte),this.firstByteToWindowLoad),this.firstByteToDomContent=Math.max(Math.round(n.domContentLoadedEventEnd-this.timeToFirstByte),this.firstByteToDomContent)}),setTimeout(this.sendRum.bind(this),0)}else this.sendRum()}sendRum(t=this.agentRef.info.jsAttributes){let r=this.agentRef.info,o={};r.queueTime&&(o.qt=r.queueTime),r.applicationTime&&(o.ap=r.applicationTime),o.be=this.timeToFirstByte,o.fe=this.firstByteToWindowLoad,o.dc=this.firstByteToDomContent;let s={tt:r.ttGuid,us:r.user,ac:r.account,pr:r.product,af:b(this.agentRef).join(`,`),...o,xx:r.extra,ua:r.userAttributes,at:r.atts};this.agentRef.runtime.session&&(s.fsh=Number(!this.agentRef.runtime.session.state.cachedRumResponse));let l=this.obfuscator.traverseAndObfuscateEvents({ja:{...t,webdriverDetected:w}});if(i.performance){let t=e();if(t){let e={timing:_(n,t,{}),navigation:v(t,{})};s.perf=a(e)}else if(typeof PerformanceTiming<`u`){let e={timing:_(n,i.performance.timing,{},!0),navigation:v(i.performance.navigation,{})};s.perf=a(e)}}s.fp=S.current.value,s.fcp=C.current.value,this.queryStringsBuilder=()=>{this.rumStartTime=c();let e=this.agentRef.runtime.timeKeeper;return e?.ready&&(s.timestamp=Math.floor(e.correctRelativeTimestamp(this.rumStartTime))),s},this.events.add(l),this.agentRef.runtime.harvester.triggerHarvestFor(this).ranSend&&(this.sentRum=!0)}serializer(e){return e[0]}postHarvestCleanup({sent:e,status:t,responseText:n,xhr:i,retry:a}){let d=c(),p,m,h=!!this.agentRef.runtime.session?.state.cachedRumResponse;try{({app:p,...m}=JSON.parse(n))}catch(e){s(53,e)}let g=this.isSessionTrackingEnabled&&!h&&!!p;if(h){let{app:e,...t}=this.agentRef.runtime.session.state.cachedRumResponse;p??=e,m=t}if(super.postHarvestCleanup({sent:e,retry:a&&!h}),this.isRetrying&&this.retries++<1)setTimeout(()=>this.agentRef.runtime.harvester.triggerHarvestFor(this),5e3);else{if(t>=400||t===0){s(18,t);let e=new TextEncoder,n=Object.values(newrelic.ee.backlog).reduce((t,n)=>n?t+e.encode(n).byteLength:t,0),i=`BCS/Error/`,a=[{params:{name:i+t},stats:{c:1}},{params:{name:i+`Duration/Ms`},stats:{c:1,t:d-this.rumStartTime}}];if(h||a.push({params:{name:i+`Dropped/Bytes`},stats:{c:1,t:n}}),u(this.agentRef,{endpoint:r[o.metrics],payload:{body:{sm:a}},submitMethod:l(),featureName:o.metrics}),!h){this.blocked=!0,this.ee.abort();return}}else g&&this.agentRef.runtime.session.write({cachedRumResponse:{app:p,...m}});try{let e=this.agentRef.runtime.timeKeeper.ready;if(this.agentRef.runtime.timeKeeper.processRumRequest(i,this.rumStartTime,d,p.nrServerTime),!this.agentRef.runtime.timeKeeper.ready)throw Error(`TimeKeeper not ready`);let t=this.agentRef.runtime.timeKeeper.correctedOriginTime-p.nrServerTime;e&&t>0&&this.reportSupportabilityMetric(`Generic/TimeKeeper/InvalidTimestamp/Seen`,t)}catch(e){this.ee.abort(),this.blocked=!0,s(17,e);return}Object.keys(this.agentRef.runtime.appMetadata).length||(this.agentRef.runtime.appMetadata=p),this.drain(),this.agentRef.runtime.harvester.startTimer(),f(m,this.agentRef)}}};export{T as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,g as t,l as n,n as r,t as i,u as a,w as o}from"./stringify-Dzp3UIiC.js";import{t as s}from"./obfuscate-DGKOc6ON.js";import{t as c}from"./register-handler-Do-e4XFS.js";import{n as l,r as u}from"./deny-list-DB7HzON3.js";import{r as d,t as f}from"./constants-CZf-nsH0.js";import{t as p}from"./aggregate-base-CCQ66xCP.js";import{a as m,c as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./payloads-DVvDS7kd.js";import{t as S}from"./type-check-DkLJNuCs.js";import{c as C,l as w,o as T,s as E}from"./utils-HjH2zvlh.js";import{t as D}from"./events-BqJgC3Et.js";function O({body:e,query:t}={}){if(e||t)try{let n=A(j(e));if(n)return n;let r=k(M(t));if(r)return r}catch{}}function k(e){if(typeof e!=`object`||!e.query||typeof e.query!=`string`)return;let t=e.query.trim().match(/^(query|mutation|subscription)\s?(\w*)/),n=t?.[1];if(n)return{operationName:e.operationName||t?.[2]||`Anonymous`,operationType:n,operationFramework:`GraphQL`}}function A(e){if(!e)return;Array.isArray(e)||(e=[e]);let t=[],n=[];for(let r of e){let e=k(r);e&&(t.push(e.operationName),n.push(e.operationType))}if(n.length)return{operationName:t.join(`,`),operationType:n.join(`,`),operationFramework:`GraphQL`}}function j(e){let t;if(!e||typeof e!=`string`&&typeof e!=`object`||(t=typeof e==`string`?JSON.parse(e):e,!S(t)&&!Array.isArray(t)))return;let n=!1;if(n=Array.isArray(t)?t.some(e=>N(e)):N(t),n)return t}function M(e){if(!e||typeof e!=`string`)return;let t=new URLSearchParams(e);return j(Object.fromEntries(t))}function N(e){return!(typeof e!=`object`||!e.query||typeof e.query!=`string`)}function P(e){return Array.isArray(e?.errors)&&e.errors.some(e=>e&&typeof e==`object`&&typeof e.message==`string`)}function F(e){if(!e)return!1;try{let t=e;return typeof e==`string`&&(t=JSON.parse(e)),Array.isArray(t)?t.some(P):P(t)}catch{return!1}}var I=class extends p{static featureName=d;constructor(e){super(e,d),l(e.runtime.denyList);let n=this;this.obfuscator=new s(e,D.AJAX),e.init.ajax.block_internal?super.customAttributesAreSeparate=!0:super.canHarvestEarly=!1,c(`returnAjax`,e=>this.events.add(e),this.featureName,this.ee),c(`xhr`,function(e,t,r,i,a,o){n.storeXhr(e,t,r,i,a,o,this)},this.featureName,this.ee),this.ee.on(`long-task`,(e,n)=>{if(n instanceof t().o.XHR){let t=this.ee.context(n);t.latestLongtaskEnd=e.end}}),this.waitForFlags([]).then(()=>this.drain())}storeXhr(t,s,c,l,d,p,m){s.time=c;let h;h=t.cat?i([t.status,t.cat]):i([t.status,t.host,t.pathname]);let _=u(t),v=this.agentRef.init.feature_flags?.includes(`ajax_metrics_deny_list`);if(this.agentRef.features?.[o.jserrors]&&(_||!v)&&this.agentRef.sharedAggregator?.add([`xhr`,h,t,s]),!_){t.hostname===this.agentRef.info.errorBeacon||this.agentRef.init.proxy?.beacon&&t.hostname===this.agentRef.init.proxy.beacon?(this.reportSupportabilityMetric(`Ajax/Events/Excluded/Agent`),v&&this.reportSupportabilityMetric(`Ajax/Metrics/Excluded/Agent`)):(this.reportSupportabilityMetric(`Ajax/Events/Excluded/App`),v&&this.reportSupportabilityMetric(`Ajax/Metrics/Excluded/App`));return}r(`bstXhrAgg`,[`xhr`,h,t,s],void 0,o.sessionTrace,this.ee);let b={method:t.method,status:t.status,domain:t.host,path:t.pathname,requestSize:s.txSize,responseSize:s.rxSize,type:d,startTime:c,endTime:l,callbackDuration:s.cbTime,[f]:a()};b.gql=O({body:m.requestBody,query:m.parsedOrigin?.search}),b.gql&&(b.gql.operationHasErrors=F(m.responseBody));let S=this.agentRef.init.ajax.capture_payloads;if(x(S,{statusCode:b.status,hasGQLErrors:b.gql?.operationHasErrors,payloadHostname:t.hostname,payloadHost:t.host,payloadPathname:t.pathname},this.agentRef.beacons)&&(b.requestQuery=g(m.parsedOrigin?.search),b.requestHeaders=m.requestHeaders,b.responseHeaders=m.responseHeaders,y(m.requestHeaders,m.requestBody)&&(b.requestBody=m.requestBody),y(m.responseHeaders,m.responseBody)&&(b.responseBody=m.responseBody)),m.dt&&(b.spanId=m.dt.spanId,b.traceId=m.dt.traceId,b.spanTimestamp=m.dt.timestampCorrected??Math.floor(this.agentRef.runtime.timeKeeper.correctAbsoluteTimestamp(m.dt.timestamp))),b.gql&&this.reportSupportabilityMetric(`Ajax/Events/GraphQL/Bytes-Added`,i(b.gql).length),C(p)){if(this.events.add({...b,targetAttributes:T(p,this)}),w(p,this)){let t={...b,targetAttributes:E(p,this)};b.spanId&&(t.spanId=e(),t.traceId=n()),this.reportContainerEvent(t,m)}}else this.reportContainerEvent(b,m)}reportContainerEvent(e,t){this.agentRef.features?.[o.softNav]?r(`ajax`,[e,t],void 0,o.softNav,this.ee):this.events.add(e)}serializer(e){if(!e.length)return;let{addString:t,addStringRaw:n,addStringWithTruncation:r}=_(v,this.obfuscator),i=`bel.7;`,a=0;for(let o=0;o<e.length;o++){let s=e[o],c=s.startTime-a;o===0&&(a=s.startTime);let l=[h(c),h(s.endTime-s.startTime),h(0),h(0),n(s.method),h(s.status),t(s.domain),t(s.path),h(s.requestSize),h(s.responseSize),s.type===`fetch`?1:``,n(0),b(s.spanId,n,!0)+b(s.traceId,n,!0)+b(s.spanTimestamp,h,!1)],u=`2,`,d=this.agentRef.info.jsAttributes,p=m({...d||{},...s.targetAttributes||{},...s.gql||{}},{addKey:n,addVal:t});p.push(...m({[f]:s[f]},{addKey:n,addVal:n}));let g=m({...s.requestBody?{requestBody:s.requestBody}:{},...s.requestHeaders?{requestHeaders:s.requestHeaders}:{},...s.requestQuery?{requestQuery:s.requestQuery}:{},...s.responseBody?{responseBody:s.responseBody}:{},...s.responseHeaders?{responseHeaders:s.responseHeaders}:{}},{addKey:n,addVal:r});g.length&&this.reportSupportabilityMetric(`Ajax/Events/Payload/Bytes-Added`,g.join(`;`).length);let _=[...p,...g];l.unshift(h(_.length)),u+=l.join(`,`),_&&_.length>0&&(u+=`;`+_.join(`;`)),o+1<e.length&&(u+=`;`),i+=u}return i}};export{I as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e,t,y as n}from"./stringify-Dzp3UIiC.js";import{t as r}from"./clean-url-PIxP5rIW.js";import{t as i}from"./obfuscate-DGKOc6ON.js";import{t as a}from"./register-handler-Do-e4XFS.js";import{t as o}from"./aggregate-base-CCQ66xCP.js";import{l as s,o as c,s as l}from"./utils-HjH2zvlh.js";import{t as u}from"./events-BqJgC3Et.js";import{a as d,i as f}from"./constants-CdX3b0L1.js";import{a as p,i as m,n as h,r as g}from"./utils-BCGlS8lK.js";import{t as _}from"./constants-CDnI58H4.js";import{t as v}from"./feature-gates-D617h-o3.js";var y=class{timestamp;message;attributes;level;constructor(t,n,i={},a=p.INFO){this.timestamp=t,this.message=n,this.attributes={...i,pageUrl:r(``+e)},this.level=a.toUpperCase()}},b=`Logging/Event/`,x=class extends o{static featureName=g;constructor(e){super(e,g);let t=(e,t)=>{this.loggingMode={auto:e,api:t},t===void 0&&(this.loggingMode.api=e)};this.harvestOpts.raw=!0,super.customAttributesAreSeparate=!0,this.obfuscator=new i(e,u.LOG),this.ee.on(f.RESET,()=>{this.abort(_.RESET)}),this.ee.on(f.UPDATE,(e,n)=>{this.blocked||e!==d.CROSS_TAB||(n.loggingMode===m.OFF&&(!n.logApiMode||n.logApiMode===m.OFF)?this.abort(_.CROSS_TAB):t(n.loggingMode,n.logApiMode))}),this.waitForFlags([`log`,`logapi`]).then(([n,r])=>{if(this.blocked)return;this.loggingMode??={auto:n,api:r};let i=this.agentRef.runtime.session;v(e.init)&&i&&(i.state.loggingMode===null||i.state.logApiMode===null?this.#e(this.loggingMode):t(i.state.loggingMode,i.state.logApiMode)),this.loggingMode.auto===m.OFF&&this.loggingMode.api===m.OFF?(this.blocked=!0,this.deregisterDrain()):(a(`log`,this.handleLog.bind(this),this.featureName,this.ee),this.drain(),e.runtime.harvester.triggerHarvestFor(this))})}handleLog(e,r,i={},a=p.INFO,o,u){if(this.blocked)return;let d=o?this.loggingMode.auto:this.loggingMode.api;if(!d)return;if(i&&typeof i==`object`||(i={}),typeof a==`string`&&(a=a.toUpperCase()),!h(a))return n(30,a);if(d<(m[a]||1/0)){this.reportSupportabilityMetric(`Logging/Event/Dropped/Sampling`);return}try{if(typeof r!=`string`){let e=t(r);r=e&&e!==`{}`?e:String(r)}}catch{n(16,r),this.reportSupportabilityMetric(`Logging/Event/Dropped/Casting`);return}if(typeof r!=`string`||!r)return n(32);let f=t=>{let n=new y(Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(e)),r,t,a);this.events.add(n)&&this.reportSupportabilityMetric(b+(o?`Auto`:`API`)+`/Added`)};f({...i,...c(u,this)}),s(u,this)&&f({...i,...l(u,this)})}serializer(e){let t=this.agentRef.runtime.session;return[{common:{attributes:{...this.obfuscator.traverseAndObfuscateEvents(this.agentRef.info.jsAttributes),...this.harvestEndpointVersion===1&&{"entity.guid":this.agentRef.runtime.appMetadata.agents[0].entityGuid,appId:this.agentRef.info.applicationID},...t&&{session:t.state.value||`0`,hasReplay:t.state.sessionReplayMode===1,hasTrace:t.state.sessionTraceMode===1},ptid:this.agentRef.runtime.ptid,standalone:!!this.agentRef.info.sa,agentVersion:this.agentRef.runtime.version,"instrumentation.provider":`browser`,"instrumentation.version":this.agentRef.runtime.version,"instrumentation.name":this.agentRef.runtime.loaderType}},logs:this.obfuscator.traverseAndObfuscateEvents(e)}]}queryStringsBuilder(){return{browser_monitoring_key:this.agentRef.info.licenseKey}}abort(e={}){this.reportSupportabilityMetric(`Logging/Abort/${e.sm}`),this.blocked=!0,this.events&&(this.events.clear(),this.events.clearSave()),this.loggingMode={auto:m.OFF,api:m.OFF},this.#e(this.loggingMode),this.deregisterDrain()}#e(e){this.agentRef.runtime.session?.write({loggingMode:e.auto,logApiMode:e.api})}};export{x as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,N as t,g as n,j as r,t as i,y as a,z as o}from"./stringify-Dzp3UIiC.js";import{t as s}from"./clean-url-PIxP5rIW.js";import{t as c}from"./obfuscate-DGKOc6ON.js";import{t as l}from"./register-handler-Do-e4XFS.js";import{t as u}from"./aggregate-base-CCQ66xCP.js";import{t as d}from"./type-check-DkLJNuCs.js";import{a as f,i as p,l as m,o as h,p as g,s as _}from"./utils-HjH2zvlh.js";import{t as v}from"./events-BqJgC3Et.js";import{a as y,n as b,r as x,s as S}from"./constants-CvitFm-l.js";import{t as C}from"./timer-De0Ampht.js";import{t as w}from"./iframe-CbOKKvMF.js";var T=(e,t=[],n)=>{let r=[],i={path:void 0,nearestFields:{},get targets(){return r.length?r:[n.runtime.v2Target]},hasButton:!1,hasLink:!1};if(!e)return i;if(e===window)return i.path=`window`,i;if(e===document)return i.path=`document`,i;let a=``,o=D(e);try{for(;e?.tagName;){let o=e.tagName.toLowerCase();i.hasLink||=o===`a`,i.hasButton||=o===`button`||o===`input`&&e.type.toLowerCase()===`button`,t.forEach(t=>{i.nearestFields[O(t)]||=e[t]?.baseVal||e[t]});let s=e?.dataset;s.nrMfeId&&r.push(...p(s.nrMfeId,n)),a=E(e,a),e=e.parentNode}}catch{}return i.path=a?o?`${a}:nth-of-type(${o})`:a:void 0,i};function E(e,t){let{id:n,localName:r}=e;return[r,n?`#${n}`:``,t?`>${t}`:``].join(``)}function D(e){try{let t=1,{tagName:n}=e;for(;e.previousElementSibling;)e.previousElementSibling.tagName===n&&t++,e=e.previousElementSibling;return t}catch{}}function O(e){return e===`tagName`&&(e=`tag`),e===`className`&&(e=`class`),`nearest${e.charAt(0).toUpperCase()+e.slice(1)}`}var k=class{constructor(e,t){this.event=e,this.count=1,this.originMs=Math.floor(e.timeStamp),this.relativeMs=[0],this.selectorPath=t.path,this.rageClick=void 0,this.nearestTargetFields=t.nearestFields,this.currentUrl=s(``+location),this.deadClick=!1,this.errorClick=!1,this.targets=t.targets}aggregate(e){this.count++,this.relativeMs.push(Math.floor(e.timeStamp-this.originMs)),this.isRageClick()&&(this.rageClick=!0)}isRageClick(){let e=this.relativeMs.length;return this.event.type===`click`&&e>=4&&this.relativeMs[e-1]-this.relativeMs[e-4]<1e3}},A=class{#e=void 0;#t=``;#n=void 0;#r=void 0;#i=void 0;constructor(e){this.agentRef=e,n().o.MO&&(this.#r=new MutationObserver(this.isLiveClick.bind(this)))}get aggregationEvent(){let e=this.#e;return this.#t=``,this.#e=void 0,e}process(e,t){if(!e)return;let n=T(y.includes(e.type)?window:e.target,t,this.agentRef),r=j(e,n.path);if(r&&r===this.#t)this.#e.aggregate(e);else{let t=this.#e;return this.#c(),this.#o(),this.#t=r,this.#e=new k(e,n),e.type===`click`&&(n.hasButton||n.hasLink)&&(this.#s(this.#e),this.#a()),t}}markAsErrorClick(){this.#e&&this.#i&&(this.#e.errorClick=!0,this.#o())}#a(){this.#i=new C({onEnd:()=>{this.#o()}},x)}#o(){this.#i?.clear(),this.#i=void 0}#s(e){!this.#l()&&this.#r&&(this.#r.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.#n=new C({onEnd:()=>{e.deadClick=!0,this.#c()}},x))}#c(){this.#r?.disconnect(),this.#n?.clear(),this.#n=void 0}#l(){return this.#n!==void 0}isLiveClick(){this.#l()&&this.#c()}};function j(e,t){let n=e.type;return e.type!==`scrollend`&&(n+=`-`+t),n}var M=class extends u{static featureName=b;#e;constructor(t){super(t,b),this.referrerUrl=e&&document.referrer?s(document.referrer):void 0,this.obfuscator=new c(t),this.waitForFlags([`ins`]).then(([n])=>{if(!n){this.blocked=!0,this.deregisterDrain();return}this.#n(),l(`api-recordCustomEvent`,(e,t,n,r)=>{if(S.includes(t))return a(46);this.addEvent({eventType:t,timestamp:this.#t(e),...n},r)},this.featureName,this.ee),t.init.page_action.enabled&&l(`api-addPageAction`,(t,n,r,i)=>{this.addEvent({...r,eventType:v.PA,timestamp:this.#t(t),timeSinceLoad:t/1e3,actionName:n,referrerUrl:this.referrerUrl,...e&&{browserWidth:window.document.documentElement?.clientWidth,browserHeight:window.document.documentElement?.clientHeight}},i)},this.featureName,this.ee);let o=()=>{};e&&t.init.user_actions.enabled&&(this.#e=new A(this.agentRef),this.harvestOpts.beforeUnload=()=>o?.(this.#e.aggregationEvent),o=e=>{try{if(e?.event){let{target:t,timeStamp:n,type:r}=e.event;e.targets.forEach(i=>{let a={eventType:v.UA,timestamp:this.#t(n),action:r,actionCount:e.count,actionDuration:e.relativeMs[e.relativeMs.length-1],actionMs:e.relativeMs,rageClick:e.rageClick,target:e.selectorPath,currentUrl:e.currentUrl,...w(window)&&{iframe:!0},...this.agentRef.init.user_actions.elementAttributes.reduce((e,n)=>(s(n)&&(e[o(n)]=String(t[n]).trim().slice(0,128)),e),{}),...e.nearestTargetFields,...e.deadClick&&{deadClick:!0},...e.errorClick&&{errorClick:!0}};this.addEvent(a,i),this.#r(a);function o(e){return e===`tagName`&&(e=`tag`),e===`className`&&(e=`class`),`target${e.charAt(0).toUpperCase()+e.slice(1)}`}function s(n){return!!(e.selectorPath!==`window`&&e.selectorPath!==`document`&&t instanceof HTMLElement&&t?.[n])}})}}catch{}},l(`ua`,e=>{o(this.#e.process(e,this.agentRef.init.user_actions.elementAttributes))},this.featureName,this.ee),l(`navChange`,()=>{this.#e.isLiveClick()},this.featureName,this.ee),l(`uaXhr`,()=>{this.#e.isLiveClick()},this.featureName,this.ee),l(`uaErr`,()=>this.#e.markAsErrorClick(),this.featureName,this.ee));let c=[...t.init.performance.capture_marks?[`mark`]:[],...t.init.performance.capture_measures?[`measure`]:[]];if(c.length)try{c.forEach(e=>{PerformanceObserver.supportedEntryTypes.includes(e)&&new PerformanceObserver(n=>{n.getEntries().forEach(n=>{try{this.reportSupportabilityMetric(`Generic/Performance/`+e+`/Seen`);let r=t.init.performance.capture_detail?i(n.detail):{};this.addEvent({...r,eventType:v.BP,timestamp:this.#t(n.startTime),entryName:n.name,entryDuration:n.duration,entryType:e});function i(e){return e==null?{}:d(e)?t(e):{entryDetail:e};function t(e,n=`entryDetail`){let r={};return e==null||Object.keys(e).forEach(i=>{let a=n+`.`+i;d(e[i])?Object.assign(r,t(e[i],a)):e[i]!==null&&e[i]!==void 0&&(r[a]=e[i])}),r}}}catch{}})}).observe({buffered:!0,type:e})})}catch{}e&&t.init.performance.resources.enabled&&l(`browserPerformance.resource`,e=>{try{let{name:n,duration:i,...a}=e.toJSON(),o=!1;try{let e=new URL(n).hostname,i=e.includes(`newrelic.com`)||e.includes(`nr-data.net`)||e.includes(`nr-local.net`);if(this.agentRef.init.performance.resources.ignore_newrelic&&i||this.agentRef.init.performance.resources.asset_types.length&&!this.agentRef.init.performance.resources.asset_types.includes(a.initiatorType))return;o=e===r?.location.hostname||t.init.performance.resources.first_party_domains.includes(e),o&&this.reportSupportabilityMetric(`Generic/Performance/FirstPartyResource/Seen`),i&&this.reportSupportabilityMetric(`Generic/Performance/NrResource/Seen`)}catch{}this.reportSupportabilityMetric(`Generic/Performance/Resource/Seen`);let c={...a,eventType:v.BP,timestamp:this.#t(a.startTime),entryName:s(n),entryDuration:i,firstParty:o},l=f(n,this.agentRef);if(l.length){l.forEach(e=>this.addEvent({...c},e));return}this.addEvent({...c},void 0);let u=g(s(n));if(u?.dom.value&&!u.dom.end){let e=()=>{f(n,this.agentRef).forEach(e=>this.addEvent({...c},e))};[`load`,`error`].forEach(t=>u.dom.value.addEventListener(t,e,{once:!0}))}}catch(e){this.ee.emit(`internal-error`,[e,`GenericEvents-Resource`])}},this.featureName,this.ee),l(`api-measure`,(e,t,n)=>{let{start:r,duration:i,customAttributes:a}=e,o={...a,eventType:v.BP,timestamp:this.#t(r),entryName:t,entryDuration:i,entryType:`measure`};this.addEvent(o,n)},this.featureName,this.ee),(t.init.feature_flags.includes(`websockets`)||t.init.web_sockets?.enabled)&&l(`ws-complete`,(e,n=[t.runtime.v2Target])=>{n.forEach(t=>{let n={...e,eventType:v.WS,timestamp:this.#t(e.timestamp),openedAt:this.#t(e.openedAt),closedAt:this.#t(e.closedAt)};this.reportSupportabilityMetric(`WebSocket/Completed/Seen`),this.reportSupportabilityMetric(`WebSocket/Completed/Bytes`,i(n).length),this.addEvent(n,t)})},this.featureName,this.ee),t.init.feature_flags.includes(`no_spv`)||l(`spv`,(e,t)=>{this.addEvent({eventType:v.SPV,timestamp:this.#t(t),...e})},this.featureName,this.ee),this.drain()})}addEvent(e={},n){if(!e||!Object.keys(e).length)return;if(!e.eventType){a(44);return}for(let t in e){let n=e[t];e[t]=n&&typeof n==`object`?i(n):n}let r={timestamp:this.#t(o()),pageUrl:s(``+t),currentUrl:s(``+location)},c={...this.agentRef.info.jsAttributes||{},...r,...e};this.events.add({...c,...h(n,this)}),m(n,this)&&this.addEvent({...c,..._(n,this)})}serializer(e){return this.obfuscator.traverseAndObfuscateEvents({ins:e})}queryStringsBuilder(){return{ua:this.agentRef.info.userAttributes,at:this.agentRef.info.atts}}#t(e){return Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(e))}#n(){let e=`Config/Performance/`;this.agentRef.init.performance.capture_marks&&this.reportSupportabilityMetric(e+`CaptureMarks/Enabled`),this.agentRef.init.performance.capture_measures&&this.reportSupportabilityMetric(e+`CaptureMeasures/Enabled`),this.agentRef.init.performance.resources.enabled&&this.reportSupportabilityMetric(e+`Resources/Enabled`),this.agentRef.init.performance.resources.asset_types?.length!==0&&this.reportSupportabilityMetric(e+`Resources/AssetTypes/Changed`),this.agentRef.init.performance.resources.first_party_domains?.length!==0&&this.reportSupportabilityMetric(e+`Resources/FirstPartyDomains/Changed`),this.agentRef.init.performance.resources.ignore_newrelic===!1&&this.reportSupportabilityMetric(e+`Resources/IgnoreNewrelic/Changed`)}#r(e){e.rageClick&&this.reportSupportabilityMetric(`UserAction/RageClick/Seen`),e.deadClick&&this.reportSupportabilityMetric(`UserAction/DeadClick/Seen`),e.errorClick&&this.reportSupportabilityMetric(`UserAction/ErrorClick/Seen`)}};export{M as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,F as t,N as n,P as r,n as i,w as a}from"./stringify-Dzp3UIiC.js";import{t as o}from"./clean-url-PIxP5rIW.js";import{n as s}from"./page-visibility-CPUGlMvF.js";import{t as c}from"./obfuscate-DGKOc6ON.js";import{t as l}from"./register-handler-Do-e4XFS.js";import{t as u}from"./aggregate-base-CCQ66xCP.js";import{a as d,c as f,n as p,o as m,s as h}from"./payloads-DVvDS7kd.js";import{t as g}from"./events-BqJgC3Et.js";import{a as _,i as v,l as y,n as b,o as x,r as S,s as C,t as w,u as T}from"./webdriver-detection-CgM1lSqf.js";import{t as E}from"./constants-BWRO9jlX.js";import{t as D}from"./event-origin-NoP9qGzT.js";import{t as O}from"./load-time-CDLVHe97.js";var k=new _(x.CUMULATIVE_LAYOUT_SHIFT,e=>e);if(t){let e=({value:e,attribution:t,id:n})=>{let r={metricId:n,largestShiftTarget:t.largestShiftTarget,largestShiftTime:t.largestShiftTime,largestShiftValue:t.largestShiftValue,loadState:t.loadState};k.update({value:e,attrs:r})};v(()=>C(e,{reportAllChanges:!0}))}var A=new _(x.INTERACTION_TO_NEXT_PAINT);if(t){let e=({value:e,attribution:t,id:n,entries:r})=>{if(!r?.length)return;let i={metricId:n,eventTarget:t.interactionTarget,eventTime:t.interactionTime,interactionTarget:t.interactionTarget,interactionTime:t.interactionTime,interactionType:t.interactionType,inputDelay:t.inputDelay,nextPaintTime:t.nextPaintTime,processingDuration:t.processingDuration,presentationDelay:t.presentationDelay,loadState:t.loadState};A.update({value:e,attrs:i})};v(()=>y(e))}var j=new _(x.LARGEST_CONTENTFUL_PAINT);if(t){let e=({value:e,attribution:t})=>{if(r||j.isValid)return;let n={timeToFirstByte:t.timeToFirstByte,resourceLoadDelay:t.resourceLoadDelay,resourceLoadDuration:t.resourceLoadDuration,resourceLoadTime:t.resourceLoadDuration,elementRenderDelay:t.elementRenderDelay},i=t.lcpEntry;i&&(n.size=i.size,n.eid=i.id,i.element?.tagName&&(n.elTag=i.element.tagName)),t.target&&(n.element=t.target),t.url&&(n.elUrl=o(t.url)),j.update({value:e,attrs:n})};v(()=>T(e))}var M=class extends u{static featureName=E;#e=({name:e,value:t,attrs:n})=>{this.addTiming(e,t,n)};constructor(e){super(e,E),this.curSessEndRecorded=!1,this.firstIxnRecorded=!1,super.customAttributesAreSeparate=!0,this.obfuscator=new c(e,g.PVT),l(`docHidden`,e=>this.endCurrentSession(e),this.featureName,this.ee),l(`winPagehide`,e=>this.addTiming(`unload`,e,null),this.featureName,this.ee),this.waitForFlags([]).then(()=>{b.subscribe(this.#e),S.subscribe(this.#e),j.subscribe(this.#e),A.subscribe(this.#e),O.subscribe(({name:e,value:t})=>{this.addTiming(e,Math.round(t))}),s(()=>{let{name:e,value:t,attrs:n}=k.current;t!==void 0&&this.addTiming(e,t*1e3,n)},!0,!0),this.drain()})}endCurrentSession(e){this.curSessEndRecorded||=(this.addTiming(`pageHide`,e,null),!0)}addTiming(t,r,s){s||={},s.pageUrl=o(e()?.name||n),N(s),t!==x.CUMULATIVE_LAYOUT_SHIFT&&k.current.value>=0&&(s.cls=k.current.value),s.webdriverDetected=w;let c={name:t,value:r,attrs:s};return this.events.add(c),i(`pvtAdded`,[t,r,s],void 0,a.sessionTrace,this.ee),this.checkForFirstInteraction(),c}checkForFirstInteraction(){if(this.firstIxnRecorded||r||!performance)return;let e=performance.getEntriesByType(`first-input`)[0];e&&(this.firstIxnRecorded=!0,this.addTiming(`fi`,e.startTime,{type:e.name,eventTarget:D(e.target),loadState:document.readyState}))}#t(){let e=[`size`,`eid`,`cls`,`type`,`fid`,`elTag`,`elUrl`,`net-type`,`net-etype`,`net-rtt`,`net-dlink`,`webdriverDetected`];return Object.fromEntries(Object.entries(this.agentRef.info.jsAttributes||{}).filter(([t])=>!e.includes(t)))}preHarvestChecks(){return this.checkForFirstInteraction(),super.preHarvestChecks()}serializer(e){if(!e?.length)return``;let{addString:t,addStringRaw:n}=p(m,this.obfuscator),r={addKey:n,addVal:n},i={addKey:n,addVal:t};for(var a=`bel.6;`,o=0;o<e.length;o++){var s=e[o];a+=`e,`,a+=n(s.name)+`,`,a+=h(s.value,f,!1)+`,`;let t=this.#t(),{pageUrl:l,...u}=s.attrs||{};var c=d(u,r);c.push(...d(t,i)),l&&c.push(...d({pageUrl:l},i)),c&&c.length>0&&(a+=f(c.length)+`;`+c.join(`;`)),o+1<e.length&&(a+=`;`)}return a}};function N(e){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;t&&(t.type&&(e[`net-type`]=t.type),t.effectiveType&&(e[`net-etype`]=t.effectiveType),t.rtt&&(e[`net-rtt`]=t.rtt),t.downlink&&(e[`net-dlink`]=t.downlink))}export{M as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./parse-url-BjQzQUGD.js";import{j as i,y as a,z as o}from"./stringify-Dzp3UIiC.js";import{t as s}from"./clean-url-PIxP5rIW.js";import{t as c}from"./encode-Cu2qrKlv.js";import{t as l}from"./obfuscate-DGKOc6ON.js";import{t as u}from"./register-handler-Do-e4XFS.js";import{t as d}from"./aggregate-base-CCQ66xCP.js";import{t as f}from"./events-BqJgC3Et.js";import{i as p,r as m}from"./constants-CdX3b0L1.js";import{t as h}from"./event-origin-NoP9qGzT.js";var g=class{constructor(e,t,n,r,i){this.n=e,this.s=t,this.e=n,this.o=r,this.t=i}};function _(e){switch(e){case`keydown`:case`keyup`:case`keypress`:return`typing`;case`mousemove`:case`mouseenter`:case`mouseleave`:case`mouseover`:case`mouseout`:return`mousing`;case`touchstart`:case`touchmove`:case`touchend`:case`touchcancel`:case`touchenter`:case`touchleave`:return`touching`;case`scroll`:case`scrollend`:return`scrolling`;default:return e}}var v={global:{mouseup:!0,mousedown:!0},window:{load:!0,pagehide:!0},xhrOriginMissing:{ignoreAll:!0}},y={typing:`typing`,scrolling:`scrolling`,mousing:`mousing`,touching:`touching`},b={[y.typing]:1e3,[y.scrolling]:100,[y.mousing]:1e3,[y.touching]:1e3},x={[y.typing]:2e3,[y.scrolling]:1e3,[y.mousing]:2e3,[y.touching]:2e3},S=class{prevStoredEvents=new Set;constructor(e){this.parent=e}#e(e){return e.n in y}#t(e){let t=t=>!(t.o!==e.o||t.n!==e.n||e.s-t.s<x[e.o]||t.e>e.s-b[e.o]),n={e:e.e};return this.parent.events.merge(t,n)}#n(e){if(e.n in v.global)return!0;let t=e.o;return v[t]?.ignoreAll||v[t]?.[e.n]?!0:t===`xhrOriginMissing`&&e.n===`Ajax`}#r(){if(this.parent.blocked)return!1;if(this.parent.events.length>=1e3){if(this.parent.mode!==m.ERROR)return!1;this.trimSTNsByTime(),this.parent.events.length>=1e3&&this.trimSTNsByIndex(1)}return!0}#i(e){return this.#n(e)||!this.#r()?!1:(this.#e(e)&&this.#t(e)||this.parent.events.add(e),!0)}storeNode(e){return this.#i(e)}processPVT(e,t,n){return this.storeTiming({[e]:t})}storeTiming(e,t=!1){if(!e)return!1;let n=!0;for(let r in e){let i=e[r],a=r.toLowerCase();a.indexOf(`size`)>=0||a.indexOf(`status`)>=0||typeof i==`number`&&i>=0&&(i=Math.round(i),t&&this.parent.timeKeeper?.ready&&(i=this.parent.timeKeeper.convertAbsoluteTimestamp(Math.floor(this.parent.timeKeeper.correctAbsoluteTimestamp(i)))),this.#i(new g(r,i,i,`document`,`timing`))||(n=!1))}return n}storeEvent(e,t,n,r){if(this.prevStoredEvents.has(e)||!this.#r())return!1;this.prevStoredEvents.add(e);let i=new g(_(e.type),n,r,void 0,`event`);try{i.o=h(e.target,t,this.parent.ee)}catch{i.o=h(null,t,this.parent.ee)}return this.#i(i)}storeHist(e,t,n){return this.#i(new g(`history.pushState`,n,n,e,t))}storeResources(e){if(!e||e.length===0)return!1;let t=!0;for(let n=0;n<e.length;n++){let i=e[n];if(!this.#r())break;let{initiatorType:a,fetchStart:o,responseEnd:s,entryType:c}=i,{protocol:l,hostname:u,port:d,pathname:f}=r(i.name),p=new g(a,o|0,s|0,`${l}://${u}:${d}${f}`,c);this.#i(p)||(t=!1)}return t}storeErrorAgg(e,t,n,r){return e===`err`&&this.#i(new g(`error`,r.time,r.time,n.message,n.stackHash))}storeXhrAgg(e,t,n,r){return e===`xhr`&&this.#i(new g(`Ajax`,r.time,r.time+r.duration,`${n.status} ${n.method}: ${n.host}${n.pathname}`,`ajax`))}trimSTNsByTime(e=n){this.parent.events.clear({clearBeforeTime:Math.max(o-e,0),timestampKey:`e`})}trimSTNsByIndex(e=0){this.parent.events.clear({clearBeforeIndex:e})}clear(){this.prevStoredEvents.clear()}},C=5e3,w=class extends d{static featureName=e;constructor(t){super(t,e),this.harvestOpts.raw=!0,this.obfuscator=new l(t,f.ST),this.entitled=void 0,this.everHarvested=!1,this.harvesting=!1,this.traceStorage=new S(this),this.waitForFlags([`sts`,`st`]).then(([e,t])=>this.initialize(e,t))}initialize(e,n,r){if(this.entitled??=n,!this.entitled)return this.abort(t.ENTITLEMENTS),this.deregisterDrain();this.timeKeeper??=this.agentRef.runtime.timeKeeper,this.initialized||(this.initialized=!0,this.ptid=this.agentRef.runtime.ptid,this.sessionId=this.agentRef.runtime.session?.state.value,this.ee.on(p.RESET,()=>{this.blocked||this.abort(t.RESET)}),this.ee.on(p.UPDATE,(e,n)=>{this.blocked||(this.mode!==m.FULL&&(n.sessionReplayMode===m.FULL||n.sessionTraceMode===m.FULL)&&this.switchToFull(),(this.sessionId!==n.value||e===`cross-tab`&&n.sessionTraceMode===m.OFF)&&this.abort(t.CROSS_TAB))}),typeof PerformanceNavigationTiming<`u`&&i.performance?.getEntriesByType(`navigation`)?.length>0?this.traceStorage.storeTiming(i.performance.getEntriesByType(`navigation`)[0]):this.traceStorage.storeTiming(i.performance?.timing,!0)),this.mode=this.agentRef.runtime.session.state.sessionTraceMode!==null&&!r?this.agentRef.runtime.session.state.sessionTraceMode:e,this.mode!==m.OFF&&(u(`bst`,(...e)=>this.traceStorage.storeEvent(...e),this.featureName,this.ee),u(`bstResource`,(...e)=>this.traceStorage.storeResources(...e),this.featureName,this.ee),u(`bstHist`,(...e)=>this.traceStorage.storeHist(...e),this.featureName,this.ee),u(`bstXhrAgg`,(...e)=>this.traceStorage.storeXhrAgg(...e),this.featureName,this.ee),u(`bstApi`,(...e)=>this.traceStorage.storeNode(...e),this.featureName,this.ee),u(`trace-jserror`,(...e)=>this.traceStorage.storeErrorAgg(...e),this.featureName,this.ee),u(`pvtAdded`,(...e)=>this.traceStorage.processPVT(...e),this.featureName,this.ee)),this.mode===m.ERROR&&u(`trace-jserror`,()=>{this.mode===m.ERROR&&this.switchToFull()},this.featureName,this.ee),this.agentRef.runtime.session.write({sessionTraceMode:this.mode}),this.mode===m.OFF?this.deregisterDrain():this.drain()}preHarvestChecks(){if(!(this.blocked||this.mode!==m.FULL)&&this.timeKeeper?.ready&&this.agentRef.runtime.session){if(this.sessionId!==this.agentRef.runtime.session.state.value||this.ptid!==this.agentRef.runtime.ptid)this.abort(t.SESSION_CHANGED);else return!0}}serializer(e){if(e.length)return this.everHarvested=!0,this.obfuscator.traverseAndObfuscateEvents(e)}queryStringsBuilder(e){let t=!this.agentRef.runtime.session.state.traceHarvestStarted;t&&this.agentRef.runtime.session.write({traceHarvestStarted:!0});let n=this.agentRef.runtime.session.state.sessionReplayMode===1,r=this.agentRef.info.jsAttributes[`enduser.id`],i=this.agentRef.runtime.appMetadata.agents?.[0]?.entityGuid,a=e.reduce((e,t)=>Math.min(e,t.s),1/0),o=e.reduce((e,t)=>Math.max(e,t.s),-1/0);return{browser_monitoring_key:this.agentRef.info.licenseKey,type:`BrowserSessionChunk`,app_id:this.agentRef.info.applicationID,protocol_version:`0`,timestamp:Math.floor(this.timeKeeper.correctRelativeTimestamp(a)),attributes:c({...i&&{entityGuid:i},harvestId:`${this.agentRef.runtime.session.state.value}_${this.agentRef.runtime.ptid}_${this.agentRef.runtime.harvestCount}`,"trace.firstTimestamp":Math.floor(this.timeKeeper.correctRelativeTimestamp(a)),"trace.lastTimestamp":Math.floor(this.timeKeeper.correctRelativeTimestamp(o)),"trace.nodes":e.length,"trace.originTimestamp":this.timeKeeper.correctedOriginTime,agentVersion:this.agentRef.runtime.version,...t&&{firstSessionHarvest:t},...n&&{hasReplay:n},ptid:`${this.ptid}`,session:`${this.sessionId}`,...r&&{"enduser.id":this.obfuscator.obfuscateString(r)},currentUrl:this.obfuscator.obfuscateString(s(``+location))},C).substring(1)}}switchToFull(){if(this.mode===m.FULL||!this.entitled||this.blocked)return;let e=this.mode;if(this.mode=m.FULL,this.agentRef.runtime.session.write({sessionTraceMode:this.mode}),e===m.OFF||!this.initialized)return this.initialize(this.mode,this.entitled);this.initialized&&(this.traceStorage.trimSTNsByTime(),this.agentRef.runtime.harvester.triggerHarvestFor(this))}abort(e={}){a(60,e.message),this.blocked=!0,this.mode=m.OFF,this.agentRef.runtime.session.write({sessionTraceMode:this.mode}),this.events.clear()}postHarvestCleanup(e){this.traceStorage.clear(),super.postHarvestCleanup(e)}};export{w as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,I as t}from"./stringify-Dzp3UIiC.js";import{r as n}from"./event-listener-opts-S1G6uDJo.js";import{n as r,r as i,t as a}from"./constants-B39wMiCG.js";import{n as o,t as s}from"./obfuscate-DGKOc6ON.js";import{t as c}from"./register-handler-Do-e4XFS.js";import{t as l}from"./aggregate-base-CCQ66xCP.js";import{t as u}from"./iframe-CbOKKvMF.js";import{t as d}from"./load-1XXgLaBh.js";var f={REACT:`React`,NEXTJS:`NextJS`,VUE:`Vue`,NUXTJS:`NuxtJS`,ANGULAR:`Angular`,ANGULARUNIVERSAL:`AngularUniversal`,SVELTE:`Svelte`,SVELTEKIT:`SvelteKit`,PREACT:`Preact`,PREACTSSR:`PreactSSR`,ANGULARJS:`AngularJS`,BACKBONE:`Backbone`,EMBER:`Ember`,METEOR:`Meteor`,ZEPTO:`Zepto`,JQUERY:`Jquery`,MOOTOOLS:`MooTools`,QWIK:`Qwik`,FLUTTER:`Flutter`,ELECTRON:`Electron`};function p(){if(!e)return[];let t=[];try{m()&&(t.push(f.REACT),h()&&t.push(f.NEXTJS)),g()&&(t.push(f.VUE),_()&&t.push(f.NUXTJS)),v()&&(t.push(f.ANGULAR),y()&&t.push(f.ANGULARUNIVERSAL)),b()&&(t.push(f.SVELTE),x()&&t.push(f.SVELTEKIT)),S()&&(t.push(f.PREACT),C()&&t.push(f.PREACTSSR)),w()&&t.push(f.ANGULARJS),Object.prototype.hasOwnProperty.call(window,`Backbone`)&&t.push(f.BACKBONE),Object.prototype.hasOwnProperty.call(window,`Ember`)&&t.push(f.EMBER),Object.prototype.hasOwnProperty.call(window,`Meteor`)&&t.push(f.METEOR),Object.prototype.hasOwnProperty.call(window,`Zepto`)&&t.push(f.ZEPTO),Object.prototype.hasOwnProperty.call(window,`jQuery`)&&t.push(f.JQUERY),Object.prototype.hasOwnProperty.call(window,`MooTools`)&&t.push(f.MOOTOOLS),Object.prototype.hasOwnProperty.call(window,`qwikevents`)&&t.push(f.QWIK),Object.hasOwn(window,`_flutter`)&&t.push(f.FLUTTER),T()&&t.push(f.ELECTRON)}catch{}return t}function m(){try{return Object.prototype.hasOwnProperty.call(window,`React`)||Object.prototype.hasOwnProperty.call(window,`ReactDOM`)||Object.prototype.hasOwnProperty.call(window,`ReactRedux`)||document.querySelector(`[data-reactroot], [data-reactid]`)||(()=>{let e=document.querySelectorAll(`body > div`);for(let t=0;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(e[t],`_reactRootContainer`))return!0})()}catch{return!1}}function h(){try{return Object.prototype.hasOwnProperty.call(window,`next`)&&Object.prototype.hasOwnProperty.call(window.next,`version`)}catch{return!1}}function g(){try{return Object.prototype.hasOwnProperty.call(window,`Vue`)}catch{return!1}}function _(){try{return Object.prototype.hasOwnProperty.call(window,`$nuxt`)&&Object.prototype.hasOwnProperty.call(window.$nuxt,`nuxt`)}catch{return!1}}function v(){try{return Object.prototype.hasOwnProperty.call(window,`ng`)||document.querySelector(`[ng-version]`)}catch{return!1}}function y(){try{return document.querySelector(`[ng-server-context]`)}catch{return!1}}function b(){try{return Object.prototype.hasOwnProperty.call(window,`__svelte`)}catch{return!1}}function x(){try{return!!Object.keys(window).find(e=>e.startsWith(`__sveltekit`))}catch{return!1}}function S(){try{return Object.prototype.hasOwnProperty.call(window,`preact`)}catch{return!1}}function C(){try{return document.querySelector(`script[type="__PREACT_CLI_DATA__"]`)}catch{return!1}}function w(){try{return Object.prototype.hasOwnProperty.call(window,`angular`)||document.querySelector(`.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]`)||document.querySelector(`script[src*="angular.js"], script[src*="angular.min.js"]`)}catch{return!1}}function T(){try{return typeof navigator==`object`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Electron`)>=0}catch{return!1}}function E(e){try{let t=[],n=(...e)=>e.join(`/`);function r(e,r,i,a){let o=`audit`;i?a?t.push(n(o,e,r,`true`,`positive`)):t.push(n(o,e,r,`false`,`positive`)):a?t.push(n(o,e,r,`false`,`negative`)):t.push(n(o,e,r,`true`,`negative`))}return e.page_view_event&&(r(`page_view`,`hasReplay`,e.page_view_event.hasReplay,!!e.session_replay),r(`page_view`,`hasTrace`,e.page_view_event.hasTrace,!!e.session_trace)),e.session_replay&&r(`session_replay`,`hasError`,e.session_replay.hasError,!!e.jserrors),t}catch{return[]}}var D=class extends l{static featureName=r;constructor(t){super(t,r),this.harvestOpts.aggregatorTypes=[`cm`,`sm`],this.obfuscator=new s(t),this.harvestMetadata={},this.harvestOpts.beforeUnload=()=>{E(this.harvestMetadata).forEach(e=>{this.storeSupportabilityMetrics(e)})},this.agentNonce=e&&document.currentScript?.nonce,this.waitForFlags([`err`]).then(([e])=>{e?(this.singleChecks(),this.eachSessionChecks(),this.drain()):(this.blocked=!0,this.deregisterDrain())}),c(i,this.storeSupportabilityMetrics.bind(this),this.featureName,this.ee),c(a,this.storeEventMetrics.bind(this),this.featureName,this.ee)}preHarvestChecks(e){return this.drained&&e.isFinalHarvest}storeSupportabilityMetrics(e,t){if(this.blocked)return;let n={name:e};this.events.addMetric(`sm`,e,n,t)}storeEventMetrics(e,t){if(this.blocked)return;let n={name:e};this.events.add([`cm`,e,n,t])}singleChecks(){let{distMethod:n,loaderType:r}=this.agentRef.runtime,{proxy:i,privacy:a}=this.agentRef.init;if(r&&this.storeSupportabilityMetrics(`Generic/LoaderType/${r}/Detected`),n&&this.storeSupportabilityMetrics(`Generic/DistMethod/${n}/Detected`),e?(this.storeSupportabilityMetrics(`Generic/Runtime/Browser/Detected`),this.agentNonce&&this.agentNonce!==``&&this.storeSupportabilityMetrics(`Generic/Runtime/Nonce/Detected`),d(()=>{p().forEach(e=>{this.storeSupportabilityMetrics(`Framework/`+e+`/Detected`)})}),a.cookies_enabled||this.storeSupportabilityMetrics(`Config/SessionTracking/Disabled`)):t?this.storeSupportabilityMetrics(`Generic/Runtime/Worker/Detected`):this.storeSupportabilityMetrics(`Generic/Runtime/Unknown/Detected`),o()&&this.storeSupportabilityMetrics(`Generic/FileProtocol/Detected`),this.obfuscator.obfuscateConfigRules.length>0&&this.storeSupportabilityMetrics(`Generic/Obfuscate/Detected`),i.assets&&this.storeSupportabilityMetrics(`Config/AssetsUrl/Changed`),i.beacon&&this.storeSupportabilityMetrics(`Config/BeaconUrl/Changed`),e&&window.MutationObserver){u(window)&&this.storeSupportabilityMetrics(`Generic/Runtime/IFrame/Detected`);let e=window.document.querySelectorAll(`video`).length;e&&this.storeSupportabilityMetrics(`Generic/VideoElement/Added`,e);let t=window.document.querySelectorAll(`iframe`).length;t&&this.storeSupportabilityMetrics(`Generic/IFrame/Added`,t),new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof HTMLVideoElement&&this.storeSupportabilityMetrics(`Generic/VideoElement/Added`,1),e instanceof HTMLIFrameElement&&this.storeSupportabilityMetrics(`Generic/IFrame/Added`,1)})})}).observe(window.document.body,{childList:!0,subtree:!0})}navigator.webdriver&&this.storeSupportabilityMetrics(`Generic/WebDriver/Detected`),c(`harvest-metadata`,(e={})=>{try{Object.keys(e).forEach(t=>{Object.assign(this.harvestMetadata[t]??={},e[t])})}catch{}},this.featureName,this.ee)}eachSessionChecks(){e&&n(`pageshow`,e=>{e?.persisted&&this.storeSupportabilityMetrics(`Generic/BFCache/PageRestored`)})}};export{D as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,w as t,y as n,z as r}from"./stringify-Dzp3UIiC.js";import{r as i}from"./constants-B39wMiCG.js";import{n as a}from"./drain-Ci6kjtHo.js";import{t as o}from"./feature-base-DCxEqhTo.js";import{a as s,r as c}from"./agent-constants-BslZEhou.js";import{t as l}from"./event-buffer-BNK4YVB0.js";var u=class{constructor(){this.aggregatedData={}}store(e,t,n,r,i){var a=this.#e(e,t,n,i);return a.metrics=d(r,a.metrics),a}merge(e,t,n,r,i,a=!1){var o=this.#e(e,t,r,i);if(a&&(o.params=r),!o.metrics)o.metrics=n;else{var s=o.metrics;s.count+=n.count,Object.keys(n||{}).forEach(e=>{if(e!==`count`){var t=s[e],r=n[e];s[e]=r&&!r.c?f(r.t,t):m(r,s[e])}})}}storeMetric(e,t,n,r){var i=this.#e(e,t,n);return i.stats=f(r,i.stats),i}take(e,t=!0){for(var n={},r=``,i=!1,a=0;a<e.length;a++)r=e[a],n[r]=Object.values(this.aggregatedData[r]||{}),n[r].length&&(i=!0),t&&delete this.aggregatedData[r];return i?n:null}#e(e,t,n,r){this.aggregatedData[e]||(this.aggregatedData[e]={});var i=this.aggregatedData[e][t];return i||(i=this.aggregatedData[e][t]={params:n||{}},r&&(i.custom=r)),i}};function d(e,t){return t||={count:0},t.count+=1,Object.entries(e||{}).forEach(([e,n])=>{t[e]=f(n,t[e])}),t}function f(e,t){return e==null?p(t):t?(t.c||(t=h(t.t)),t.c+=1,t.t+=e,t.sos+=e*e,e>t.max&&(t.max=e),e<t.min&&(t.min=e),t):{t:e}}function p(e){return e?e.c++:e={c:1},e}function m(e,t){return t?(t.c||(t=h(t.t)),t.min=Math.min(e.min,t.min),t.max=Math.max(e.max,t.max),t.t+=e.t,t.sos+=e.sos,t.c+=e.c,t):e}function h(e){return{t:e,min:e,max:e,sos:e*e,c:1}}var g=class{#e=new u;#t={};byteSize(){return 0}isEmpty({aggregatorTypes:e}){return e?e.every(e=>!this.#e.aggregatedData[e]):Object.keys(this.#e.aggregatedData).length===0}add([e,t,n,r,i]){return this.#e.store(e,t,n,r,i),!0}addMetric(e,t,n,r){return this.#e.storeMetric(e,t,n,r),!0}save({aggregatorTypes:e}){let t=e.toString(),n={};e.forEach(e=>n[e]=this.#e.aggregatedData[e]),this.#t[t]=n}get(e){let t=Array.isArray(e)?e:e.aggregatorTypes;return this.#e.take(t,!1)}clear({aggregatorTypes:e}={}){e?e.forEach(e=>delete this.#e.aggregatedData[e]):this.#e.aggregatedData={}}reloadSave({aggregatorTypes:e}){let t=e.toString(),n=this.#t[t];e.forEach(e=>{Object.keys(n[e]||{}).forEach(t=>{let r=n[e][t];this.#e.merge(e,t,r.metrics,r.params,r.custom,!0)})})}clearSave({aggregatorTypes:e}){let t=e.toString();delete this.#t[t]}},_=class extends o{constructor(e,t){super(e,t),this.customAttributesAreSeparate=!1,this.canHarvestEarly=!0,this.isRetrying=!1,this.lastEarlyHarvestAt=void 0,this.harvestOpts={},this.#e(),this.waitForDrain()}#e(){if(!this.events)switch(this.featureName){case t.sessionReplay:break;case t.jserrors:case t.metrics:this.events=this.agentRef.sharedAggregator??=new g;break;default:this.events=new l(c,this)}}get supportsRegisteredEntities(){return this.featureName in s&&(s[this.featureName]||this.agentRef.init.feature_flags.includes(`register.`+this.featureName))}get harvestEndpointVersion(){return this.supportsRegisteredEntities&&this.agentRef.runtime.registeredEntities.length?2:1}waitForDrain(){this.ee.on(`drain-`+this.featureName,()=>{this.drained||setTimeout(()=>this.agentRef.runtime.harvester.triggerHarvestFor(this),1),this.drained=!0})}decideEarlyHarvest(){if(!this.canHarvestEarly||this.blocked||this.isRetrying)return;let e=this.events.byteSize()+(this.customAttributesAreSeparate?this.agentRef.runtime.jsAttributesMetadata.bytes:0);if(e>16e3){let t=r();if(e<5e5&&this.lastEarlyHarvestAt!==void 0&&t-this.lastEarlyHarvestAt<500)return;this.lastEarlyHarvestAt=t,this.agentRef.runtime.harvester.triggerHarvestFor(this),this.reportSupportabilityMetric(`${this.featureName}/Harvest/Early/Seen`,e)}}waitForFlags(e=[]){return new Promise((t,r)=>{this.agentRef.runtime?.activatedFeatures?t(i(this.agentRef.runtime.activatedFeatures)):this.ee.on(`rumresp`,(e={})=>{t(i(e))});function i(t){return e.map(e=>((t[e]===void 0||t[e]===null)&&n(71,e),t[e]?t[e]:0))}}).catch(e=>{this.ee.emit(`internal-error`,[e]),this.blocked=!0,this.deregisterDrain()})}drain(){a(this.agentRef,this.featureName)}preHarvestChecks(e){return!this.blocked&&!this.ee.aborted}makeHarvestPayload(e=!1,t={}){if(!this.events||this.events.isEmpty(this.harvestOpts)||this.preHarvestChecks&&!this.preHarvestChecks(t))return;e&&this.events.save(this.harvestOpts);let n=this.events.get(this.harvestOpts);if(!n)return;this.events.clear(this.harvestOpts);let r={body:this.serializer?this.serializer(n):n};return this.queryStringsBuilder&&(r.qs=this.queryStringsBuilder(n)),r}postHarvestCleanup(e={}){this.isRetrying=e.sent&&e.retry,this.isRetrying&&this.events.reloadSave(this.harvestOpts),this.events.clearSave(this.harvestOpts)}reportSupportabilityMetric(n,r){e(i,[n,r],void 0,t.metrics,this.ee)}};export{_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e,j as t,n,u as r,w as i,z as a}from"./stringify-Dzp3UIiC.js";import{t as o}from"./clean-url-PIxP5rIW.js";import{r as s}from"./constants-B39wMiCG.js";import{t as c}from"./obfuscate-DGKOc6ON.js";import{t as l}from"./register-handler-Do-e4XFS.js";import{t as u}from"./constants-CZf-nsH0.js";import{t as d}from"./aggregate-base-CCQ66xCP.js";import{a as f,c as p,n as m,o as h,s as g}from"./payloads-DVvDS7kd.js";import{t as _}from"./events-BqJgC3Et.js";import{r as v}from"./nav-timing-Clx3l32R.js";import{n as y,r as b,t as x}from"./webdriver-detection-CgM1lSqf.js";import{t as S}from"./load-time-CDLVHe97.js";import{a as C,i as w,n as T,o as E,r as D,s as O,t as k}from"./constants-Dx9_fT4n.js";var A=0,j=class{belType;children=[];start;end;callbackEnd=0;callbackDuration=0;nodeId=++A;addChild(e){this.children.push(e)}serialize(){}},M=class extends j{constructor(e,t){super(),this.belType=E.AJAX,this.method=e.method,this.status=e.status,this.domain=e.domain,this.path=e.path,this.txSize=e.requestSize,this.rxSize=e.responseSize,this.requestedWith=e.type===`fetch`?1:``,this.spanId=e.spanId,this.traceId=e.traceId,this.spanTimestamp=e.spanTimestamp,this.gql=e.gql,this.targetAttributes=e.targetAttributes,this[u]=e[u],this.requestBody=e.requestBody,this.requestHeaders=e.requestHeaders,this.requestQuery=e.requestQuery,this.responseBody=e.responseBody,this.responseHeaders=e.responseHeaders,this.start=e.startTime,this.end=e.endTime,t?.latestLongtaskEnd?(this.callbackEnd=Math.max(t.latestLongtaskEnd,this.end),this.callbackDuration=this.callbackEnd-this.end):this.callbackEnd=this.end}serialize(e,t,r){let{addString:a,addStringRaw:o,addStringWithTruncation:c}=m(h,r),l=[],d=[p(this.belType),0,p(this.start-e),p(this.end-this.start),p(this.callbackEnd-this.end),p(this.callbackDuration),o(this.method),p(this.status),a(this.domain),a(this.path),p(this.txSize),p(this.rxSize),this.requestedWith,o(this.nodeId),g(this.spanId,o,!0)+g(this.traceId,o,!0)+g(this.spanTimestamp,p)],_=f({...this.targetAttributes||{},...this.gql||{}},{addKey:o,addVal:a});_.push(...f({[u]:this[u]},{addKey:o,addVal:o}));let v=f({...this.requestBody?{requestBody:this.requestBody}:{},...this.requestHeaders?{requestHeaders:this.requestHeaders}:{},...this.requestQuery?{requestQuery:this.requestQuery}:{},...this.responseBody?{responseBody:this.responseBody}:{},...this.responseHeaders?{responseHeaders:this.responseHeaders}:{}},{addKey:o,addVal:c});v.length&&n(s,[`Ajax/Events/Payload/Bytes-Added`,v.join(`;`).length],void 0,i.metrics,t.ee);let y=[..._,...v];return this.children.forEach(e=>y.push(e.serialize())),d[1]=p(y.length),l.push(d),y.length&&l.push(y.join(`;`)),l.join(`;`)}},N=class extends j{id=r();initialPageURL=e;customName;customAttributes={};customDataByApi={};queueTime;appTime;newRoute;status=T.IP;domTimestamp=0;historyTimestamp=0;createdByApi=!1;keepOpenUntilEndApi=!1;onDone=[];customEnd=0;cancellationTimer;watchLongtaskTimer;constructor(e,n,r,i){super(),this.belType=E.INTERACTION,this.trigger=e,this.start=n,this.oldRoute=r,this.eventSubscription=new Map([[`finished`,[]],[`cancelled`,[]]]),this.forceSave=this.forceIgnore=!1,this.trigger===`api`&&(this.createdByApi=!0),this.newURL=this.oldURL=i||t?.location.href}updateHistory(e,t){this.domTimestamp>0||t&&t!==this.oldURL&&(this.newURL=t,this.historyTimestamp=e||a())}updateDom(e){!this.historyTimestamp||e<this.historyTimestamp||(this.domTimestamp=e||a())}checkHistoryAndDomChange(){return this.historyTimestamp>0&&this.domTimestamp>this.historyTimestamp&&(this.status===T.PF||(this.status=T.PF,clearTimeout(this.cancellationTimer),this.watchLongtaskTimer??=setTimeout(()=>this.done(),O)),!0)}on(e,t){if(!this.eventSubscription.has(e))throw Error(`Cannot subscribe to non pre-defined events.`);if(typeof t!=`function`)throw Error(`Must supply function as callback.`);this.eventSubscription.get(e).push(t)}done(e=this.customEnd,t=!1){return this.keepOpenUntilEndApi&&!t?!1:(this.status===T.FIN||this.status===T.CAN||(clearTimeout(this.cancellationTimer),clearTimeout(this.watchLongtaskTimer),this.onDone.forEach(e=>e(this.customDataByApi)),this.forceIgnore?this.#t():this.status===T.PF?this.#e(e):this.forceSave?this.#e(e||performance.now()):this.#t()),!0)}#e(e){this.end=Math.max(this.domTimestamp,this.historyTimestamp,e),this.status=T.FIN,this.eventSubscription.get(`finished`).forEach(e=>e())}#t(){this.status=T.CAN,this.eventSubscription.get(`cancelled`).forEach(e=>e())}isActiveDuring(e){return this.status===T.IP||this.status===T.PF?this.start<=e:this.status===T.FIN&&this.start<=e&&e<this.end}get firstPaint(){}get firstContentfulPaint(){}get navTiming(){}serialize(e,t,n,r){let i=e===void 0,{addString:a,addStringRaw:s}=m(h,n),c=[],l;l=this.trigger===`initialPageLoad`?w.INITIAL_PAGE_LOAD:this.newURL===this.oldURL?w.UNSPECIFIED:w.ROUTE_CHANGE;let u=[p(this.belType),0,p(this.start-(i?0:e)),p(this.end-this.start),p(0),p(0),s(this.trigger),a(o(this.initialPageURL,!0)),a(o(this.oldURL,!0)),a(o(this.newURL,!0)),a(this.customName),l,g(this.queueTime,p,!0)+g(this.appTime,p,!0)+g(this.oldRoute,a,!0)+g(this.newRoute,a,!0)+s(this.id),s(this.nodeId),g(this.firstPaint,p,!0)+g(this.firstContentfulPaint,p)],d={...t.info.jsAttributes,...this.customAttributes},_=f(d||{},{addKey:s,addVal:a});return t.info.atts&&_.push(`a,`+a(t.info.atts)),this.children.forEach(n=>_.push(n.serialize(i?this.start:e,t,r))),u[1]=p(_.length),c.push(u),_.length&&c.push(_.join(`;`)),this.navTiming?c.push(this.navTiming):c.push(``),c.join(`;`)}},P=class extends N{constructor(e){super(C,0,null),this.queueTime=e.info.queueTime,this.appTime=e.info.applicationTime,this.oldURL=document.referrer||void 0}get firstPaint(){return y.current.value}get firstContentfulPaint(){return b.current.value}get navTiming(){if(!v.length)return;let e=`,`,t=`b`,n=0;return v.slice(1,21).forEach(r=>{r===void 0?(t+=e+`!`,e=``):(t+=e+p(r-n),e=`,`,n=r)}),t}},F=class extends d{static featureName=k;constructor(e,{domObserver:t}){super(e,k),super.customAttributesAreSeparate=!0,this.interactionObfuscator=new c(e,_.BI),this.ajaxObfuscator=new c(e,_.AJAX),this.interactionsToHarvest=this.events,this.domObserver=t,this.initialPageLoadInteraction=new P(e),this.initialPageLoadInteraction.onDone.push(()=>{e.runtime.session?.isNew&&(this.initialPageLoadInteraction.customAttributes.isFirstOfSession=!0),this.initialPageLoadInteraction.customAttributes.webdriverDetected=x,this.initialPageLoadInteraction.forceSave=!0;let t=this.initialPageLoadInteraction;this.events.add(t)}),S.subscribe(({value:e})=>{this.initialPageLoadInteraction.done(e),this.reportSupportabilityMetric(`SoftNav/Interaction/InitialPageLoad/Duration/Ms`,Math.round(e))}),this.latestRouteSetByApi=null,this.interactionInProgress=null,this.latestHistoryUrl=window.location.href,this.harvestOpts.beforeUnload=()=>this.interactionInProgress?.done(),this.waitForFlags([`spa`]).then(([e])=>{e?this.drain():(this.blocked=!0,this.deregisterDrain())}),l(`newUIEvent`,e=>this.startUIInteraction(e.type,Math.floor(e.timeStamp),e.target),this.featureName,this.ee),l(`newURL`,(e,t)=>{this.latestHistoryUrl=t,this.interactionInProgress?.updateHistory(e,t)},this.featureName,this.ee),l(`newDom`,e=>{this.interactionInProgress?.updateDom(e),this.interactionInProgress?.checkHistoryAndDomChange()},this.featureName,this.ee),this.ee.on(`long-task`,e=>{this.interactionInProgress?.watchLongtaskTimer&&(clearTimeout(this.interactionInProgress.watchLongtaskTimer),this.interactionInProgress.customEnd=e.end,this.interactionInProgress.watchLongtaskTimer=setTimeout(()=>this.interactionInProgress.done(),O),this.reportSupportabilityMetric(`SoftNav/Interaction/Extended`))}),this.#n(),l(`ajax`,this.#e.bind(this),this.featureName,this.ee),l(`jserror`,this.#t.bind(this),this.featureName,this.ee)}serializer(e){let t,n=[];for(let r of e)n.push(r.serialize(t,this.agentRef,this.interactionObfuscator,this.ajaxObfuscator)),t===void 0&&(t=Math.floor(r.start));return`bel.7;${n.join(`;`)}`}startUIInteraction(e,t,n){if(this.interactionInProgress?.createdByApi||e===`popstate`&&this.interactionInProgress?.trigger!==`popstate`&&t-this.interactionInProgress?.start<=500||this.interactionInProgress?.done()===!1)return;let r=e===`popstate`?this.latestHistoryUrl:void 0;if(this.interactionInProgress=new N(e,t,this.latestRouteSetByApi,r),e===D[0]){let e=I(n);e&&(this.interactionInProgress.customAttributes.actionText=e)}this.interactionInProgress.cancellationTimer=setTimeout(()=>{this.interactionInProgress.done(),this.reportSupportabilityMetric(`SoftNav/Interaction/TimeOut`)},3e4),this.setClosureHandlers()}setClosureHandlers(){this.interactionInProgress.on(`finished`,()=>{let e=this.interactionInProgress;this.events.add(this.interactionInProgress),this.interactionInProgress=null,this.domObserver.disconnect(),this.reportSupportabilityMetric(`SoftNav/Interaction/${e.newURL===e.oldURL?`Custom`:`RouteChange`}/Duration/Ms`,Math.round(e.end-e.start))}),this.interactionInProgress.on(`cancelled`,()=>{this.interactionInProgress=null,this.domObserver.disconnect()})}getInteractionFor(e){if(this.interactionInProgress?.isActiveDuring(e))return this.interactionInProgress;let t,n=this.interactionsToHarvest.get();if(n){for(let r=n.length-1;r>=0;r--){let i=n[r];if(i.isActiveDuring(e)){if(i.trigger!==`initialPageLoad`)return i;t=i}}if(t)return t;if(this.initialPageLoadInteraction?.isActiveDuring(e))return this.initialPageLoadInteraction}}#e(e,t){let r=this.getInteractionFor(e.startTime);r?r.status===T.FIN?a.call(this,e,t,r):(r.on(`finished`,()=>a.call(this,e,t,r)),r.on(`cancelled`,()=>n(`returnAjax`,[e],void 0,i.ajax,this.ee))):n(`returnAjax`,[e],void 0,i.ajax,this.ee);function a(e,t,r){let a=r.end;if(e.startTime>a){n(`returnAjax`,[e],void 0,i.ajax,this.ee);return}let o=new M(e,t);r.addChild(o)}}#t(e){let t=e[3].time,r=this.getInteractionFor(t);if(!r)return n(`returnJserror`,[e],void 0,i.jserrors,this.ee);r.status===T.FIN?a.call(this,e,r):(r.on(`finished`,()=>a.call(this,e,r)),r.on(`cancelled`,()=>n(`returnJserror`,[e],void 0,i.jserrors,this.ee)));function a(e,r){let a=r.end;if(t>a)return n(`returnJserror`,[e],void 0,i.jserrors,this.ee);let o=e[2];o.browserInteractionId=r.id,n(`returnJserror`,[e,r.customAttributes],void 0,i.jserrors,this.ee)}}#n(){let e=this;l(`api-ixn-get`,function(t,{waitForEnd:n,targetPageLoad:r}={}){r?this.associatedInteraction=e.initialPageLoadInteraction:(this.associatedInteraction=e.getInteractionFor(t),this.associatedInteraction?.trigger===`initialPageLoad`&&(this.associatedInteraction=null),this.associatedInteraction||(this.associatedInteraction=e.interactionInProgress=new N(`api`,Math.floor(t),e.latestRouteSetByApi),e.domObserver.observe(document.body,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e.setClosureHandlers())),n===!0&&(this.associatedInteraction.keepOpenUntilEndApi=!0,clearTimeout(this.associatedInteraction.cancellationTimer))},e.featureName,e.ee),l(`api-ixn-end`,function(e){this.associatedInteraction.done(e,!0)},e.featureName,e.ee),l(`api-ixn-save`,function(){this.associatedInteraction.forceSave=!0},e.featureName,e.ee),l(`api-ixn-ignore`,function(){this.associatedInteraction.forceIgnore=!0},e.featureName,e.ee),l(`api-ixn-getContext`,function(e,t){typeof t==`function`&&setTimeout(()=>t(this.associatedInteraction.customDataByApi),0)},e.featureName,e.ee),l(`api-ixn-onEnd`,function(e,t){typeof t==`function`&&this.associatedInteraction.onDone.push(t)},e.featureName,e.ee),l(`api-ixn-actionText`,function(e,t){t&&(this.associatedInteraction.customAttributes.actionText=t)},e.featureName,e.ee),l(`api-ixn-setName`,function(e,t,n){t&&(this.associatedInteraction.customName=t),n&&(this.associatedInteraction.trigger=n)},e.featureName,e.ee),l(`api-ixn-setAttribute`,function(e,t,n){this.associatedInteraction.customAttributes[t]=n},e.featureName,e.ee),l(`api-ixn-routeName`,function(t,n){e.latestRouteSetByApi=n,e.interactionInProgress&&(e.interactionInProgress.newRoute=n)},e.featureName,e.ee)}};function I(e){let t=e.tagName?.toLowerCase();if([`a`,`button`,`input`].includes(t))return e.title||e.value||e.innerText}export{F as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,F as t,R as n,j as r,t as i}from"./stringify-Dzp3UIiC.js";import{t as a}from"./obfuscate-DGKOc6ON.js";import{t as o}from"./aggregate-base-CCQ66xCP.js";import{t as s}from"./events-BqJgC3Et.js";import{n as c,t as l}from"./nav-timing-Clx3l32R.js";import{t as u}from"./constants-CMEXhPvr.js";import{n as d,t as f}from"./time-to-first-byte-DrD5gGoY.js";import{n as p,r as m,t as h}from"./webdriver-detection-CgM1lSqf.js";var g=class extends o{static featureName=u;#e=0;#t=0;#n=0;#r;constructor(e){super(e,u),this.#r=new a(e,s.PVE),t&&f.subscribe(({value:e,attrs:t})=>{let n=t.navigationEntry;this.#e=Math.max(e,this.#e),this.#t=Math.max(Math.round(n.loadEventEnd-this.#e),this.#t),this.#n=Math.max(Math.round(n.domContentLoadedEventEnd-this.#e),this.#n)}),this.waitForFlags([]).then(()=>{let t=this.#r.traverseAndObfuscateEvents({ja:{...e.info.jsAttributes,webdriverDetected:h}});this.events.add(t),this.drain()})}queryStringsBuilder(){let t=this.agentRef.info,a={};t.queueTime&&(a.qt=t.queueTime),t.applicationTime&&(a.ap=t.applicationTime),a.be=this.#e,a.fe=this.#t,a.dc=this.#n;let o={at:t.atts,af:d(this.agentRef).join(`,`),igp:this.agentRef.runtime.appMetadata.igp,...a,fp:p.current.value,fcp:m.current.value};if(r.performance){let t=e();if(t){let e={timing:c(n,t,{}),navigation:l(t,{})};o.perf=i(e)}else if(typeof PerformanceTiming<`u`){let e={timing:c(n,r.performance.timing,{},!0),navigation:l(r.performance.navigation,{})};o.perf=i(e)}}let{correctedOriginTime:s}=this.agentRef.runtime.timeKeeper;return s&&(o.timestamp=s),o}get harvestEndpointVersion(){return 2}serializer(e){return e[0]}};export{g as Aggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Uint8Array,t=Uint16Array,n=Int32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(e,r){for(var i=new t(31),a=0;a<31;++a)i[a]=r+=1<<e[a-1];for(var o=new n(i[30]),a=1;a<30;++a)for(var s=i[a];s<i[a+1];++s)o[s]=s-i[a]<<5|a;return{b:i,r:o}},s=o(r,2),c=s.b,l=s.r;c[28]=258,l[258]=28;var u=o(i,0);u.b;for(var d=u.r,f=new t(32768),p=0;p<32768;++p){var m=(p&43690)>>1|(p&21845)<<1;m=(m&52428)>>2|(m&13107)<<2,m=(m&61680)>>4|(m&3855)<<4,f[p]=((m&65280)>>8|(m&255)<<8)>>1}for(var h=(function(e,n,r){for(var i=e.length,a=0,o=new t(n);a<i;++a)e[a]&&++o[e[a]-1];var s=new t(n);for(a=1;a<n;++a)s[a]=s[a-1]+o[a-1]<<1;var c;if(r){c=new t(1<<n);var l=15-n;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],d=n-e[a],p=s[e[a]-1]++<<d,m=p|(1<<d)-1;p<=m;++p)c[f[p]>>l]=u}else for(c=new t(i),a=0;a<i;++a)e[a]&&(c[a]=f[s[e[a]-1]++]>>15-e[a]);return c}),g=new e(288),p=0;p<144;++p)g[p]=8;for(var p=144;p<256;++p)g[p]=9;for(var p=256;p<280;++p)g[p]=7;for(var p=280;p<288;++p)g[p]=8;for(var _=new e(32),p=0;p<32;++p)_[p]=5;var v=h(g,9,0),ee=h(_,5,0),y=function(e){return(e+7)/8|0},b=function(t,n,r){return(n==null||n<0)&&(n=0),(r==null||r>t.length)&&(r=t.length),new e(t.subarray(n,r))},x=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},S=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},C=function(n,r){for(var i=[],a=0;a<n.length;++a)n[a]&&i.push({s:a,f:n[a]});var o=i.length,s=i.slice();if(!o)return{t:k,l:0};if(o==1){var c=new e(i[0].s+1);return c[i[0].s]=1,{t:c,l:1}}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var l=i[0],u=i[1],d=0,f=1,p=2;for(i[0]={s:-1,f:l.f+u.f,l,r:u};f!=o-1;)l=i[i[d].f<i[p].f?d++:p++],u=i[d!=f&&i[d].f<i[p].f?d++:p++],i[f++]={s:-1,f:l.f+u.f,l,r:u};for(var m=s[0].s,a=1;a<o;++a)s[a].s>m&&(m=s[a].s);var h=new t(m+1),g=w(i[f-1],h,0);if(g>r){var a=0,_=0,v=g-r,ee=1<<v;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});a<o;++a){var y=s[a].s;if(h[y]>r)_+=ee-(1<<g-h[y]),h[y]=r;else break}for(_>>=v;_>0;){var b=s[a].s;h[b]<r?_-=1<<r-h[b]++-1:++a}for(;a>=0&&_;--a){var x=s[a].s;h[x]==r&&(--h[x],++_)}g=r}return{t:new e(h),l:g}},w=function(e,t,n){return e.s==-1?Math.max(w(e.l,t,n+1),w(e.r,t,n+1)):t[e.s]=n},T=function(e){for(var n=e.length;n&&!e[--n];);for(var r=new t(++n),i=0,a=e[0],o=1,s=function(e){r[i++]=e},c=1;c<=n;++c)if(e[c]==a&&c!=n)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[c]}return{c:r.subarray(0,i),n}},E=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},te=function(e,t,n){var r=n.length,i=y(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},D=function(e,n,o,s,c,l,u,d,f,p,m){x(n,m++,o),++c[256];for(var y=C(c,15),b=y.t,w=y.l,D=C(l,15),O=D.t,k=D.l,A=T(b),j=A.c,M=A.n,N=T(O),P=N.c,F=N.n,I=new t(19),L=0;L<j.length;++L)++I[j[L]&31];for(var L=0;L<P.length;++L)++I[P[L]&31];for(var R=C(I,7),z=R.t,B=R.l,V=19;V>4&&!z[a[V-1]];--V);var H=p+5<<3,U=E(c,g)+E(l,_)+u,W=E(c,b)+E(l,O)+u+14+3*V+E(I,z)+2*I[16]+3*I[17]+7*I[18];if(f>=0&&H<=U&&H<=W)return te(n,m,e.subarray(f,f+p));var G,K,q,J;if(x(n,m,1+(W<U)),m+=2,W<U){G=h(b,w,0),K=b,q=h(O,k,0),J=O;var ne=h(z,B,0);x(n,m,M-257),x(n,m+5,F-1),x(n,m+10,V-4),m+=14;for(var L=0;L<V;++L)x(n,m+3*L,z[a[L]]);m+=3*V;for(var re=[j,P],Y=0;Y<2;++Y)for(var X=re[Y],L=0;L<X.length;++L){var Z=X[L]&31;x(n,m,ne[Z]),m+=z[Z],Z>15&&(x(n,m,X[L]>>5&127),m+=X[L]>>12)}}else G=v,K=g,q=ee,J=_;for(var L=0;L<d;++L){var Q=s[L];if(Q>255){var Z=Q>>18&31;S(n,m,G[Z+257]),m+=K[Z+257],Z>7&&(x(n,m,Q>>23&31),m+=r[Z]);var $=Q&31;S(n,m,q[$]),m+=J[$],$>3&&(S(n,m,Q>>5&8191),m+=i[$])}else S(n,m,G[Q]),m+=K[Q]}return S(n,m,G[256]),m+K[256]},O=new n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),k=new e(0),A=function(a,o,s,c,u,f){var p=f.z||a.length,m=new e(c+p+5*(1+Math.ceil(p/7e3))+u),h=m.subarray(c,m.length-u),g=f.l,_=(f.r||0)&7;if(o){_&&(h[0]=f.r>>3);for(var v=O[o-1],ee=v>>13,x=v&8191,S=(1<<s)-1,C=f.p||new t(32768),w=f.h||new t(S+1),T=Math.ceil(s/3),E=2*T,k=function(e){return(a[e]^a[e+1]<<T^a[e+2]<<E)&S},A=new n(25e3),j=new t(288),M=new t(32),N=0,P=0,F=f.i||0,I=0,L=f.w||0,R=0;F+2<p;++F){var z=k(F),B=F&32767,V=w[z];if(C[B]=V,w[z]=B,L<=F){var H=p-F;if((N>7e3||I>24576)&&(H>423||!g)){_=D(a,h,0,A,j,M,P,I,R,F-R,_),I=N=P=0,R=F;for(var U=0;U<286;++U)j[U]=0;for(var U=0;U<30;++U)M[U]=0}var W=2,G=0,K=x,q=B-V&32767;if(H>2&&z==k(F-q))for(var J=Math.min(ee,H)-1,ne=Math.min(32767,F),re=Math.min(258,H);q<=ne&&--K&&B!=V;){if(a[F+W]==a[F+W-q]){for(var Y=0;Y<re&&a[F+Y]==a[F+Y-q];++Y);if(Y>W){if(W=Y,G=q,Y>J)break;for(var X=Math.min(q,Y-2),Z=0,U=0;U<X;++U){var Q=F-q+U&32767,$=Q-C[Q]&32767;$>Z&&(Z=$,V=Q)}}}B=V,V=C[B],q+=B-V&32767}if(G){A[I++]=268435456|l[W]<<18|d[G];var ie=l[W]&31,ae=d[G]&31;P+=r[ie]+i[ae],++j[257+ie],++M[ae],L=F+W,++N}else A[I++]=a[F],++j[a[F]]}}for(F=Math.max(F,L);F<p;++F)A[I++]=a[F],++j[a[F]];_=D(a,h,g,A,j,M,P,I,R,F-R,_),g||(f.r=_&7|h[_/8|0]<<3,_-=7,f.h=w,f.p=C,f.i=F,f.w=L)}else{for(var F=f.w||0;F<p+g;F+=65535){var oe=F+65535;oe>=p&&(h[_/8|0]=g,oe=p),_=te(h,_+1,a.subarray(F,oe))}f.i=p}return b(m,0,c+y(_)+u)},j=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),M=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=j[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},N=function(t,n,r,i,a){if(!a&&(a={l:1},n.dictionary)){var o=n.dictionary.subarray(-32768),s=new e(o.length+t.length);s.set(o),s.set(t,o.length),t=s,a.w=o.length}return A(t,n.level==null?6:n.level,n.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+n.mem,r,i,a)},P=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},F=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&P(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},I=function(e){return 10+(e.filename?e.filename.length+1:0)};function L(e,t){t||={};var n=M(),r=e.length;n.p(e);var i=N(e,t,I(t),8),a=i.length;return F(i,t),P(i,a-8,n.d()),P(i,a-4,r),i}var R=typeof TextEncoder<`u`&&new TextEncoder,z=typeof TextDecoder<`u`&&new TextDecoder;try{z.decode(k,{stream:!0})}catch{}function B(t,n){if(n){for(var r=new e(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}if(R)return R.encode(t);for(var a=t.length,o=new e(t.length+(t.length>>1)),s=0,c=function(e){o[s++]=e},i=0;i<a;++i){if(s+5>o.length){var l=new e(s+8+(a-i<<1));l.set(o),o=l}var u=t.charCodeAt(i);u<128||n?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|t.charCodeAt(++i)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return b(o,0,s)}export{L as compressSync,L as gzipSync,B as strToU8};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=/([^?#]*)[^#]*(#[^?]*|$).*/,t=/([^?#]*)().*/;function n(n,r){return n&&n.replace(r?e:t,`$1$2`)}export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,S as t,T as n,n as r,w as i,y as a,z as o}from"./stringify-Dzp3UIiC.js";import{r as s}from"./env.npm-BosvNi0g.js";import{t as c}from"./send-DAQlgypB.js";import{r as l}from"./constants-B39wMiCG.js";import{n as u,t as d}from"./feature-flags-C-2g43g2.js";var f=3,p=3e3,m=class{#e;#t;#n=0;constructor(t){if(t.init.feature_flags.includes(`rum_v2`)){if(this.#e=t,t.runtime.timeKeeper=new u(t.runtime.session),e){let e=t.runtime.session&&t.runtime.session.state.cachedRumResponse;if(e){let{app:t,...n}=e;this.#r({app:t,config:n});return}}this.makeConnectRequest()}}makeConnectRequest(e){return this.#t=o(),c(this.#e,{endpoint:`browser/connect/2/${this.#e.info.licenseKey}`,payload:{body:{},qs:{a:this.#e.info.applicationID,v:s,s:this.#e.runtime.session?.state.value||`0`}},localOpts:{sendEmptyBody:!0,headers:e},raw:!0,featureName:t,cbFinished:this.#i.bind(this)})}#r({app:e,config:t}){Object.keys(this.#e.runtime.appMetadata).length||(this.#e.runtime.appMetadata=e),d(t,this.#e)}#i({sent:e,status:t,retry:s,xhr:u,responseText:d}){let m=o(),h=this.#e.runtime.session;if(h){let e=h.state.cachedRumResponse;if(e){r(l,[`Session/RaceCondition/Seen`],void 0,i.metrics,this.#e.ee),this.#e.runtime.timeKeeper.processStoredDiff();let{app:t,...n}=e;this.#r({app:t,config:n});return}}if(e&&s&&++this.#n<f){let e=Math.floor(Math.random()*p*2**(this.#n-1)),n=[{key:`X-Retry-Count`,value:this.#n},{key:`X-Previous-Status`,value:t}];setTimeout(()=>this.makeConnectRequest(n),e);return}if(t>=400||t===0){a(18,t);let e=new TextEncoder,r=Object.values(newrelic.ee.backlog).reduce((t,n)=>n?t+e.encode(n).byteLength:t,0),o=`BCS/Error/`,s=[{params:{name:o+t},stats:{c:1}},{params:{name:o+`Duration/Ms`},stats:{c:1,t:m-this.#t}},{params:{name:o+`Dropped/Bytes`},stats:{c:1,t:r}}];c(this.#e,{endpoint:n[i.metrics],payload:{body:{sm:s}},featureName:i.metrics}),this.#e.ee.abort();return}let g;try{g=JSON.parse(d)}catch(e){a(53,e),this.#e.ee.abort();return}h&&h.write({cachedRumResponse:{app:g.app,...g.config}});try{let e=this.#e.runtime.timeKeeper.ready;if(this.#e.runtime.timeKeeper.processRumRequest(u,this.#t,m,g.app.nrServerTime),!this.#e.runtime.timeKeeper.ready)throw Error(`TimeKeeper not ready`);let t=this.#e.runtime.timeKeeper.correctedOriginTime-g.app.nrServerTime;e&&t>0&&r(l,[`Generic/TimeKeeper/InvalidTimestamp/Seen`,t],void 0,i.metrics,this.#e.ee)}catch(e){a(17,e),this.#e.ee.abort();return}this.#r(g)}};export{m as Connector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=e.metrics,n=`storeSupportabilityMetrics`,r=`storeEventMetrics`;export{t as n,n as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=e.jserrors;export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`api-`,t=`api-ixn-`,n=`addPageAction`,r=`addToTrace`,i=`addRelease`,a=`finished`,o=`interaction`,s=`noticeError`,c=`pauseReplay`,l=`recordCustomEvent`,u=`recordReplay`,d=`register`,f=`setApplicationVersion`,p=`setCurrentRouteName`,m=`setCustomAttribute`,h=`setErrorHandler`,g=`setPageViewName`,_=`setUserId`,v=`start`,y=`wrapLogger`,b=`measure`,x=`consent`;export{t as S,g as _,a,y as b,s as c,u as d,d as f,h as g,m as h,x as i,c as l,p as m,i as n,o,f as p,r,b as s,n as t,l as u,_ as v,e as x,v as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=e.pageViewTiming;export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";import{r as t}from"./constants-CdX3b0L1.js";var n=e.sessionReplay,r=`errorDuringReplay`,i=.12,a={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5},o={[t.ERROR]:15e3,[t.FULL]:3e5,[t.OFF]:0},s={RESET:{message:`Session was reset`,sm:`Reset`},IMPORT:{message:`Recorder failed to import`,sm:`Import`},TOO_MANY:{message:`429: Too Many Requests`,sm:`Too-Many`},TOO_BIG:{message:`Payload was too large`,sm:`Too-Big`},CROSS_TAB:{message:`Session Entity was set to OFF on another tab`,sm:`Cross-Tab`},ENTITLEMENTS:{message:`Session Replay is not allowed and will not be started`,sm:`Entitlement`}},c=5e3,l={API:`api`,RESUME:`resume`,SWITCH_TO_FULL:`switchToFull`,INITIALIZE:`initialize`,PRELOAD:`preload`};export{n as a,l as c,r as i,i as n,c as o,o as r,a as s,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=e.pageViewEvent;export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=e.ajax,n={NONE:`none`,FAILURES:`failures`,ALL:`all`},r=`ajaxRequest.id`;export{n,t as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`NRBA_SESSION::`,t=144e5,n=18e5,r={STARTED:`session-started`,PAUSE:`session-pause`,RESET:`session-reset`,RESUME:`session-resume`,UPDATE:`session-update`},i={SAME_TAB:`same-tab`,CROSS_TAB:`cross-tab`},a={OFF:0,FULL:1,ERROR:2};export{i as a,r as i,n,e as o,a as r,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";import{t}from"./events-BqJgC3Et.js";var n=e.genericEvents,r=[`auxclick`,`click`,`copy`,`keydown`,`paste`,`scrollend`],i=[`focus`,`blur`],a=1e3,o=2e3,s=[t.PA,t.UA,t.BP],c={RESOURCES:`experimental.resources`,REGISTER:`register`};export{i as a,r as i,n,a as o,o as r,s,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e}from"./stringify-Dzp3UIiC.js";var t=[`click`,`keydown`,`submit`],n=`popstate`,r=`initialPageLoad`,i=e.softNav,a=5e3,o={INITIAL_PAGE_LOAD:``,ROUTE_CHANGE:1,UNSPECIFIED:2},s={INTERACTION:1,AJAX:2,CUSTOM_END:3,CUSTOM_TRACER:4},c={IP:`in progress`,PF:`pending finish`,FIN:`finished`,CAN:`cancelled`};export{r as a,n as c,o as i,c as n,s as o,t as r,a as s,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[];function t(t){if(!t||n(t))return!1;if(e.length===0)return!0;if(e[0].hostname===`*`)return!1;for(var r=0;r<e.length;r++){var i=e[r];if(i.hostname.test(t.hostname)&&i.pathname.test(t.pathname))return!1}return!0}function n(e){return e.hostname===void 0}function r(t){if(e=[],t&&t.length)for(var n=0;n<t.length;n++){let r=t[n];if(!r)continue;if(r===`*`){e=[{hostname:`*`}];return}r.indexOf(`http://`)===0?r=r.substring(7):r.indexOf(`https://`)===0&&(r=r.substring(8));let a=r.indexOf(`/`),o,s;a>0?(o=r.substring(0,a),s=r.substring(a)):(o=r,s=`*`);let[c]=o.split(`:`);e.push({hostname:i(c),pathname:i(s,!0)})}}function i(e,t=!1){let n=e.replace(/[.+?^${}()|[\]\\]/g,e=>`\\`+e).replace(/\*/g,`.*?`);return RegExp((t?`^`:``)+n+`$`)}export{r as n,t as r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,b as t,d as n}from"./stringify-Dzp3UIiC.js";import{t as r}from"./register-handler-Do-e4XFS.js";function i(t,n){if(!t)return;let r={staged:!1,priority:e[n]||0};t.runtime.drainRegistry.get(n)||t.runtime.drainRegistry.set(n,r)}function a(e,t){if(!e)return;let n=e.runtime.drainRegistry;n&&(n.get(t)&&n.delete(t),c(e,t,!1),n.size&&s(e))}function o(e,t=`feature`,n=!1){if(e){if(!e.runtime.drainRegistry.get(t)||n)return c(e,t);e.runtime.drainRegistry.get(t).staged=!0,s(e)}}function s(e){if(!e)return;let t=Array.from(e.runtime.drainRegistry);t.every(([e,t])=>t.staged)&&(t.sort((e,t)=>e[1].priority-t[1].priority),t.forEach(([t])=>{e.runtime.drainRegistry.delete(t),c(e,t)}))}function c(e,i,a=!0){if(!e)return;let o=e.ee,s=r.handlers;if(o&&!o.aborted&&o.backlog&&s){if(t({type:`lifecycle`,name:`drain`,feature:i}),a){let e=o.backlog[i],t=s[i];if(t){for(let n=0;e&&n<e.length;++n)l(e[n],t);Object.entries(t).forEach(([e,t])=>{Object.values(t||{}).forEach(t=>{t[0]?.on&&t[0].context()instanceof n&&!t[0].listeners(e).includes(t[1])&&t[0].on(e,t[1])})})}}o.isolatedBacklog||delete s[i],o.backlog[i]=null,o.emit(`drain-`+i,[])}}function l(e,t){var n=e[1];Object.values(t[n]||{}).forEach(t=>{var n=e[0];if(t[0]===n){var r=t[1],i=e[3],a=e[2];r.apply(i,a)}})}export{o as n,i as r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./stringify-Dzp3UIiC.js";var t={"%2C":`,`,"%3A":`:`,"%2F":`/`,"%40":`@`,"%24":`$`,"%3B":`;`},n=Object.keys(t),r=new RegExp(n.join(`|`),`g`);function i(e){return t[e]}function a(e){return e==null?`null`:encodeURIComponent(e).replace(r,i)}function o(t,n){var r=0,i=``;return Object.entries(t||{}).forEach(([t,o])=>{var s=[],c,l;if(typeof o==`string`||!Array.isArray(o)&&o!=null&&o.toString().length)c=`&`+t+`=`+a(o),r+=c.length,i+=c;else if(Array.isArray(o)&&o.length){for(r+=9,l=0;l<o.length&&(c=a(e(o[l])),r+=c.length,!(n!==void 0&&r>=n));l++)s.push(c);i+=`&`+t+`=%5B`+s.join(`,`)+`%5D`}}),i}function s(e,t,n={}){return Object.keys(n).includes(e)?``:t&&typeof t==`string`?`&`+e+`=`+a(t):``}export{s as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`1.324.0`,t=`@newrelic/rrweb`,n=`^1.1.2`;export{n,e as r,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./stringify-Dzp3UIiC.js";import{r as t}from"./agent-constants-BslZEhou.js";var n=class{#e=[];#t=0;#n;#r;constructor(e=t,n){this.maxPayloadSize=e,this.featureAgg=n}get length(){return this.#e.length}isEmpty(){return this.#e.length===0}get(){return this.#e}byteSize(){return this.#t}wouldExceedMaxSize(e){return this.#t+e>this.maxPayloadSize}add(t,n){let r=n||e(t)?.length||0;if(this.#t+r>this.maxPayloadSize){let e=e=>`EventBuffer/${e}/Dropped/Bytes`;return this.featureAgg?.reportSupportabilityMetric(e(this.featureAgg.featureName),r),this.featureAgg?.reportSupportabilityMetric(e(`Combined`),r),!1}return this.#e.push(t),this.#t+=r,this.featureAgg?.decideEarlyHarvest(),!0}merge(e,t){if(this.isEmpty()||!e)return!1;let n=this.#e.findIndex(e);return n<0?!1:(this.#e[n]={...this.#e[n],...t},!0)}clear(t={}){this.#e=t.clearBeforeTime!==void 0&&t.timestampKey?this.#e.filter(e=>e[t.timestampKey]>=t.clearBeforeTime):t.clearBeforeIndex===void 0?[]:this.#e.slice(t.clearBeforeIndex),this.#t=this.#e.length&&e(this.#e)?.length||0}save(){this.#n=this.#e,this.#r=this.#t}clearSave(){this.#n=void 0,this.#r=void 0}reloadSave(){this.#n&&(this.#r+this.#t>this.maxPayloadSize||(this.#e=[...this.#n,...this.#e],this.#t=this.#r+this.#t))}};export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){return{capture:e,passive:!1,signal:t}}function t(t,n,r=!1,i){window.addEventListener(t,n,e(r,i))}function n(t,n,r=!1,i){document.addEventListener(t,n,e(r,i))}export{e as n,t as r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){let r=`unknown`;if(e&&e instanceof XMLHttpRequest){let t=n.context(e).params;if(!t||!t.status||!t.method||!t.host||!t.pathname)return`xhrOriginMissing`;r=t.status+` `+t.method+`: `+t.host+t.pathname}else if(e&&typeof e.tagName==`string`&&(r=e.tagName.toLowerCase(),e.id&&(r+=`#`+e.id),e.className))for(let t=0;t<e.classList.length;t++)r+=`.`+e.classList[t];return r===`unknown`&&(typeof t==`string`?r=t:t===document?r=`document`:t===window?r=`window`:t instanceof FileReader&&(r=`FileReader`)),r}export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={AJAX:`AjaxRequest`,PA:`PageAction`,UA:`UserAction`,BP:`BrowserPerformance`,WS:`WebSocket`,SPV:`SecurityPolicyViolation`,JSE:`JavaScriptError`,LOG:`Log`,PVE:`PageView`,PVT:`PageViewTiming`,SR:`SessionReplay`,ST:`SessionTrace`,BI:`BrowserInteraction`};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./drain-Ci6kjtHo.js";var t=class{constructor(e,t){this.agentRef=e,this.ee=e?.ee,this.featureName=t,this.blocked=!1}deregisterDrain(){e(this.agentRef,this.featureName)}};export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as e,b as t,n,v as r,w as i}from"./stringify-Dzp3UIiC.js";import{r as a}from"./constants-B39wMiCG.js";var o=class{#e;#t;#n;#r=!1;#i=0;constructor(e){this.#e=e,this.processStoredDiff(),r(performance.now,Date.now)}#a(){try{let t=Date.now()-e-performance.now();t>1e3&&t-this.#i>1e3&&(this.#i=t,this.#e&&n(a,[`Generic/TimeKeeper/ClockDrift/Detected`,t],void 0,i.metrics,this.#e.agentRef.ee))}catch{}}get ready(){return this.#r}get correctedOriginTime(){return this.#t}get localTimeDiff(){return this.#n}processRumRequest(t,n,r,i){if(this.processStoredDiff(),this.#r)return;if(!i)throw Error(`nrServerTime not found`);let a=n+(r-n)/2;if(this.#t=Math.floor(i-a),this.#n=e-this.#t,isNaN(this.#t))throw Error(`Failed to correct browser time to server time`);this.#e?.write({serverTimeDiff:this.#n}),this.#r=!0}convertRelativeTimestamp(t){return this.#a(),e+t+this.#i}convertAbsoluteTimestamp(t){return this.#a(),t-e-this.#i}correctAbsoluteTimestamp(e){return this.#a(),e-this.#n}correctRelativeTimestamp(e){return this.#a(),this.correctAbsoluteTimestamp(this.convertRelativeTimestamp(e))}processStoredDiff(){if(this.#r)return;let t=this.#e?.read()?.serverTimeDiff;typeof t==`number`&&!isNaN(t)&&(this.#n=t,this.#t=e-this.#n,this.#r=!0)}};function s(e,n){e&&typeof e==`object`&&!n.runtime.activatedFeatures&&(n.ee.emit(`rumresp`,[e]),n.runtime.activatedFeatures=e,t({loaded:!0,drained:!n.init.feature_flags.includes(`rum_v2`),type:`lifecycle`,name:`load`,feature:void 0,data:e}))}export{o as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./stringify-Dzp3UIiC.js";var t=t=>e&&t?.privacy.cookies_enabled===!0;export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,I as t,T as n,j as r,n as i,w as a}from"./stringify-Dzp3UIiC.js";import{n as o,r as s,t as c}from"./send-DAQlgypB.js";import{r as l}from"./constants-B39wMiCG.js";import{n as u}from"./page-visibility-CPUGlMvF.js";import{t as d}from"./obfuscate-DGKOc6ON.js";if(t){r.cleanupTasks=[];let e=r.close;r.close=()=>{for(let e of r.cleanupTasks)e();e()}}function f(n){e?u(n,!0):t&&r.cleanupTasks.push(n)}var p=`Harvester/Retry/`,m=p+`Attempted/`,h=p+`Failed/`,g=p+`Succeeded/`,_=class{#e=!1;initializedAggregates=[];constructor(e){this.agentRef=e,this.obfuscator=new d(e)}startTimer(e=this.agentRef.init.harvest.interval){if(this.#e)return;this.#e=!0,f(()=>{this.initializedAggregates.forEach(e=>{typeof e.harvestOpts.beforeUnload==`function`&&e.harvestOpts.beforeUnload()}),this.initializedAggregates.forEach(e=>this.triggerHarvestFor(e,{isFinalHarvest:!0}))});let t=()=>{this.initializedAggregates.forEach(e=>this.triggerHarvestFor(e)),setTimeout(t,e*1e3)};setTimeout(t,e*1e3)}triggerHarvestFor(e,t={}){let r={ranSend:!1,payload:void 0,endpointVersion:e.harvestEndpointVersion||1};if(e.blocked||this.agentRef.init?.browser_consent_mode?.enabled&&!this.agentRef.runtime.consented)return r;let u=o(t);if(!u)return r;let d=!t.isFinalHarvest&&u===s;return r.payload=e.makeHarvestPayload(d,t),r.payload&&(c(this.agentRef,{endpoint:n[e.featureName],payload:r.payload,localOpts:t,submitMethod:u,harvesterObfuscator:this.obfuscator,cbFinished:f,raw:e.harvestOpts.raw,featureName:e.featureName,endpointVersion:r.endpointVersion}),r.ranSend=!0),r;function f(n){if(e.harvestOpts.prevAttemptCode){let t=t=>i(l,[t],void 0,a.metrics,e.ee);t(m+e.featureName),t((n.retry?h:g)+e.harvestOpts.prevAttemptCode),delete e.harvestOpts.prevAttemptCode}n.retry&&(e.harvestOpts.prevAttemptCode=n.status),t.forceNoRetry&&(n.retry=!1),e.postHarvestCleanup(n)}}};export{_ as Harvester};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e?e.self!==e.top:!1}export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`newrelic-iframe-`,t=e+`timing-update`,n=e+`api`,r=e+`api-response`,i=e+`vitals-update`,a=e+`ajax`;export{i as a,t as i,n,e as o,r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,n as t,t as n,w as r,y as i}from"./stringify-Dzp3UIiC.js";import{t as a}from"./register-handler-Do-e4XFS.js";import{n as o}from"./drain-Ci6kjtHo.js";import{n as s}from"./utils-HjH2zvlh.js";import{f as c}from"./constants-BR-VOpyY.js";import{a as l,i as u,n as d,r as f,t as p}from"./iframe-constants-C6xKQhrH.js";function m(e,t){try{let{iframeInterfaceId:n}=e.data;if(!n)return;let r=s(n,t);return y(e,r)?r:void 0}catch{}}function h(e,t){return t in e&&typeof t==`string`&&![`__proto__`,`constructor`,`prototype`].includes(t)}function g(e,t){let n=m(e,t);n&&n.metadata.timings&&e.data.entries?.forEach(({property:e,value:t})=>{h(n.metadata.timings,e)&&(n.metadata.timings[e]=t)})}function _(e,t){let n=m(e,t);n&&n.metadata?.vitals&&e.data.entries?.forEach(({property:e,value:t})=>{h(n.metadata.vitals,e)&&(Number(t)||t===0)&&(n.metadata.vitals[e].value=t)})}function v(e,n){let i=m(e,n);if(!i)return;let{entries:a}=e.data;a?.forEach(({params:e,metrics:a,start:o,end:s,initiatorType:c})=>{t(`xhr`,[e,a,o,s,c,i.metadata.target],void 0,r.ajax,n.ee)})}function y(e,t){if(!t)return!1;try{return e.origin===`null`||t.metadata.target.iframeOrigin===`null`?!1:e.origin===t.metadata.target.iframeOrigin}catch(e){return i(77,e),!1}}async function b(e,t){let{target:n,iframeInterfaceId:r,timestamp:a}=e.data,[{method:o,args:l}={}]=e.data.entries||[],u={entity:null,result:null};if(o===`register`){if(e.origin===`null`)return i(74,e.origin),u;let a=t.init.api.register.iframe_domains;if(a.length&&!a.includes(e.origin))return i(74,e.origin),u;let o=l?.[0]||n||{};if(!t.register)return i(35,c),u;let s={id:o.id,name:o.name,type:o.type,version:o.version,tags:o.tags};return u.entity=t[c](s),u.entity.metadata.target.iframeInterfaceId=r,u.entity.metadata.target.iframeOrigin=e.origin,u}let d=s(r,t);if(!y(e,d))return i(76),u;u.entity=d;let f=d[o];return!h(d,o)||typeof f!=`function`?(i(35,o),u):(d.metadata.events.latestTimestamp=a,u.result=await f.apply(d,l||[]),u)}function x(e){let t=e.metadata;return JSON.parse(n(t))}function S(e,t){e.source.postMessage({type:f,messageId:e.data.messageId,iframeInterfaceId:e.data.iframeInterfaceId,...t},e.origin)}function C(t){e&&window.addEventListener&&!t.runtime.listeningForIframeMessages&&(a(`iframe-message`,async e=>{if(e.data)switch(e.data.type){case u:g(e,t);return;case l:_(e,t);return;case p:v(e,t);return;case d:try{if(!e.source||!e.data.messageId||!e.data.entries?.[0]?.method)return;let{entity:n,result:r}=await b(e,t);S(e,{result:r,metadata:n?x(n):void 0})}catch(t){S(e,{error:t?.message||String(t)})}}},`IFRAME`,t.ee),o(t,`IFRAME`,!0),t.runtime.listeningForIframeMessages=!0)}export{C as setupIframeMFEMessageListener};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monitoring-BrrZzYzN.js","assets/parse-url-BjQzQUGD.js","assets/stringify-Dzp3UIiC.js","assets/preload-helper-DqzGtu2i.js","assets/env.npm-BosvNi0g.js","assets/event-listener-opts-S1G6uDJo.js","assets/clean-url-PIxP5rIW.js","assets/constants-B39wMiCG.js","assets/page-visibility-CPUGlMvF.js","assets/deny-list-DB7HzON3.js","assets/constants-CZf-nsH0.js","assets/drain-Ci6kjtHo.js","assets/register-handler-Do-e4XFS.js","assets/feature-base-DCxEqhTo.js","assets/agent-constants-BslZEhou.js","assets/utils-HjH2zvlh.js","assets/invoke-yXE5uxEq.js","assets/events-BqJgC3Et.js","assets/constants-CvitFm-l.js","assets/constants-BCcBZ5XF.js","assets/constants-CdX3b0L1.js","assets/utils-BCGlS8lK.js","assets/constants-CDnI58H4.js","assets/feature-gates-D617h-o3.js","assets/load-1XXgLaBh.js","assets/constants-CMEXhPvr.js","assets/constants-BWRO9jlX.js","assets/constants-BR-VOpyY.js","assets/utils-ByvlpCaG.js","assets/constants-Dx9_fT4n.js","assets/sharedHandlers-WNAr8J3U.js","assets/iframe-constants-C6xKQhrH.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-DqzGtu2i.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=Object.freeze({__proto__:null,get start(){return He},get ensureJQuerySupport(){return Ce},get setBootstrapMaxTime(){return le},get setMountMaxTime(){return ue},get setUnmountMaxTime(){return de},get setUnloadMaxTime(){return fe},get registerApplication(){return Me},get unregisterApplication(){return Pe},get getMountedApps(){return Oe},get getAppStatus(){return Ae},get unloadApplication(){return Fe},get checkActivityFunctions(){return Ne},get getAppNames(){return ke},get pathToActiveWhen(){return Re},get navigateToUrl(){return V},get patchHistoryApi(){return be},get triggerAppChange(){return ze},get addErrorHandler(){return o},get removeErrorHandler(){return s},get mountRootParcel(){return oe},get NOT_LOADED(){return u},get LOADING_SOURCE_CODE(){return d},get NOT_BOOTSTRAPPED(){return f},get BOOTSTRAPPING(){return p},get NOT_MOUNTED(){return m},get MOUNTING(){return h},get UPDATING(){return _},get LOAD_ERROR(){return b},get MOUNTED(){return g},get UNLOADING(){return y},get UNMOUNTING(){return v},get SKIP_BECAUSE_BROKEN(){return x}}),n=(typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{}).CustomEvent,r=function(){try{var e=new n(`cat`,{detail:{foo:`bar`}});return e.type===`cat`&&e.detail.foo===`bar`}catch{}return!1}()?n:typeof document<`u`&&typeof document.createEvent==`function`?function(e,t){var n=document.createEvent(`CustomEvent`);return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},i=[];function a(e,t,n){let r=l(e,t,n);i.length?i.forEach((e=>e(r))):setTimeout((()=>{throw r}))}function o(e){if(typeof e!=`function`)throw Error(c(28,!1));i.push(e)}function s(e){if(typeof e!=`function`)throw Error(c(29,!1));let t=!1;return i=i.filter((n=>{let r=n===e;return t||=r,!r})),t}function c(e,t,...n){return`single-spa minified message #${e}: ${t?t+` `:``}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join(`&arg=`)}`:``}`}function l(e,t,n){let r=`${E(t)} '${w(t)}' died in status ${t.status}: `,i;if(e instanceof Error){try{e.message=r+e.message}catch{}i=e}else{console.warn(c(30,!1,t.status,w(t)));try{i=Error(r+JSON.stringify(e))}catch{i=e}}return i.appOrParcelName=w(t),t.status=n,i}var u=`NOT_LOADED`,d=`LOADING_SOURCE_CODE`,f=`NOT_BOOTSTRAPPED`,p=`BOOTSTRAPPING`,m=`NOT_MOUNTED`,h=`MOUNTING`,g=`MOUNTED`,_=`UPDATING`,v=`UNMOUNTING`,y=`UNLOADING`,b=`LOAD_ERROR`,x=`SKIP_BECAUSE_BROKEN`;function S(e){return e.status===g}function C(e){try{return e.activeWhen(window.location)}catch(t){return a(t,e,x),!1}}function w(e){return e.name}function T(e){return!!e.unmountThisParcel}function E(e){return T(e)?`parcel`:`application`}function D(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])t!==`__proto__`&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function O(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function k(e){return e&&(typeof e==`function`||(t=e,Array.isArray(t)&&!O(t,(e=>typeof e!=`function`))));var t}function A(e,t){let n=e[t]||[];n=Array.isArray(n)?n:[n],n.length===0&&(n=[()=>Promise.resolve()]);let r=E(e),i=w(e);return function(e){return n.reduce(((n,a,o)=>n.then((()=>{let n=a(e);return ee(n)?n:Promise.reject(c(15,!1,r,i,t,o))}))),Promise.resolve())}}function ee(e){return e&&typeof e.then==`function`&&typeof e.catch==`function`}var te=[];function j(e,t){return Promise.resolve().then((()=>e.status===`NOT_BOOTSTRAPPED`?(e.status=p,e.bootstrap?I(e,`bootstrap`).then(n).catch((n=>{if(t)throw l(n,e,x);return a(n,e,x),e})):Promise.resolve().then(n)):e));function n(){return e.status=m,e}}function M(e,t){return Promise.resolve().then((()=>{if(e.status!==`MOUNTED`)return e;e.status=v;let n=Object.keys(e.parcels).map((t=>e.parcels[t].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{let r=Error(n.message);if(t)throw l(r,e,x);a(r,e,x)})))).then((()=>e));function r(){return I(e,`unmount`).then((()=>{e.status=m}),(n=>{if(t)throw l(n,e,x);a(n,e,x)}))}}))}var ne=!1,re=!1;function N(e,t){return Promise.resolve().then((()=>e.status===`NOT_MOUNTED`?(ne||=(window.dispatchEvent(new r(`single-spa:before-first-mount`)),!0),e.status=h,I(e,`mount`).then((()=>(e.status=g,re||=(window.dispatchEvent(new r(`single-spa:first-mount`)),!0),e))).catch((n=>{return e.status=g,M(e,!0).then(r,r);function r(){if(t)throw l(n,e,x);return a(n,e,x),e}}))):e))}var ie=0,ae={parcels:{}};function oe(){return se.apply(ae,arguments)}function se(e,t){let n=this;if(!e||typeof e!=`object`&&typeof e!=`function`)throw Error(c(2,!1));if(e.name&&typeof e.name!=`string`)throw Error(c(3,!1,typeof e.name));let r=ie++,i=e.name||`parcel-${r}`;if(typeof t!=`object`)throw Error(c(4,!1,i,typeof t));if(!t.domElement)throw Error(c(5,!1,i));let a=typeof e==`function`,o=a?e:()=>Promise.resolve(e),s={id:r,parcels:{},status:a?d:f,customProps:t,parentName:w(n),unmountThisParcel:()=>h.then((()=>{if(s.status!==`MOUNTED`)throw Error(c(6,!1,i,s.status));return M(s,!0)})).then((e=>(s.parentName&&delete n.parcels[s.id],e))).then((e=>(g(e),e))).catch((e=>{throw s.status=x,_(e),e}))},u;n.parcels[r]=s;let p=o();if(!p||typeof p.then!=`function`)throw Error(c(7,!1));p=p.then((e=>{if(!e)throw Error(c(8,!1));if(i=e.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(e,`bootstrap`)&&!k(e.bootstrap))throw Error(c(9,!1,i));if(!k(e.mount))throw Error(c(10,!1,i));if(!k(e.unmount))throw Error(c(11,!1,i));if(e.update&&!k(e.update))throw Error(c(12,!1,i));let t=A(e,`bootstrap`),n=A(e,`mount`),a=A(e,`unmount`);s.status=f,s.name=i,s.bootstrap=t,s.mount=n,s.unmount=a,s.timeouts=pe(e.timeouts),e.update&&(s.update=A(e,`update`),u.update=function(e){return s.customProps=e,P((t=s,Promise.resolve().then((()=>{if(t.status!==`MOUNTED`)throw Error(c(32,!1,w(t)));return t.status=`UPDATING`,I(t,`update`).then((()=>(t.status=`MOUNTED`,t))).catch((e=>{throw l(e,t,`SKIP_BECAUSE_BROKEN`)}))}))));var t})}));let m=p.then((()=>j(s,!0))),h=m.then((()=>N(s,!0))),g,_,v=new Promise(((e,t)=>{g=e,_=t}));return u={mount:()=>P(Promise.resolve().then((()=>{if(s.status!==`NOT_MOUNTED`)throw Error(c(13,!1,i,s.status));return n.parcels[r]=s,N(s)}))),unmount:()=>P(s.unmountThisParcel()),getStatus:()=>s.status,loadPromise:P(p),bootstrapPromise:P(m),mountPromise:P(h),unmountPromise:P(v)},u}function P(e){return e.then((()=>null))}function ce(e){let n=w(e),r=typeof e.customProps==`function`?e.customProps(n,window.location):e.customProps;(typeof r!=`object`||!r||Array.isArray(r))&&(r={},console.warn(c(40,!1),n,r));let i=D({},r,{name:n,mountParcel:se.bind(e),singleSpa:t});return T(e)&&(i.unmountSelf=e.unmountThisParcel),i}var F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function le(e,t,n){if(typeof e!=`number`||e<=0)throw Error(c(16,!1));F.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function ue(e,t,n){if(typeof e!=`number`||e<=0)throw Error(c(17,!1));F.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function de(e,t,n){if(typeof e!=`number`||e<=0)throw Error(c(18,!1));F.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function fe(e,t,n){if(typeof e!=`number`||e<=0)throw Error(c(19,!1));F.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function I(e,t){let n=e.timeouts[t],r=n.warningMillis,i=E(e);return new Promise(((a,o)=>{let s=!1,l=!1;e[t](ce(e)).then((e=>{s=!0,a(e)})).catch((e=>{s=!0,o(e)})),setTimeout((()=>d(1)),r),setTimeout((()=>d(!0)),n.millis);let u=c(31,!1,t,i,w(e),n.millis);function d(e){if(!s){if(!0===e)l=!0,n.dieOnTimeout?o(Error(u)):console.error(u);else if(!l){let t=e,i=t*r;console.warn(u),i+r<n.millis&&setTimeout((()=>d(t+1)),r)}}}}))}function pe(e){let t={};for(let n in F)t[n]=D({},F[n],e&&e[n]||{});return t}function L(e){return Promise.resolve().then((()=>{if(e.loadPromise)return e.loadPromise;if(e.status!==`NOT_LOADED`&&e.status!==`LOAD_ERROR`)return e;let t,n;return e.status=d,e.loadPromise=Promise.resolve().then((()=>{let r=e.loadApp(ce(e));if(!ee(r))throw n=!0,Error(c(33,!1,w(e)));return r.then((n=>{let r;e.loadErrorTime=null,t=n,typeof t!=`object`&&(r=34),Object.prototype.hasOwnProperty.call(t,`bootstrap`)&&!k(t.bootstrap)&&(r=35),k(t.mount)||(r=36),k(t.unmount)||(r=37);let i=E(t);if(r){let n;try{n=JSON.stringify(t)}catch{}return console.error(c(r,!1,i,w(e),n),t),a(void 0,e,x),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=D({},e.devtools.overlays,t.devtools.overlays)),e.status=f,e.bootstrap=A(t,`bootstrap`),e.mount=A(t,`mount`),e.unmount=A(t,`unmount`),e.unload=A(t,`unload`),e.timeouts=pe(t.timeouts),delete e.loadPromise,e}))})).catch((t=>{let r;return delete e.loadPromise,n?r=x:(r=b,e.loadErrorTime=new Date().getTime()),a(t,e,r),e}))}))}var R=typeof window<`u`,z={hashchange:[],popstate:[]},B=[`hashchange`,`popstate`];function V(e){let t;if(typeof e==`string`)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(c(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=xe(window.location.href),r=xe(t);t.indexOf(`#`)===0?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function me(e){if(e){let t=e[0].type;B.indexOf(t)>=0&&z[t].forEach((t=>{try{t.apply(this,e)}catch(e){setTimeout((()=>{throw e}))}}))}}var he;function ge(){Y([],arguments)}function _e(e,t){return function(){let n=window.location.href,r=e.apply(this,arguments),i=window.location.href;return he&&n===i||window.dispatchEvent(ve(window.history.state,t)),r}}function ve(e,t){let n;try{n=new PopStateEvent(`popstate`,{state:e})}catch{n=document.createEvent(`PopStateEvent`),n.initPopStateEvent(`popstate`,!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}var H=null,ye=!1;function be(e){if(ye)throw Error(c(43,!1));he=!e||!e.hasOwnProperty(`urlRerouteOnly`)||e.urlRerouteOnly,ye=!0,H=window.history.replaceState,window.addEventListener(`hashchange`,ge),window.addEventListener(`popstate`,ge);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!(typeof n==`function`&&B.indexOf(e)>=0)||O(z[e],(e=>e===n)))return t.apply(this,arguments);z[e].push(n)},window.removeEventListener=function(e,t){return typeof t==`function`&&B.indexOf(e)>=0&&(z[e]=z[e].filter((e=>e!==t))),n.apply(this,arguments)},window.history.pushState=_e(window.history.pushState,`pushState`),window.history.replaceState=_e(H,`replaceState`)}function xe(e){let t=document.createElement(`a`);return t.href=e,t}R&&(window.singleSpaNavigate?console.warn(c(41,!1)):window.singleSpaNavigate=V);var Se=!1;function Ce(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!Se){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return we.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return we.call(this,n,window.removeEventListener,e,t,arguments)},Se=!0}}function we(e,t,n,r,i){return typeof n==`string`?(n.split(/\s+/).forEach((e=>{B.indexOf(e)>=0&&(t(e,r),n=n.replace(e,``))})),n.trim()===``?this:e.apply(this,i)):e.apply(this,i)}var U={};function W(e){return Promise.resolve().then((()=>{let t=U[w(e)];if(!t)return e;if(e.status===`NOT_LOADED`)return Te(e,t),e;if(e.status===`UNLOADING`)return t.promise.then((()=>e));if(e.status!==`NOT_MOUNTED`&&e.status!==`LOAD_ERROR`)return e;let n=e.status===`LOAD_ERROR`?Promise.resolve():I(e,`unload`);return e.status=y,n.then((()=>(Te(e,t),e))).catch((n=>(function(e,t,n){delete U[w(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,a(n,e,x),t.reject(n)}(e,t,n),e)))}))}function Te(e,t){delete U[w(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=u,t.resolve()}function Ee(e,t,n,r){U[w(e)]={app:e,resolve:n,reject:r},Object.defineProperty(U[w(e)],"promise",{get:t})}function De(e){return U[e]}var G=[];function Oe(){return G.filter(S).map(w)}function ke(){return G.map(w)}function Ae(e){let t=O(G,(t=>w(t)===e));return t?t.status:null}var je=!1;function Me(e,t,n,r){let i=function(e,t,n,r){let i={name:null,loadApp:null,activeWhen:null,customProps:null};return typeof e==`object`?(function(e){if(Array.isArray(e)||e===null)throw Error(c(39,!1));let t=[`name`,`app`,`activeWhen`,`customProps`],n=Object.keys(e).reduce(((e,n)=>t.indexOf(n)>=0?e:e.concat(n)),[]);if(n.length!==0)throw Error(c(38,!1,t.join(`, `),n.join(`, `)));if(typeof e.name!=`string`||e.name.length===0||typeof e.app!=`object`&&typeof e.app!=`function`)throw Error(c(20,!1));let r=e=>typeof e==`string`||typeof e==`function`;if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(c(24,!1));if(!Le(e.customProps))throw Error(c(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if(typeof e!=`string`||e.length===0)throw Error(c(20,!1));if(!t)throw Error(c(23,!1));if(typeof n!=`function`)throw Error(c(24,!1));if(!Le(r))throw Error(c(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp=typeof(a=i.loadApp)==`function`?a:()=>Promise.resolve(a),i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){let t=Array.isArray(e)?e:[e];return t=t.map((e=>typeof e==`function`?e:Re(e))),e=>t.some((t=>t(e)))}(i.activeWhen),i;var a}(e,t,n,r);if(X()||je||(je=!0,setTimeout((()=>{X()||console.warn(c(1,!1))}),5e3)),ke().indexOf(i.name)!==-1)throw Error(c(21,!1,i.name));G.push(D({loadErrorTime:null,status:u,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),R&&(Ce(),Y())}function Ne(e=window.location){return G.filter((t=>t.activeWhen(e))).map(w)}function Pe(e){if(G.filter((t=>w(t)===e)).length===0)throw Error(c(25,!1,e));return(R?Fe(e,{waitForUnmount:!1}):Promise.resolve()).then((()=>{let t=G.map(w).indexOf(e);G.splice(t,1)}))}function Fe(e,t={waitForUnmount:!1}){if(typeof e!=`string`)throw Error(c(26,!1));let n=O(G,(t=>w(t)===e));if(!n)throw Error(c(27,!1,e));let r=De(w(n));if(t&&t.waitForUnmount){if(r)return r.promise;{let e=new Promise(((t,r)=>{Ee(n,(()=>e),t,r)}));return e}}{let e;return r?(e=r.promise,Ie(n,r.resolve,r.reject)):e=new Promise(((t,r)=>{Ee(n,(()=>e),t,r),Ie(n,t,r)})),e}}function Ie(e,t,n){Promise.resolve().then((()=>{if(O(Ne(),(t=>t===w(e))))return ze()})).then((()=>M(e).then(W).then((()=>{t(),setTimeout((()=>{Y()}))})))).catch(n)}function Le(e){return!e||typeof e==`function`||typeof e==`object`&&!!e&&!Array.isArray(e)}function Re(e,t){let n=function(e,t){let n=0,r=!1,i=`^`;e[0]!==`/`&&(e=`/`+e);for(let t=0;t<e.length;t++){let n=e[t];(!r&&n===`:`||r&&n===`/`)&&a(t)}return a(e.length),new RegExp(i,`i`);function a(a){let o=e.slice(n,a).replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`);if(i+=r?`[^/]+/?`:o,a===e.length){if(r)t&&(i+=`$`);else{let e=t?``:`.*`;i=i.charAt(i.length-1)===`/`?`${i}${e}$`:`${i}(/${e})?(#.*)?$`}}r=!r,n=a}}(e,t);return e=>{let t=e.origin;t||=`${e.protocol}//${e.host}`;let r=e.href.replace(t,``).replace(e.search,``).split(`?`)[0];return n.test(r)}}var K=!1,q=[],J=R&&window.location.href;function ze(){return Y()}function Y(e=[],t,n=!1){if(K)return new Promise(((e,n)=>{q.push({resolve:e,reject:n,eventArguments:t})}));let{appsToUnload:i,appsToUnmount:a,appsToLoad:o,appsToMount:s}=function(){let e=[],t=[],n=[],r=[],i=new Date().getTime();return G.forEach((a=>{let o=a.status!==`SKIP_BECAUSE_BROKEN`&&C(a);switch(a.status){case b:o&&i-a.loadErrorTime>=200&&n.push(a);break;case u:case d:o&&n.push(a);break;case f:case m:!o&&De(w(a))?e.push(a):o&&r.push(a);break;case g:o||t.push(a)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),l,p=[],h=J,_=J=window.location.href;return X()?(K=!0,l=i.concat(o,a,s),Promise.resolve().then((()=>(E(l.length===0?`before-no-app-change`:`before-app-change`,T(!0)),E(`before-routing-event`,T(!0,{cancelNavigation:v})),Promise.all(p).then((n=>{if(n.some((e=>e)))return H.call(window.history,history.state,``,h.substring(location.origin.length)),J=location.href,K=!1,Y(e,t,!0);let r=i.map(W),c=a.map(M).map((e=>e.then(W))).concat(r),l=Promise.all(c);l.then((()=>{E(`before-mount-routing-event`,T(!0))}),(e=>{throw e}));let u=o.map((e=>L(e).then((e=>Be(e,l))))),d=s.filter((e=>o.indexOf(e)<0)).map((e=>Be(e,l)));return l.catch((e=>{throw S(),e})).then((()=>(S(),Promise.all(u.concat(d)).catch((t=>{throw e.forEach((e=>e.reject(t))),t})).then(y).then((()=>{}),(e=>{throw e})))))})))))):(l=o,Promise.resolve().then((()=>{let e=o.map(L);return Promise.all(e).then(S).then((()=>[])).catch((e=>{throw S(),e})).finally((()=>{}))})));function v(e=!0){let t=typeof e?.then==`function`?e:Promise.resolve(e);p.push(t.catch((e=>(console.warn(Error(c(42,!1))),console.warn(e),!1))))}function y(){let t=Oe();e.forEach((e=>e.resolve(t)));try{E(l.length===0?`no-app-change`:`app-change`,T()),E(`routing-event`,T())}catch(e){setTimeout((()=>{throw e}))}if(K=!1,q.length>0){let e=q;q=[],Y(e)}return t}function S(){n||(e.forEach((e=>{me(e.eventArguments)})),me(t))}function T(e=!1,n){let r={},c={[g]:[],[m]:[],[u]:[],[x]:[]};e?(o.concat(s).forEach(((e,t)=>{f(e,g)})),i.forEach((e=>{f(e,u)})),a.forEach((e=>{f(e,m)}))):l.forEach((e=>{f(e)}));let d={detail:{newAppStatuses:r,appsByNewStatus:c,totalAppChanges:l.length,originalEvent:t?.[0],oldUrl:h,newUrl:_}};return n&&D(d.detail,n),d;function f(e,t){let n=w(e);t||=Ae(n),r[n]=t,(c[t]=c[t]||[]).push(n)}}function E(e,t){n||window.dispatchEvent(new r(`single-spa:${e}`,t))}}function Be(e,t){return C(e)?j(e).then((e=>t.then((()=>C(e)?N(e):e)))):t.then((()=>e))}var Ve=!1;function He(e){Ve=!0,R&&(be(e),Y())}function X(){return Ve}var Ue={getRawAppData:function(){return[...G]},reroute:Y,NOT_LOADED:u,toLoadPromise:L,toBootstrapPromise:j,unregisterApplication:Pe,getProfilerData:function(){return te}};R&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ue);function We(){let e=document.getElementById(`shell-stub-config`);if(!e?.textContent)throw Error(`shell-stub: the server did not provide a config`);return JSON.parse(e.textContent)}var Z=We(),{name:Q,routePrefix:Ge}=Z;if(Z.newRelic){let{startMonitoring:t}=await e(async()=>{let{startMonitoring:e}=await import(`./monitoring-BrrZzYzN.js`);return{startMonitoring:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));t(Z.newRelic)}var Ke=document.getElementById(`stub-title`),$=document.getElementById(`stub-message`),qe=document.getElementById(`mfe-root`);Ke&&(Ke.textContent=`${Q[0]?.toUpperCase()??``}${Q.slice(1)} (standalone)`),document.title=`${Q} standalone`;function Je(e){return e===Ge||e.startsWith(`${Ge}/`)}function Ye(e){$&&($.textContent=e,$.hidden=e===null)}Me({name:Q,app:()=>e(()=>import(`/mfe/${Q}/entry.js`),[]),activeWhen:e=>Je(e.pathname),customProps:()=>({domElement:qe})}),o(e=>{reportError(e),Ye(`The ${Q} section is unavailable`)}),window.addEventListener(`single-spa:routing-event`,()=>{Je(window.location.pathname)?$?.textContent.startsWith(`This page`)&&Ye(null):Ye(`This page is not part of ${Q}.`)}),window.location.pathname===`/`&&V(Ge),He({urlRerouteOnly:!0});
|