@datadog/rspack-plugin 3.0.6 → 3.0.8

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.
@@ -1 +1 @@
1
- "use strict";const t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},e=console,n={};Object.keys(t).forEach((t=>{n[t]=e[t]}));const r="Datadog Browser SDK:",o={debug:n.debug.bind(e,r),log:n.log.bind(e,r),info:n.info.bind(e,r),warn:n.warn.bind(e,r),error:n.error.bind(e,r)},i="https://docs.datadoghq.com",s=`${i}/real_user_monitoring/browser/troubleshooting`,a="More details:";function c(t,e){return(...n)=>{try{return t(...n)}catch(t){o.error(e,t)}}}function u(t){return 0!==t&&100*Math.random()<=t}function l(t,e){return+t.toFixed(e)}function d(t){return"number"==typeof t}const f=1e3,p=6e4,h=31536e6;function m(t){return{relative:t,timeStamp:g(t)}}function g(t){const e=y()-performance.now();return e>E()?Math.round(C(e,t)):function(t){return Math.round(C(E(),t))}(t)}function v(t){return d(t)?l(1e6*t,0):t}function y(){return(new Date).getTime()}function _(){return y()}function b(){return performance.now()}function w(){return{relative:b(),timeStamp:_()}}function S(){return{relative:0,timeStamp:E()}}function k(t,e){return e-t}function C(t,e){return t+e}function x(t){return t-E()}let T;function E(){return void 0===T&&(T=performance.timing.navigationStart),T}const A=1024,R=/[^\u0000-\u007F]/;function I(t){return R.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function N(t){return{...t}}function O(t,e){return Object.keys(t).some((n=>t[n]===e))}function L(t){return 0===Object.keys(t).length}function M(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}function D(t,e){const n=M();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let P,U=!1;function $(t){U=t}function z(t){return function(){return B(t,this,arguments)}}function B(t,e,n){try{return t.apply(e,n)}catch(t){V(t)}}function V(t){if(F(t),P)try{P(t)}catch(t){F(t)}}function F(...t){U&&o.error("[MONITOR]",...t)}function j(t,e){return D(M(),"setTimeout")(z(t),e)}function q(t){D(M(),"clearTimeout")(t)}function H(t,e){return D(M(),"setInterval")(z(t),e)}function G(t){D(M(),"clearInterval")(t)}class W{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function K(...t){return new W((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function J(t,e,n){const r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing;let i,s,a=!1;return{throttled:(...n)=>{a?i=n:(r?t(...n):i=n,a=!0,s=j((()=>{o&&i&&t(...i),a=!1,i=void 0}),e))},cancel:()=>{q(s),a=!1,i=void 0}}}function X(){}function Y(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,Y)}const Z=/([\w-]+)\s*=\s*([^;]+)/g;function Q(t,e){for(Z.lastIndex=0;;){const n=Z.exec(t);if(!n)break;if(n[1]===e)return n[2]}}function tt(t,e,n=""){const r=t.charCodeAt(e-1),o=r>=55296&&r<=56319?e+1:e;return t.length<=o?t:`${t.slice(0,o)}${n}`}let et,nt,rt;function ot(){return null!=et?et:et=function(t=window){var e;const n=t.navigator.userAgent;if(t.chrome||/HeadlessChrome/.test(n))return 0;if(0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 1;return 2}()}function it(t,e,n=0,r){const o=new Date;o.setTime(o.getTime()+n);const i=`expires=${o.toUTCString()}`,s=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${s}${a}${c}${u}`}function st(t){return Q(document.cookie,t)}function at(t){return nt||(nt=function(t){const e=new Map;for(Z.lastIndex=0;;){const n=Z.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),nt.get(t)}function ct(t,e){it(t,"",0,e)}const ut="_dd_s";function lt(t){return Object.values(t)}function dt(t){return Object.entries(t)}function ft(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function pt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const ht=144e5,mt=9e5,gt=h,vt="cookie",yt="local-storage",_t=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function bt(t,e){const n={isExpired:"1"};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function wt(t){return L(t)}function St(t){return!wt(t)}function kt(t){return void 0!==t.isExpired||!((void 0===(e=t).created||y()-Number(e.created)<ht)&&(void 0===e.expire||y()<Number(e.expire)));var e}function Ct(t){t.expire=String(y()+mt)}function xt(t){return dt(t).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join("&")}function Tt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf("&")||_t.test(t))}(t)&&t.split("&").forEach((t=>{const n=_t.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}function Et(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===rt){const t=`dd_site_test_${Y()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!st(t);)r=`${n.pop()}.${r}`,it(t,e,f,{domain:r});ct(t,{domain:r}),rt=r}return rt}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${Y()}`,n="test";it(e,n,p,t);const r=st(e)===n;return ct(e,t),r}catch(t){return o.error(t),!1}}(e)?{type:vt,cookieOptions:e}:void 0}function At(t,e){const n={isLockEnabled:0===ot(),persistSession:(r=e,t=>{it(ut,xt(t),mt,r)}),retrieveSession:Rt,expireSession:n=>function(t,e,n){const r=bt(e,n);it(ut,xt(r),n.trackAnonymousUser?gt:ht,t)}(e,n,t)};var r;return function(t){if(!at(ut)){const e=at("_dd"),n=at("_dd_r"),r=at("_dd_l"),o={};e&&(o.id=e),r&&/^[01]$/.test(r)&&(o.logs=r),n&&/^[012]$/.test(n)&&(o.rum=n),St(o)&&(Ct(o),t.persistSession(o))}}(n),n}function Rt(){return Tt(st(ut))}function It(){try{const t=Y(),e=`_dd_test_${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:yt}:void 0}catch(t){return}}function Nt(t){return{isLockEnabled:!1,persistSession:Ot,retrieveSession:Lt,expireSession:e=>function(t,e){Ot(bt(t,e))}(e,t)}}function Ot(t){localStorage.setItem(ut,xt(t))}function Lt(){return Tt(localStorage.getItem(ut))}const Mt=[];let Dt;function Pt(t,e,n=0){var r;const{isLockEnabled:o,persistSession:i,expireSession:s}=e,a=t=>i({...t,lock:u}),c=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Dt||(Dt=t),t!==Dt)return void Mt.push(t);if(o&&n>=100)return void $t(e);let u,l=c();if(o){if(l.lock)return void Ut(t,e,n);if(u=Y(),a(l.session),l=c(),l.lock!==u)return void Ut(t,e,n)}let d=t.process(l.session);if(o&&(l=c(),l.lock!==u))Ut(t,e,n);else{if(d&&(kt(d)?s(d):(Ct(d),o?a(d):i(d))),o&&(!d||!kt(d))){if(l=c(),l.lock!==u)return void Ut(t,e,n);i(l.session),d=l.session}null===(r=t.after)||void 0===r||r.call(t,d||l.session),$t(e)}}function Ut(t,e,n){j((()=>{Pt(t,e,n+1)}),10)}function $t(t){Dt=void 0;const e=Mt.shift();e&&Pt(e,t)}const zt=f;function Bt(t){switch(t.sessionPersistence){case vt:return Et(t);case yt:return It();case void 0:{let e=Et(t);return!e&&t.allowFallbackToLocalStorage&&(e=It()),e}default:o.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Vt(t,e,n,r){const o=new W,i=new W,s=new W,a=t.type===vt?At(e,t.cookieOptions):Nt(e),{expireSession:c}=a,u=H((function(){Pt({process:t=>kt(t)?bt(t,e):void 0,after:p},a)}),zt);let l;h();const{throttled:d,cancel:f}=J((()=>{Pt({process:t=>{if(wt(t))return;const e=p(t);return function(t){if(wt(t))return!1;const{trackingType:e,isTracked:o}=r(t[n]);t[n]=e,delete t.isExpired,o&&!t.id&&(t.id=Y(),t.created=String(y()))}(e),e},after:t=>{St(t)&&!m()&&function(t){l=t,o.notify()}(t),l=t}},a)}),zt);function p(t){return kt(t)&&(t=bt(t,e)),m()&&(!function(t){return l.id!==t.id||l[n]!==t[n]}(t)?(s.notify({previousState:l,newState:t}),l=t):(l=bt(l,e),i.notify())),t}function h(){Pt({process:t=>{if(wt(t))return bt(t,e)},after:t=>{l=t}},a)}function m(){return void 0!==l[n]}return{expandOrRenewSession:d,expandSession:function(){Pt({process:t=>m()?p(t):void 0},a)},getSession:()=>l,renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s,restartSession:h,expire:()=>{f(),c(l),p(bt(l,e))},stop:()=>{G(u)},updateSessionState:function(t){Pt({process:e=>({...e,...t}),after:p},a)}}}const Ft={GRANTED:"granted",NOT_GRANTED:"not-granted"};function jt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=qt(Object.prototype),o=qt(Array.prototype),i=qt(Object.getPrototypeOf(t)),s=qt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function qt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):X}function Ht(t){return Gt(t,location.href).href}function Gt(t,e){const n=function(){if(void 0===Kt)try{const t=new Wt("http://test/path");Kt="http://test/path"===t.href}catch(t){Kt=!1}return Kt?Wt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${jt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const o=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(o)}return o.href=t,o}const Wt=URL;let Kt;const Jt="datad0g.com",Xt="dd0g-gov.com",Yt="datadoghq.com",Zt="datadoghq.eu",Qt="pci.browser-intake-datadoghq.com",te=["ddsource","ddtags"];function ee(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=Ht(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const o=function(t,e){const{site:n=Yt,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===Yt)return Qt;if(r&&n===Yt)return`${r}.${Yt}`;if(n===Xt)return`http-intake.logs.${n}`;const o=n.split("."),i=o.pop();return`browser-intake-${o.join("-")}.${i}`}(e,t);return t=>`https://${o}${n}?${t}`}(t,e);return{build(o,i){const s=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,o,{retry:i,encoding:s}){const a=["sdk_version:6.0.0",`api:${o}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${Y()}`];s&&c.push(`dd-evp-encoding=${s}`);"rum"===n&&c.push(`batch_time=${_()}`);e&&c.reverse();return c.join("&")}(t,e,n,o,i);return r(s)},urlPrefix:r(""),trackType:e}}function ne(t,e){const n=200-t.length-1;(e.length>n||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(e))&&o.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${a} ${i}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function re(t){const e=t.site||Yt,n=function(t){const{env:e,service:n,version:r,datacenter:o}=t,i=[];return e&&i.push(ne("env",e)),n&&i.push(ne("service",n)),r&&i.push(ne("version",r)),o&&i.push(ne("datacenter",o)),i}(t),r=function(t,e){return{logsEndpointBuilder:ee(t,"logs",e),rumEndpointBuilder:ee(t,"rum",e),sessionReplayEndpointBuilder:ee(t,"replay",e)}}(t,n),o=function(t,e){if(!t.replica)return;const n={...t,site:Yt,clientToken:t.replica.clientToken},r={logsEndpointBuilder:ee(n,"logs",e),rumEndpointBuilder:ee(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:o,site:e,...r}}const oe={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ie={ALL:"all",SAMPLED:"sampled"};function se(t,e){return null==t||"string"==typeof t||(o.error(`${e} must be defined as a string`),!1)}function ae(t,e){return!!(void 0===t||(n=t,d(n)&&n>=0&&n<=100))||(o.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function ce(t){var e,n,r,s,u,l;if(t&&t.clientToken){if((!(d=t.site)||"string"!=typeof d||/(datadog|ddog|datad0g|dd0g)/.test(d)||(o.error(`Site should be a valid Datadog site. ${a} ${i}/getting_started/site/.`),0))&&ae(t.sessionSampleRate,"Session")&&ae(t.telemetrySampleRate,"Telemetry")&&ae(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&ae(t.telemetryUsageSampleRate,"Telemetry Usage")&&se(t.version,"Version")&&se(t.env,"Env")&&se(t.service,"Service")){var d;if(void 0===t.trackingConsent||O(Ft,t.trackingConsent))return{beforeSend:t.beforeSend&&c(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Bt(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(s=t.telemetryUsageSampleRate)&&void 0!==s?s:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(u=t.trackingConsent)&&void 0!==u?u:Ft.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144,...re(t)};o.error('Tracking Consent should be either "granted" or "not-granted"')}}else o.error("Client Token is not configured, we will not send any data.")}var ue;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(ue||(ue={}));const le=new Set;function de(t){Array.isArray(t)&&t.filter((t=>O(ue,t))).forEach((t=>{le.add(t)}))}function fe(t){return le.has(t)}function pe(){return le}const he="?";function me(t){const e=[];let n=Ce(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=ye.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),o=_e.exec(e[2]);r&&o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||he,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=be.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:he,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=we.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||he,line:+e[3],url:e[2]}}(t)||function(t){const e=Se.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=ke.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||he,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=he),e.push(n))})),{message:Ce(t,"message"),name:Ce(t,"name"),stack:e}}const ge="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",ve="(?::(\\d+))",ye=new RegExp(`^\\s*at (.*?) ?\\(${ge}${ve}?${ve}?\\)?\\s*$`,"i"),_e=new RegExp(`\\((\\S*)${ve}${ve}\\)`);const be=new RegExp(`^\\s*at ?${ge}${ve}?${ve}??\\s*$`,"i");const we=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ke=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ce(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function xe(t,e,n,r){const o=[{url:e,column:r,line:n}],{name:i,message:s}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=Te.exec(t));return{name:e,message:n}}(t);return{name:i,message:s,stack:o}}const Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Ee(){const t=new Error;let e;return B((()=>{const n=me(t);n.stack=n.stack.slice(2),e=Ae(n)})),e}function Ae(t){let e=Re(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",o=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${o}${i}`})),e}function Re(t){return`${t.name||"Error"}: ${t.message}`}function Ie(t,e,n,{computeHandlingStack:r}={}){let o=t[e];if("function"!=typeof o){if(!(e in t)||!e.startsWith("on"))return{stop:X};o=X}let i=!1;const s=function(){if(i)return o.apply(this,arguments);const t=Array.from(arguments);let e;B(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Ee():void 0}]);const s=o.apply(this,t);return e&&B(e,null,[s]),s};return t[e]=s,{stop:()=>{i=!0,t[e]===s&&(t[e]=o)}}}function Ne(t,e,n){const r=Object.getOwnPropertyDescriptor(t,e);if(!r||!r.set||!r.configurable)return{stop:X};const o=X;let i=(t,e)=>{j((()=>{i!==o&&n(t,e)}),0)};const s=function(t){r.set.call(this,t),i(this,t)};return Object.defineProperty(t,e,{set:s}),{stop:()=>{var n;(null===(n=Object.getOwnPropertyDescriptor(t,e))||void 0===n?void 0:n.set)===s&&Object.defineProperty(t,e,r),i=o}}}function Oe(t,e=225280){const n=qt(Object.prototype),r=qt(Array.prototype),o=[],i=new WeakMap,s=Le(t,"$",void 0,o,i),a=JSON.stringify(s);let c=a?a.length:0;if(!(c>e)){for(;o.length>0&&c<e;){const n=o.shift();let r=0;if(Array.isArray(n.source))for(let s=0;s<n.source.length;s++){const a=Le(n.source[s],n.path,s,o,i);if(c+=void 0!==a?JSON.stringify(a).length:4,c+=r,r=1,c>e){De(e,"truncated",t);break}n.target[s]=a}else for(const s in n.source)if(Object.prototype.hasOwnProperty.call(n.source,s)){const a=Le(n.source[s],n.path,s,o,i);if(void 0!==a&&(c+=JSON.stringify(a).length+r+s.length+3,r=1),c>e){De(e,"truncated",t);break}n.target[s]=a}}return n(),r(),s}De(e,"discarded",t)}function Le(t,e,n,r,o){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const s=Me(i);if("[Object]"!==s&&"[Array]"!==s&&"[Error]"!==s)return s;const a=t;if(o.has(a))return`[Reference seen at ${o.get(a)}]`;const c=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return o.set(a,c),r.push({source:i,target:u,path:c}),u}function Me(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Me(e.currentTarget):null,target:e.target?Me(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function De(t,e,n){o.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Pe="No stack, consider using an instance of Error";function Ue({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:o,source:i,handling:s}){const a=ze(e),c=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${jt(Oe(r))}`}(t,a,o,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(a,t)?Ae(t):Pe,l=a?Be(e,i):void 0;return{startClocks:r,source:i,handling:s,handlingStack:n,originalError:e,type:t?t.name:void 0,message:c,stack:u,causes:l,fingerprint:$e(e)}}function $e(t){return ze(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function ze(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function Be(t,e){let n=t;const r=[];for(;ze(null==n?void 0:n.cause)&&r.length<10;){const t=me(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&Ae(t)}),n=n.cause}return r.length?r:void 0}const Ve="agent",Fe="console",je="custom",qe="source",He="report";function Ge(t){const e=(e,n)=>{const r=Ue({stackTrace:e,originalError:n,startClocks:w(),nonErrorPrefix:"Uncaught",source:qe,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ie(window,"onerror",(({parameters:[t,e,n,o,i]})=>{let s;s=ze(i)?me(i):xe(t,e,n,o),r(s,null!=i?i:t)})));var r;const{stop:o}=function(t){return Ie(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=me(n);t(r,n)}))}(e);return{stop:()=>{n(),o()}}}function We(t,e){e.silentMultipleInit||o.error(`${t} is already initialized.`)}function Ke(t,e,n,r,o){return Je(t,e,[n],r,o)}function Je(t,e,n,r,{once:o,capture:i,passive:s}={}){const a=z((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(o&&d(),r(e))})),c=s?{capture:i,passive:s}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,l=D(u,"addEventListener");function d(){const t=D(u,"removeEventListener");n.forEach((n=>t.call(e,n,a,c)))}return n.forEach((t=>l.call(e,t,a,c))),{stop:d}}const Xe="intervention",Ye="csp_violation";function Ze(t,e){const n=[];e.includes(Ye)&&n.push(function(t){return new W((e=>{const{stop:n}=Ke(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return Qe({type:t.effectiveDirective,message:`${Ye}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:tn(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${tt(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Ye));return r.length&&n.push(function(t){return new W((e=>{if(!window.ReportingObserver)return;const n=z(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return Qe({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:tn(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),K(...n)}function Qe(t){return{startClocks:w(),source:He,handling:"unhandled",...t}}function tn(t,e,n,r,o){return n?Ae({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}function en(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function nn(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=nn(r[t],e[t],n);return r}const r="object"===ft(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=nn(r[t],e[t],n));return r}function rn(t){return nn(void 0,t)}function on(...t){let e;for(const n of t)null!=n&&(e=nn(e,n));return e}function sn(){var t;const e=window.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function an(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}function cn(){const t=[];return{add:e=>{t.push(e)>500&&t.splice(0,1)},remove:e=>{an(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const un="log",ln="configuration",dn="usage",fn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],pn=["ddog-gov.com"];let hn=cn(),mn=t=>{hn.add((()=>mn(t)))};function gn(t,e){let n;const r=new W,o=new Set,i=!pn.includes(e.site)&&u(e.telemetrySampleRate),s={[un]:i,[ln]:i&&u(e.telemetryConfigurationSampleRate),[dn]:i&&u(e.telemetryUsageSampleRate)},a={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return mn=i=>{const c=jt(i);if(s[i.type]&&o.size<e.maxTelemetryEventsPerPage&&!o.has(c)){const e=function(t,e,r){return on({type:"telemetry",date:_(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:on(e,{runtime_env:r,connectivity:sn(),sdk_setup:"npm"}),experimental_features:Array.from(pe())},void 0!==n?n():{})}(t,i,a);r.notify(e),en("telemetry",e),o.add(c)}},P=yn,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function vn(e,n){F(t.debug,e,n),mn({type:un,message:e,status:"debug",...n})}function yn(t,e){mn({type:un,status:"error",...bn(t),...e})}function _n(t){mn({type:dn,usage:t})}function bn(t){if(ze(t)){const e=me(t);return{error:{kind:e.name,stack:Ae(wn(e))},message:e.message}}return{error:{stack:Pe},message:`Uncaught ${jt(t)}`}}function wn(t){return t.stack=t.stack.filter((t=>!t.url||fn.some((e=>t.url.startsWith(e))))),t}const Sn=1/0;function kn({expireDelay:t,maxEntries:e}){let n=[];const r=H((()=>function(){const e=b()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),6e4);return{add:function(t,r){const o={value:t,startTime:r,endTime:Sn,remove:()=>{an(n,o)},close:t=>{o.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(o),o},find:function(t=Infinity,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===Sn&&e.close(t)},findAll:function(t=Infinity,e=0){const r=C(t,e);return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){G(r)}}}const Cn=p,xn=ht;function Tn(t,e,n,r){const o=new W,i=new W,s=Vt(t.sessionStoreStrategyType,t,e,n),a=kn({expireDelay:xn});function c(){return{id:s.getSession().id,trackingType:s.getSession()[e],isReplayForced:!!s.getSession().forcedReplay,anonymousId:s.getSession().anonymousId}}return s.renewObservable.subscribe((()=>{a.add(c(),b()),o.notify()})),s.expireObservable.subscribe((()=>{i.notify(),a.closeActive(b())})),s.expandOrRenewSession(),a.add(c(),S().relative),r.observable.subscribe((()=>{r.isGranted()?s.expandOrRenewSession():s.expire()})),function(t,e){const{stop:n}=Je(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,(()=>{r.isGranted()&&s.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=Ke(t,document,"visibilitychange",n);H(n,Cn)}(t,(()=>s.expandSession())),function(t,e){const{stop:n}=Ke(t,window,"resume",e,{capture:!0})}(t,(()=>s.restartSession())),{findSession:(t,e)=>a.find(t,e),renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s.sessionStateUpdateObservable,expire:s.expire,updateSessionState:s.updateSessionState}}const En=3145728,An=f;function Rn(t,e,n,r,o){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Nn(t,e,n,{onSuccess:()=>On(0,e,n,r,o),onFailure:()=>{e.queuedPayloads.enqueue(t),In(e,n,r,o)}}):e.queuedPayloads.enqueue(t)}function In(t,e,n,r){2===t.transportStatus&&j((()=>{Nn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=An,On(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(6e4,2*t.currentBackoffTime),In(t,e,n,r)}})}),t.currentBackoffTime)}function Nn(t,e,n,{onSuccess:r,onFailure:o}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||(e=t.status,e>=500));var e}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},o())}))}function On(t,e,n,r,o){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(o({message:`Reached max ${r} events size queued for upload: 3MiB`,source:Ve,startClocks:w()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Ln();i.size()>0;)Rn(i.dequeue(),e,n,r,o)}function Ln(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=En}}}function Mn(t,e,n){const r={transportStatus:0,currentBackoffTime:An,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=81920&&this.ongoingRequestCount<32},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Ln(),queueFullReported:!1},o=(n,r)=>function(t,e,n,r){const o=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(o){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(z((t=>null==r?void 0:r({status:t.status,type:t.type}))),z((()=>{Pn(t.build("xhr",n),n.data,r)})))}else{Pn(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{Rn(e,r,o,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Dn||(Dn=!0,yn(t))}(t)}const o=t.build("xhr",n);Pn(o,n.data)}(t,e,n)}}}let Dn=!1;function Pn(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Ke({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Un(){const t=M().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const o=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:o}))}}}function $n(t){const e=Un();return!!e&&e.getCapabilities().includes(t)}function zn(t){var e;void 0===t&&(t=null===(e=M().location)||void 0===e?void 0:e.hostname);const n=Un();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const Bn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Vn(t){return lt(Bn).includes(t)}function Fn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let i={};const c=n.flushObservable.subscribe((n=>function(n){const r=lt(i).join("\n");i={};const o=Vn(n.reason),s=o?e.sendOnExit:e.send;if(o&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&s(jn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&s({data:n,bytesCount:I(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{s(jn(t))}))}(n)));function u(e,c){const u=jt(e),l=t.estimateEncodedBytesCount(u);l>=r?o.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${a} ${s}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==i[t]}(c)&&function(e){const r=i[e];delete i[e];const o=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(o)}(c),function(e,r,o){n.notifyBeforeAddMessage(r),void 0!==o?(i[o]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,l,c))}return{flushController:n,add:u,upsert:u,stop:c.unsubscribe}}function jn(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}function qn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:o}){const i=r.subscribe((t=>d(t.reason))),s=o.subscribe((()=>d("session_expire"))),a=new W((()=>()=>{i.unsubscribe(),s.unsubscribe()}));let c,u=0,l=0;function d(t){if(0===l)return;const e=l,n=u;l=0,u=0,f(),a.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){q(c),c=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(t){u+t>=e&&d("bytes_limit"),l+=1,u+=t,void 0===c&&(c=j((()=>{d("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,l>=t?d("messages_limit"):u>=e&&d("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,l-=1,0===l&&f()}}}function Hn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const o=I(n);e+=o,t+=n,r&&r(o)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}function Gn(t,e,n){let r=0,o=!1;return{isLimitReached(){if(0===r&&j((()=>{r=0}),p),r+=1,r<=e||o)return o=!1,!1;if(r===e+1){o=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Ve,startClocks:w()})}finally{o=!1}}return!0}}}function Wn(t,e,n){if(document.readyState===e||"complete"===document.readyState)return n(),{stop:X};return Ke(t,window,"complete"===e?"load":"DOMContentLoaded",n,{once:!0})}function Kn(t,e){return new Promise((n=>{Wn(t,e,n)}))}let Jn;const Xn=new WeakMap;function Yn(t){return Jn||(Jn=function(t){return new W((e=>{const{stop:n}=Ie(XMLHttpRequest.prototype,"open",Zn),{stop:r}=Ie(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const o=Xn.get(t);if(!o)return;const i=o;i.state="start",i.startClocks=w(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let s=!1;const{stop:a}=Ie(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&c()})),c=()=>{if(u(),a(),s)return;s=!0;const e=o;e.state="complete",e.duration=k(i.startClocks.timeStamp,_()),e.status=t.status,r.notify(N(e))},{stop:u}=Ke(n,t,"loadend",c);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:o}=Ie(XMLHttpRequest.prototype,"abort",Qn);return()=>{n(),r(),o()}}))}(t)),Jn}function Zn({target:t,parameters:[e,n]}){Xn.set(t,{state:"open",method:String(e).toUpperCase(),url:Ht(String(n))})}function Qn({target:t}){const e=Xn.get(t);e&&(e.isAborted=!0)}let tr;function er(){return tr||(tr=new W((t=>{if(!window.fetch)return;const{stop:e}=Ie(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[o,i]=t;let s=i&&i.method;void 0===s&&o instanceof Request&&(s=o.method);const a=void 0!==s?String(s).toUpperCase():"GET",c=o instanceof Request?o.url:Ht(String(o)),u=w(),l={state:"start",init:i,input:o,method:a,startClocks:u,url:c,handlingStack:n};r.notify(l),t[0]=l.input,t[1]=l.init,e((t=>function(t,e,n){const r=n;function o(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(z((t=>{o({response:t,responseType:t.type,status:t.status,isAborted:!1})})),z((t=>{var e,n;o({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,l)))}(e,t)),{computeHandlingStack:!0});return e}))),tr}function nr(t,e){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(z(t),e);return()=>window.cancelIdleCallback(n)}return function(t){const e=y(),n=j((()=>{t({didTimeout:!1,timeRemaining:()=>Math.max(0,rr-(y()-e))})}),0);return()=>q(n)}(t)}const rr=50;let or={};function ir(n){return K(...n.map((n=>(or[n]||(or[n]=function(n){return new W((r=>{const o=e[n];return e[n]=(...e)=>{o.apply(console,e);const i=Ee();B((()=>{r.notify(function(e,n,r){const o=e.map((t=>function(t){if("string"==typeof t)return Oe(t);if(ze(t))return Re(me(t));return jt(Oe(t),void 0,2)}(t))).join(" ");let i;if(n===t.error){const t=e.find(ze);i={stack:t?Ae(me(t)):void 0,fingerprint:$e(t),causes:t?Be(t,"console"):void 0,startClocks:w(),message:o,source:Fe,handling:"handled",handlingStack:r}}return{api:n,message:o,error:i,handlingStack:r}}(e,n,i))}))},()=>{e[n]=o}}))}(n)),or[n]))))}function sr(t){let e={};const n=new W,r={getContext:()=>rn(e),setContext:o=>{"object"===ft(o)?(e=Oe(o),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,o)=>{e[r]=Oe(o),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const ar="_dd_c",cr=[];function ur(t,e,n,r){const o=function(t,e){return`${ar}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(o);return null!==t?JSON.parse(t):{}}cr.push(Ke(t,window,"storage",(({key:t})=>{o===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(e.getContext()))})),e.setContext(on(i(),e.getContext()))}function lr(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const i=2===t?3072:16384;let c=r;e.forEach((t=>{c+=t.getBytesCount()})),c>i&&(!function(t){o.warn(`Customer data exceeds the recommended ${t/A}KiB threshold. ${a} ${s}/#customer-data-exceeds-the-recommended-threshold-warning`)}(i),n=!0)}return{createDetachedTracker:()=>{const t=dr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,dr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function dr(t){let e=0;const{throttled:n,cancel:r}=J((n=>{e=I(jt(n)),t()}),200),o=()=>{r(),e=0};return{updateCustomerData:t=>{L(t)?o():n(t)},resetCustomerData:o,getBytesCount:()=>e,stop:()=>{r()}}}function fr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||at("datadog-synthetics-injects-rum"))}function pr(t){const e=ft(t);return"string"===e||"function"===e||t instanceof RegExp}function hr(t,e,n=!1){return t.some((t=>{try{if("function"==typeof t)return t(e);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?e.startsWith(t):t===e}catch(t){o.error(t)}return!1}))}function mr(t,e,n){function r(n){(function(t){return!e.wasInPageStateDuringPeriod("frozen",t.startClocks.relative,t.duration)})(n)&&t.notify(11,function(t){const e={date:t.startClocks.timeStamp,vital:{id:Y(),type:t.type,name:t.name,duration:v(t.duration),description:t.description},type:"vital",_dd:{vital:{computed_value:!0}}};return{rawRumEvent:e,startTime:t.startClocks.relative,customerContext:t.context,domainContext:{}}}(n))}return{addDurationVital:r,startDurationVital:(t,e={})=>gr(n,t,e),stopDurationVital:(t,e={})=>{vr(r,n,t,e)}}}function gr({vitalsByName:t,vitalsByReference:e},n,r={}){const o={name:n,startClocks:w(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return t.set(n,o),e.set(i,o),i}function vr(t,{vitalsByName:e,vitalsByReference:n},r,o={}){const i="string"==typeof r?e.get(r):n.get(r);i&&(t(function(t,e,n,r){var o;return{name:t.name,type:"duration",startClocks:e,duration:k(e.timeStamp,r.timeStamp),context:on(t.context,n.context),description:null!==(o=n.description)&&void 0!==o?o:t.description}}(i,i.startClocks,o,w())),"string"==typeof r?e.delete(r):n.delete(r))}function yr(){return window.crypto||window.msCrypto}function _r(){return wr(63)}let br;function wr(t){return br||(br=fe(ue.CONSISTENT_TRACE_SAMPLING)&&function(){try{return crypto.getRandomValues(new BigUint64Array(1)),!0}catch(t){return!1}}()?Sr:kr),br(t)}function Sr(t){let e=crypto.getRandomValues(new BigUint64Array(1))[0];return 63===t&&(e>>=BigInt("1")),e}function kr(t){const e=yr().getRandomValues(new Uint32Array(2));return 63===t&&(e[e.length-1]>>>=1),{toString(t=10){let n=e[1],r=e[0],o="";do{const e=n%t*4294967296+r;n=Math.floor(n/t),r=Math.floor(e/t),o=(e%t).toString(t)+o}while(n||r);return o}}}function Cr(t){const e=t.toString(16);return Array(17-e.length).join("0")+e}function xr(t){0!==t.status||t.isAborted||(t.traceId=void 0,t.spanId=void 0,t.traceSampled=void 0)}function Tr(t,e,n,r){if(void 0===yr()||!n.findTrackedSession())return;const o=t.allowedTracingUrls.find((t=>hr([t.match],e.url,!0)));if(!o)return;const i=wr(64);e.traceSampled=function(t,e){if(100===e)return!0;if(0===e)return!1;if("bigint"!=typeof t)return u(e);const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000");return Number(t*n%r)<=e/100*Number(r)}(i,t.traceSampleRate);(e.traceSampled||t.traceContextInjection===ie.ALL)&&(e.traceId=i,e.spanId=_r(),r(function(t,e,n,r){const o={};return r.forEach((r=>{switch(r){case"datadog":Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":e.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":t.toString()});break;case"tracecontext":Object.assign(o,{traceparent:`00-0000000000000000${Cr(t)}-${Cr(e)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break;case"b3":Object.assign(o,{b3:`${Cr(t)}-${Cr(e)}-${n?"1":"0"}`});break;case"b3multi":Object.assign(o,{"X-B3-TraceId":Cr(t),"X-B3-SpanId":Cr(e),"X-B3-Sampled":n?"1":"0"})}})),o}(e.traceId,e.spanId,e.traceSampled,o.propagatorTypes)))}const Er=["tracecontext","datadog"];function Ar(t){var e,n,r,i,s,a;if(!t.applicationId)return void o.error("Application ID is not configured, no RUM data will be collected.");if(!ae(t.sessionReplaySampleRate,"Session Replay")||!ae(t.traceSampleRate,"Trace"))return;if(void 0!==t.excludedActivityUrls&&!Array.isArray(t.excludedActivityUrls))return void o.error("Excluded Activity Urls should be an array");const c=function(t){if(void 0===t.allowedTracingUrls)return[];if(!Array.isArray(t.allowedTracingUrls))return void o.error("Allowed Tracing URLs should be an array");if(0!==t.allowedTracingUrls.length&&void 0===t.service)return void o.error("Service needs to be configured when tracing is enabled");const e=[];return t.allowedTracingUrls.forEach((t=>{pr(t)?e.push({match:t,propagatorTypes:Er}):!function(t){const e=t;return"object"===ft(e)&&pr(e.match)&&Array.isArray(e.propagatorTypes)}(t)?o.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",t):e.push(t)})),e}(t);if(!c)return;const u=ce(t);if(!u)return;const l=null!==(e=t.sessionReplaySampleRate)&&void 0!==e?e:0;return{applicationId:t.applicationId,version:t.version||void 0,actionNameAttribute:t.actionNameAttribute,sessionReplaySampleRate:l,startSessionReplayRecordingManually:void 0!==t.startSessionReplayRecordingManually?!!t.startSessionReplayRecordingManually:0===l,traceSampleRate:null!==(n=t.traceSampleRate)&&void 0!==n?n:100,rulePsr:d(t.traceSampleRate)?t.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:null!==(r=t.excludedActivityUrls)&&void 0!==r?r:[],workerUrl:t.workerUrl,compressIntakeRequests:!!t.compressIntakeRequests,trackUserInteractions:!(null!==(i=t.trackUserInteractions)&&void 0!==i&&!i),trackViewsManually:!!t.trackViewsManually,trackResources:!(null!==(s=t.trackResources)&&void 0!==s&&!s),trackLongTasks:!(null!==(a=t.trackLongTasks)&&void 0!==a&&!a),subdomain:t.subdomain,defaultPrivacyLevel:O(oe,t.defaultPrivacyLevel)?t.defaultPrivacyLevel:oe.MASK,enablePrivacyForActionName:!!t.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:O(ie,t.traceContextInjection)?t.traceContextInjection:ie.SAMPLED,plugins:t.plugins||[],...u}}function Rr(t){const e=new Set;return Array.isArray(t.allowedTracingUrls)&&t.allowedTracingUrls.length>0&&t.allowedTracingUrls.forEach((t=>{pr(t)?Er.forEach((t=>e.add(t))):"object"===ft(t)&&Array.isArray(t.propagatorTypes)&&t.propagatorTypes.forEach((t=>e.add(t)))})),Array.from(e)}const Ir="https://d3uc069fcn7uxw.cloudfront.net/configuration";function Nr(t,e){!function(t,e){const n=new XMLHttpRequest;Ke(t,n,"load",(function(){200===n.status?e(JSON.parse(n.responseText)):Or()})),Ke(t,n,"error",(function(){Or()})),n.open("GET",`${Ir}/${encodeURIComponent(t.remoteConfigurationId)}.json`),n.send()}(t,(n=>{e(function(t,e){return{...t,...e}}(t,n))}))}function Or(){o.error("Error fetching the remote configuration.")}function Lr({ignoreInitIfSyntheticsWillInjectRum:t,startDeflateWorker:e},n,r,i,s){const a=cn();let c,u,l,d;const f=r.observable.subscribe(p);function p(){if(!l||!d||!r.isGranted())return;let t;if(f.unsubscribe(),d.trackViewsManually){if(!c)return;a.remove(c.callback),t=c.options}const e=s(d,u,t);a.drain(e)}function h(t){const n=zn();if(n&&(t=function(t){var e,n;return{...t,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:null!==(e=t.defaultPrivacyLevel)&&void 0!==e?e:null===(n=Un())||void 0===n?void 0:n.getPrivacyLevel()}}(t)),l=t,function(t){mn({type:ln,configuration:t})}(function(t){var e;const n={session_sample_rate:(r=t).sessionSampleRate,telemetry_sample_rate:r.telemetrySampleRate,telemetry_configuration_sample_rate:r.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:r.telemetryUsageSampleRate,use_before_send:!!r.beforeSend,use_partitioned_cross_site_session_cookie:r.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:r.useSecureSessionCookie,use_proxy:!!r.proxy,silent_multiple_init:r.silentMultipleInit,track_session_across_subdomains:r.trackSessionAcrossSubdomains,track_anonymous_user:r.trackAnonymousUser,session_persistence:r.sessionPersistence,allow_fallback_to_local_storage:!!r.allowFallbackToLocalStorage,store_contexts_across_pages:!!r.storeContextsAcrossPages,allow_untrusted_events:!!r.allowUntrustedEvents,tracking_consent:r.trackingConsent};var r;return{session_replay_sample_rate:t.sessionReplaySampleRate,start_session_replay_recording_manually:t.startSessionReplayRecordingManually,trace_sample_rate:t.traceSampleRate,trace_context_injection:t.traceContextInjection,action_name_attribute:t.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(t.allowedTracingUrls)&&t.allowedTracingUrls.length>0,selected_tracing_propagators:Rr(t),default_privacy_level:t.defaultPrivacyLevel,enable_privacy_for_action_name:t.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(t.excludedActivityUrls)&&t.excludedActivityUrls.length>0,use_worker_url:!!t.workerUrl,compress_intake_requests:t.compressIntakeRequests,track_views_manually:t.trackViewsManually,track_user_interactions:t.trackUserInteractions,track_resources:t.trackResources,track_long_task:t.trackLongTasks,plugins:null===(e=t.plugins)||void 0===e?void 0:e.map((t=>{var e;return{name:t.name,...null===(e=t.getConfigurationTelemetry)||void 0===e?void 0:e.call(t)}})),...n}}(t)),d)return void We("DD_RUM",t);const i=Ar(t);i&&(n||i.sessionStoreStrategyType?i.compressIntakeRequests&&!n&&e&&(u=e(i,"Datadog RUM",X),!u)||(d=i,er().subscribe(X),r.tryToInit(i.trackingConsent),p()):o.warn("No storage available for session. We will not send any data."))}const m=t=>{a.add((e=>e.addDurationVital(t)))};return{init(e,n){e?(de(e.enableExperimentalFeatures),l=e,t&&fr()||(!function(t,e,n){if(t)for(const r of t){const t=r[e];t&&t(n)}}(e.plugins,"onInit",{initConfiguration:e,publicApi:n}),e.remoteConfigurationId&&fe(ue.REMOTE_CONFIGURATION)?Nr(e,h):h(e))):o.error("Missing configuration")},get initConfiguration(){return l},getInternalContext:X,stopSession:X,addTiming(t,e=_()){a.add((n=>n.addTiming(t,e)))},startView(t,e=w()){const n=n=>{n.startView(t,e)};a.add(n),c||(c={options:t,callback:n},p())},setViewName(t){a.add((e=>e.setViewName(t)))},setViewContext(t){a.add((e=>e.setViewContext(t)))},setViewContextProperty(t,e){a.add((n=>n.setViewContextProperty(t,e)))},addAction(t,e=n()){a.add((n=>n.addAction(t,e)))},addError(t,e=n()){a.add((n=>n.addError(t,e)))},addFeatureFlagEvaluation(t,e){a.add((n=>n.addFeatureFlagEvaluation(t,e)))},startDurationVital:(t,e)=>gr(i,t,e),stopDurationVital(t,e){vr(m,i,t,e)},addDurationVital:m}}function Mr(){let t;const e=window;if(e.Zone&&(t=D(e,"MutationObserver"),e.MutationObserver&&t===e.MutationObserver)){const n=D(new e.MutationObserver(X),"originalInstance");t=n&&n.constructor}return t||(t=e.MutationObserver),t}function Dr(){const t=function(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||at("datadog-synthetics-public-id");return"string"==typeof t?t:void 0}(),e=function(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||at("datadog-synthetics-result-id");return"string"==typeof t?t:void 0}();if(t&&e)return{test_id:t,result_id:e,injected:fr()}}function Pr(t,e,n){const r=rn(t),o=n(r);return dt(e).forEach((([e,n])=>{const o=function(t,e){let n=t;for(const t of e.split(".")){if(!zr(n,t))return;n=n[t]}return n}(r,e),i=ft(o);i===n?Ur(t,e,Oe(o)):"object"!==n||"undefined"!==i&&"null"!==i||Ur(t,e,{})})),o}function Ur(t,e,n){let r=t;const o=e.split(".");for(let t=0;t<o.length;t+=1){const e=o[t];if(!$r(r))return;t!==o.length-1?r=r[e]:r[e]=n}}function $r(t){return"object"===ft(t)}function zr(t,e){return $r(t)&&Object.prototype.hasOwnProperty.call(t,e)}const Br={"view.name":"string","view.url":"string","view.referrer":"string"},Vr={context:"object"},Fr={service:"string",version:"string"};let jr;function qr(t,e,n,r,i,s,a,c,u,d){jr={view:{...Vr,...Br},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Vr,...Br,...Fr},resource:{"resource.url":"string",...fe(ue.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...Vr,...Br,...Fr},action:{"action.target.name":"string",...Vr,...Br,...Fr},long_task:{...Vr,...Br},vital:{...Vr,...Br}};const f={error:Gn("error",t.eventRateLimiterThreshold,d),action:Gn("action",t.eventRateLimiterThreshold,d),vital:Gn("vital",t.eventRateLimiterThreshold,d)},p=Dr();e.subscribe(11,(({startTime:d,rawRumEvent:h,domainContext:m,savedCommonContext:g,customerContext:v})=>{const b=r.findView(d),w=i.findUrl(d),S=n.findTrackedSession(d);if(S&&b&&w){const n=g||u(),r=s.findActionId(d),i=on({_dd:{format_version:2,drift:Math.round(y()-C(E(),performance.now())),configuration:{session_sample_rate:l(t.sessionSampleRate,3),session_replay_sample_rate:l(t.sessionReplaySampleRate,3)},browser_sdk_version:zn()?"6.0.0":void 0},application:{id:t.applicationId},date:_(),service:b.service||t.service,version:b.version||t.version,source:"browser",session:{id:S.id,type:p?"synthetics":c.get()?"ci_test":"user"},view:{id:b.id,name:b.name,url:w.url,referrer:w.referrer},action:(k=h,-1!==["error","resource","long_task"].indexOf(k.type)&&r?{id:r}:void 0),synthetics:p,ci_test:c.get(),display:a.get(),connectivity:sn()},h);i.context=on(n.context,b.context,v),"has_replay"in i.session||(i.session.has_replay=n.hasReplay),"view"===i.type&&(i.session.sampled_for_replay=1===S.sessionReplay),S.anonymousId&&!n.user.anonymous_id&&t.trackAnonymousUser&&(n.user.anonymous_id=S.anonymousId),L(n.user)||(i.usr=n.user),function(t,e,n,r){var i;if(e){const r=Pr(t,jr[t.type],(t=>e(t,n)));if(!1===r&&"view"!==t.type)return!1;!1===r&&o.warn("Can't dismiss view events using beforeSend!")}const s=null===(i=r[t.type])||void 0===i?void 0:i.isLimitReached();return!s}(i,t.beforeSend,m,f)&&(L(i.context)&&delete i.context,e.notify(12,i))}var k}))}const Hr=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}},Gr=ht;const Wr="initial_document",Kr=[["document",t=>Wr===t],["xhr",t=>"xmlhttprequest"===t],["fetch",t=>"fetch"===t],["beacon",t=>"beacon"===t],["css",(t,e)=>/\.css$/i.test(e)],["js",(t,e)=>/\.js$/i.test(e)],["image",(t,e)=>["image","img","icon"].includes(t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)],["font",(t,e)=>null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)],["media",(t,e)=>["audio","video"].includes(t)||null!==/\.(mp3|mp4)$/i.exec(e)]];function Jr(t){const e=t.name;if(!function(t){try{return!!Gt(t)}catch(t){return!1}}(e))return vn(`Failed to construct URL for "${t.name}"`),"other";const n=function(t){const e=Gt(t).pathname;return"/"===e[0]?e:`/${e}`}(e);for(const[e,r]of Kr)if(r(t.initiatorType,n))return e;return"other"}function Xr(...t){for(let e=1;e<t.length;e+=1)if(t[e-1]>t[e])return!1;return!0}function Yr(t){return"xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType}function Zr(t){const{duration:e,startTime:n,responseEnd:r}=t;return v(0===e&&n<r?k(n,r):e)}function Qr(t){if(!eo(t))return;const{startTime:e,fetchStart:n,workerStart:r,redirectStart:o,redirectEnd:i,domainLookupStart:s,domainLookupEnd:a,connectStart:c,secureConnectionStart:u,connectEnd:l,requestStart:d,responseStart:f,responseEnd:p}=t,h={download:no(e,f,p),first_byte:no(e,d,f)};return 0<r&&r<n&&(h.worker=no(e,r,n)),n<l&&(h.connect=no(e,c,l),c<=u&&u<=l&&(h.ssl=no(e,u,l))),n<a&&(h.dns=no(e,s,a)),e<i&&(h.redirect=no(e,o,i)),h}function to(t){return t.duration>=0}function eo(t){const e=Xr(t.startTime,t.fetchStart,t.domainLookupStart,t.domainLookupEnd,t.connectStart,t.connectEnd,t.requestStart,t.responseStart,t.responseEnd),n=!function(t){return t.redirectEnd>t.startTime}(t)||Xr(t.startTime,t.redirectStart,t.redirectEnd,t.fetchStart);return e&&n}function no(t,e,n){if(t<=e&&e<=n)return{duration:v(k(e,n)),start:v(k(t,e))}}function ro(t){return""===t.nextHopProtocol?void 0:t.nextHopProtocol}function oo(t){return""===t.deliveryType?"other":t.deliveryType}function io(t){if(t.startTime<t.responseStart){const{encodedBodySize:e,decodedBodySize:n,transferSize:r}=t;return{size:n,encoded_body_size:e,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function so(t){return t&&!function(t){return te.every((e=>t.includes(e)))}(t)}const ao=/data:(.+)?(;base64)?,/g;function co(t){return!(t.length<=24e3)&&("data:"===t.substring(0,5)&&(t=t.substring(0,24e3),!0))}function uo(t){return`${t.match(ao)[0]}[...]`}let lo=1;function fo(t,e,n){const r=function(t,e){return{clearTracingIfNeeded:xr,traceFetch:n=>Tr(t,n,e,(t=>{var e;if(n.input instanceof Request&&!(null===(e=n.init)||void 0===e?void 0:e.headers))n.input=new Request(n.input),Object.keys(t).forEach((e=>{n.input.headers.append(e,t[e])}));else{n.init=N(n.init);const e=[];n.init.headers instanceof Headers?n.init.headers.forEach(((t,n)=>{e.push([n,t])})):Array.isArray(n.init.headers)?n.init.headers.forEach((t=>{e.push(t)})):n.init.headers&&Object.keys(n.init.headers).forEach((t=>{e.push([t,n.init.headers[t]])})),n.init.headers=e.concat(dt(t))}})),traceXhr:(n,r)=>Tr(t,n,e,(t=>{Object.keys(t).forEach((e=>{r.setRequestHeader(e,t[e])}))}))}}(e,n);!function(t,e,n){const r=Yn(e).subscribe((e=>{const r=e;if(so(r.url))switch(r.state){case"start":n.traceXhr(r,r.xhr),r.requestIndex=po(),t.notify(6,{requestIndex:r.requestIndex,url:r.url});break;case"complete":n.clearTracingIfNeeded(r),t.notify(7,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:"xhr",url:r.url,xhr:r.xhr,isAborted:r.isAborted,handlingStack:r.handlingStack})}}))}(t,e,r),function(t,e){const n=er().subscribe((n=>{const r=n;if(so(r.url))switch(r.state){case"start":e.traceFetch(r),r.requestIndex=po(),t.notify(6,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":!function(t,e){const n=t.response&&function(t){try{return t.clone()}catch(t){return}}(t.response);n&&n.body?function(t,e,n){const r=t.getReader();let o=0;function i(){r.cancel().catch(X),e(void 0,void 0,void 0)}!function t(){r.read().then(z((e=>{e.done?i():(o+=e.value.length,o>n.bytesLimit?i():t())})),z((t=>e(t))))}()}(n.body,(()=>{e(k(t.startClocks.timeStamp,_()))}),{bytesLimit:Number.POSITIVE_INFINITY}):e(k(t.startClocks.timeStamp,_()))}(r,(n=>{e.clearTracingIfNeeded(r),t.notify(7,{duration:n,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:"fetch",url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})}))}}))}(t,r)}function po(){const t=lo;return lo+=1,t}function ho(t){return d(t)&&t<0?void 0:t}function mo({lifeCycle:t,isChildEvent:e,onChange:n=X}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},o=t.subscribe(12,(t=>{var o;if("view"!==t.type&&"vital"!==t.type&&e(t))switch(t.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,t.action.frustration&&(r.frustrationCount+=t.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":(null===(o=t._dd)||void 0===o?void 0:o.discarded)||(r.resourceCount+=1,n())}}));return{stop:()=>{o.unsubscribe()},eventCounts:r}}function go(t,e){const n=y();let r=!1;const{stop:o}=Je(t,window,["click","mousedown","keydown","touchstart","pointerdown"],(e=>{if(!e.cancelable)return;const n={entryType:"first-input",processingStart:b(),processingEnd:b(),startTime:e.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};"pointerdown"===e.type?function(t,e){Je(t,window,["pointerup","pointercancel"],(t=>{"pointerup"===t.type&&i(e)}),{once:!0})}(t,n):i(n)}),{passive:!0,capture:!0});return{stop:o};function i(t){if(!r){r=!0,o();const i=t.processingStart-t.startTime;i>=0&&i<y()-n&&e(t)}}}var vo;function yo(t,e){return new W((n=>{if(!window.PerformanceObserver)return;const r=t=>{const e=function(t){return t.filter((t=>!function(t){return!(t.entryType!==vo.RESOURCE||so(t.name)&&to(t))}(t)))}(t);e.length>0&&n.notify(e)};let o,i=!0;const s=new PerformanceObserver(z((t=>{i?o=j((()=>r(t.getEntries()))):r(t.getEntries())})));try{s.observe(e)}catch(t){if([vo.RESOURCE,vo.NAVIGATION,vo.LONG_TASK,vo.PAINT].includes(e.type)){e.buffered&&(o=j((()=>r(performance.getEntriesByType(e.type)))));try{s.observe({entryTypes:[e.type]})}catch(t){return}}}let a;return i=!1,function(t){!_o&&void 0!==window.performance&&"getEntries"in performance&&"addEventListener"in performance&&(_o=Ke(t,performance,"resourcetimingbufferfull",(()=>{performance.clearResourceTimings()})))}(t),bo(vo.FIRST_INPUT)||e.type!==vo.FIRST_INPUT||({stop:a}=go(t,(t=>{r([t])}))),()=>{s.disconnect(),a&&a(),q(o)}}))}let _o;function bo(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}!function(t){t.EVENT="event",t.FIRST_INPUT="first-input",t.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",t.LAYOUT_SHIFT="layout-shift",t.LONG_TASK="longtask",t.LONG_ANIMATION_FRAME="long-animation-frame",t.NAVIGATION="navigation",t.PAINT="paint",t.RESOURCE="resource"}(vo||(vo={}));const wo=100;function So(t,e,n,r,o,i){const s=function(t,e,n,r){return new W((o=>{const i=[];let s,a=0;return i.push(e.subscribe(c),n.subscribe(c),yo(r,{type:vo.RESOURCE}).subscribe((t=>{t.some((t=>!ko(r,t.name)))&&c()})),t.subscribe(6,(t=>{ko(r,t.url)||(void 0===s&&(s=t.requestIndex),a+=1,c())})),t.subscribe(7,(t=>{ko(r,t.url)||void 0===s||t.requestIndex<s||(a-=1,c())}))),()=>{i.forEach((t=>t.unsubscribe()))};function c(){o.notify({isBusy:a>0})}}))}(t,e,n,r);return function(t,e,n){let r,o=!1;const i=j(z((()=>u({hadActivity:!1}))),100),s=void 0!==n?j(z((()=>u({hadActivity:!0,end:_()}))),n):void 0,a=t.subscribe((({isBusy:t})=>{q(i),q(r);const e=_();t||(r=j(z((()=>u({hadActivity:!0,end:e}))),100))})),c=()=>{o=!0,q(i),q(r),q(s),a.unsubscribe()};function u(t){o||(c(),e(t))}return{stop:c}}(s,o,i)}function ko(t,e){return hr(t.excludedActivityUrls,e)}function Co(t){return t.nodeType===Node.TEXT_NODE}function xo(t){return t.nodeType===Node.ELEMENT_NODE}function To(t){return xo(t)&&Boolean(t.shadowRoot)}function Eo(t){const e=t;return!!e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&xo(e.host)}function Ao(t,e){let n=t.firstChild;for(;n;)e(n),n=n.nextSibling;To(t)&&e(t.shadowRoot)}function Ro(t){return Eo(t)?t.host:t.parentNode}const Io={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:oe.ALLOW,MASK:oe.MASK,MASK_USER_INPUT:oe.MASK_USER_INPUT},No="data-dd-privacy",Oo="hidden",Lo="***",Mo="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",Do={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0};function Po(t,e,n){if(n&&n.has(t))return n.get(t);const r=Ro(t),o=r?Po(r,e,n):e,i=Uo($o(t),o);return n&&n.set(t,i),i}function Uo(t,e){switch(e){case Io.HIDDEN:case Io.IGNORE:return e}switch(t){case Io.ALLOW:case Io.MASK:case Io.MASK_USER_INPUT:case Io.HIDDEN:case Io.IGNORE:return t;default:return e}}function $o(t){if(xo(t)){if("BASE"===t.tagName)return Io.ALLOW;if("INPUT"===t.tagName){const e=t;if("password"===e.type||"email"===e.type||"tel"===e.type)return Io.MASK;if("hidden"===e.type)return Io.MASK;const n=e.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Io.MASK}return t.matches(Fo(Io.HIDDEN))?Io.HIDDEN:t.matches(Fo(Io.MASK))?Io.MASK:t.matches(Fo(Io.MASK_USER_INPUT))?Io.MASK_USER_INPUT:t.matches(Fo(Io.ALLOW))?Io.ALLOW:function(t){if("SCRIPT"===t.nodeName)return!0;if("LINK"===t.nodeName){const t=e("rel");return/preload|prefetch/i.test(t)&&"script"===e("as")||"shortcut icon"===t||"icon"===t}if("META"===t.nodeName){const n=e("name"),r=e("rel"),o=e("property");return/^msapplication-tile(image|color)$/.test(n)||"application-name"===n||"icon"===r||"apple-touch-icon"===r||"shortcut icon"===r||"keywords"===n||"description"===n||/^(og|twitter|fb):/.test(o)||/^(og|twitter):/.test(n)||"pinterest"===n||"robots"===n||"googlebot"===n||"bingbot"===n||t.hasAttribute("http-equiv")||"author"===n||"generator"===n||"framework"===n||"publisher"===n||"progid"===n||/^article:/.test(o)||/^product:/.test(o)||"google-site-verification"===n||"yandex-verification"===n||"csrf-token"===n||"p:domain_verify"===n||"verify-v1"===n||"verification"===n||"shopify-checkout-api-token"===n}function e(e){return(t.getAttribute(e)||"").toLowerCase()}return!1}(t)?Io.IGNORE:void 0}}function zo(t,e){switch(e){case Io.MASK:case Io.HIDDEN:case Io.IGNORE:return!0;case Io.MASK_USER_INPUT:return Co(t)?Bo(t.parentNode):Bo(t);default:return!1}}function Bo(t){if(!t||t.nodeType!==t.ELEMENT_NODE)return!1;const e=t;if("INPUT"===e.tagName)switch(e.type){case"button":case"color":case"reset":case"submit":return!1}return!!Do[e.tagName]}function Vo(t,e,n){var r;const o=null===(r=t.parentElement)||void 0===r?void 0:r.tagName;let i=t.textContent||"";if(e&&!i.trim())return;if("SCRIPT"===o)i=Lo;else if(n===Io.HIDDEN)i=Lo;else if(zo(t,n))if("DATALIST"===o||"SELECT"===o||"OPTGROUP"===o){if(!i.trim())return}else i="OPTION"===o?Lo:i.replace(/\S/g,"x");return i}function Fo(t){return`[${No}="${t}"], .dd-privacy-${t}`}const jo="data-dd-action-name";function qo(t,e){const n=t.closest(`[${e}]`);if(!n)return;return Xo(Jo(n.getAttribute(e).trim()))}const Ho=[(t,e)=>{if("labels"in t&&t.labels&&t.labels.length>0)return Zo(t.labels[0],e)},t=>{if("INPUT"===t.nodeName){const e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return{name:e.value,nameSource:"text_content"}}},(t,e,n)=>{if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Zo(t,e,n)},t=>Yo(t,"aria-label"),(t,e,n)=>{const r=t.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map((e=>function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e))).filter((t=>Boolean(t))).map((t=>Qo(t,e,n))).join(" "),nameSource:"text_content"}},t=>Yo(t,"alt"),t=>Yo(t,"name"),t=>Yo(t,"title"),t=>Yo(t,"placeholder"),(t,e)=>{if("options"in t&&t.options.length>0)return Zo(t.options[0],e)}],Go=[(t,e,n)=>Zo(t,e,n)],Wo=10;function Ko(t,e,n,r){let o=t,i=0;for(;i<=Wo&&o&&"BODY"!==o.nodeName&&"HTML"!==o.nodeName&&"HEAD"!==o.nodeName;){for(const t of n){const n=t(o,e,r);if(n){const{name:t,nameSource:e}=n,r=t&&t.trim();if(r)return{name:Xo(Jo(r)),nameSource:e}}}if("FORM"===o.nodeName)break;o=o.parentElement,i+=1}}function Jo(t){return t.replace(/\s+/g," ")}function Xo(t){return t.length>100?`${tt(t,100)} [...]`:t}function Yo(t,e){return{name:t.getAttribute(e)||"",nameSource:"standard_attribute"}}function Zo(t,e,n){return{name:Qo(t,e,n)||"",nameSource:"text_content"}}function Qo(t,e,n){if(!t.isContentEditable){if("innerText"in t){let r=t.innerText;const o=e=>{const n=t.querySelectorAll(e);for(let t=0;t<n.length;t+=1){const e=n[t];if("innerText"in e){const t=e.innerText;t&&t.trim().length>0&&(r=r.replace(t,""))}}};return o(`[${jo}]`),e&&o(`[${e}]`),n&&o(`${Fo(Io.HIDDEN)}, ${Fo(Io.MASK)}`),r}return t.textContent}}const ti=[jo,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],ei=[ii,function(t){if(t.id&&!oi(t.id))return`#${CSS.escape(t.id)}`}],ni=[ii,function(t){if("BODY"===t.tagName)return;const e=t.classList;for(let n=0;n<e.length;n+=1){const r=e[n];if(!oi(r))return`${CSS.escape(t.tagName)}.${CSS.escape(r)}`}},function(t){return CSS.escape(t.tagName)}];function ri(t,e){if(!function(t){if("isConnected"in t)return t.isConnected;return t.ownerDocument.documentElement.contains(t)}(t))return;let n,r=t;for(;r&&"HTML"!==r.nodeName;){const t=ai(r,ei,ci,e,n);if(t)return t;n=ai(r,ni,ui,e,n)||li(si(r),n),r=r.parentElement}return n}function oi(t){return/[0-9]/.test(t)}function ii(t,e){if(e){const t=n(e);if(t)return t}for(const t of ti){const e=n(t);if(e)return e}function n(e){if(t.hasAttribute(e))return`${CSS.escape(t.tagName)}[${e}="${CSS.escape(t.getAttribute(e))}"]`}}function si(t){let e=t.parentElement.firstElementChild,n=1;for(;e&&e!==t;)e.tagName===t.tagName&&(n+=1),e=e.nextElementSibling;return`${CSS.escape(t.tagName)}:nth-of-type(${n})`}function ai(t,e,n,r,o){for(const i of e){const e=i(t,r);if(e&&n(t,e,o))return li(e,o)}}function ci(t,e,n){return 1===t.ownerDocument.querySelectorAll(li(e,n)).length}function ui(t,e,n){let r;if(void 0===n)r=t=>t.matches(e);else{const t=function(){if(void 0===di)try{document.querySelector(":scope"),di=!0}catch(t){di=!1}return di}()?li(`${e}:scope`,n):li(e,n);r=e=>null!==e.querySelector(t)}let o=t.parentElement.firstElementChild;for(;o;){if(o!==t&&r(o))return!1;o=o.nextElementSibling}return!0}function li(t,e){return e?`${t}>${e}`:t}let di;const fi=f;function pi(t,e){const n=[];let r,o=0;function i(t){t.stopObservable.subscribe(s),n.push(t),q(r),r=j(a,fi)}function s(){1===o&&n.every((t=>t.isStopped()))&&(o=2,e(n))}function a(){q(r),0===o&&(o=1,s())}return i(t),{tryAppend:t=>{return 0===o&&(n.length>0&&(e=n[n.length-1].event,r=t.event,!(e.target===r.target&&(s=e,c=r,Math.sqrt(Math.pow(s.clientX-c.clientX,2)+Math.pow(s.clientY-c.clientY,2))<=100)&&e.timeStamp-r.timeStamp<=fi))?(a(),!1):(i(t),!0));var e,r,s,c},stop:()=>{a()}}}function hi(){const t=window.getSelection();return!t||t.isCollapsed}function mi(t){return t.target instanceof Element&&!1!==t.isPrimary}function gi(t,e){if(function(t){if(t.some((t=>t.getUserActivity().selection||t.getUserActivity().scroll)))return!1;for(let e=0;e<t.length-2;e+=1)if(t[e+3-1].event.timeStamp-t[e].event.timeStamp<=f)return!0;return!1}(t))return e.addFrustration("rage_click"),t.some(yi)&&e.addFrustration("dead_click"),e.hasError&&e.addFrustration("error_click"),{isRage:!0};const n=t.some((t=>t.getUserActivity().selection));return t.forEach((t=>{t.hasError&&t.addFrustration("error_click"),yi(t)&&!n&&t.addFrustration("dead_click")})),{isRage:!1}}const vi='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function yi(t){return!(t.hasPageActivity||t.getUserActivity().input||t.getUserActivity().scroll)&&!t.event.target.matches(vi)}const _i=1e4,bi=new Map;function wi(t,e){bi.set(t,e),bi.forEach(((t,e)=>{k(e,b())>1e4&&bi.delete(e)}))}function Si(t,e,n,r){const o=kn({expireDelay:3e5}),i=new W;let s;t.subscribe(9,(()=>{o.reset()})),t.subscribe(4,u);const{stop:a}=function(t,{onPointerDown:e,onPointerUp:n}){let r,o,i={selection:!1,input:!1,scroll:!1};const s=[Ke(t,window,"pointerdown",(t=>{mi(t)&&(r=hi(),i={selection:!1,input:!1,scroll:!1},o=e(t))}),{capture:!0}),Ke(t,window,"selectionchange",(()=>{r&&hi()||(i.selection=!0)}),{capture:!0}),Ke(t,window,"scroll",(()=>{i.scroll=!0}),{capture:!0,passive:!0}),Ke(t,window,"pointerup",(t=>{if(mi(t)&&o){const e=i;n(o,t,(()=>e)),o=void 0}}),{capture:!0}),Ke(t,window,"input",(()=>{i.input=!0}),{capture:!0})];return{stop:()=>{s.forEach((t=>t.stop()))}}}(r,{onPointerDown:o=>function(t,e,n,r,o){const i=t.enablePrivacyForActionName?Po(r.target,t.defaultPrivacyLevel):Io.ALLOW;if(i===Io.HIDDEN)return;const s=function(t,e,n){const r=t.target.getBoundingClientRect(),o=ri(t.target,n.actionNameAttribute);o&&wi(t.timeStamp,o);const i=function(t,{enablePrivacyForActionName:e,actionNameAttribute:n},r){const o=qo(t,jo)||n&&qo(t,n);return o?{name:o,nameSource:"custom_attribute"}:r===Io.MASK?{name:"Masked Element",nameSource:"mask_placeholder"}:Ko(t,n,Ho,e)||Ko(t,n,Go,e)||{name:"",nameSource:"blank"}}(t.target,n,e);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:o},position:{x:Math.round(t.clientX-r.left),y:Math.round(t.clientY-r.top)},name:i.name,nameSource:i.nameSource}}(r,i,t);let a=!1;return So(e,n,o,t,(t=>{a=t.hadActivity}),wo),{clickActionBase:s,hadActivityOnPointerDown:()=>a}}(r,t,e,o,n),onPointerUp:({clickActionBase:s,hadActivityOnPointerDown:a},u,l)=>{!function(t,e,n,r,o,i,s,a,c,u,l){var d;const f=ki(e,o,u,a,c);s(f);const p=null===(d=null==a?void 0:a.target)||void 0===d?void 0:d.selector;p&&wi(c.timeStamp,p);const{stop:h}=So(e,n,r,t,(t=>{t.hadActivity&&t.end<f.startClocks.timeStamp?f.discard():t.hadActivity?f.stop(t.end):l()?f.stop(f.startClocks.timeStamp):f.stop()}),_i),m=e.subscribe(4,(({endClocks:t})=>{f.stop(t.timeStamp)})),g=i.subscribe((()=>{f.stop()}));f.stopObservable.subscribe((()=>{m.unsubscribe(),h(),g.unsubscribe()}))}(r,t,e,n,o,i,c,s,u,l,a)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:t=>o.findAll(t)}};function c(t){if(!s||!s.tryAppend(t)){const e=t.clone();s=pi(t,(t=>{!function(t,e){const{isRage:n}=gi(t,e);n?(t.forEach((t=>t.discard())),e.stop(_()),e.validate(t.map((t=>t.event)))):(e.discard(),t.forEach((t=>t.validate())))}(t,e)}))}}function u(){s&&s.stop()}}function ki(t,e,n,r,o){const i=Y(),s=w(),a=e.add(i,s.relative),c=mo({lifeCycle:t,isChildEvent:t=>void 0!==t.action&&(Array.isArray(t.action.id)?t.action.id.includes(i):t.action.id===i)});let u,l=0;const d=[],f=new W;function p(t){0===l&&(u=t,l=1,u?a.close(x(u)):a.remove(),c.stop(),f.notify())}return{event:o,stop:p,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return void 0!==u},getUserActivity:n,addFrustration:t=>{d.push(t)},startClocks:s,isStopped:()=>1===l||2===l,clone:()=>ki(t,e,n,r,o),validate:e=>{if(p(),1!==l)return;const{resourceCount:n,errorCount:a,longTaskCount:f}=c.eventCounts,h={duration:u&&k(s.timeStamp,u),startClocks:s,id:i,frustrationTypes:d,counts:{resourceCount:n,errorCount:a,longTaskCount:f},events:null!=e?e:[o],event:o,...r};t.notify(0,h),l=2},discard:()=>{p(),l=2}}}function Ci(t,e){const n=xi(t)?{action:{id:t.id,loading_time:ho(v(t.duration)),frustration:{type:t.frustrationTypes},error:{count:t.counts.errorCount},long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}},_dd:{action:{target:t.target,position:t.position,name_source:fe(ue.ACTION_NAME_MASKING)?t.nameSource:void 0}}}:void 0,r=xi(t)?void 0:t.context,o=on({action:{id:Y(),target:{name:t.name},type:t.type},date:t.startClocks.timeStamp,type:"action",view:{in_foreground:e.wasInPageStateAt("active",t.startClocks.relative)}},n),i=xi(t)?{events:t.events}:{};return!xi(t)&&t.handlingStack&&(i.handlingStack=t.handlingStack),{customerContext:r,rawRumEvent:o,startTime:t.startClocks.relative,domainContext:i}}function xi(t){return"custom"!==t.type}function Ti(e,n,r,o){const i=new W;return function(e){const n=ir([t.error]).subscribe((t=>e.notify(t.error)))}(i),Ge(i),function(t,e){const n=Ze(t,[Ye,Xe]).subscribe((t=>e.notify(t)))}(n,i),i.subscribe((t=>e.notify(13,{error:t}))),function(t,e,n){return t.subscribe(13,(({error:r,customerContext:o,savedCommonContext:i})=>{t.notify(11,{customerContext:o,savedCommonContext:i,...Ei(r,e,n)})})),{addError:({error:e,handlingStack:n,startClocks:r,context:o},i)=>{const s=Ue({stackTrace:ze(e)?me(e):void 0,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:"Provided",source:je,handling:"handled"});t.notify(13,{customerContext:o,savedCommonContext:i,error:s})}}}(e,r,o)}function Ei(t,e,n){const r={date:t.startClocks.timeStamp,error:{id:Y(),message:t.message,source:t.source,stack:t.stack,handling_stack:t.handlingStack,type:t.type,handling:t.handling,causes:t.causes,source_type:"browser",fingerprint:t.fingerprint,csp:t.csp},type:"error",view:{in_foreground:e.wasInPageStateAt("active",t.startClocks.relative)}},o=n.findFeatureFlagEvaluations(t.startClocks.relative);o&&!L(o)&&(r.feature_flags=o);const i={error:t.originalError,handlingStack:t.handlingStack};return{rawRumEvent:r,startTime:t.startClocks.relative,domainContext:i}}const Ai=new WeakSet;function Ri(t){if(!performance||!("getEntriesByName"in performance))return;const e=performance.getEntriesByName(t.url,"resource");if(!e.length||!("toJSON"in e[0]))return;const n=e.filter((t=>!Ai.has(t))).filter((t=>to(t)&&eo(t))).filter((e=>function(t,e,n){const r=1;return t.startTime>=e-r&&Ii(t)<=C(n,r)}(e,t.startClocks.relative,Ii({startTime:t.startClocks.relative,duration:t.duration}))));return 1===n.length?(Ai.add(n[0]),n[0].toJSON()):void 0}function Ii(t){return C(t.startTime,t.duration)}function Ni(t){const e=function(t){const e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return Oi(e&&e.content,n&&n.content)}(t)||function(t){const e=function(t){for(let e=0;e<t.childNodes.length;e+=1){const n=Li(t.childNodes[e]);if(n)return n}if(t.body)for(let e=t.body.childNodes.length-1;e>=0;e-=1){const n=t.body.childNodes[e],r=Li(n);if(r)return r;if(!Co(n))break}}(t);if(!e)return;return Oi(Q(e,"trace-id"),Q(e,"trace-time"))}(t);if(e&&!(e.traceTime<=y()-12e4))return e.traceId}function Oi(t,e){const n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function Li(t){if(t&&function(t){return t.nodeType===Node.COMMENT_NODE}(t)){const e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function Mi(){if(bo(vo.NAVIGATION)){const t=performance.getEntriesByType(vo.NAVIGATION)[0];if(t)return t}const t=function(){const t={},e=performance.timing;for(const n in e)if(d(e[n])){const r=n,o=e[r];t[r]=0===o?0:x(o)}return t}(),e={entryType:vo.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:t.responseEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...e,toJSON:void 0}),...t};return e}function Di(t,e){Wn(t,"interactive",(()=>{const t=Object.assign(Mi().toJSON(),{entryType:vo.RESOURCE,initiatorType:Wr,traceId:Ni(document),toJSON:()=>({...t,toJSON:void 0})});e(t)}))}function Pi(t,e,n,r=function(){const t=[];function e(e){let r;if(e.didTimeout){const t=performance.now();r=()=>30-(performance.now()-t)}else r=e.timeRemaining.bind(e);for(;r()>0&&t.length;)t.shift()();t.length&&n()}function n(){nr(e,{timeout:1e3})}return{push(e){1===t.push(e)&&n()}}}(),o=Di){t.subscribe(7,(t=>{s((()=>function(t,e,n){const r=Ri(t),o=r?m(r.startTime):t.startClocks,i=function(t,e){const n=t.traceSampled&&t.traceId&&t.spanId;if(!n)return;return{_dd:{span_id:t.spanId.toString(),trace_id:t.traceId.toString(),rule_psr:e.rulePsr}}}(t,e);if(!e.trackResources&&!i)return;const s="xhr"===t.type?"xhr":"fetch",a=r?$i(r):void 0,c=function(t,e,n){return t.wasInPageStateDuringPeriod("frozen",e.relative,n)?void 0:v(n)}(n,o,t.duration),u=on({date:o.timeStamp,resource:{id:Y(),type:s,duration:c,method:t.method,status_code:t.status,protocol:r&&ro(r),url:co(t.url)?uo(t.url):t.url,delivery_type:r&&oo(r)},type:"resource",_dd:{discarded:!e.trackResources}},i,a);return{startTime:o.relative,rawRumEvent:u,domainContext:{performanceEntry:r,xhr:t.xhr,response:t.response,requestInput:t.input,requestInit:t.init,error:t.error,isAborted:t.isAborted,handlingStack:t.handlingStack}}}(t,e,n)))}));const i=yo(e,{type:vo.RESOURCE,buffered:!0}).subscribe((t=>{for(const n of t)Yr(n)||s((()=>Ui(n,e)))}));function s(e){r.push((()=>{const n=e();n&&t.notify(11,n)}))}return o(e,(t=>{s((()=>Ui(t,e)))})),{stop:()=>{i.unsubscribe()}}}function Ui(t,e){const n=m(t.startTime),r=function(t,e){const n=t.traceId;if(!n)return;return{_dd:{trace_id:t.traceId,span_id:_r().toString(),rule_psr:e.rulePsr}}}(t,e);if(!e.trackResources&&!r)return;const o=Jr(t),i=$i(t),s=on({date:n.timeStamp,resource:{id:Y(),type:o,url:t.name,status_code:(a=t.responseStatus,0===a?void 0:a),protocol:ro(t),delivery_type:oo(t)},type:"resource",_dd:{discarded:!e.trackResources}},r,i);var a;return{startTime:n.relative,rawRumEvent:s,domainContext:{performanceEntry:t}}}function $i(t){const{renderBlockingStatus:e}=t;return{resource:{duration:Zr(t),render_blocking_status:e,...io(t),...Qr(t)}}}function zi(t,e,n=Mi){return function(t,e){let n;const{stop:r}=Wn(t,"complete",(()=>{n=j((()=>e()))}));return{stop:()=>{r(),q(n)}}}(t,(()=>{const t=n();(function(t){return t.loadEventEnd<=0})(t)||e(function(t){return{domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd,firstByte:t.responseStart>=0&&t.responseStart<=b()?t.responseStart:void 0}}(t))}))}function Bi(t,e=window){let n,r;return"hidden"===document.visibilityState?n=0:(n=1/0,({stop:r}=Je(t,e,["pagehide","visibilitychange"],(t=>{"pagehide"!==t.type&&"hidden"!==document.visibilityState||(n=t.timeStamp,r())}),{capture:!0}))),{get timeStamp(){return n},stop(){null==r||r()}}}function Vi(t,e,n){const r={},{stop:o}=zi(t,(t=>{e(t.loadEvent),r.navigationTimings=t,n()})),i=Bi(t),{stop:s}=function(t,e,n){return{stop:yo(t,{type:vo.PAINT,buffered:!0}).subscribe((t=>{const r=t.find((t=>"first-contentful-paint"===t.name&&t.startTime<e.timeStamp&&t.startTime<6e5));r&&n(r.startTime)})).unsubscribe}}(t,i,(t=>{r.firstContentfulPaint=t,n()})),{stop:a}=function(t,e,n,r){let o=1/0;const{stop:i}=Je(t,n,["pointerdown","keydown"],(t=>{o=t.timeStamp}),{capture:!0,once:!0});let s=0;const a=yo(t,{type:vo.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe((n=>{const i=function(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(e(r,n,t))return r}}(n,(t=>t.entryType===vo.LARGEST_CONTENTFUL_PAINT&&t.startTime<o&&t.startTime<e.timeStamp&&t.startTime<6e5&&t.size>s));if(i){let e;i.element&&(e=ri(i.element,t.actionNameAttribute)),r({value:i.startTime,targetSelector:e}),s=i.size}}));return{stop:()=>{i(),a.unsubscribe()}}}(t,i,window,(t=>{r.largestContentfulPaint=t,n()})),{stop:c}=function(t,e,n){const r=yo(t,{type:vo.FIRST_INPUT,buffered:!0}).subscribe((r=>{const o=r.find((t=>t.startTime<e.timeStamp));if(o){const e=k(o.startTime,o.processingStart);let r;o.target&&xo(o.target)&&(r=ri(o.target,t.actionNameAttribute)),n({delay:e>=0?e:0,time:o.startTime,targetSelector:r})}}));return{stop:()=>{r.unsubscribe()}}}(t,i,(t=>{r.firstInput=t,n()}));return{stop:function(){o(),s(),a(),c(),i.stop()},initialViewMetrics:r}}function Fi(t,e,n){if(!Gi())return{stop:X};let r,o,i=0;n({value:0});const s=function(){let t,e,n=0,r=0;return{update:o=>{let i;return void 0===t||o.startTime-e>=Hi||o.startTime-t>=qi?(t=e=o.startTime,r=n=o.value,i=!0):(n+=o.value,e=o.startTime,i=o.value>r,i&&(r=o.value)),{cumulatedValue:n,isMaxValue:i}}}}(),a=yo(t,{type:vo.LAYOUT_SHIFT,buffered:!0}).subscribe((a=>{for(const c of a){if(c.hadRecentInput||c.startTime<e)continue;const{cumulatedValue:a,isMaxValue:u}=s.update(c);if(u){const t=ji(c.sources);r=t?new WeakRef(t):void 0,o=k(e,c.startTime)}if(a>i){i=a;const e=null==r?void 0:r.deref();n({value:l(i,4),targetSelector:e&&ri(e,t.actionNameAttribute),time:o})}}}));return{stop:()=>{a.unsubscribe()}}}function ji(t){var e;if(t)return null===(e=t.find((t=>!!t.node&&xo(t.node))))||void 0===e?void 0:e.node}const qi=5e3,Hi=f;function Gi(){return bo(vo.LAYOUT_SHIFT)&&"WeakRef"in window}let Wi,Ki=0,Ji=1/0,Xi=0;const Yi=()=>Wi?Ki:window.performance.interactionCount||0;function Zi(t,e,n){if(!(bo(vo.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return{getInteractionToNextPaint:()=>{},setViewEnd:X,stop:X};const{getViewInteractionCount:r,stopViewInteractionCount:o}=function(t){"interactionCount"in performance||Wi||(Wi=new window.PerformanceObserver(z((t=>{t.getEntries().forEach((t=>{const e=t;e.interactionId&&(Ji=Math.min(Ji,e.interactionId),Xi=Math.max(Xi,e.interactionId),Ki=(Xi-Ji)/7+1)}))}))),Wi.observe({type:"event",buffered:!0,durationThreshold:0}));const e="initial_load"===t?0:Yi();let n={stopped:!1};function r(){return Yi()-e}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}(n);let i=1/0;const s=function(t){const e=[];function n(){e.sort(((t,e)=>e.duration-t.duration)).splice(10)}return{process(t){const r=e.findIndex((e=>t.interactionId===e.interactionId)),o=e[e.length-1];-1!==r?t.duration>e[r].duration&&(e[r]=t,n()):(e.length<10||t.duration>o.duration)&&(e.push(t),n())},estimateP98Interaction(){const n=Math.min(e.length-1,Math.floor(t()/50));return e[n]}}}(r);let a,c,u=-1;function l(n){for(const t of n)t.interactionId&&t.startTime>=e&&t.startTime<=i&&s.process(t);const r=s.estimateP98Interaction();r&&r.duration!==u&&(u=r.duration,c=k(e,r.startTime),a=function(t){const e=bi.get(t);return bi.delete(t),e}(r.startTime),!a&&r.target&&xo(r.target)&&(a=ri(r.target,t.actionNameAttribute)))}const d=yo(t,{type:vo.FIRST_INPUT,buffered:!0}).subscribe(l),f=yo(t,{type:vo.EVENT,durationThreshold:40,buffered:!0}).subscribe(l);return{getInteractionToNextPaint:()=>u>=0?{value:Math.min(u,6e4),targetSelector:a,time:c}:r()?{value:0}:void 0,setViewEnd:t=>{i=t,o()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function Qi(){let t;const e=window.visualViewport;return t=e?e.pageLeft-e.offsetLeft:void 0!==window.scrollX?window.scrollX:window.pageXOffset||0,Math.round(t)}function ts(){let t;const e=window.visualViewport;return t=e?e.pageTop-e.offsetTop:void 0!==window.scrollY?window.scrollY:window.pageYOffset||0,Math.round(t)}let es;function ns(t){return es||(es=function(t){return new W((e=>{const{throttled:n}=J((()=>{e.notify(rs())}),200);return Ke(t,window,"resize",n,{capture:!0,passive:!0}).stop}))}(t)),es}function rs(){const t=window.visualViewport;return t?{width:Number(t.width*t.scale),height:Number(t.height*t.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}function os(t,e,n,r=function(t,e=1e3){return new W((n=>{function r(){n.notify(function(){const t=ts(),{height:e}=rs(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(e+t);return{scrollHeight:n,scrollDepth:r,scrollTop:t}}())}if(window.ResizeObserver){const n=J(r,e,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,i=new ResizeObserver(z(n.throttled));o&&i.observe(o);const s=Ke(t,window,"scroll",n.throttled,{passive:!0});return()=>{n.cancel(),i.disconnect(),s.stop()}}}))}(t)){let o=0,i=0,s=0;const a=r.subscribe((({scrollDepth:t,scrollTop:r,scrollHeight:a})=>{let c=!1;if(t>o&&(o=t,c=!0),a>i){i=a;const t=b();s=k(e.relative,t),c=!0}c&&n({maxDepth:Math.min(o,i),maxDepthScrollTop:r,maxScrollHeight:i,maxScrollHeightTime:s})}));return{stop:()=>a.unsubscribe()}}function is(t,e,n,r,o,i,s){const a={},{stop:c,setLoadEvent:u}=function(t,e,n,r,o,i,s){let a="initial_load"===o,c=!0;const u=[],l=Bi(r);function d(){if(!c&&!a&&u.length>0){const t=Math.max(...u);t<l.timeStamp&&s(t)}}const{stop:f}=So(t,e,n,r,(t=>{c&&(c=!1,t.hadActivity&&u.push(k(i.timeStamp,t.end)),d())}));return{stop:()=>{f(),l.stop()},setLoadEvent:t=>{a&&(a=!1,u.push(t),d())}}}(t,e,n,r,i,s,(t=>{a.loadingTime=t,o()})),{stop:l}=os(r,s,(t=>{a.scroll=t})),{stop:d}=Fi(r,s.relative,(t=>{a.cumulativeLayoutShift=t,o()})),{stop:f,getInteractionToNextPaint:p,setViewEnd:h}=Zi(r,s.relative,i);return{stop:()=>{c(),d(),l()},stopINPTracking:f,setLoadEvent:u,setViewEnd:h,getCommonViewMetrics:()=>(a.interactionToNextPaint=p(),a)}}const ss=3e5,as=3e5;function cs(t,e,n,r,i,s,a,c){const u=new Set;let l,d=f("initial_load",S(),c);function f(s,a,c){const l=function(t,e,n,r,i,s,a=w(),c){const u=Y(),l=new W,d={};let f,p=0;const m=N(i),g=sr();let v,y,b,S,C=!0;c&&(v=c.name,y=c.service||void 0,b=c.version||void 0,c.context&&(S=c.context,g.setContext(S)));const x={id:u,name:v,startClocks:a,service:y,version:b,context:S};t.notify(1,x),t.notify(2,x);const{throttled:T,cancel:E}=J(z,3e3,{leading:!1}),{setLoadEvent:A,setViewEnd:R,stop:I,stopINPTracking:O,getCommonViewMetrics:L}=is(t,e,n,r,T,s,a),{stop:M,initialViewMetrics:D}="initial_load"===s?Vi(r,A,T):{stop:X,initialViewMetrics:{}},{stop:P,eventCounts:U}=function(t,e,n){const{stop:r,eventCounts:o}=mo({lifeCycle:t,isChildEvent:t=>t.view.id===e,onChange:n});return{stop:r,eventCounts:o}}(t,u,T),$=H(z,ss);function z(){E(),p+=1;const e=void 0===f?_():f.timeStamp;t.notify(3,{customTimings:d,documentVersion:p,id:u,name:v,service:y,version:b,context:g.getContext(),loadingType:s,location:m,startClocks:a,commonViewMetrics:L(),initialViewMetrics:D,duration:k(a.timeStamp,e),isActive:void 0===f,sessionIsActive:C,eventCounts:U})}return z(),g.changeObservable.subscribe(z),{get name(){return v},service:y,version:b,contextManager:g,stopObservable:l,end(e={}){var n,r;f||(f=null!==(n=e.endClocks)&&void 0!==n?n:w(),C=null===(r=e.sessionIsActive)||void 0===r||r,t.notify(4,{endClocks:f}),t.notify(5,{endClocks:f}),G($),R(f.relative),I(),z(),j((()=>{this.stop()}),as))},stop(){M(),P(),O(),l.notify()},addTiming(t,e){if(f)return;const n=function(t){return t<h}(e)?e:k(a.timeStamp,e);d[function(t){const e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&o.warn(`Invalid timing name: ${t}, sanitized to: ${e}`);return e}(t)]=n,T()},setViewName(t){v=t,z()}}}(e,n,r,i,t,s,a,c);return u.add(l),l.stopObservable.subscribe((()=>{u.delete(l)})),l}return e.subscribe(9,(()=>{d=f("route_change",void 0,{name:d.name,service:d.service,version:d.version,context:d.contextManager.getContext()})})),e.subscribe(8,(()=>{d.end({sessionIsActive:!1})})),e.subscribe(10,(t=>{t.reason===Bn.UNLOADING&&d.end()})),a&&(l=function(t){return t.subscribe((({oldLocation:t,newLocation:e})=>{var n,r;r=e,((n=t).pathname!==r.pathname||!function(t){const e=t.substring(1);return""!==e&&!!document.getElementById(e)}(r.hash)&&us(r.hash)!==us(n.hash))&&(d.end(),d=f("route_change"))}))}(s)),{addTiming:(t,e=_())=>{d.addTiming(t,e)},startView:(t,e)=>{d.end({endClocks:e}),d=f("route_change",e,t)},setViewContext:t=>{d.contextManager.setContext(t)},setViewContextProperty:(t,e)=>{d.contextManager.setContextProperty(t,e)},setViewName:t=>{d.setViewName(t)},stop:()=>{l&&l.unsubscribe(),d.end(),u.forEach((t=>t.stop()))}}}function us(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ls(t,e,n,r,o,i,s,a,c,u){return t.subscribe(3,(n=>t.notify(11,function(t,e,n,r,o){var i,s,a,c,u,l,d,f,p,h,m,g,y,_,b,w;const S=r.getReplayStats(t.id),k=n.findFeatureFlagEvaluations(t.startClocks.relative),C=o.findAll(t.startClocks.relative,t.duration),x={_dd:{document_version:t.documentVersion,replay_stats:S,page_states:C,configuration:{start_session_replay_recording_manually:e.startSessionReplayRecordingManually}},date:t.startClocks.timeStamp,type:"view",view:{action:{count:t.eventCounts.actionCount},frustration:{count:t.eventCounts.frustrationCount},cumulative_layout_shift:null===(i=t.commonViewMetrics.cumulativeLayoutShift)||void 0===i?void 0:i.value,cumulative_layout_shift_time:v(null===(s=t.commonViewMetrics.cumulativeLayoutShift)||void 0===s?void 0:s.time),cumulative_layout_shift_target_selector:null===(a=t.commonViewMetrics.cumulativeLayoutShift)||void 0===a?void 0:a.targetSelector,first_byte:v(null===(c=t.initialViewMetrics.navigationTimings)||void 0===c?void 0:c.firstByte),dom_complete:v(null===(u=t.initialViewMetrics.navigationTimings)||void 0===u?void 0:u.domComplete),dom_content_loaded:v(null===(l=t.initialViewMetrics.navigationTimings)||void 0===l?void 0:l.domContentLoaded),dom_interactive:v(null===(d=t.initialViewMetrics.navigationTimings)||void 0===d?void 0:d.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:v(t.initialViewMetrics.firstContentfulPaint),first_input_delay:v(null===(f=t.initialViewMetrics.firstInput)||void 0===f?void 0:f.delay),first_input_time:v(null===(p=t.initialViewMetrics.firstInput)||void 0===p?void 0:p.time),first_input_target_selector:null===(h=t.initialViewMetrics.firstInput)||void 0===h?void 0:h.targetSelector,interaction_to_next_paint:v(null===(m=t.commonViewMetrics.interactionToNextPaint)||void 0===m?void 0:m.value),interaction_to_next_paint_time:v(null===(g=t.commonViewMetrics.interactionToNextPaint)||void 0===g?void 0:g.time),interaction_to_next_paint_target_selector:null===(y=t.commonViewMetrics.interactionToNextPaint)||void 0===y?void 0:y.targetSelector,is_active:t.isActive,name:t.name,largest_contentful_paint:v(null===(_=t.initialViewMetrics.largestContentfulPaint)||void 0===_?void 0:_.value),largest_contentful_paint_target_selector:null===(b=t.initialViewMetrics.largestContentfulPaint)||void 0===b?void 0:b.targetSelector,load_event:v(null===(w=t.initialViewMetrics.navigationTimings)||void 0===w?void 0:w.loadEvent),loading_time:ho(v(t.commonViewMetrics.loadingTime)),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:v(t.duration)},feature_flags:k&&!L(k)?k:void 0,display:t.commonViewMetrics.scroll?{scroll:{max_depth:t.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:t.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:t.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:v(t.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:!!S||void 0,is_active:!!t.sessionIsActive&&void 0},privacy:{replay_level:e.defaultPrivacyLevel}};L(t.customTimings)||(x.view.custom_timings=function(t,e){const n={};for(const r of Object.keys(t))n[r]=e(t[r]);return n}(t.customTimings,v));return{rawRumEvent:x,startTime:t.startClocks.relative,domainContext:{location:t.location}}}(n,e,s,c,a)))),cs(n,t,r,o,e,i,!e.trackViewsManually,u)}function ds(t,e,n){const r=Tn(t,"rum",(e=>function(t,e){let n;n=function(t){return"0"===t||"1"===t||"2"===t}(e)?e:u(t.sessionSampleRate)?u(t.sessionReplaySampleRate)?"1":"2":"0";return{trackingType:n,isTracked:fs(n)}}(t,e)),n);return r.expireObservable.subscribe((()=>{e.notify(8)})),r.renewObservable.subscribe((()=>{e.notify(9)})),r.sessionStateUpdateObservable.subscribe((({previousState:t,newState:e})=>{if(!t.forcedReplay&&e.forcedReplay){const t=r.findSession();t&&(t.isReplayForced=!0)}})),{findTrackedSession:t=>{const e=r.findSession(t);if(e&&fs(e.trackingType))return{id:e.id,sessionReplay:"1"===e.trackingType?1:e.isReplayForced?2:0,anonymousId:e.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function fs(t){return"2"===t||"1"===t}function ps(t,e,n,r,o,i,s){const a=t.replica,c=function(t,e,n,r,o,i,s=Fn){const a=u(t,e),c=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return s({encoder:n,request:Mn(e,t.batchBytesLimit,r),flushController:qn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(t,e=!0){a.add(t),c&&e&&c.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{a.upsert(t,e),c&&c.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{a.stop(),c&&c.stop()}}}(t,{endpoint:t.rumEndpointBuilder,encoder:s(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:t=>on(t,{application:{id:a.applicationId}}),encoder:s(3)},r,o,i);return e.subscribe(12,(t=>{"view"===t.type?c.upsert(t,t.view.id):c.add(t)})),n.subscribe((e=>c.add(e,function(t){return t.site===Jt}(t)))),c}const hs=ht;function ms(t,e){let n=N(e);return new W((r=>{const{stop:o}=function(t,e){const{stop:n}=Ie(gs("pushState"),"pushState",(({onPostCall:t})=>{t(e)})),{stop:r}=Ie(gs("replaceState"),"replaceState",(({onPostCall:t})=>{t(e)})),{stop:o}=Ke(t,window,"popstate",e);return{stop:()=>{n(),r(),o()}}}(t,s),{stop:i}=function(t,e){return Ke(t,window,"hashchange",e)}(t,s);function s(){if(n.href===e.href)return;const t=N(e);r.notify({newLocation:t,oldLocation:n}),n=t}return()=>{o(),i()}}))}function gs(t){return Object.prototype.hasOwnProperty.call(history,t)?history:History.prototype}const vs=ht;let ys,_s,bs;function ws(){0!==ys.batchCount&&(vn("Customer data measures",ys),Cs())}function Ss(t,e){t.sum+=e,t.min=Math.min(t.min,e),t.max=Math.max(t.max,e)}function ks(t,e){t.sum+=e.sum,t.min=Math.min(t.min,e.min),t.max=Math.max(t.max,e.max)}function Cs(){ys={batchCount:0,batchBytesCount:{min:1/0,max:0,sum:0},batchMessagesCount:{min:1/0,max:0,sum:0},globalContextBytes:{min:1/0,max:0,sum:0},userContextBytes:{min:1/0,max:0,sum:0},featureFlagBytes:{min:1/0,max:0,sum:0}}}function xs(){bs=!1,_s={globalContextBytes:{min:1/0,max:0,sum:0},userContextBytes:{min:1/0,max:0,sum:0},featureFlagBytes:{min:1/0,max:0,sum:0}}}const Ts=ht;function Es(t,e=500){const n=kn({expireDelay:Ts,maxEntries:4e3});let r;i(As(),b());const{stop:o}=Je(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],(t=>{i(function(t){if("freeze"===t.type)return"frozen";if("pagehide"===t.type)return t.persisted?"frozen":"terminated";return As()}(t),t.timeStamp)}),{capture:!0});function i(t,e=b()){t!==r&&(r=t,n.closeActive(e),n.add({state:r,startTime:e},e))}const s={findAll:(t,r)=>{const o=n.findAll(t,r);if(0===o.length)return;const i=[],s=Math.max(0,o.length-e);for(let e=o.length-1;e>=s;e--){const n=o[e],r=k(t,n.startTime);i.push({state:n.state,start:v(r)})}return i},wasInPageStateAt:(t,e)=>s.wasInPageStateDuringPeriod(t,e,0),wasInPageStateDuringPeriod:(t,e,r)=>n.findAll(e,r).some((e=>e.state===t)),addPageState:i,stop:()=>{o(),n.stop()}};return s}function As(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}function Rs(t,e){const n=window.cookieStore?function(t){return(e,n)=>Ke(t,window.cookieStore,"change",(t=>{const r=t.changed.find((t=>t.name===e))||t.deleted.find((t=>t.name===e));r&&n(r.value)})).stop}(t):Ns;return new W((t=>n(e,(e=>t.notify(e)))))}const Is=f;function Ns(t,e){const n=Q(document.cookie,t),r=H((()=>{const r=Q(document.cookie,t);r!==n&&e(r)}),Is);return()=>{G(r)}}const Os="datadog-ci-visibility-test-execution-id";function Ls(t,{session:e,viewContext:n,errorType:r}){const o=e?e.id:"no-session-id",i=[];void 0!==r&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const s=function(t){const e=t.site,n=t.subdomain||function(t){switch(t.site){case Yt:case Zt:return"app";case Jt:return"dd";default:return}}(t);return`https://${n?`${n}.`:""}${e}`}(t);return`${s}${`/rum/replay/sessions/${o}`}?${i.join("&")}`}let Ms;function Ds(t){return Ps(t).segments_count}function Ps(t){let e;return Ms||(Ms=new Map),Ms.has(t)?e=Ms.get(t):(e={records_count:0,segments_count:0,segments_total_raw_size:0},Ms.set(t,e),Ms.size>10&&function(){if(!Ms)return;const t=Ms.keys().next().value;t&&Ms.delete(t)}()),e}function Us(t,e,n){let r,o=0,i=[],s=0;const a=[],{stop:c}=Ke(t,e,"message",(({data:t})=>{if("wrote"!==t.type||t.streamId!==n)return;o+=t.additionalBytesCount,i.push(t.result),r=t.trailer;const e=a.shift();e&&e.id===t.id?e.writeCallback?e.writeCallback(t.result.byteLength):e.finishCallback&&e.finishCallback():(c(),vn("Worker responses received out of order."))}));function u(){const t=0===i.length?new Uint8Array(0):function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(i.concat(r)),e={rawBytesCount:o,output:t,outputBytesCount:t.byteLength,encoding:"deflate"};return o=0,i=[],e}function l(){s>0&&(e.postMessage({action:"reset",streamId:n}),s=0)}return{isAsync:!0,get isEmpty(){return 0===s},write(t,r){e.postMessage({action:"write",id:s,data:t,streamId:n}),a.push({id:s,writeCallback:r,data:t}),s+=1},finish(t){l(),a.length?(a.forEach((t=>{delete t.writeCallback})),a[a.length-1].finishCallback=()=>t(u())):t(u())},finishSync(){l();const t=a.map((t=>(delete t.writeCallback,delete t.finishCallback,t.data))).join("");return{...u(),pendingData:t}},estimateEncodedBytesCount:t=>t.length/8,stop(){c()}}}function $s(t){return new Worker(t.workerUrl||URL.createObjectURL(new Blob(['(()=>{"use strict";function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([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]),h=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:"pako deflate (from Nodeca project)"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a="[object ArrayBuffer]"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:String(e),streamId:a})}}function se(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,"[object ArrayBuffer]"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.0.0"};case"write":{let n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()})();'])))}let zs={status:0};function Bs(t,e,n,r=$s){switch(0===zs.status&&function(t,e,n=$s){try{const r=n(t),{stop:i}=Ke(t,r,"error",(n=>{Fs(t,e,n)})),{stop:s}=Ke(t,r,"message",(({data:n})=>{var r;"errored"===n.type?Fs(t,e,n.error,n.streamId):"initialized"===n.type&&(r=n.version,1===zs.status&&(zs={status:3,worker:zs.worker,stop:zs.stop,version:r}))}));r.postMessage({action:"init"}),j((()=>function(t){1===zs.status&&(o.error(`${t} failed to start: a timeout occurred while initializing the Worker`),zs.initializationFailureCallbacks.forEach((t=>t())),zs={status:2})}(e)),3e4);zs={status:1,worker:r,stop:()=>{i(),s()},initializationFailureCallbacks:[]}}catch(n){Fs(t,e,n)}}(t,e,r),zs.status){case 1:return zs.initializationFailureCallbacks.push(n),zs.worker;case 3:return zs.worker}}function Vs(){return zs.status}function Fs(t,e,n,r){if(1===zs.status||0===zs.status){if(o.error(`${e} failed to start: an error occurred while creating the Worker:`,n),n instanceof Event||n instanceof Error&&((s=n.message).includes("Content Security Policy")||s.includes("requires 'TrustedScriptURL'"))){let e;e=t.workerUrl?`Please make sure the Worker URL ${t.workerUrl} is correct and CSP is correctly configured.`:"Please make sure CSP is correctly configured.",o.error(`${e} See documentation at ${i}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else yn(n);1===zs.status&&zs.initializationFailureCallbacks.forEach((t=>t())),zs={status:2}}else yn(n,{worker_version:3===zs.status&&zs.version,stream_id:r});var s}function js(){return"function"==typeof Array.from&&"function"==typeof CSSSupportsRule&&"function"==typeof URL.createObjectURL&&"forEach"in NodeList.prototype}function qs(t,e,n,r){const o=e.findTrackedSession(),i=function(t,e){if(!js())return"browser-not-supported";if(!t)return"rum-not-tracked";if(0===t.sessionReplay)return"incorrect-session-plan";if(!e)return"replay-not-started"}(o,r);return Ls(t,{viewContext:n.findView(),errorType:i,session:o})}function Hs(t,e,n,r,o,i){let s,a=0;e.subscribe(8,(()=>{2!==a&&3!==a||(l(),a=1)})),e.subscribe(10,(t=>{t.reason===Bn.UNLOADING&&l()})),e.subscribe(9,(()=>{1===a&&u()}));const c=async()=>{const[c]=await Promise.all([o(),Kn(t,"interactive")]);if(2!==a)return;const u=i();u&&c?(({stop:s}=c(e,t,n,r,u)),a=3):a=0};function u(t){const e=n.findTrackedSession();!function(t,e){return!t||0===t.sessionReplay&&(!e||!e.force)}(e,t)?function(t){return 2===t||3===t}(a)||(a=2,c().catch(V),function(t,e){return e&&e.force&&0===t.sessionReplay}(e,t)&&n.setForcedReplay()):a=1}function l(){3===a&&(null==s||s()),a=0}return{start:u,stop:l,getSessionReplayLink:()=>qs(t,n,r,0!==a),isRecording:()=>3===a}}const Gs=function(t,e,n={}){const r=lr(0),i=sr(r.getOrCreateTracker(2)),s=sr(r.getOrCreateTracker(1)),a=function(t){const e=new W;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Ft.GRANTED,observable:e}}(),c={vitalsByName:new Map,vitalsByReference:new WeakMap};function u(){return function(t,e,n){return{context:t.getContext(),user:e.getContext(),hasReplay:!!n.isRecording()||void 0}}(i,s,e)}let l=Lr(n,u,a,c,((o,d,f)=>{o.storeContextsAcrossPages&&(ur(o,i,"rum",2),ur(o,s,"rum",1)),r.setCompressionStatus(d?1:2);const p=t(o,e,r,u,f,d&&n.createDeflateEncoder?t=>n.createDeflateEncoder(o,d,t):Hn,a,c);return e.onRumStart(p.lifeCycle,o,p.session,p.viewHistory,d),l=function(t,e){return{init:t=>{We("DD_RUM",t)},initConfiguration:t.initConfiguration,...e}}(l,p),p}));const d=z((t=>{const e="object"==typeof t?t:{name:t};e.context&&r.getOrCreateTracker(3).updateCustomerData(e.context),l.startView(e),_n({feature:"start-view"})})),f=function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>$,enumerable:!1}),e}({init:z((t=>{l.init(t,f)})),setTrackingConsent:z((t=>{a.update(t),_n({feature:"set-tracking-consent",tracking_consent:t})})),setViewName:z((t=>{l.setViewName(t)})),setViewContext:z((t=>{l.setViewContext(t)})),setViewContextProperty:z(((t,e)=>{l.setViewContextProperty(t,e)})),setGlobalContext:z((t=>{i.setContext(t),_n({feature:"set-global-context"})})),getGlobalContext:z((()=>i.getContext())),setGlobalContextProperty:z(((t,e)=>{i.setContextProperty(t,e),_n({feature:"set-global-context"})})),removeGlobalContextProperty:z((t=>i.removeContextProperty(t))),clearGlobalContext:z((()=>i.clearContext())),getInternalContext:z((t=>l.getInternalContext(t))),getInitConfiguration:z((()=>rn(l.initConfiguration))),addAction:(t,e)=>{const n=Ee();B((()=>{l.addAction({name:Oe(t),context:Oe(e),startClocks:w(),type:"custom",handlingStack:n}),_n({feature:"add-action"})}))},addError:(t,e)=>{const n=Ee();B((()=>{l.addError({error:t,handlingStack:n,context:Oe(e),startClocks:w()}),_n({feature:"add-error"})}))},addTiming:z(((t,e)=>{l.addTiming(Oe(t),e)})),setUser:z((t=>{(function(t){const e="object"===ft(t);return e||o.error("Unsupported user:",t),e})(t)&&s.setContext(pt(t)),_n({feature:"set-user"})})),getUser:z((()=>s.getContext())),setUserProperty:z(((t,e)=>{const n=pt({[t]:e})[t];s.setContextProperty(t,n),_n({feature:"set-user"})})),removeUserProperty:z((t=>s.removeContextProperty(t))),clearUser:z((()=>s.clearContext())),startView:d,stopSession:z((()=>{l.stopSession(),_n({feature:"stop-session"})})),addFeatureFlagEvaluation:z(((t,e)=>{l.addFeatureFlagEvaluation(Oe(t),Oe(e)),_n({feature:"add-feature-flag-evaluation"})})),getSessionReplayLink:z((()=>e.getSessionReplayLink())),startSessionReplayRecording:z((t=>{e.start(t),_n({feature:"start-session-replay-recording",force:t&&t.force})})),stopSessionReplayRecording:z((()=>e.stop())),addDurationVital:z(((t,e)=>{var n;_n({feature:"add-duration-vital"}),l.addDurationVital({name:Oe(t),type:"duration",startClocks:(n=e.startTime,{relative:x(n),timeStamp:n}),duration:e.duration,context:Oe(e&&e.context),description:Oe(e&&e.description)})})),startDurationVital:z(((t,e)=>(_n({feature:"start-duration-vital"}),l.startDurationVital(Oe(t),{context:Oe(e&&e.context),description:Oe(e&&e.description)})))),stopDurationVital:z(((t,e)=>{_n({feature:"stop-duration-vital"}),l.stopDurationVital("string"==typeof t?Oe(t):t,{context:Oe(e&&e.context),description:Oe(e&&e.description)})}))});return f}((function(t,e,n,r,o,i,s,a){var c;const l=[],d=new Hr;d.subscribe(12,(t=>en("rum",t)));const f=function(t){const e=gn("browser-rum-sdk",t);if(zn()){const t=Un();e.observable.subscribe((e=>t.send("internal_telemetry",e)))}return e}(t);f.setContextProvider((()=>{var e,n;return{application:{id:t.applicationId},session:{id:null===(e=_.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(n=T.findView())||void 0===n?void 0:n.id},action:{id:A.findActionId()}}}));const p=t=>{d.notify(13,{error:t}),vn("Error reported to customer",{"error.message":t.message})},h=function(t,e){const n=kn({expireDelay:vs});return t.subscribe(1,(({startClocks:t})=>{n.add({},t.relative),e.resetCustomerData()})),t.subscribe(5,(({endClocks:t})=>{n.closeActive(t.relative)})),{findFeatureFlagEvaluations:t=>n.find(t),addFeatureFlagEvaluation:(t,r)=>{const o=n.find();o&&(o[t]=r,e.updateCustomerData(o))},stop:()=>e.stop()}}(d,n.getOrCreateTracker(0)),g=function(t){return new W((e=>{const{stop:n}=Je(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Bn.HIDDEN}):"freeze"===t.type&&e.notify({reason:Bn.FROZEN})}),{capture:!0}),r=Ke(t,window,"beforeunload",(()=>{e.notify({reason:Bn.UNLOADING})})).stop;return()=>{n(),r()}}))}(t),y=g.subscribe((t=>{d.notify(10,t)}));l.push((()=>y.unsubscribe()));const _=zn()?function(){const t={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:$n("records")?1:0};return{findTrackedSession:()=>t,expire:X,expireObservable:new W,setForcedReplay:X}}():ds(t,d,s);if(zn())!function(t){const e=Un();t.subscribe(12,(t=>{e.send("rum",t)}))}(d);else{const e=ps(t,d,f.observable,p,g,_.expireObservable,i);l.push((()=>e.stop())),function(t,e,n,r,o){e.enabled&&u(t.customerDataTelemetrySampleRate)&&(Cs(),xs(),n.subscribe(12,(t=>{bs=!0,Ss(_s.globalContextBytes,r.getOrCreateTracker(2).getBytesCount()),Ss(_s.userContextBytes,r.getOrCreateTracker(1).getBytesCount()),Ss(_s.featureFlagBytes,["view","error"].includes(t.type)?r.getOrCreateTracker(0).getBytesCount():0)})),o.subscribe((({bytesCount:t,messagesCount:e})=>{bs&&(ys.batchCount+=1,Ss(ys.batchBytesCount,t),Ss(ys.batchMessagesCount,e),ks(ys.globalContextBytes,_s.globalContextBytes),ks(ys.userContextBytes,_s.userContextBytes),ks(ys.featureFlagBytes,_s.featureFlagBytes),xs())})),H(ws,1e4))}(t,f,d,n,e.flushObservable)}const w=function(){const t=Mr();return new W((e=>{if(!t)return;const n=new t(z((()=>e.notify())));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()}))}(),S=ms(t,location),k=Es(t),{observable:C,stop:x}=function(){const t=new W,{stop:e}=Ie(window,"open",(()=>t.notify()));return{observable:t,stop:e}}();l.push(x);const{viewHistory:T,urlContexts:E,actionContexts:A,addAction:R,stop:I}=function(t,e,n,r,o,i,s,a,c,u){const l=function(t){const e=kn({expireDelay:Gr});return t.subscribe(1,(t=>{e.add(function(t){return{service:t.service,version:t.version,context:t.context,id:t.id,name:t.name,startClocks:t.startClocks}}(t),t.startClocks.relative)})),t.subscribe(5,(({endClocks:t})=>{e.closeActive(t.relative)})),t.subscribe(3,(t=>{const n=e.find(t.startClocks.relative);n&&t.name&&(n.name=t.name),n&&t.context&&(n.context=t.context)})),t.subscribe(9,(()=>{e.reset()})),{findView:t=>e.find(t),stop:()=>{e.stop()}}}(t),d=function(t,e,n){const r=kn({expireDelay:hs});let o;t.subscribe(1,(({startClocks:t})=>{const e=n.href;r.add(s({url:e,referrer:o||document.referrer}),t.relative),o=e})),t.subscribe(5,(({endClocks:t})=>{r.closeActive(t.relative)}));const i=e.subscribe((({newLocation:t})=>{const e=r.find();if(e){const n=b();r.closeActive(n),r.add(s({url:t.href,referrer:e.referrer}),n)}}));function s({url:t,referrer:e}){return{url:t,referrer:e}}return{findUrl:t=>r.find(t),stop:()=>{i.unsubscribe(),r.stop()}}}(t,i,n),f=function(t,e,n,r,o){t.subscribe(0,(e=>t.notify(11,Ci(e,o))));let i={findActionId:X},s=X;return r.trackUserInteractions&&({actionContexts:i,stop:s}=Si(t,e,n,r)),{addAction:(e,n)=>{t.notify(11,{savedCommonContext:n,...Ci(e,o)})},actionContexts:i,stop:s}}(t,s,a,e,o),p=function(t){let e,n;fe(ue.DELAY_VIEWPORT_COLLECTION)?n=requestAnimationFrame((()=>{e=rs()})):e=rs();const r=ns(t).subscribe((t=>{e=t})).unsubscribe;return{get:()=>e?{viewport:e}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}(e),h=function(t,e=Rs(t,Os)){var n;let r=at(Os)||(null===(n=window.Cypress)||void 0===n?void 0:n.env("traceId"));const o=e.subscribe((t=>{r=t}));return{get:()=>{if("string"==typeof r)return{test_execution_id:r}},stop:()=>o.unsubscribe()}}(e);return qr(e,t,r,l,d,f.actionContexts,p,h,c,u),{viewHistory:l,pageStateHistory:o,urlContexts:d,addAction:f.addAction,actionContexts:f.actionContexts,stop:()=>{f.stop(),h.stop(),p.stop(),d.stop(),l.stop(),o.stop()}}}(d,t,location,_,k,S,w,C,r,p);l.push(I),hn.drain();const{addTiming:N,startView:O,setViewName:L,setViewContext:M,setViewContextProperty:D,stop:P}=ls(d,t,location,w,C,S,h,k,e,o);l.push(P);const{stop:U}=Pi(d,t,k);if(l.push(U),t.trackLongTasks)if(null===(c=PerformanceObserver.supportedEntryTypes)||void 0===c?void 0:c.includes(vo.LONG_ANIMATION_FRAME)){const{stop:e}=function(t,e){const n=yo(e,{type:vo.LONG_ANIMATION_FRAME,buffered:!0}).subscribe((e=>{for(const n of e){const e=m(n.startTime),r={date:e.timeStamp,long_task:{id:Y(),entry_type:"long-animation-frame",duration:v(n.duration),blocking_duration:v(n.blockingDuration),first_ui_event_timestamp:v(n.firstUIEventTimestamp),render_start:v(n.renderStart),style_and_layout_start:v(n.styleAndLayoutStart),start_time:v(n.startTime),scripts:n.scripts.map((t=>({duration:v(t.duration),pause_duration:v(t.pauseDuration),forced_style_and_layout_duration:v(t.forcedStyleAndLayoutDuration),start_time:v(t.startTime),execution_start:v(t.executionStart),source_url:t.sourceURL,source_function_name:t.sourceFunctionName,source_char_position:t.sourceCharPosition,invoker:t.invoker,invoker_type:t.invokerType,window_attribution:t.windowAttribution})))},type:"long_task",_dd:{discarded:!1}};t.notify(11,{rawRumEvent:r,startTime:e.relative,domainContext:{performanceEntry:n}})}}));return{stop:()=>n.unsubscribe()}}(d,t);l.push(e)}else!function(t,e){const n=yo(e,{type:vo.LONG_TASK,buffered:!0}).subscribe((n=>{for(const r of n){if(r.entryType!==vo.LONG_TASK)break;if(!e.trackLongTasks)break;const n=m(r.startTime),o={date:n.timeStamp,long_task:{id:Y(),entry_type:"long-task",duration:v(r.duration)},type:"long_task",_dd:{discarded:!1}};t.notify(11,{rawRumEvent:o,startTime:n.relative,domainContext:{performanceEntry:r}})}}))}(d,t);const{addError:$}=Ti(d,t,k,h);fo(d,t,_);const B=mr(d,k,a),V=function(t,e,n,r,o){return{get:i=>{const s=n.findView(i),a=o.findUrl(i),c=e.findTrackedSession(i);if(c&&s&&a){const e=r.findActionId(i);return{application_id:t,session_id:c.id,user_action:e?{id:e}:void 0,view:{id:s.id,name:s.name,referrer:a.referrer,url:a.url}}}}}}(t.applicationId,_,T,A,E);return{addAction:R,addError:$,addTiming:N,addFeatureFlagEvaluation:h.addFeatureFlagEvaluation,startView:O,setViewContext:M,setViewContextProperty:D,setViewName:L,lifeCycle:d,viewHistory:T,session:_,stopSession:()=>_.expire(),getInternalContext:V.get,startDurationVital:B.startDurationVital,stopDurationVital:B.stopDurationVital,addDurationVital:B.addDurationVital,stop:()=>{l.forEach((t=>t()))}}}),function(t,e){if(zn()&&!$n("records")||!js())return{start:X,stop:X,getReplayStats:()=>{},onRumStart:X,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=function(){let t=0;return{strategy:{start(){t=1},stop(){t=2},isRecording:()=>!1,getSessionReplayLink:X},shouldStartImmediately:e=>1===t||0===t&&!e.startSessionReplayRecordingManually}}();return{start:t=>n.start(t),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:function(o,i,s,a,c){let u;n=Hs(i,o,s,a,t,(function(){u||(null!=c||(c=Bs(i,"Datadog Session Replay",(()=>{n.stop()}),e)),c&&(u=Us(i,c,1)));return u})),r(i)&&n.start()},isRecording:()=>3===Vs()&&n.isRecording(),getReplayStats:t=>3===Vs()?function(t){return null==Ms?void 0:Ms.get(t)}(t):void 0}}((async function(){try{return(await Promise.resolve().then((function(){return lc}))).startRecording}catch(t){}})),{startDeflateWorker:Bs,createDeflateEncoder:Us});!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach((t=>c(t,"onReady callback threw an error:")()))}(M(),"DD_RUM",Gs);globalThis.DD_RUM=Gs;const Ws=new WeakMap;function Ks(t){return Ws.has(t)}function Js(t){return Ws.get(t)}function Xs(t,e){const n=t.tagName,r=t.value;if(zo(t,e)){const e=t.type;if("INPUT"===n&&("button"===e||"submit"===e||"reset"===e))return r;if(!r||"OPTION"===n)return;return Lo}return"OPTION"===n||"SELECT"===n?t.value:"INPUT"===n||"TEXTAREA"===n?r:void 0}const Ys=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Zs=/^[A-Za-z]+:|^\/\//,Qs=/^data:.*,/i;function ta(t,e){return t.replace(Ys,((t,n,r,o,i,s)=>{const a=r||i||s;if(!e||!a||Zs.test(a)||Qs.test(a))return t;const c=n||o||"";return`url(${c}${function(t,e){try{return Gt(t,e).href}catch(e){return t}}(a,e)}${c})`}))}const ea=/[^a-z1-6-_]/;function na(t){const e=t.toLowerCase().trim();return ea.test(e)?"div":e}function ra(t,e){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${e}' style='background-color:silver'%3E%3C/svg%3E`}const oa=2,ia=3,sa=4,aa=6,ca=7,ua=8,la=9,da=0,fa=1,pa=2,ha=3,ma=4,ga=11,va=0,ya=1,_a=2,ba=3,wa=4,Sa=5,ka=6,Ca=7,xa=8,Ta=5,Ea=6,Aa=0,Ra=1;function Ia(t){if(void 0!==t&&0!==t.length)return t.map((t=>{const e=t.cssRules||t.rules;return{cssRules:Array.from(e,(t=>t.cssText)),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}}))}function Na(t,e,n,r){if(e===Io.HIDDEN)return null;const o=t.getAttribute(n);if(e===Io.MASK&&n!==No&&!ti.includes(n)&&n!==r.actionNameAttribute){const e=t.tagName;switch(n){case"title":case"alt":case"placeholder":return Lo}if("IMG"===e&&("src"===n||"srcset"===n)){const e=t;if(e.naturalWidth>0)return ra(e.naturalWidth,e.naturalHeight);const{width:n,height:r}=t.getBoundingClientRect();return n>0||r>0?ra(n,r):Mo}if("SOURCE"===e&&("src"===n||"srcset"===n))return Mo;if("A"===e&&"href"===n)return Lo;if(o&&n.startsWith("data-"))return Lo;if("IFRAME"===e&&"srcdoc"===n)return Lo}return o&&"string"==typeof o&&co(o)?uo(o):o}function Oa(t){if(!t)return null;let e;try{e=t.rules||t.cssRules}catch(t){}if(!e)return null;return ta(Array.from(e,1===ot()?La:Ma).join(""),t.href)}function La(t){if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")){const e=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return t.cssText.replace(e,"$1\\$2")}return Ma(t)}function Ma(t){return function(t){return"styleSheet"in t}(t)&&Oa(t.styleSheet)||t.cssText}function Da(t,e){const n=function(t,e){switch(t.nodeType){case t.DOCUMENT_NODE:return function(t,e){return{type:da,childNodes:Ua(t,e),adoptedStyleSheets:Ia(t.adoptedStyleSheets)}}(t,e);case t.DOCUMENT_FRAGMENT_NODE:return function(t,e){const n=Eo(t);n&&e.serializationContext.shadowRootsController.addShadowRoot(t);return{type:ga,childNodes:Ua(t,e),isShadowRoot:n,adoptedStyleSheets:n?Ia(t.adoptedStyleSheets):void 0}}(t,e);case t.DOCUMENT_TYPE_NODE:return{type:fa,name:(n=t).name,publicId:n.publicId,systemId:n.systemId};case t.ELEMENT_NODE:return function(t,e){const n=na(t.tagName),r=(i=t,"svg"===i.tagName||i instanceof SVGElement||void 0),o=Uo($o(t),e.parentNodePrivacyLevel);var i;if(o===Io.HIDDEN){const{width:e,height:o}=t.getBoundingClientRect();return{type:pa,tagName:n,attributes:{rr_width:`${e}px`,rr_height:`${o}px`,[No]:Oo},childNodes:[],isSVG:r}}if(o===Io.IGNORE)return;const s=function(t,e,n){if(e===Io.HIDDEN)return{};const r={},o=na(t.tagName),i=t.ownerDocument;for(let o=0;o<t.attributes.length;o+=1){const i=t.attributes.item(o).name,s=Na(t,e,i,n.configuration);null!==s&&(r[i]=s)}if(t.value&&("textarea"===o||"select"===o||"option"===o||"input"===o)){const n=Xs(t,e);void 0!==n&&(r.value=n)}if("option"===o&&e===Io.ALLOW){const e=t;e.selected&&(r.selected=e.selected)}if("link"===o){const e=Array.from(i.styleSheets).find((e=>e.href===t.href)),n=Oa(e);n&&e&&(r._cssText=n)}if("style"===o&&t.sheet){const e=Oa(t.sheet);e&&(r._cssText=e)}const s=t;if("input"!==o||"radio"!==s.type&&"checkbox"!==s.type||(e===Io.ALLOW?r.checked=!!s.checked:zo(s,e)&&delete r.checked),"audio"===o||"video"===o){const e=t;r.rr_mediaState=e.paused?"paused":"played"}let a,c;const u=n.serializationContext;switch(u.status){case 0:a=Math.round(t.scrollTop),c=Math.round(t.scrollLeft),(a||c)&&u.elementsScrollPositions.set(t,{scrollTop:a,scrollLeft:c});break;case 1:u.elementsScrollPositions.has(t)&&({scrollTop:a,scrollLeft:c}=u.elementsScrollPositions.get(t))}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}(t,o,e);let a=[];if(function(t){return t.childNodes.length>0||To(t)}(t)&&"style"!==n){let r;r=e.parentNodePrivacyLevel===o&&e.ignoreWhiteSpace===("head"===n)?e:{...e,parentNodePrivacyLevel:o,ignoreWhiteSpace:"head"===n},a=Ua(t,r)}return{type:pa,tagName:n,attributes:s,childNodes:a,isSVG:r}}(t,e);case t.TEXT_NODE:return function(t,e){const n=Vo(t,e.ignoreWhiteSpace||!1,e.parentNodePrivacyLevel);if(void 0===n)return;return{type:ha,textContent:n}}(t,e);case t.CDATA_SECTION_NODE:return{type:ma,textContent:""}}var n}(t,e);if(!n)return null;const r=Js(t)||Pa++,o=n;return o.id=r,function(t,e){Ws.set(t,e)}(t,r),e.serializedNodeIds&&e.serializedNodeIds.add(r),o}let Pa=1;function Ua(t,e){const n=[];return Ao(t,(t=>{const r=Da(t,e);r&&n.push(r)})),n}function $a(t,e,n){return Da(t,{serializationContext:n,parentNodePrivacyLevel:e.defaultPrivacyLevel,configuration:e})}function za(t){return Boolean(t.changedTouches)}function Ba(t){return!0===t.composed&&To(t.target)?t.composedPath()[0]:t.target}const Va=(t,e)=>{const n=window.visualViewport,r={layoutViewportX:t,layoutViewportY:e,visualViewportX:t,visualViewportY:e};return n?(!function(t){return Math.abs(t.pageTop-t.offsetTop-window.scrollY)>25||Math.abs(t.pageLeft-t.offsetLeft-window.scrollX)>25}(n)?(r.visualViewportX=Math.round(t-n.offsetLeft),r.visualViewportY=Math.round(e-n.offsetTop)):(r.layoutViewportX=Math.round(t+n.offsetLeft),r.layoutViewportY=Math.round(e+n.offsetTop)),r):r},Fa=t=>({scale:t.scale,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,pageLeft:t.pageLeft,pageTop:t.pageTop,height:t.height,width:t.width});function ja(t,e){return{data:{source:t,...e},type:ia,timestamp:_()}}function qa(t,e){const{throttled:n,cancel:r}=J((t=>{const n=Ba(t);if(Ks(n)){const r=Ha(t);if(!r)return;const o={id:Js(n),timeOffset:0,x:r.x,y:r.y};e(ja(za(t)?ka:ya,{positions:[o]}))}}),50,{trailing:!1}),{stop:o}=Je(t,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{o(),r()}}}function Ha(t){let{clientX:e,clientY:n}=za(t)?t.changedTouches[0]:t;if(window.visualViewport){const{visualViewportX:t,visualViewportY:r}=Va(e,n);e=t,n=r}if(Number.isFinite(e)&&Number.isFinite(n))return{x:e,y:n};t.isTrusted&&vn("mouse/touch event without x/y")}const Ga={pointerup:0,mousedown:1,click:2,contextmenu:3,dblclick:4,focus:Ta,blur:Ea,touchstart:7,touchend:9};function Wa(t,e,n){return Je(t,document,Object.keys(Ga),(r=>{const o=Ba(r);if(Po(o,t.defaultPrivacyLevel)===Io.HIDDEN||!Ks(o))return;const i=Js(o),s=Ga[r.type];let a;if(s!==Ea&&s!==Ta){const t=Ha(r);if(!t)return;a={id:i,type:s,x:t.x,y:t.y}}else a={id:i,type:s};const c={id:n.getIdForEvent(r),...ja(_a,a)};e(c)}),{capture:!0,passive:!0})}function Ka(t,e,n,r=document){const{throttled:o,cancel:i}=J((r=>{const o=Ba(r);if(!o||Po(o,t.defaultPrivacyLevel)===Io.HIDDEN||!Ks(o))return;const i=Js(o),s=o===document?{scrollTop:ts(),scrollLeft:Qi()}:{scrollTop:Math.round(o.scrollTop),scrollLeft:Math.round(o.scrollLeft)};n.set(o,s),e(ja(ba,{id:i,x:s.scrollLeft,y:s.scrollTop}))}),100),{stop:s}=Ke(t,r,"scroll",o,{capture:!0,passive:!0});return{stop:()=>{s(),i()}}}function Ja(t,e){const n=ns(t).subscribe((t=>{e(ja(wa,t))}));return{stop:()=>{n.unsubscribe()}}}function Xa(t,e){const n=window.visualViewport;if(!n)return{stop:X};const{throttled:r,cancel:o}=J((()=>{e({data:Fa(n),type:ua,timestamp:_()})}),200,{trailing:!1}),{stop:i}=Je(t,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),o()}}}function Ya(t,e){return Je(t,document,["play","pause"],(n=>{const r=Ba(n);r&&Po(r,t.defaultPrivacyLevel)!==Io.HIDDEN&&Ks(r)&&e(ja(Ca,{id:Js(r),type:"play"===n.type?Aa:Ra}))}),{capture:!0,passive:!0})}function Za(t){function e(t,e){t&&Ks(t.ownerNode)&&e(Js(t.ownerNode))}const n=[Ie(CSSStyleSheet.prototype,"insertRule",(({target:n,parameters:[r,o]})=>{e(n,(e=>t(ja(xa,{id:e,adds:[{rule:r,index:o}]}))))})),Ie(CSSStyleSheet.prototype,"deleteRule",(({target:n,parameters:[r]})=>{e(n,(e=>t(ja(xa,{id:e,removes:[{index:r}]}))))}))];function r(r){n.push(Ie(r.prototype,"insertRule",(({target:n,parameters:[r,o]})=>{e(n.parentStyleSheet,(e=>{const i=Qa(n);i&&(i.push(o||0),t(ja(xa,{id:e,adds:[{rule:r,index:i}]})))}))})),Ie(r.prototype,"deleteRule",(({target:n,parameters:[r]})=>{e(n.parentStyleSheet,(e=>{const o=Qa(n);o&&(o.push(r),t(ja(xa,{id:e,removes:[{index:o}]})))}))})))}return"undefined"!=typeof CSSGroupingRule?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule)),{stop:()=>{n.forEach((t=>t.stop()))}}}function Qa(t){const e=[];let n=t;for(;n.parentRule;){const t=Array.from(n.parentRule.cssRules).indexOf(n);e.unshift(t),n=n.parentRule}if(!n.parentStyleSheet)return;const r=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return e.unshift(r),e}function tc(t,e){return Je(t,window,["focus","blur"],(()=>{e({data:{has_focus:document.hasFocus()},type:aa,timestamp:_()})}))}function ec(t,e,n){const r=t.subscribe(11,(t=>{var r,o;"action"===t.rawRumEvent.type&&"click"===t.rawRumEvent.action.type&&(null===(o=null===(r=t.rawRumEvent.action.frustration)||void 0===r?void 0:r.type)||void 0===o?void 0:o.length)&&"events"in t.domainContext&&t.domainContext.events&&t.domainContext.events.length&&e({timestamp:t.rawRumEvent.date,type:la,data:{frustrationTypes:t.rawRumEvent.action.frustration.type,recordIds:t.domainContext.events.map((t=>n.getIdForEvent(t)))}})}));return{stop:()=>{r.unsubscribe()}}}function nc(t,e){const n=t.subscribe(4,(()=>{e({timestamp:_(),type:ca})}));return{stop:()=>{n.unsubscribe()}}}function rc(t,e,n=document){const r=t.defaultPrivacyLevel,o=new WeakMap,i=n!==document,{stop:s}=Je(t,n,i?["change"]:["input","change"],(t=>{const e=Ba(t);(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&c(e)}),{capture:!0,passive:!0});let a;if(i)a=X;else{const t=[Ne(HTMLInputElement.prototype,"value",c),Ne(HTMLInputElement.prototype,"checked",c),Ne(HTMLSelectElement.prototype,"value",c),Ne(HTMLTextAreaElement.prototype,"value",c),Ne(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{t.forEach((t=>t.stop()))}}return{stop:()=>{a(),s()}};function c(t){const e=Po(t,r);if(e===Io.HIDDEN)return;const n=t.type;let o;if("radio"===n||"checkbox"===n){if(zo(t,e))return;o={isChecked:t.checked}}else{const n=Xs(t,e);if(void 0===n)return;o={text:n}}u(t,o);const i=t.name;"radio"===n&&i&&t.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(i)}"]`).forEach((e=>{e!==t&&u(e,{isChecked:!1})}))}function u(t,n){if(!Ks(t))return;const r=o.get(t);r&&r.text===n.text&&r.isChecked===n.isChecked||(o.set(t,n),e(ja(Sa,{id:Js(t),...n})))}}function oc(t,e,n,r){const o=Mr();if(!o)return{stop:X,flush:X};const i=function(t){let e=X,n=[];function r(){e(),t(n),n=[]}const{throttled:o,cancel:i}=J(r,16,{leading:!1});return{addMutations:t=>{0===n.length&&(e=nr(o,{timeout:100})),n.push(...t)},flush:r,stop:()=>{e(),i()}}}((r=>{!function(t,e,n,r){const o=new Map;t.filter((t=>"childList"===t.type)).forEach((t=>{t.removedNodes.forEach((t=>{ic(t,r.removeShadowRoot)}))}));const i=t.filter((t=>t.target.isConnected&&function(t){let e=t;for(;e;){if(!Ks(e)&&!Eo(e))return!1;e=Ro(e)}return!0}(t.target)&&Po(t.target,n.defaultPrivacyLevel,o)!==Io.HIDDEN)),{adds:s,removes:a,hasBeenSerialized:c}=function(t,e,n,r){const o=new Set,i=new Map;for(const e of t)e.addedNodes.forEach((t=>{o.add(t)})),e.removedNodes.forEach((t=>{o.has(t)||i.set(t,e.target),o.delete(t)}));const s=Array.from(o);a=s,a.sort(((t,e)=>{const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_CONTAINS||n&Node.DOCUMENT_POSITION_FOLLOWING?1:n&Node.DOCUMENT_POSITION_PRECEDING?-1:0}));var a;const c=new Set,u=[];for(const t of s){if(d(t))continue;const o=Po(t.parentNode,e.defaultPrivacyLevel,r);if(o===Io.HIDDEN||o===Io.IGNORE)continue;const i=Da(t,{serializedNodeIds:c,parentNodePrivacyLevel:o,serializationContext:{status:2,shadowRootsController:n},configuration:e});if(!i)continue;const s=Ro(t);u.push({nextId:f(t),parentId:Js(s),node:i})}const l=[];return i.forEach(((t,e)=>{Ks(e)&&l.push({parentId:Js(t),id:Js(e)})})),{adds:u,removes:l,hasBeenSerialized:d};function d(t){return Ks(t)&&c.has(Js(t))}function f(t){let e=t.nextSibling;for(;e;){if(Ks(e))return Js(e);e=e.nextSibling}return null}}(i.filter((t=>"childList"===t.type)),n,r,o),u=function(t,e,n){var r;const o=[],i=new Set,s=t.filter((t=>!i.has(t.target)&&(i.add(t.target),!0)));for(const t of s){if(t.target.textContent===t.oldValue)continue;const i=Po(Ro(t.target),e.defaultPrivacyLevel,n);i!==Io.HIDDEN&&i!==Io.IGNORE&&o.push({id:Js(t.target),value:null!==(r=Vo(t.target,!1,i))&&void 0!==r?r:null})}return o}(i.filter((t=>"characterData"===t.type&&!c(t.target))),n,o),l=function(t,e,n){const r=[],o=new Map,i=t.filter((t=>{const e=o.get(t.target);return(!e||!e.has(t.attributeName))&&(e?e.add(t.attributeName):o.set(t.target,new Set([t.attributeName])),!0)})),s=new Map;for(const t of i){if(t.target.getAttribute(t.attributeName)===t.oldValue)continue;const o=Po(t.target,e.defaultPrivacyLevel,n),i=Na(t.target,o,t.attributeName,e);let a;if("value"===t.attributeName){const e=Xs(t.target,o);if(void 0===e)continue;a=e}else a="string"==typeof i?i:null;let c=s.get(t.target);c||(c={id:Js(t.target),attributes:{}},r.push(c),s.set(t.target,c)),c.attributes[t.attributeName]=a}return r}(i.filter((t=>"attributes"===t.type&&!c(t.target))),n,o);if(!(u.length||l.length||a.length||s.length))return;e(ja(va,{adds:s,removes:a,texts:u,attributes:l}))}(r.concat(s.takeRecords()),t,e,n)})),s=new o(z(i.addMutations));return s.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{s.disconnect(),i.stop()},flush:()=>{i.flush()}}}function ic(t,e){To(t)&&e(t.shadowRoot),Ao(t,(t=>ic(t,e)))}function sc(t){const{emit:e,configuration:n,lifeCycle:r}=t;if(!e)throw new Error("emit function is required");const o=n=>{e(n),en("record",{record:n});const r=t.viewHistory.findView();Ps(r.id).records_count+=1},i=function(){const t=new WeakMap;return{set(e,n){(e!==document||document.scrollingElement)&&t.set(e===document?document.scrollingElement:e,n)},get:e=>t.get(e),has:e=>t.has(e)}}(),s=((t,e,n)=>{const r=new Map,o={addShadowRoot:i=>{if(r.has(i))return;const s=oc(e,t,o,i),a=rc(t,e,i),c=Ka(t,e,n,i);r.set(i,{flush:()=>s.flush(),stop:()=>{s.stop(),a.stop(),c.stop()}})},removeShadowRoot:t=>{const e=r.get(t);e&&(e.stop(),r.delete(t))},stop:()=>{r.forEach((({stop:t})=>t()))},flush:()=>{r.forEach((({flush:t})=>t()))}};return o})(n,o,i),{stop:a}=function(t,e,n,r,o,i){const s=(n=_(),o={status:0,elementsScrollPositions:t,shadowRootsController:e})=>{const{width:i,height:s}=rs(),a=[{data:{height:s,href:window.location.href,width:i},type:sa,timestamp:n},{data:{has_focus:document.hasFocus()},type:aa,timestamp:n},{data:{node:$a(document,r,o),initialOffset:{left:Qi(),top:ts()}},type:oa,timestamp:n}];return window.visualViewport&&a.push({data:Fa(window.visualViewport),type:ua,timestamp:n}),a};i(s());const{unsubscribe:a}=n.subscribe(2,(n=>{o(),i(s(n.startClocks.timeStamp,{shadowRootsController:e,status:1,elementsScrollPositions:t}))}));return{stop:a}}(i,s,r,n,c,(t=>t.forEach((t=>o(t)))));function c(){s.flush(),l.flush()}const u=function(){const t=new WeakMap;let e=1;return{getIdForEvent:n=>(t.has(n)||t.set(n,e++),t.get(n))}}(),l=oc(o,n,s,document),d=[l,qa(n,o),Wa(n,o,u),Ka(n,o,i,document),Ja(n,o),rc(n,o),Ya(n,o),Za(o),tc(n,o),Xa(n,o),ec(r,o,u),nc(r,(t=>{c(),o(t)}))];return{stop:()=>{s.stop(),d.forEach((t=>t.stop())),a()},flushMutations:c,shadowRootsController:s}}function ac({context:t,creationReason:e,encoder:n}){let r=0;const o=t.view.id,i={start:1/0,end:-1/0,creation_reason:e,records_count:0,has_full_snapshot:!1,index_in_view:Ds(o),source:"browser",...t};return function(t){Ps(t).segments_count+=1}(o),{addRecord:function(t,e){i.start=Math.min(i.start,t.timestamp),i.end=Math.max(i.end,t.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=t.type===oa);const o=n.isEmpty?'{"records":[':",";n.write(o+JSON.stringify(t),(t=>{r+=t,e(r)}))},flush:function(t){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}\n`),n.finish((e=>{!function(t,e){Ps(t).segments_total_raw_size+=e}(i.view.id,e.rawBytesCount),t(i,e)}))}}}let cc=6e4;function uc(t,e,n,r,o,i){return function(t,e,n,r){let o={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=t.subscribe(2,(()=>{a("view_change")})),{unsubscribe:s}=t.subscribe(10,(t=>{a(t.reason)}));function a(t){1===o.status&&(o.segment.flush(((e,r)=>{const o=function(t,e,n){const r=new FormData;r.append("segment",new Blob([t],{type:"application/octet-stream"}),`${e.session.id}-${e.start}`);const o={raw_segment_size:n,compressed_segment_size:t.byteLength,...e},i=JSON.stringify(o);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:t.byteLength}}(r.output,e,r.rawBytesCount);Vn(t)?n.sendOnExit(o):n.send(o)})),q(o.expirationTimeoutId)),o="stop"!==t?{status:0,nextSegmentCreationReason:t}:{status:2}}return{addRecord:t=>{if(2!==o.status){if(0===o.status){const t=e();if(!t)return;o={status:1,segment:ac({encoder:r,context:t,creationReason:o.nextSegmentCreationReason}),expirationTimeoutId:j((()=>{a("segment_duration_limit")}),5e3)}}o.segment.addRecord(t,(t=>{t>cc&&a("segment_bytes_limit")}))}},stop:()=>{a("stop"),i(),s()}}}(t,(()=>function(t,e,n){const r=e.findTrackedSession(),o=n.findView();if(!r||!o)return;return{application:{id:t},session:{id:r.id},view:{id:o.id}}}(e.applicationId,n,r)),o,i)}var lc=Object.freeze({__proto__:null,startRecording:function(t,e,n,r,o,i){const s=[],a=i||Mn(e.sessionReplayEndpointBuilder,cc,(e=>{t.notify(13,{error:e}),vn("Error reported to customer",{"error.message":e.message})}));let c;if(zn())({addRecord:c}=function(t){const e=Un();return{addRecord:n=>{const r=t.findView();e.send("record",n,r.id)}}}(r));else{const i=uc(t,e,n,r,a,o);c=i.addRecord,s.push(i.stop)}const{stop:u}=sc({emit:c,configuration:e,lifeCycle:t,viewHistory:r});return s.push(u),{stop:()=>{s.forEach((t=>t()))}}}});
1
+ "use strict";const t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},e=console,n={};Object.keys(t).forEach((t=>{n[t]=e[t]}));const r="Datadog Browser SDK:",o={debug:n.debug.bind(e,r),log:n.log.bind(e,r),info:n.info.bind(e,r),warn:n.warn.bind(e,r),error:n.error.bind(e,r)},i="https://docs.datadoghq.com",s=`${i}/real_user_monitoring/browser/troubleshooting`,a="More details:";function c(t,e){return(...n)=>{try{return t(...n)}catch(t){o.error(e,t)}}}function u(t){return 0!==t&&100*Math.random()<=t}function l(t,e){return+t.toFixed(e)}function d(t){return"number"==typeof t}const f=1e3,p=6e4,m=31536e6;function h(t){return{relative:t,timeStamp:g(t)}}function g(t){const e=b()-performance.now();return e>A()?Math.round(E(e,t)):function(t){return Math.round(E(A(),t))}(t)}function v(){return Math.round(b()-E(A(),performance.now()))}function y(t){return d(t)?l(1e6*t,0):t}function b(){return(new Date).getTime()}function _(){return b()}function w(){return performance.now()}function S(){return{relative:w(),timeStamp:_()}}function k(){return{relative:0,timeStamp:A()}}function T(t,e){return e-t}function E(t,e){return t+e}function x(t){return t-A()}let C;function A(){var t,e;return void 0===C&&(C=null!==(e=null===(t=performance.timing)||void 0===t?void 0:t.navigationStart)&&void 0!==e?e:performance.timeOrigin),C}const I=/[^\u0000-\u007F]/;function R(t){return I.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function N(t){if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}function O(t){return{...t}}function L(t,e){return Object.keys(t).some((n=>t[n]===e))}function M(t){return 0===Object.keys(t).length}function P(t,e){const n={};for(const r of Object.keys(t))n[r]=e(t[r]);return n}function D(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}const U=D(),z="WorkerGlobalScope"in U;function $(t,e){const n=D();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let V,B=!1;function F(t){B=t}function q(t){return function(){return j(t,this,arguments)}}function j(t,e,n){try{return t.apply(e,n)}catch(t){H(t)}}function H(t){if(G(t),V)try{V(t)}catch(t){G(t)}}function G(...t){B&&o.error("[MONITOR]",...t)}function W(t,e){return $(D(),"setTimeout")(q(t),e)}function K(t){$(D(),"clearTimeout")(t)}function J(t,e){return $(D(),"setInterval")(q(t),e)}function Y(t){$(D(),"clearInterval")(t)}function Z(t){var e;const n=null===(e=U.queueMicrotask)||void 0===e?void 0:e.bind(U);"function"==typeof n?n(q(t)):Promise.resolve().then(q(t))}class X{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach((e=>e(t)))}addObserver(t){this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}function Q(...t){return new X((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}class tt extends X{constructor(t){super(),this.maxBufferSize=t,this.buffer=[]}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(t)}subscribe(t){let e=!1;const n={unsubscribe:()=>{e=!0,this.removeObserver(t)}};return Z((()=>{for(const n of this.buffer){if(e)return;t(n)}e||this.addObserver(t)})),n}unbuffer(){Z((()=>{this.maxBufferSize=this.buffer.length=0}))}}function et(t,e,n){const r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing;let i,s,a=!1;return{throttled:(...n)=>{a?i=n:(r?t(...n):i=n,a=!0,s=W((()=>{o&&i&&t(...i),a=!1,i=void 0}),e))},cancel:()=>{K(s),a=!1,i=void 0}}}function nt(){}function rt(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,rt)}const ot=/([\w-]+)\s*=\s*([^;]+)/g;function it(t,e){for(ot.lastIndex=0;;){const n=ot.exec(t);if(!n)break;if(n[1]===e)return n[2]}}function st(t,e,n=""){const r=t.charCodeAt(e-1),o=r>=55296&&r<=56319?e+1:e;return t.length<=o?t:`${t.slice(0,o)}${n}`}let at,ct,ut,lt;function dt(){return null!=at?at:at=function(t=window){var e;const n=t.navigator.userAgent;if(t.chrome||/HeadlessChrome/.test(n))return 0;if(0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 1;return 2}()}function ft(t){return pt(t,location.href).href}function pt(t,e){const{URL:n}=function(){if(!ct){let t,e;try{t=document.createElement("iframe"),t.style.display="none",document.body.appendChild(t),e=t.contentWindow}catch(t){e=U}ct={URL:e.URL},null==t||t.remove()}return ct}();try{return void 0!==e?new n(t,e):new n(t)}catch(t){throw new Error(`Failed to construct URL: ${String(t)}`)}}function mt(t,e,n=0,r){const o=new Date;o.setTime(o.getTime()+n);const i=`expires=${o.toUTCString()}`,s=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${s}${a}${c}${u}`}function ht(t){return it(document.cookie,t)}function gt(t){return function(t){const e=new Map;for(ot.lastIndex=0;;){const n=ot.exec(t);if(!n)break;{const t=n[1],r=n[2];e.has(t)?e.get(t).push(r):e.set(t,[r])}}return e}(document.cookie).get(t)||[]}function vt(t){return ut||(ut=function(t){const e=new Map;for(ot.lastIndex=0;;){const n=ot.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),ut.get(t)}function yt(t,e){mt(t,"",0,e)}function bt(t=location.hostname,e=document.referrer){if(void 0===lt){const n=function(t,e){try{return t||pt(e).hostname}catch(t){}}(t,e);if(n){const t=`dd_site_test_${rt()}`,e="test",r=n.split(".");let o=r.pop();for(;r.length&&!ht(t);)o=`${r.pop()}.${o}`,mt(t,e,f,{domain:o});yt(t,{domain:o}),lt=o}}return lt}const _t="_dd_s";function wt(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(e(r,n,t))return r}}function St(t){return Object.values(t)}function kt(t){return Object.entries(t)}const Tt=144e5,Et=9e5,xt=m,Ct="cookie",At="local-storage",It=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Rt(t,e){const n={isExpired:"1"};return e.trackAnonymousUser&&(null==t?void 0:t.anonymousId)&&(n.anonymousId=null==t?void 0:t.anonymousId),n}function Nt(t){return M(t)}function Ot(t){return!Nt(t)}function Lt(t){return void 0!==t.isExpired||!((void 0===(e=t).created||b()-Number(e.created)<Tt)&&(void 0===e.expire||b()<Number(e.expire)));var e}function Mt(t){t.expire=String(b()+Et)}function Pt(t){return kt(t).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join("&")}function Dt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf("&")||It.test(t))}(t)&&t.split("&").forEach((t=>{const n=It.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}function Ut(t){const e=function(t){const e={};if(e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains){const t=bt();if(!t)return;e.domain=t}return e}(t);return e&&function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${rt()}`,n="test";mt(e,n,p,t);const r=ht(e)===n;return yt(e,t),r}catch(t){return o.error(t),!1}}(e)?{type:Ct,cookieOptions:e}:void 0}function zt(t,e){const n={isLockEnabled:0===dt(),persistSession:n=>$t(e,t,n,Et),retrieveSession:()=>Vt(e,t),expireSession:n=>$t(e,t,Rt(n,t),Tt)};return function(t){if(!vt(_t)){const e=vt("_dd"),n=vt("_dd_r"),r=vt("_dd_l"),o={};e&&(o.id=e),r&&/^[01]$/.test(r)&&(o.logs=r),n&&/^[012]$/.test(n)&&(o.rum=n),Ot(o)&&(Mt(o),t.persistSession(o))}}(n),n}function $t(t,e,n,r){let o=Pt(n);e.betaEncodeCookieOptions&&(o=Pt({...n,...M(n)?{}:{c:Bt(t)}})),mt(_t,o,e.trackAnonymousUser?xt:r,t)}function Vt(t,e){if(e.betaEncodeCookieOptions)return function(t){const e=gt(_t),n=Bt(t);let r;for(const t of e.reverse())if(r=Dt(t),r.c===n)break;return null==r||delete r.c,null!=r?r:{}}(t);return Dt(ht(_t))}function Bt(t){let e=0;return e|=0,e|=(t.domain?t.domain.split(".").length-1:0)<<1,e|=t.crossSite?1:0,e.toString(16)}function Ft(){try{const t=rt(),e=`_dd_test_${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:At}:void 0}catch(t){return}}function qt(t){return{isLockEnabled:!1,persistSession:jt,retrieveSession:Ht,expireSession:e=>function(t,e){jt(Rt(t,e))}(e,t)}}function jt(t){localStorage.setItem(_t,Pt(t))}function Ht(){return Dt(localStorage.getItem(_t))}const Gt="--",Wt=[];let Kt;function Jt(t,e,n=0){var r;const{isLockEnabled:o,persistSession:i,expireSession:s}=e,a=t=>i({...t,lock:u}),c=()=>{const{lock:t,...n}=e.retrieveSession();return{session:n,lock:t&&!Xt(t)?t:void 0}};if(Kt||(Kt=t),t!==Kt)return void Wt.push(t);if(o&&n>=100)return void Zt(e);let u,l=c();if(o){if(l.lock)return void Yt(t,e,n);if(u=rt()+Gt+_(),a(l.session),l=c(),l.lock!==u)return void Yt(t,e,n)}let d=t.process(l.session);if(o&&(l=c(),l.lock!==u))Yt(t,e,n);else{if(d&&(Lt(d)?s(d):(Mt(d),o?a(d):i(d))),o&&(!d||!Lt(d))){if(l=c(),l.lock!==u)return void Yt(t,e,n);i(l.session),d=l.session}null===(r=t.after)||void 0===r||r.call(t,d||l.session),Zt(e)}}function Yt(t,e,n){W((()=>{Jt(t,e,n+1)}),10)}function Zt(t){Kt=void 0;const e=Wt.shift();e&&Jt(e,t)}function Xt(t){const[,e]=t.split(Gt);return!e||T(Number(e),_())>1e3}const Qt=f;function te(t){switch(t.sessionPersistence){case Ct:return Ut(t);case At:return Ft();case void 0:{let e=Ut(t);return!e&&t.allowFallbackToLocalStorage&&(e=Ft()),e}default:o.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function ee(t,e,n,r,o=function(t,e){return t.type===Ct?zt(e,t.cookieOptions):qt(e)}(t,e)){const i=new X,s=new X,a=new X,c=J((function(){const t=o.retrieveSession();Lt(t)?Jt({process:t=>Lt(t)?Rt(t,e):void 0,after:f},o):f(t)}),Qt);let u;p();const{throttled:l,cancel:d}=et((()=>{Jt({process:t=>{if(Nt(t))return;const e=f(t);return function(t){if(Nt(t))return!1;const e=r(t[n]);t[n]=e,delete t.isExpired,"0"===e||t.id||(t.id=rt(),t.created=String(b()))}(e),e},after:t=>{Ot(t)&&!m()&&function(t){u=t,i.notify()}(t),u=t}},o)}),Qt);function f(t){return Lt(t)&&(t=Rt(t,e)),m()&&(!function(t){return u.id!==t.id||u[n]!==t[n]}(t)?(a.notify({previousState:u,newState:t}),u=t):(u=Rt(u,e),s.notify())),t}function p(){Jt({process:t=>{if(Nt(t))return t.anonymousId=rt(),Rt(t,e)},after:t=>{u=t}},o)}function m(){return void 0!==(null==u?void 0:u[n])}return{expandOrRenewSession:l,expandSession:function(){Jt({process:t=>m()?f(t):void 0},o)},getSession:()=>u,renewObservable:i,expireObservable:s,sessionStateUpdateObservable:a,restartSession:p,expire:t=>{d(),!1===t&&u&&delete u.anonymousId,o.expireSession(u),f(Rt(u,e))},stop:()=>{Y(c)},updateSessionState:function(t){Jt({process:e=>({...e,...t}),after:f},o)}}}const ne={GRANTED:"granted",NOT_GRANTED:"not-granted"};function re(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function oe(t){const e=re(t);return"string"===e||"function"===e||t instanceof RegExp}function ie(t,e,n=!1){return t.some((t=>{try{if("function"==typeof t)return t(e);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?e.startsWith(t):t===e}catch(t){o.error(t)}return!1}))}const se=["chrome-extension://","moz-extension://"];function ae(t){return se.some((e=>t.includes(e)))}function ce(t,e,n=("undefined"!=typeof location?location.origin:"")){const r=t.allowedTrackingOrigins;if(!r)return!function(t,e=""){return!ae(t)&&ae(e.split("\n").filter((t=>{const e=t.trim();return e.length&&/^at\s+|@/.test(e)}))[1]||"")}(n,e)||(o.error("Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided."),!1);const i=ie(r,n);return i||o.error("SDK initialized on a non-allowed domain."),i}const ue="datad0g.com",le="datadoghq.com",de="datadoghq.eu",fe=["ddsource","dd-api-key","dd-request-id"];function pe(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=ft(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const o=me(e,t);return t=>`https://${o}${n}?${t}`}(t,e);return{build(o,i){const s=function({clientToken:t,internalAnalyticsSubdomain:e,source:n="browser"},r,o,{retry:i,encoding:s},a=[]){const c=[`ddsource=${n}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.24.0")}`,"dd-evp-origin=browser",`dd-request-id=${rt()}`].concat(a);s&&c.push(`dd-evp-encoding=${s}`);"rum"===r&&(c.push(`batch_time=${_()}`,`_dd.api=${o}`),i&&c.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`));e&&c.reverse();return c.join("&")}(t,e,o,i,n);return r(s)},trackType:e}}function me(t,e){const{site:n=le,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===le)return"pci.browser-intake-datadoghq.com";if(r&&n===le)return`${r}.${le}`;if("dd0g-gov.com"===n)return`http-intake.logs.${n}`;const o=n.split("."),i=o.pop();return`browser-intake-${o.join("-")}.${i}`}function he(t){const e=t.site||le,n=function(t){if("flutter"===t||"unity"===t)return t;return"browser"}(t.source),r=function(t){return{logsEndpointBuilder:pe(t,"logs"),rumEndpointBuilder:pe(t,"rum"),profilingEndpointBuilder:pe(t,"profile"),sessionReplayEndpointBuilder:pe(t,"replay"),exposuresEndpointBuilder:pe(t,"exposures")}}({...t,site:e,source:n}),o=function(t){if(!t.replica)return;const e={...t,site:le,clientToken:t.replica.clientToken};return{logsEndpointBuilder:pe(e,"logs"),rumEndpointBuilder:pe(e,"rum",[`application.id=${t.replica.applicationId}`])}}({...t,site:e,source:n});return{replica:o,site:e,source:n,...r}}const ge={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},ve={ALL:"all",SAMPLED:"sampled"};function ye(t,e){return null==t||"string"==typeof t||(o.error(`${e} must be defined as a string`),!1)}function be(t,e){return!!(void 0===t||(n=t,d(n)&&n>=0&&n<=100))||(o.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function _e(t,e){var n,r,s,u,l,d,f,p,m,h;if(t&&t.clientToken)if(void 0===t.allowedTrackingOrigins||Array.isArray(t.allowedTrackingOrigins)){if((!(g=t.site)||"string"!=typeof g||/(datadog|ddog|datad0g|dd0g)/.test(g)||(o.error(`Site should be a valid Datadog site. ${a} ${i}/getting_started/site/.`),0))&&be(t.sessionSampleRate,"Session")&&be(t.telemetrySampleRate,"Telemetry")&&be(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&be(t.telemetryUsageSampleRate,"Telemetry Usage")&&ye(t.version,"Version")&&ye(t.env,"Env")&&ye(t.service,"Service")&&ce(t,null!=e?e:"")){var g;if(void 0===t.trackingConsent||L(ne,t.trackingConsent))return{beforeSend:t.beforeSend&&c(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:z?void 0:te(t),sessionSampleRate:null!==(n=t.sessionSampleRate)&&void 0!==n?n:100,telemetrySampleRate:null!==(r=t.telemetrySampleRate)&&void 0!==r?r:20,telemetryConfigurationSampleRate:null!==(s=t.telemetryConfigurationSampleRate)&&void 0!==s?s:5,telemetryUsageSampleRate:null!==(u=t.telemetryUsageSampleRate)&&void 0!==u?u:5,service:null!==(l=t.service)&&void 0!==l?l:void 0,env:null!==(d=t.env)&&void 0!==d?d:void 0,version:null!==(f=t.version)&&void 0!==f?f:void 0,datacenter:null!==(p=t.datacenter)&&void 0!==p?p:void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(m=t.trackingConsent)&&void 0!==m?m:ne.GRANTED,trackAnonymousUser:null===(h=t.trackAnonymousUser)||void 0===h||h,storeContextsAcrossPages:!!t.storeContextsAcrossPages,betaEncodeCookieOptions:!!t.betaEncodeCookieOptions,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:z?1:50,messageBytesLimit:262144,variant:t.variant,sdkVersion:t.sdkVersion,...he(t)};o.error('Tracking Consent should be either "granted" or "not-granted"')}}else o.error("Allowed Tracking Origins must be an array");else o.error("Client Token is not configured, we will not send any data.")}var we;!function(t){t.TRACK_INTAKE_REQUESTS="track_intake_requests",t.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",t.FEATURE_OPERATION_VITAL="feature_operation_vital",t.SHORT_SESSION_INVESTIGATION="short_session_investigation",t.AVOID_FETCH_KEEPALIVE="avoid_fetch_keepalive"}(we||(we={}));const Se=new Set;function ke(t){Array.isArray(t)&&t.filter((t=>L(we,t))).forEach((t=>{Se.add(t)}))}function Te(t){return Se.has(t)}function Ee(){return Se}const xe="?";function Ce(t){var e,n;const r=[];let o=De(t,"stack");const i=String(t);if(o&&o.startsWith(i)&&(o=o.slice(i.length)),o&&o.split("\n").forEach((t=>{const e=function(t){const e=Re.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),o=Ne.exec(e[2]);r&&o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||xe,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=Oe.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:xe,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=Le.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||xe,line:+e[3],url:e[2]}}(t)||function(t){const e=Me.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=Pe.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||xe,line:e[4]?+e[4]:void 0,url:e[3]}}(t);e&&(!e.func&&e.line&&(e.func=xe),r.push(e))})),r.length>0&&function(){if(void 0!==Ve)return Ve;class t extends Error{constructor(){super(),this.name="Error"}}const[e,n]=[t,Error].map((t=>new t));return Ve=$e(Object.getPrototypeOf(e))&&n.stack!==e.stack,Ve}()&&t instanceof Error){const o=[];let i=t;for(;(i=Object.getPrototypeOf(i))&&$e(i);){const t=(null===(e=i.constructor)||void 0===e?void 0:e.name)||xe;o.push(t)}for(let t=o.length-1;t>=0&&(null===(n=r[0])||void 0===n?void 0:n.func)===o[t];t--)r.shift()}return{message:De(t,"message"),name:De(t,"name"),stack:r}}const Ae="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Ie="(?::(\\d+))",Re=new RegExp(`^\\s*at (.*?) ?\\(${Ae}${Ie}?${Ie}?\\)?\\s*$`,"i"),Ne=new RegExp(`\\((\\S*)${Ie}${Ie}\\)`);const Oe=new RegExp(`^\\s*at ?${Ae}${Ie}?${Ie}??\\s*$`,"i");const Le=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const Me=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Pe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function De(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function Ue(t,e,n,r){if(void 0===e)return;const{name:o,message:i}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=ze.exec(t));return{name:e,message:n}}(t);return{name:o,message:i,stack:[{url:e,column:r,line:n}]}}const ze=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function $e(t){return String(t.constructor).startsWith("class ")}let Ve;function Be(t){const e=new Error(t);let n;return e.name="HandlingStack",j((()=>{const t=Ce(e);t.stack=t.stack.slice(2),n=Fe(t)})),n}function Fe(t){let e=qe(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",o=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${o}${i}`})),e}function qe(t){return`${t.name||"Error"}: ${t.message}`}function je(t,e,n,{computeHandlingStack:r}={}){let o=t[e];if("function"!=typeof o){if(!(e in t)||!e.startsWith("on"))return{stop:nt};o=nt}let i=!1;const s=function(){if(i)return o.apply(this,arguments);const t=Array.from(arguments);let e;j(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Be("instrumented method"):void 0}]);const s=o.apply(this,t);return e&&j(e,null,[s]),s};return t[e]=s,{stop:()=>{i=!0,t[e]===s&&(t[e]=o)}}}function He(t,e,n){const r=Object.getOwnPropertyDescriptor(t,e);if(!r||!r.set||!r.configurable)return{stop:nt};const o=nt;let i=(t,e)=>{W((()=>{i!==o&&n(t,e)}),0)};const s=function(t){r.set.call(this,t),i(this,t)};return Object.defineProperty(t,e,{set:s}),{stop:()=>{var n;(null===(n=Object.getOwnPropertyDescriptor(t,e))||void 0===n?void 0:n.set)===s&&Object.defineProperty(t,e,r),i=o}}}function Ge(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=We(Object.prototype),o=We(Array.prototype),i=We(Object.getPrototypeOf(t)),s=We(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function We(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):nt}function Ke(t,e=225280){const n=We(Object.prototype),r=We(Array.prototype),o=[],i=new WeakMap,s=Je(t,"$",void 0,o,i),a=JSON.stringify(s);let c=a?a.length:0;if(!(c>e)){for(;o.length>0&&c<e;){const n=o.shift();let r=0;if(Array.isArray(n.source))for(let s=0;s<n.source.length;s++){const a=Je(n.source[s],n.path,s,o,i);if(c+=void 0!==a?JSON.stringify(a).length:4,c+=r,r=1,c>e){Ze(e,"truncated",t);break}n.target[s]=a}else for(const s in n.source)if(Object.prototype.hasOwnProperty.call(n.source,s)){const a=Je(n.source[s],n.path,s,o,i);if(void 0!==a&&(c+=JSON.stringify(a).length+r+s.length+3,r=1),c>e){Ze(e,"truncated",t);break}n.target[s]=a}}return n(),r(),s}Ze(e,"discarded",t)}function Je(t,e,n,r,o){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const s=Ye(i);if("[Object]"!==s&&"[Array]"!==s&&"[Error]"!==s)return s;const a=t;if(o.has(a))return`[Reference seen at ${o.get(a)}]`;const c=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return o.set(a,c),r.push({source:i,target:u,path:c}),u}function Ye(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Ye(e.currentTarget):null,target:e.target?Ye(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function Ze(t,e,n){o.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Xe="No stack, consider using an instance of Error";function Qe({stackTrace:t,originalError:e,handlingStack:n,componentStack:r,startClocks:o,nonErrorPrefix:i,useFallbackStack:s=!0,source:a,handling:c}){const u=rn(e);return!t&&u&&(t=Ce(e)),{startClocks:o,source:a,handling:c,handlingStack:n,componentStack:r,originalError:e,type:t?t.name:void 0,message:tn(t,u,i,e),stack:t?Fe(t):s?Xe:void 0,causes:u?on(e,a):void 0,fingerprint:en(e),context:nn(e)}}function tn(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${Ge(Ke(r))}`}function en(t){return rn(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function nn(t){if(null!==t&&"object"==typeof t&&"dd_context"in t)return t.dd_context}function rn(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function on(t,e){let n=t;const r=[];for(;rn(null==n?void 0:n.cause)&&r.length<10;){const t=Ce(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&Fe(t)}),n=n.cause}return r.length?r:void 0}const sn="agent",an="console",cn="custom",un="source",ln="report";function dn(){return new X((t=>{const e=(e,n)=>{const r=Qe({stackTrace:n,originalError:e,startClocks:S(),nonErrorPrefix:"Uncaught",source:un,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,je(D(),"onerror",(({parameters:[t,e,n,o,i]})=>{let s;rn(i)||(s=Ue(t,e,n,o)),r(null!=i?i:t,s)})));var r;const{stop:o}=function(t){return je(D(),"onunhandledrejection",(({parameters:[e]})=>{t(e.reason||"Empty reason")}))}(e);return()=>{n(),o()}}))}function fn(t,e){e.silentMultipleInit||o.error(`${t} is already initialized.`)}function pn(t,e,n,r,o){return mn(t,e,[n],r,o)}function mn(t,e,n,r,{once:o,capture:i,passive:s}={}){const a=q((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(o&&d(),r(e))})),c=s?{capture:i,passive:s}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,l=$(u,"addEventListener");function d(){const t=$(u,"removeEventListener");n.forEach((n=>t.call(e,n,a,c)))}return n.forEach((t=>l.call(e,t,a,c))),{stop:d}}const hn="intervention",gn="csp_violation";function vn(t,e){const n=[];e.includes(gn)&&n.push(function(t){return new X((e=>{const{stop:n}=pn(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return yn({type:t.effectiveDirective,message:`${gn}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:bn(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${st(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==gn));return r.length&&n.push(function(t){return new X((e=>{if(!window.ReportingObserver)return;const n=q(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return yn({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:bn(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),Q(...n)}function yn(t){return{startClocks:S(),source:ln,handling:"unhandled",...t}}function bn(t,e,n,r,o){return n?Fe({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}function _n(t){const{env:e,service:n,version:r,datacenter:o,sdkVersion:i,variant:s}=t,a=[wn("sdk_version",null!=i?i:"6.24.0")];return e&&a.push(wn("env",e)),n&&a.push(wn("service",n)),r&&a.push(wn("version",r)),o&&a.push(wn("datacenter",o)),s&&a.push(wn("variant",s)),a}function wn(t,e){const n=e?`${t}:${e}`:t;return(n.length>200||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(n))&&o.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${a} ${i}/getting_started/tagging/#defining-tags`),function(t){return t.replace(/,/g,"_")}(n)}function Sn(t,e){const n=U.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function kn(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=kn(r[t],e[t],n);return r}const r="object"===re(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=kn(r[t],e[t],n));return r}function Tn(t){return kn(void 0,t)}function En(...t){let e;for(const n of t)null!=n&&(e=kn(e,n));return e}function xn(){var t;const e=U.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}const Cn=20971520,An=f;function In(t,e,n,r,o,i){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Nn(t,e,n,i,{onSuccess:()=>On(0,e,n,r,o,i),onFailure:()=>{e.queuedPayloads.enqueue(t)||i.notify({type:"queue-full",bandwidth:e.bandwidthMonitor.stats(),payload:t}),Rn(e,n,r,o,i)}}):e.queuedPayloads.enqueue(t)||i.notify({type:"queue-full",bandwidth:e.bandwidthMonitor.stats(),payload:t})}function Rn(t,e,n,r,o){2===t.transportStatus&&W((()=>{Nn(t.queuedPayloads.first(),t,e,o,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=An,On(1,t,e,n,r,o)},onFailure:()=>{t.currentBackoffTime=Math.min(6e4,2*t.currentBackoffTime),Rn(t,e,n,r,o)}})}),t.currentBackoffTime)}function Nn(t,e,n,r,{onSuccess:o,onFailure:i}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||(e=t.status,e>=500));var e}(n)?(e.transportStatus=0,r.notify({type:"success",bandwidth:e.bandwidthMonitor.stats(),payload:t}),o()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},r.notify({type:"failure",bandwidth:e.bandwidthMonitor.stats(),payload:t}),i())}))}function On(t,e,n,r,o,i){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(o({message:`Reached max ${r} events size queued for upload: 20MiB`,source:sn,startClocks:S()}),e.queueFullReported=!0);const s=e.queuedPayloads;for(e.queuedPayloads=Ln();s.size()>0;)In(s.dequeue(),e,n,r,o,i)}function Ln(){const t=[];return{bytesCount:0,enqueue(e){return!this.isFull()&&(t.push(e),this.bytesCount+=e.bytesCount,!0)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=Cn}}}function Mn(t,e,n){const r=new X,o={transportStatus:0,currentBackoffTime:An,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=81920&&this.ongoingRequestCount<32},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}},queuedPayloads:Ln(),queueFullReported:!1};return{observable:r,send:i=>{for(const s of t)In(i,o,((t,n)=>{Te(we.AVOID_FETCH_KEEPALIVE)?zn(s,t,n):Un(s,e,t,n)}),s.trackType,n,r)},sendOnExit:n=>{for(const r of t)Pn(r,e,n)}}}function Pn(t,e,n){if(!!navigator.sendBeacon&&n.bytesCount<e)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Dn||(Dn=!0,H(t))}(t)}zn(t,n)}let Dn=!1;function Un(t,e,n,r){if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e){const e=t.build("fetch-keepalive",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(q((t=>null==r?void 0:r({status:t.status,type:t.type})))).catch(q((()=>zn(t,n,r))))}else zn(t,n,r)}function zn(t,e,n){const r=t.build("fetch",e);fetch(r,{method:"POST",body:e.data,mode:"cors"}).then(q((t=>null==n?void 0:n({status:t.status,type:t.type})))).catch(q((()=>null==n?void 0:n({status:0}))))}function $n(){const t=D().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const o=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:o}))}}}function Vn(t){const e=$n();return!!e&&e.getCapabilities().includes(t)}function Bn(t){var e;void 0===t&&(t=null===(e=D().location)||void 0===e?void 0:e.hostname);const n=$n();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const Fn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function qn(t){return St(Fn).includes(t)}function jn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let i={};const c=n.flushObservable.subscribe((n=>function(n){const r=St(i).join("\n");i={};const o=qn(n.reason),s=o?e.sendOnExit:e.send;if(o&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&s(Hn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&s({data:n,bytesCount:R(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{s(Hn(t))}))}(n)));function u(e,c){const u=Ge(e),l=t.estimateEncodedBytesCount(u);l>=r?o.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${a} ${s}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==i[t]}(c)&&function(e){const r=i[e];delete i[e];const o=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(o)}(c),function(e,r,o){n.notifyBeforeAddMessage(r),void 0!==o?(i[o]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,l,c))}return{flushController:n,add:u,upsert:u,stop:c.unsubscribe}}function Hn(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}function Gn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:o}){const i=r.subscribe((t=>d(t.reason))),s=o.subscribe((()=>d("session_expire"))),a=new X((()=>()=>{i.unsubscribe(),s.unsubscribe()}));let c,u=0,l=0;function d(t){if(0===l)return;const e=l,n=u;l=0,u=0,f(),a.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){K(c),c=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(t){u+t>=e&&d("bytes_limit"),l+=1,u+=t,void 0===c&&(c=W((()=>{d("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,l>=t?d("messages_limit"):u>=e&&d("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,l-=1,0===l&&f()}}}const Wn="DISCARDED",Kn="SKIPPED";const Jn="log",Yn="configuration",Zn="usage",Xn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Qn=["ddog-gov.com"];let tr;function er(){return tr||(tr=new tt(100)),tr}function nr(t,e,n,r,o,i){const s=new X,{stop:a}=function(t,e,n,r,o){const i=[];if(Bn()){const t=$n(),e=o.subscribe((e=>t.send("internal_telemetry",e)));i.push(e.unsubscribe)}else{const s=[t.rumEndpointBuilder];t.replica&&function(t){return t.site===ue}(t)&&s.push(t.replica.rumEndpointBuilder);const a=jn({encoder:r(4),request:Mn(s,t.batchBytesLimit,e),flushController:Gn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new X}),messageBytesLimit:t.messageBytesLimit});i.push(a.stop);const c=o.subscribe(a.add);i.push(c.unsubscribe)}return{stop:()=>i.forEach((t=>t()))}}(e,r,o,i,s),{enabled:c,metricsEnabled:l}=function(t,e,n,r,o=1){const i={},s=!Qn.includes(e.site)&&u(e.telemetrySampleRate),a={[Jn]:s,[Yn]:s&&u(e.telemetryConfigurationSampleRate),[Zn]:s&&u(e.telemetryUsageSampleRate),metric:s&&u(o)},c={is_local_file:"file:"===(null===(d=U.location)||void 0===d?void 0:d.protocol),is_worker:z},l=er();var d;return l.subscribe((({rawEvent:o,metricName:s})=>{if(s&&!a.metric||!a[o.type])return;const u=s||o.status||o.type;let l=i[u];if(l||(l=i[u]=new Set),l.size>=e.maxTelemetryEventsPerPage)return;const d=Ge(o);if(l.has(d))return;const p=n.triggerHook(1,{startTime:S().relative});if(p===Wn)return;const m=f(p,t,o,c);r.notify(m),Sn("telemetry",m),l.add(d)})),l.unbuffer(),function(t){V=t}(or),{enabled:s,metricsEnabled:a.metric};function f(t,n,r,o){const i={type:"telemetry",date:S().timeStamp,service:n,version:"6.24.0",source:"browser",_dd:{format_version:2},telemetry:En(r,{runtime_env:o,connectivity:xn(),sdk_setup:"npm"}),ddtags:_n(e).join(","),experimental_features:Array.from(Ee())};return En(i,t)}}(t,e,n,s);return{stop:a,enabled:c,metricsEnabled:l}}function rr(e,n){G(t.debug,e,n),er().notify({rawEvent:{type:Jn,message:e,status:"debug",...n}})}function or(t,e){er().notify({rawEvent:{type:Jn,status:"error",...ar(t),...e}})}function ir(t,e){er().notify({rawEvent:{type:Jn,message:t,status:"debug",...e},metricName:t})}function sr(t){er().notify({rawEvent:{type:Zn,usage:t}})}function ar(t){if(rn(t)){const e=Ce(t);return{error:{kind:e.name,stack:Fe(cr(e))},message:e.message}}return{error:{stack:Xe},message:`Uncaught ${Ge(t)}`}}function cr(t){return t.stack=t.stack.filter((t=>!t.url||Xn.some((e=>t.url.startsWith(e))))),t}function ur(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}function lr(t){return Array.isArray(t)&&t.length>0}const dr=1/0;let fr=null;const pr=new Set;function mr({expireDelay:t,maxEntries:e}){let n=[];fr||(fr=J((()=>{pr.forEach((t=>t()))}),6e4));const r=()=>{const e=w()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()};return pr.add(r),{add:function(t,r){const o={value:t,startTime:r,endTime:dr,remove:()=>{ur(n,o)},close:t=>{o.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(o),o},find:function(t=Infinity,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===dr&&e.close(t)},findAll:function(t=Infinity,e=0){const r=E(t,e);return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){pr.delete(r),0===pr.size&&fr&&(Y(fr),fr=null)}}}function hr(){return!z&&Boolean(U._DATADOG_SYNTHETICS_INJECTS_RUM||vt("datadog-synthetics-injects-rum"))}function gr(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||vt("datadog-synthetics-public-id");return"string"==typeof t?t:void 0}function vr(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||vt("datadog-synthetics-result-id");return"string"==typeof t?t:void 0}function yr(){return Boolean(gr()&&vr())}const br=p,_r=Tt;function wr(t,e,n,r){const o=new X,i=new X,s=ee(t.sessionStoreStrategyType,t,e,n),a=mr({expireDelay:_r});if(s.renewObservable.subscribe((()=>{a.add(c(),w()),o.notify()})),s.expireObservable.subscribe((()=>{i.notify(),a.closeActive(w())})),s.expandOrRenewSession(),a.add(c(),k().relative),Te(we.SHORT_SESSION_INVESTIGATION)){const e=s.getSession();e&&function(t,e){if(!window.cookieStore||!e.created)return;const n=Number(e.created),r=b(),{stop:o}=pn(t,cookieStore,"change",i);function i(t){const i=wt(t.changed,(t=>t.name===_t));if(!i)return;const s=b()-n;if(s>84e4)o();else{const t=Dt(i.value);if(t.id&&t.id!==e.id){o();const n=b()-r;Sr().then((r=>{rr("Session cookie changed",{time:n,session_age:s,old:e,new:t,cookie:r})})).catch(H)}}}}(t,e)}function c(){const n=s.getSession();return n?{id:n.id,trackingType:n[e],isReplayForced:!!n.forcedReplay,anonymousId:n.anonymousId}:(async function(t){const e=t.sessionStoreStrategyType;if(!e)return;let n,r;e.type===Ct?(n=Vt(e.cookieOptions,t),r={cookie:await Sr(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=Ht();rr("Unexpected session state",{sessionStoreStrategyType:e.type,session:n,isSyntheticsTest:yr(),createdTimestamp:null==n?void 0:n.created,expireTimestamp:null==n?void 0:n.expire,...r})}(t).catch((()=>{})),{id:"invalid",trackingType:"0",isReplayForced:!1,anonymousId:void 0})}return r.observable.subscribe((()=>{r.isGranted()?s.expandOrRenewSession():s.expire(!1)})),function(t,e){const{stop:n}=mn(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,(()=>{r.isGranted()&&s.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=pn(t,document,"visibilitychange",n);J(n,br)}(t,(()=>s.expandSession())),function(t,e){const{stop:n}=pn(t,window,"resume",e,{capture:!0})}(t,(()=>s.restartSession())),{findSession:(t,e)=>a.find(t,e),renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s.sessionStateUpdateObservable,expire:s.expire,updateSessionState:s.updateSessionState}}async function Sr(){let t;return t="cookieStore"in window?await window.cookieStore.getAll(_t):document.cookie.split(/\s*;\s*/).filter((t=>t.startsWith(_t))),{count:t.length,domain:bt()||"undefined",...t}}function kr(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const o=R(n);e+=o,t+=n,r&&r(o)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}function Tr(t,e,n){let r=0,o=!1;return{isLimitReached(){if(0===r&&W((()=>{r=0}),p),r+=1,r<=e||o)return o=!1,!1;if(r===e+1){o=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:sn,startClocks:S()})}finally{o=!1}}return!0}}}function Er(t,e,n){if(document.readyState===e||"complete"===document.readyState)return n(),{stop:nt};return pn(t,window,"complete"===e?"load":"DOMContentLoaded",n,{once:!0})}function xr(t,e){return new Promise((n=>{Er(t,e,n)}))}let Cr;const Ar=new WeakMap;function Ir(t){return Cr||(Cr=function(t){return new X((e=>{const{stop:n}=je(XMLHttpRequest.prototype,"open",Rr),{stop:r}=je(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,parameters:[e],handlingStack:n},r,o){const i=Ar.get(t);if(!i)return;const s=i;s.state="start",s.startClocks=S(),s.isAborted=!1,s.xhr=t,s.handlingStack=n,s.requestBody=e;let a=!1;const{stop:c}=je(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&u()})),u=()=>{if(l(),c(),a)return;a=!0;const e=i;e.state="complete",e.duration=T(s.startClocks.timeStamp,_()),e.status=t.status,"string"==typeof t.response&&(e.responseBody=t.response),o.notify(O(e))},{stop:l}=pn(r,t,"loadend",u);o.notify(s)}(n,t,e)}),{computeHandlingStack:!0}),{stop:o}=je(XMLHttpRequest.prototype,"abort",Nr);return()=>{n(),r(),o()}}))}(t)),Cr}function Rr({target:t,parameters:[e,n]}){Ar.set(t,{state:"open",method:String(e).toUpperCase(),url:ft(String(n))})}function Nr({target:t}){const e=Ar.get(t);e&&(e.isAborted=!0)}let Or;const Lr=[];function Mr({responseBodyAction:t}={}){return t&&Lr.push(t),Or||(Or=new X((t=>{if(!U.fetch)return;const{stop:e}=je(U,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[o,i]=t;let s=i&&i.method;void 0===s&&o instanceof Request&&(s=o.method);const a=void 0!==s?String(s).toUpperCase():"GET",c=o instanceof Request?o.url:ft(String(o)),u=S(),l={state:"start",init:i,input:o,method:a,startClocks:u,url:c,handlingStack:n};r.notify(l),t[0]=l.input,t[1]=l.init,e((t=>{(async function(t,e,n){var r,o;const i=n;let s;i.state="resolve";try{s=await e}catch(e){return i.status=0,i.isAborted=(null===(o=null===(r=i.init)||void 0===r?void 0:r.signal)||void 0===o?void 0:o.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,i.error=e,void t.notify(i)}i.response=s,i.status=s.status,i.responseType=s.type,i.isAborted=!1;const a=Lr.reduce(((t,e)=>Math.max(t,e(i))),0);if(0!==a){const t=function(t){try{return t.clone()}catch(t){return}}(s);if(t&&t.body)try{const e=await async function(t,e){const n=t.getReader(),r=[];for(;;){const t=await n.read();if(t.done)break;e.collectStreamBody&&r.push(t.value)}return n.cancel().catch(nt),e.collectStreamBody?N(r):void 0}(t.body,{collectStreamBody:2===a});i.responseBody=e&&(new TextDecoder).decode(e)}catch(t){}}t.notify(i)})(r,t,l).catch(H)}))}(e,t)),{computeHandlingStack:!0});return e}))),Or}function Pr(t,e){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(q(t),e);return()=>window.cancelIdleCallback(n)}return function(t){const e=b(),n=W((()=>{t({didTimeout:!1,timeRemaining:()=>Math.max(0,Dr-(b()-e))})}),0);return()=>K(n)}(t)}const Dr=50;let Ur={};function zr(n){return Q(...n.map((n=>(Ur[n]||(Ur[n]=function(n){return new X((r=>{const o=e[n];return e[n]=(...e)=>{o.apply(console,e);const i=Be("console error");j((()=>{r.notify(function(e,n,r){const o=e.map((t=>function(t){if("string"==typeof t)return Ke(t);if(rn(t))return qe(Ce(t));return Ge(Ke(t),void 0,2)}(t))).join(" ");if(n===t.error){const t=Qe({originalError:e.find(rn),handlingStack:r,startClocks:S(),source:an,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return t.message=o,{api:n,message:o,handlingStack:r,error:t}}return{api:n,message:o,error:void 0,handlingStack:r}}(e,n,i))}))},()=>{e[n]=o}}))}(n)),Ur[n]))))}function $r(t,e,n){const r={...t};for(const[t,{required:i,type:s}]of Object.entries(e))"string"!==s||Vr(r[t])||(r[t]=String(r[t])),i&&Vr(r[t])&&o.warn(`The property ${t} of ${n} is required; context will not be sent to the intake.`);return r}function Vr(t){return null==t||""===t}function Br(t="",{propertiesConfig:e={}}={}){let n={};const r=new X,i={getContext:()=>Tn(n),setContext:s=>{!function(t){const e="object"===re(t);return e||o.error("Unsupported context:",t),e}(s)?i.clearContext():n=Ke($r(s,e,t)),r.notify()},setContextProperty:(o,i)=>{n=Ke($r({...n,[o]:i},e,t)),r.notify()},removeContextProperty:o=>{delete n[o],$r(n,e,t),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Fr(t,e,n,r){return q(((...o)=>(r&&sr({feature:r}),t()[e][n](...o))))}const qr="_dd_c",jr=[];function Hr(t,e,n,r){const o=function(t,e){return`${qr}_${t}_${e}`}(n,r);jr.push(pn(t,window,"storage",(({key:t})=>{o===t&&e.setContext(s())}))),e.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(e.getContext()))}));const i=En(s(),e.getContext());function s(){const t=localStorage.getItem(o);return t?JSON.parse(t):{}}M(i)||e.setContext(i)}function Gr(){return Br("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function Wr(){return Br("global context")}function Kr(){return Br("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Jr="userContext",Yr="globalContext",Zr="accountContext",Xr="getContext",Qr="setContext",to="setContextProperty",eo="removeContextProperty",no="clearContext",ro="document",oo="xhr",io="beacon",so="fetch",ao="css",co="js",uo="image",lo="font",fo="media",po="other",mo={FETCH:so,XHR:oo};function ho(){try{return(new Intl.DateTimeFormat).resolvedOptions().timeZone}catch(t){return}}const go="action",vo="error",yo="long_task",bo="view",_o="resource",wo="vital",So="long-task",ko="long-animation-frame",To="initial_load",Eo="route_change",xo="bf_cache",Co="click",Ao="custom",Io="rage_click",Ro="error_click",No="dead_click",Oo="duration",Lo="operation_step";function Mo(t,e,n){function r(n){(function(t){return!e.wasInPageStateDuringPeriod("frozen",t.startClocks.relative,t.duration)})(n)&&t.notify(12,Uo(n))}return{addOperationStepVital:function(e,n,r,o){if(!Te(we.FEATURE_OPERATION_VITAL))return;const{operationKey:i,context:s,description:a}=r||{},c={name:e,type:Lo,operationKey:i,failureReason:o,stepType:n,startClocks:S(),context:Ke(s),description:a};t.notify(12,Uo(c))},addDurationVital:r,startDurationVital:(t,e={})=>Po(n,t,e),stopDurationVital:(t,e={})=>{Do(r,n,t,e)}}}function Po({vitalsByName:t,vitalsByReference:e},n,r={}){const o={name:n,startClocks:S(),...r},i={__dd_vital_reference:!0};return t.set(n,o),e.set(i,o),i}function Do(t,{vitalsByName:e,vitalsByReference:n},r,o={}){const i="string"==typeof r?e.get(r):n.get(r);i&&(t(function(t,e,n,r){var o;return{name:t.name,type:Oo,startClocks:e,duration:T(e.timeStamp,r.timeStamp),context:En(t.context,n.context),description:null!==(o=n.description)&&void 0!==o?o:t.description}}(i,i.startClocks,o,S())),"string"==typeof r?e.delete(r):n.delete(r))}function Uo(t){const{startClocks:e,type:n,name:r,description:o,context:i}=t,s={id:rt(),type:n,name:r,description:o,...n===Oo?{duration:y(t.duration)}:{step_type:t.stepType,operation_key:t.operationKey,failure_reason:t.failureReason}};return{rawRumEvent:{date:e.timeStamp,vital:s,type:wo,context:i},startTime:e.relative,duration:n===Oo?t.duration:void 0,domainContext:{}}}function zo(t,e,n){if(t)for(const r of t){const t=r[e];t&&t(n)}}const $o=new Map;function Vo(t,e){if(100===e)return!0;if(0===e)return!1;const n=$o.get(e);if(n&&t===n.sessionId)return n.decision;let r;return r=window.BigInt?function(t,e){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000");return Number(t*n%r)<=e/100*Number(r)}(BigInt(`0x${t.split("-")[4]}`),e):u(e),$o.set(e,{sessionId:t,decision:r}),r}function Bo(){return Fo(63)}function Fo(t){const e=crypto.getRandomValues(new Uint32Array(2));return 63===t&&(e[e.length-1]>>>=1),{toString(t=10){let n=e[1],r=e[0],o="";do{const e=n%t*4294967296+r;n=Math.floor(n/t),r=Math.floor(e/t),o=(e%t).toString(t)+o}while(n||r);return o}}}function qo(t){return t.toString(16).padStart(16,"0")}function jo(t){0!==t.status||t.isAborted||(t.traceId=void 0,t.spanId=void 0,t.traceSampled=void 0)}function Ho(t,e,n,r,o,i){const s=n.findTrackedSession();if(!s)return;const a=t.allowedTracingUrls.find((t=>ie([t.match],e.url,!0)));if(!a)return;const c=Vo(s.id,t.traceSampleRate);(c||t.traceContextInjection===ve.ALL)&&(e.traceSampled=c,e.traceId=Fo(64),e.spanId=Bo(),i(function(t,e,n,r,o,i,s,a){const c={};if(o.forEach((r=>{switch(r){case"datadog":Object.assign(c,{"x-datadog-origin":"rum","x-datadog-parent-id":e.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":t.toString()});break;case"tracecontext":Object.assign(c,{traceparent:`00-0000000000000000${qo(t)}-${qo(e)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break;case"b3":Object.assign(c,{b3:`${qo(t)}-${qo(e)}-${n?"1":"0"}`});break;case"b3multi":Object.assign(c,{"X-B3-TraceId":qo(t),"X-B3-SpanId":qo(e),"X-B3-Sampled":n?"1":"0"})}})),a.propagateTraceBaggage){const t={"session.id":r},e=i.getContext().id;"string"==typeof e&&(t["user.id"]=e);const n=s.getContext().id;"string"==typeof n&&(t["account.id"]=n);const o=Object.entries(t).map((([t,e])=>`${t}=${encodeURIComponent(e)}`)).join(",");o&&(c.baggage=o)}return c}(e.traceId,e.spanId,e.traceSampled,s.id,a.propagatorTypes,r,o,t)))}const Go=["tracecontext","datadog"];function Wo(t,e){var n,r,i,s,a,c,u;if(void 0===t.trackFeatureFlagsForEvents||Array.isArray(t.trackFeatureFlagsForEvents)||o.warn("trackFeatureFlagsForEvents should be an array"),!t.applicationId)return void o.error("Application ID is not configured, no RUM data will be collected.");if(!be(t.sessionReplaySampleRate,"Session Replay")||!be(t.traceSampleRate,"Trace"))return;if(void 0!==t.excludedActivityUrls&&!Array.isArray(t.excludedActivityUrls))return void o.error("Excluded Activity Urls should be an array");const l=function(t){if(void 0===t.allowedTracingUrls)return[];if(!Array.isArray(t.allowedTracingUrls))return void o.error("Allowed Tracing URLs should be an array");if(0!==t.allowedTracingUrls.length&&void 0===t.service)return void o.error("Service needs to be configured when tracing is enabled");const e=[];return t.allowedTracingUrls.forEach((t=>{oe(t)?e.push({match:t,propagatorTypes:Go}):!function(t){const e=t;return"object"===re(e)&&oe(e.match)&&Array.isArray(e.propagatorTypes)}(t)?o.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",t):e.push(t)})),e}(t);if(!l)return;const f=_e(t,e),p=function(t){if(!t.allowedGraphQlUrls)return[];if(!Array.isArray(t.allowedGraphQlUrls))return o.warn("allowedGraphQlUrls should be an array"),[];const e=[];return t.allowedGraphQlUrls.forEach((t=>{oe(t)?e.push({match:t,trackPayload:!1,trackResponseErrors:!1}):t&&"object"==typeof t&&"match"in t&&oe(t.match)&&e.push({match:t.match,trackPayload:!!t.trackPayload,trackResponseErrors:!!t.trackResponseErrors})})),e}(t);if(!f)return;const m=null!==(n=t.sessionReplaySampleRate)&&void 0!==n?n:0;return{applicationId:t.applicationId,actionNameAttribute:t.actionNameAttribute,sessionReplaySampleRate:m,startSessionReplayRecordingManually:void 0!==t.startSessionReplayRecordingManually?!!t.startSessionReplayRecordingManually:0===m,traceSampleRate:null!==(r=t.traceSampleRate)&&void 0!==r?r:100,rulePsr:d(t.traceSampleRate)?t.traceSampleRate/100:void 0,allowedTracingUrls:l,excludedActivityUrls:null!==(i=t.excludedActivityUrls)&&void 0!==i?i:[],workerUrl:t.workerUrl,compressIntakeRequests:!!t.compressIntakeRequests,trackUserInteractions:!(null!==(s=t.trackUserInteractions)&&void 0!==s&&!s),trackViewsManually:!!t.trackViewsManually,trackResources:!(null!==(a=t.trackResources)&&void 0!==a&&!a),trackLongTasks:!(null!==(c=t.trackLongTasks)&&void 0!==c&&!c),trackBfcacheViews:!!t.trackBfcacheViews,trackEarlyRequests:!!t.trackEarlyRequests,subdomain:t.subdomain,defaultPrivacyLevel:L(ge,t.defaultPrivacyLevel)?t.defaultPrivacyLevel:ge.MASK,enablePrivacyForActionName:!!t.enablePrivacyForActionName,traceContextInjection:L(ve,t.traceContextInjection)?t.traceContextInjection:ve.SAMPLED,plugins:t.plugins||[],trackFeatureFlagsForEvents:t.trackFeatureFlagsForEvents||[],profilingSampleRate:null!==(u=t.profilingSampleRate)&&void 0!==u?u:0,propagateTraceBaggage:!!t.propagateTraceBaggage,allowedGraphQlUrls:p,...f}}function Ko(t){const e=new Set;return lr(t.allowedTracingUrls)&&t.allowedTracingUrls.forEach((t=>{oe(t)?Go.forEach((t=>e.add(t))):"object"===re(t)&&Array.isArray(t.propagatorTypes)&&t.propagatorTypes.forEach((t=>e.add(t)))})),Array.from(e)}function Jo(t){return lr(t)&&t.some((t=>"object"==typeof t&&"trackResponseErrors"in t&&!!t.trackResponseErrors))}function Yo(t){var e;const n={session_sample_rate:(r=t).sessionSampleRate,telemetry_sample_rate:r.telemetrySampleRate,telemetry_configuration_sample_rate:r.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:r.telemetryUsageSampleRate,use_before_send:!!r.beforeSend,use_partitioned_cross_site_session_cookie:r.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:r.useSecureSessionCookie,use_proxy:!!r.proxy,silent_multiple_init:r.silentMultipleInit,track_session_across_subdomains:r.trackSessionAcrossSubdomains,track_anonymous_user:r.trackAnonymousUser,session_persistence:r.sessionPersistence,allow_fallback_to_local_storage:!!r.allowFallbackToLocalStorage,store_contexts_across_pages:!!r.storeContextsAcrossPages,allow_untrusted_events:!!r.allowUntrustedEvents,tracking_consent:r.trackingConsent,use_allowed_tracking_origins:Array.isArray(r.allowedTrackingOrigins),beta_encode_cookie_options:r.betaEncodeCookieOptions,source:r.source,sdk_version:r.sdkVersion,variant:r.variant};var r,o;return{session_replay_sample_rate:t.sessionReplaySampleRate,start_session_replay_recording_manually:t.startSessionReplayRecordingManually,trace_sample_rate:t.traceSampleRate,trace_context_injection:t.traceContextInjection,propagate_trace_baggage:t.propagateTraceBaggage,action_name_attribute:t.actionNameAttribute,use_allowed_tracing_urls:lr(t.allowedTracingUrls),use_allowed_graph_ql_urls:lr(t.allowedGraphQlUrls),use_track_graph_ql_payload:(o=t.allowedGraphQlUrls,lr(o)&&o.some((t=>"object"==typeof t&&"trackPayload"in t&&!!t.trackPayload))),use_track_graph_ql_response_errors:Jo(t.allowedGraphQlUrls),selected_tracing_propagators:Ko(t),default_privacy_level:t.defaultPrivacyLevel,enable_privacy_for_action_name:t.enablePrivacyForActionName,use_excluded_activity_urls:lr(t.excludedActivityUrls),use_worker_url:!!t.workerUrl,compress_intake_requests:t.compressIntakeRequests,track_views_manually:t.trackViewsManually,track_user_interactions:t.trackUserInteractions,track_resources:t.trackResources,track_long_task:t.trackLongTasks,track_bfcache_views:t.trackBfcacheViews,track_early_requests:t.trackEarlyRequests,plugins:null===(e=t.plugins)||void 0===e?void 0:e.map((t=>{var e;return{name:t.name,...null===(e=t.getConfigurationTelemetry)||void 0===e?void 0:e.call(t)}})),track_feature_flags_for_events:t.trackFeatureFlagsForEvents,remote_configuration_id:t.remoteConfigurationId,profiling_sample_rate:t.profilingSampleRate,use_remote_configuration_proxy:!!t.remoteConfigurationProxy,...n}}const Zo=/[a-zA-Z_$]/,Xo=/[a-zA-Z0-9_$]/,Qo=/[0-9]/,ti=/[a-fA-F0-9]/,ei={0:()=>!1,1:()=>!1,2:t=>Zo.test(t),3:t=>Xo.test(t),4:t=>"."===t,5:t=>"["===t,6:t=>"]"===t,7:t=>Qo.test(t),8:t=>"'\"".includes(t),9:(t,e)=>t===e.quote,10:()=>!0,11:t=>"\\"===t,12:(t,e)=>void 0===e.escapeSequence?`${e.quote}/\\bfnrtu`.includes(t):!!(e.escapeSequence.startsWith("u")&&e.escapeSequence.length<5)&&ti.test(t)},ni={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},ri=[2,3,7,10],oi=[4,5,6];const ii={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function si(t){return t.startsWith("u")?String.fromCharCode(parseInt(t.slice(1),16)):ii[t]}const ai=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ci(t,e){let n;const r=function(){const t={fetch:{}};return{get:()=>t,increment:(e,n)=>{t[e]||(t[e]={}),t[e][n]||(t[e][n]=0),t[e][n]=t[e][n]+1}}}(),i=await async function(t){let e;try{e=await fetch(function(t){if(t.remoteConfigurationProxy)return t.remoteConfigurationProxy;return`https://sdk-configuration.${me("rum",t)}/v1/${encodeURIComponent(t.remoteConfigurationId)}.json`}(t))}catch(t){e=void 0}if(!e||!e.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await e.json();if(n.rum)return{ok:!0,value:n.rum};return{ok:!1,error:new Error("No remote configuration for RUM.")}}(t);return i.ok?(r.increment("fetch","success"),n=function(t,e,n,r){const i={...t};return ai.forEach((t=>{t in e&&(i[t]=s(e[t]))})),Object.keys(n).forEach((t=>{void 0!==e[t]&&a(n[t],e[t])})),i;function s(t){if(Array.isArray(t))return t.map(s);if(function(t){return"object"==typeof t&&null!==t}(t)){if("rcSerializedType"in t){const e=t.rcSerializedType;switch(e){case"string":return t.value;case"regex":return ui(t.value);case"dynamic":return c(t);default:return void o.error(`Unsupported remote configuration: "rcSerializedType": "${e}"`)}}return P(t,s)}return t}function a(t,e){e.forEach((({key:e,value:n})=>{t.setContextProperty(e,s(n))}))}function c(t){const e=t.strategy;let n;switch(e){case"cookie":n=u(t);break;case"dom":n=l(t);break;case"js":n=f(t);break;default:return void o.error(`Unsupported remote configuration: "strategy": "${e}"`)}const r=t.extractor;return void 0!==r&&"string"==typeof n?function(t,e){const n=ui(t.value);if(void 0===n)return;const r=n.exec(e);if(null===r)return;const[o,i]=r;return i||o}(r,n):n}function u({name:t}){const e=ht(t);return r.increment("cookie",void 0!==e?"success":"missing"),e}function l({selector:t,attribute:e}){let n;try{n=document.querySelector(t)}catch(e){return o.error(`Invalid selector in the remote configuration: '${t}'`),void r.increment("dom","failure")}if(!n)return void r.increment("dom","missing");if(d(n,e))return o.error(`Forbidden element selected by the remote configuration: '${t}'`),void r.increment("dom","failure");const i=void 0!==e?n.getAttribute(e):n.textContent;if(null!==i)return r.increment("dom","success"),i;r.increment("dom","missing")}function d(t,e){return"password"===t.getAttribute("type")&&"value"===e}function f({path:t}){let e=window;const n=function(t){const e=[];let n,r=0;const o={quote:void 0,escapeSequence:void 0};let i="";for(const a of t){if(n=ni[r].find((t=>ei[t](a,o))),!n)return[];if(void 0!==o.escapeSequence&&12!==n){if(s=o.escapeSequence,!("\"'/\\bfnrt".includes(s)||s.startsWith("u")&&5===s.length))return[];i+=si(o.escapeSequence),o.escapeSequence=void 0}ri.includes(n)?i+=a:oi.includes(n)&&""!==i?(e.push(i),i=""):12===n?o.escapeSequence=o.escapeSequence?`${o.escapeSequence}${a}`:a:8===n?o.quote=a:9===n&&(o.quote=void 0),r=n}var s;return ni[r].includes(1)?(""!==i&&e.push(i),e):[]}(t);if(0===n.length)return o.error(`Invalid JSON path in the remote configuration: '${t}'`),void r.increment("js","failure");for(const i of n){if(!(i in e))return void r.increment("js","missing");try{e=e[i]}catch(e){return o.error(`Error accessing: '${t}'`,e),void r.increment("js","failure")}}return r.increment("js","success"),e}}(t,i.value,e,r)):(r.increment("fetch","failure"),o.error(i.error)),ir("remote configuration metrics",{metrics:r.get()}),n}function ui(t){try{return new RegExp(t)}catch(e){o.error(`Invalid regex in the remote configuration: '${t}'`)}}function li({ignoreInitIfSyntheticsWillInjectRum:t=!0,startDeflateWorker:e},n,r,i){const s=function(){const t=[];return{add:e=>{t.push(e)>500&&t.splice(0,1)},remove:e=>{ur(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}(),a=Wr();di(a,Yr,s);const c=Kr();di(c,Jr,s);const u=Gr();let l,d,f,p;di(u,Zr,s);const m=n.observable.subscribe(g),h={};function g(){if(!f||!p||!n.isGranted())return;let t;if(m.unsubscribe(),p.trackViewsManually){if(!l)return;s.remove(l.callback),t=l.options}const e=i(p,d,t);s.drain(e)}function v(t,r){const i=Bn();if(i&&(t=function(t){var e,n;return{...t,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:null!==(e=t.defaultPrivacyLevel)&&void 0!==e?e:null===(n=$n())||void 0===n?void 0:n.getPrivacyLevel()}}(t)),f=t,function(t){er().notify({rawEvent:{type:Yn,configuration:t}})}(Yo(t)),p)return void fn("DD_RUM",t);const s=Wo(t,r);s&&(i||s.sessionStoreStrategyType?s.compressIntakeRequests&&!i&&e&&(d=e(s,"Datadog RUM",nt),!d)||(p=s,Mr().subscribe(nt),n.tryToInit(s.trackingConsent),g()):o.warn("No storage available for session. We will not send any data."))}const y=t=>{s.add((e=>e.addDurationVital(t)))};return{init(e,n,r){e?(ke(e.enableExperimentalFeatures),f=e,t&&hr()||(zo(e.plugins,"onInit",{initConfiguration:e,publicApi:n}),e.remoteConfigurationId?ci(e,{user:c,context:a}).then((t=>{t&&v(t,r)})).catch(H):v(e,r))):o.error("Missing configuration")},get initConfiguration(){return f},getInternalContext:nt,stopSession:nt,addTiming(t,e=_()){s.add((n=>n.addTiming(t,e)))},startView(t,e=S()){const n=n=>{n.startView(t,e)};s.add(n),l||(l={options:t,callback:n},g())},setViewName(t){s.add((e=>e.setViewName(t)))},setViewContext(t){s.add((e=>e.setViewContext(t)))},setViewContextProperty(t,e){s.add((n=>n.setViewContextProperty(t,e)))},getViewContext:()=>h,globalContext:a,userContext:c,accountContext:u,addAction(t){s.add((e=>e.addAction(t)))},addError(t){s.add((e=>e.addError(t)))},addFeatureFlagEvaluation(t,e){s.add((n=>n.addFeatureFlagEvaluation(t,e)))},startDurationVital:(t,e)=>Po(r,t,e),stopDurationVital(t,e){Do(y,r,t,e)},addDurationVital:y,addOperationStepVital:(t,e,n,r)=>{s.add((o=>o.addOperationStepVital(Ke(t),e,Ke(n),Ke(r))))}}}function di(t,e,n){t.changeObservable.subscribe((()=>{const r=t.getContext();n.add((t=>t[e].setContext(r)))}))}function fi(){let t;const e=window;if(e.Zone&&(t=$(e,"MutationObserver"),e.MutationObserver&&t===e.MutationObserver)){const n=$(new e.MutationObserver(nt),"originalInstance");t=n&&n.constructor}return t||(t=e.MutationObserver),t}const pi=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}},mi=Tt;const hi="initial_document",gi=[[ro,t=>hi===t],[oo,t=>"xmlhttprequest"===t],[so,t=>"fetch"===t],[io,t=>"beacon"===t],[ao,(t,e)=>/\.css$/i.test(e)],[co,(t,e)=>/\.js$/i.test(e)],[uo,(t,e)=>["image","img","icon"].includes(t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)],[lo,(t,e)=>null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)],[fo,(t,e)=>["audio","video"].includes(t)||null!==/\.(mp3|mp4)$/i.exec(e)]];function vi(t){const e=t.name;if(!function(t){try{return!!pt(t)}catch(t){return!1}}(e))return po;const n=function(t){const e=pt(t).pathname;return"/"===e[0]?e:`/${e}`}(e);for(const[e,r]of gi)if(r(t.initiatorType,n))return e;return po}function yi(...t){for(let e=1;e<t.length;e+=1)if(t[e-1]>t[e])return!1;return!0}function bi(t){return"xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType}function _i(t){if(!Si(t))return;const{startTime:e,fetchStart:n,workerStart:r,redirectStart:o,redirectEnd:i,domainLookupStart:s,domainLookupEnd:a,connectStart:c,secureConnectionStart:u,connectEnd:l,requestStart:d,responseStart:f,responseEnd:p}=t,m={download:ki(e,f,p),first_byte:ki(e,d,f)};return 0<r&&r<n&&(m.worker=ki(e,r,n)),n<l&&(m.connect=ki(e,c,l),c<=u&&u<=l&&(m.ssl=ki(e,u,l))),n<a&&(m.dns=ki(e,s,a)),e<i&&(m.redirect=ki(e,o,i)),m}function wi(t){return t.duration>=0}function Si(t){const e=yi(t.startTime,t.fetchStart,t.domainLookupStart,t.domainLookupEnd,t.connectStart,t.connectEnd,t.requestStart,t.responseStart,t.responseEnd),n=!function(t){return t.redirectEnd>t.startTime}(t)||yi(t.startTime,t.redirectStart,t.redirectEnd,t.fetchStart);return e&&n}function ki(t,e,n){if(t<=e&&e<=n)return{duration:y(T(e,n)),start:y(T(t,e))}}function Ti(t){return""===t.nextHopProtocol?void 0:t.nextHopProtocol}function Ei(t){return""===t.deliveryType?"other":t.deliveryType}function xi(t){if(t.startTime<t.responseStart){const{encodedBodySize:e,decodedBodySize:n,transferSize:r}=t;return{size:n,encoded_body_size:e,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function Ci(t){return t&&(!function(t){return fe.every((e=>t.includes(e)))}(t)||Te(we.TRACK_INTAKE_REQUESTS))}const Ai=/data:(.+)?(;base64)?,/g;function Ii(t,e=24e3){if(t.length<=e||!t.startsWith("data:"))return t;const n=t.substring(0,100).match(Ai);return n?`${n[0]}[...]`:t}function Ri(t,e){const n=function(t,e=!1){if(!t||"string"!=typeof t)return;let n;try{n=JSON.parse(t)}catch(t){return}if(!n||!n.query)return;const r=n.query.trim(),o=function(t){var e;return null===(e=t.match(/^\s*(query|mutation|subscription)\b/i))||void 0===e?void 0:e[1]}(r),i=n.operationName;if(!o)return;let s;n.variables&&(s=JSON.stringify(n.variables));return{operationType:o,operationName:i,variables:s,payload:e?st(r,32768,"..."):void 0}}(t.requestBody,e.trackPayload);if(n){if(e.trackResponseErrors&&t.responseBody){const e=function(t){let e;try{e=JSON.parse(t)}catch(t){return}if(!e||"object"!=typeof e)return;const n=e;if(!lr(n.errors))return;return n.errors.map((t=>{var e;return{message:t.message,path:t.path,locations:t.locations,code:null===(e=t.extensions)||void 0===e?void 0:e.code}}))}(t.responseBody);e&&(n.errors_count=e.length,n.errors=e)}return n}}function Ni(t,e){return e.allowedGraphQlUrls.find((e=>ie([e.match],t)))}let Oi=1;function Li(t,e,n,r,o){const i=function(t,e,n,r){return{clearTracingIfNeeded:jo,traceFetch:o=>Ho(t,o,e,n,r,(t=>{var e;if(o.input instanceof Request&&!(null===(e=o.init)||void 0===e?void 0:e.headers))o.input=new Request(o.input),Object.keys(t).forEach((e=>{o.input.headers.append(e,t[e])}));else{o.init=O(o.init);const e=[];o.init.headers instanceof Headers?o.init.headers.forEach(((t,n)=>{e.push([n,t])})):Array.isArray(o.init.headers)?o.init.headers.forEach((t=>{e.push(t)})):o.init.headers&&Object.keys(o.init.headers).forEach((t=>{e.push([t,o.init.headers[t]])})),o.init.headers=e.concat(kt(t))}})),traceXhr:(o,i)=>Ho(t,o,e,n,r,(t=>{Object.keys(t).forEach((e=>{i.setRequestHeader(e,t[e])}))}))}}(e,n,r,o);!function(t,e,n){const r=Ir(e).subscribe((e=>{const r=e;if(Ci(r.url))switch(r.state){case"start":n.traceXhr(r,r.xhr),r.requestIndex=Mi(),t.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"complete":n.clearTracingIfNeeded(r),t.notify(8,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:mo.XHR,url:r.url,xhr:r.xhr,isAborted:r.isAborted,handlingStack:r.handlingStack,requestBody:r.requestBody,responseBody:r.responseBody})}}))}(t,e,i),function(t,e,n){const r=Mr({responseBodyAction:t=>{var n;return(null===(n=Ni(t.url,e))||void 0===n?void 0:n.trackResponseErrors)?2:1}}).subscribe((e=>{var r;const o=e;if(Ci(o.url))switch(o.state){case"start":n.traceFetch(o),o.requestIndex=Mi(),t.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"resolve":n.clearTracingIfNeeded(o),t.notify(8,{duration:T(o.startClocks.timeStamp,_()),method:o.method,requestIndex:o.requestIndex,responseType:o.responseType,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:mo.FETCH,url:o.url,response:o.response,init:o.init,input:o.input,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:null===(r=o.init)||void 0===r?void 0:r.body,responseBody:o.responseBody})}}))}(t,e,i)}function Mi(){const t=Oi;return Oi+=1,t}function Pi(t){return d(t)&&t<0?void 0:t}function Di({lifeCycle:t,isChildEvent:e,onChange:n=nt}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},o=t.subscribe(13,(t=>{var o;if("view"!==t.type&&"vital"!==t.type&&e(t))switch(t.type){case vo:r.errorCount+=1,n();break;case go:r.actionCount+=1,t.action.frustration&&(r.frustrationCount+=t.action.frustration.type.length),n();break;case yo:r.longTaskCount+=1,n();break;case _o:(null===(o=t._dd)||void 0===o?void 0:o.discarded)||(r.resourceCount+=1,n())}}));return{stop:()=>{o.unsubscribe()},eventCounts:r}}function Ui(t,e){const n=b();let r=!1;const{stop:o}=mn(t,window,["click","mousedown","keydown","touchstart","pointerdown"],(e=>{if(!e.cancelable)return;const n={entryType:"first-input",processingStart:w(),processingEnd:w(),startTime:e.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};"pointerdown"===e.type?function(t,e){mn(t,window,["pointerup","pointercancel"],(t=>{"pointerup"===t.type&&i(e)}),{once:!0})}(t,n):i(n)}),{passive:!0,capture:!0});return{stop:o};function i(t){if(!r){r=!0,o();const i=t.processingStart-t.startTime;i>=0&&i<b()-n&&e(t)}}}var zi;function $i(t,e){return new X((n=>{if(!window.PerformanceObserver)return;const r=t=>{const e=function(t){return t.filter((t=>!function(t){return!(t.entryType!==zi.RESOURCE||Ci(t.name)&&wi(t))}(t)))}(t);e.length>0&&n.notify(e)};let o,i=!0;const s=new PerformanceObserver(q((t=>{i?o=W((()=>r(t.getEntries()))):r(t.getEntries())})));try{s.observe(e)}catch(t){if([zi.RESOURCE,zi.NAVIGATION,zi.LONG_TASK,zi.PAINT].includes(e.type)){e.buffered&&(o=W((()=>r(performance.getEntriesByType(e.type)))));try{s.observe({entryTypes:[e.type]})}catch(t){return}}}let a;return i=!1,function(t){!Vi&&void 0!==window.performance&&"getEntries"in performance&&"addEventListener"in performance&&(Vi=pn(t,performance,"resourcetimingbufferfull",(()=>{performance.clearResourceTimings()})))}(t),Bi(zi.FIRST_INPUT)||e.type!==zi.FIRST_INPUT||({stop:a}=Ui(t,(t=>{r([t])}))),()=>{s.disconnect(),a&&a(),K(o)}}))}let Vi;function Bi(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}function Fi(t){return t.nodeType===Node.TEXT_NODE}function qi(t){return t.nodeType===Node.ELEMENT_NODE}function ji(t){return qi(t)&&Boolean(t.shadowRoot)}function Hi(t){const e=t;return!!e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&qi(e.host)}function Gi(t,e){let n=t.firstChild;for(;n;)e(n),n=n.nextSibling;ji(t)&&e(t.shadowRoot)}function Wi(t){return Hi(t)?t.host:t.parentNode}!function(t){t.EVENT="event",t.FIRST_INPUT="first-input",t.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",t.LAYOUT_SHIFT="layout-shift",t.LONG_TASK="longtask",t.LONG_ANIMATION_FRAME="long-animation-frame",t.NAVIGATION="navigation",t.PAINT="paint",t.RESOURCE="resource",t.VISIBILITY_STATE="visibility-state"}(zi||(zi={}));const Ki=100,Ji="data-dd-excluded-activity-mutations";function Yi(t,e,n,r,o,i){const s=function(t,e,n,r){return new X((o=>{const i=[];let s,a=0;return i.push(e.subscribe((t=>{t.every(Xi)||c()})),n.subscribe(c),$i(r,{type:zi.RESOURCE}).subscribe((t=>{t.some((t=>!Zi(r,t.name)))&&c()})),t.subscribe(7,(t=>{Zi(r,t.url)||(void 0===s&&(s=t.requestIndex),a+=1,c())})),t.subscribe(8,(t=>{Zi(r,t.url)||void 0===s||t.requestIndex<s||(a-=1,c())}))),()=>{i.forEach((t=>t.unsubscribe()))};function c(){o.notify({isBusy:a>0})}}))}(t,e,n,r);return function(t,e,n){let r,o=!1;const i=W(q((()=>u({hadActivity:!1}))),100),s=void 0!==n?W(q((()=>u({hadActivity:!0,end:_()}))),n):void 0,a=t.subscribe((({isBusy:t})=>{K(i),K(r);const e=_();t||(r=W(q((()=>u({hadActivity:!0,end:e}))),100))})),c=()=>{o=!0,K(i),K(r),K(s),a.unsubscribe()};function u(t){o||(c(),e(t))}return{stop:c}}(s,o,i)}function Zi(t,e){return ie(t.excludedActivityUrls,e)}function Xi(t){const e="characterData"===t.type?t.target.parentElement:t.target;return Boolean(e&&qi(e)&&e.matches(`[${Ji}], [${Ji}] *`))}const Qi="data-dd-action-name",ts=[Qi,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],es=[is,function(t){if(t.id&&!os(t.id))return`#${CSS.escape(t.id)}`}],ns=[is,function(t){if("BODY"===t.tagName)return;const e=t.classList;for(let n=0;n<e.length;n+=1){const r=e[n];if(!os(r))return`${CSS.escape(t.tagName)}.${CSS.escape(r)}`}},function(t){return CSS.escape(t.tagName)}];function rs(t,e){if(!t.isConnected)return;let n,r=t;for(;r&&"HTML"!==r.nodeName;){const t=as(r,es,cs,e,n);if(t)return t;n=as(r,ns,us,e,n)||ls(ss(r),n),r=r.parentElement}return n}function os(t){return/[0-9]/.test(t)}function is(t,e){if(e){const t=n(e);if(t)return t}for(const t of ts){const e=n(t);if(e)return e}function n(e){if(t.hasAttribute(e))return`${CSS.escape(t.tagName)}[${e}="${CSS.escape(t.getAttribute(e))}"]`}}function ss(t){let e=t.parentElement.firstElementChild,n=1;for(;e&&e!==t;)e.tagName===t.tagName&&(n+=1),e=e.nextElementSibling;return`${CSS.escape(t.tagName)}:nth-of-type(${n})`}function as(t,e,n,r,o){for(const i of e){const e=i(t,r);if(e&&n(t,e,o))return ls(e,o)}}function cs(t,e,n){return 1===t.ownerDocument.querySelectorAll(ls(e,n)).length}function us(t,e,n){let r;if(void 0===n)r=t=>t.matches(e);else{const t=ls(`${e}:scope`,n);r=e=>null!==e.querySelector(t)}let o=t.parentElement.firstElementChild;for(;o;){if(o!==t&&r(o))return!1;o=o.nextElementSibling}return!0}function ls(t,e){return e?`${t}>${e}`:t}const ds={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:ge.ALLOW,MASK:ge.MASK,MASK_USER_INPUT:ge.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:ge.MASK_UNLESS_ALLOWLISTED},fs="data-dd-privacy",ps="hidden",ms="***",hs="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",gs={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0};function vs(t){return`[${fs}="${t}"], .dd-privacy-${t}`}function ys(t,e,n){if(n&&n.has(t))return n.get(t);const r=Wi(t),o=r?ys(r,e,n):e,i=bs(_s(t),o);return n&&n.set(t,i),i}function bs(t,e){switch(e){case ds.HIDDEN:case ds.IGNORE:return e}switch(t){case ds.ALLOW:case ds.MASK:case ds.MASK_USER_INPUT:case ds.MASK_UNLESS_ALLOWLISTED:case ds.HIDDEN:case ds.IGNORE:return t;default:return e}}function _s(t){if(qi(t)){if("BASE"===t.tagName)return ds.ALLOW;if("INPUT"===t.tagName){const e=t;if("password"===e.type||"email"===e.type||"tel"===e.type)return ds.MASK;if("hidden"===e.type)return ds.MASK;const n=e.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return ds.MASK}return t.matches(vs(ds.HIDDEN))?ds.HIDDEN:t.matches(vs(ds.MASK))?ds.MASK:t.matches(vs(ds.MASK_UNLESS_ALLOWLISTED))?ds.MASK_UNLESS_ALLOWLISTED:t.matches(vs(ds.MASK_USER_INPUT))?ds.MASK_USER_INPUT:t.matches(vs(ds.ALLOW))?ds.ALLOW:function(t){if("SCRIPT"===t.nodeName)return!0;if("LINK"===t.nodeName){const t=e("rel");return/preload|prefetch/i.test(t)&&"script"===e("as")||"shortcut icon"===t||"icon"===t}if("META"===t.nodeName){const n=e("name"),r=e("rel"),o=e("property");return/^msapplication-tile(image|color)$/.test(n)||"application-name"===n||"icon"===r||"apple-touch-icon"===r||"shortcut icon"===r||"keywords"===n||"description"===n||/^(og|twitter|fb):/.test(o)||/^(og|twitter):/.test(n)||"pinterest"===n||"robots"===n||"googlebot"===n||"bingbot"===n||t.hasAttribute("http-equiv")||"author"===n||"generator"===n||"framework"===n||"publisher"===n||"progid"===n||/^article:/.test(o)||/^product:/.test(o)||"google-site-verification"===n||"yandex-verification"===n||"csrf-token"===n||"p:domain_verify"===n||"verify-v1"===n||"verification"===n||"shopify-checkout-api-token"===n}function e(e){return(t.getAttribute(e)||"").toLowerCase()}return!1}(t)?ds.IGNORE:void 0}}function ws(t,e){switch(e){case ds.MASK:case ds.HIDDEN:case ds.IGNORE:return!0;case ds.MASK_UNLESS_ALLOWLISTED:return Fi(t)?!!Ss(t.parentNode)||!Es(t.textContent||""):Ss(t);case ds.MASK_USER_INPUT:return Fi(t)?Ss(t.parentNode):Ss(t);default:return!1}}function Ss(t){if(!t||t.nodeType!==t.ELEMENT_NODE)return!1;const e=t;if("INPUT"===e.tagName)switch(e.type){case"button":case"color":case"reset":case"submit":return!1}return!!gs[e.tagName]}const ks=t=>t.replace(/\S/g,"x");function Ts(t,e){var n;const r=null===(n=t.parentElement)||void 0===n?void 0:n.tagName;let o=t.textContent||"";if("HEAD"===r&&!o.trim())return;const i=e;if("SCRIPT"===r)o=ms;else if(i===ds.HIDDEN)o=ms;else if(ws(t,i))if("DATALIST"===r||"SELECT"===r||"OPTGROUP"===r){if(!o.trim())return}else o="OPTION"===r?ms:i===ds.MASK_UNLESS_ALLOWLISTED?function(t,e){if(Es(t))return t;return e||ks(t)}(o):ks(o);return o}function Es(t){var e;return!t||!t.trim()||((null===(e=window.$DD_ALLOW)||void 0===e?void 0:e.has(t.toLocaleLowerCase()))||!1)}const xs=f;function Cs(t,e){const n=[];let r,o=0;function i(t){t.stopObservable.subscribe(s),n.push(t),K(r),r=W(a,xs)}function s(){1===o&&n.every((t=>t.isStopped()))&&(o=2,e(n))}function a(){K(r),0===o&&(o=1,s())}return i(t),{tryAppend:t=>{return 0===o&&(n.length>0&&(e=n[n.length-1].event,r=t.event,!(e.target===r.target&&(s=e,c=r,Math.sqrt(Math.pow(s.clientX-c.clientX,2)+Math.pow(s.clientY-c.clientY,2))<=100)&&e.timeStamp-r.timeStamp<=xs))?(a(),!1):(i(t),!0));var e,r,s,c},stop:()=>{a()}}}function As(t,e){const n=t.closest(`[${e}]`);if(!n)return;return Ms(Ls(n.getAttribute(e).trim()))}const Is=[(t,e)=>{if("labels"in t&&t.labels&&t.labels.length>0)return Ds(t.labels[0],e)},t=>{if("INPUT"===t.nodeName){const e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return{name:e.value,nameSource:"text_content"}}},(t,e)=>{if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Ds(t,e)},t=>Ps(t,"aria-label"),(t,e)=>{const n=t.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map((e=>function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e))).filter((t=>Boolean(t))).map((t=>Us(t,e))).join(" "),nameSource:"text_content"}},t=>Ps(t,"alt"),t=>Ps(t,"name"),t=>Ps(t,"title"),t=>Ps(t,"placeholder"),(t,e)=>{if("options"in t&&t.options.length>0)return Ds(t.options[0],e)}],Rs=[(t,e)=>Ds(t,e)],Ns=10;function Os(t,e,n){let r=t,o=0;for(;o<=Ns&&r&&"BODY"!==r.nodeName&&"HTML"!==r.nodeName&&"HEAD"!==r.nodeName;){for(const t of e){const e=t(r,n);if(e){const{name:t,nameSource:n}=e,r=t&&t.trim();if(r)return{name:Ms(Ls(r)),nameSource:n}}}if("FORM"===r.nodeName)break;r=r.parentElement,o+=1}}function Ls(t){return t.replace(/\s+/g," ")}function Ms(t){return t.length>100?`${st(t,100)} [...]`:t}function Ps(t,e){return{name:t.getAttribute(e)||"",nameSource:"standard_attribute"}}function Ds(t,e){return{name:Us(t,e)||"",nameSource:"text_content"}}function Us(t,e){if(t.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:r,defaultPrivacyLevel:o}=e;if(Te(we.USE_TREE_WALKER_FOR_ACTION_NAME))return function(t,e,n,r){const o=new Map,i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,a);let s="";for(;i.nextNode();){const t=i.currentNode;qi(t)?("BR"===t.nodeName||"P"===t.nodeName||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(t).display))&&(s+=" "):s+=t.textContent||""}return s.replace(/\s+/g," ").trim();function a(t){const i=ys(t,r,o);if(n&&i&&ws(t,i))return NodeFilter.FILTER_REJECT;if(qi(t)){if(t.hasAttribute(Qi)||e&&t.hasAttribute(e))return NodeFilter.FILTER_REJECT;const n=getComputedStyle(t);if("visible"!==n.visibility||"none"===n.display||n.contentVisibility&&"visible"!==n.contentVisibility)return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}(t,r,n,o);if("innerText"in t){let e=t.innerText;const o=n=>{const r=t.querySelectorAll(n);for(let t=0;t<r.length;t+=1){const n=r[t];if("innerText"in n){const t=n.innerText;t&&t.trim().length>0&&(e=e.replace(t,""))}}};return o(`[${Qi}]`),r&&o(`[${r}]`),n&&o(`${vs(ds.HIDDEN)}, ${vs(ds.MASK)}`),e}return t.textContent}function zs(){const t=window.getSelection();return!t||t.isCollapsed}function $s(t){return t.target instanceof Element&&!1!==t.isPrimary}function Vs(t,e){if(function(t){if(t.some((t=>t.getUserActivity().selection||t.getUserActivity().scroll)))return!1;for(let e=0;e<t.length-2;e+=1)if(t[e+3-1].event.timeStamp-t[e].event.timeStamp<=f)return!0;return!1}(t))return e.addFrustration(Io),t.some(Fs)&&e.addFrustration(No),e.hasError&&e.addFrustration(Ro),{isRage:!0};const n=t.some((t=>t.getUserActivity().selection));return t.forEach((t=>{t.hasError&&t.addFrustration(Ro),Fs(t)&&!n&&t.addFrustration(No)})),{isRage:!1}}const Bs='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function Fs(t){if(t.hasPageActivity||t.getUserActivity().input||t.getUserActivity().scroll)return!1;let e=t.event.target;return"LABEL"===e.tagName&&e.hasAttribute("for")&&(e=document.getElementById(e.getAttribute("for"))),!e||!e.matches(Bs)}const qs=1e4,js=new Map;function Hs(t,e){js.set(t,e),js.forEach(((t,e)=>{T(e,w())>1e4&&js.delete(e)}))}function Gs(t,e,n,r){const o=mr({expireDelay:3e5}),i=new X;let s;t.subscribe(10,(()=>{o.reset()})),t.subscribe(5,u),t.subscribe(11,(t=>{t.reason===Fn.UNLOADING&&u()}));const{stop:a}=function(t,{onPointerDown:e,onPointerUp:n}){let r,o,i={selection:!1,input:!1,scroll:!1};const s=[pn(t,window,"pointerdown",(t=>{$s(t)&&(r=zs(),i={selection:!1,input:!1,scroll:!1},o=e(t))}),{capture:!0}),pn(t,window,"selectionchange",(()=>{r&&zs()||(i.selection=!0)}),{capture:!0}),pn(t,window,"scroll",(()=>{i.scroll=!0}),{capture:!0,passive:!0}),pn(t,window,"pointerup",(t=>{if($s(t)&&o){const e=i;n(o,t,(()=>e)),o=void 0}}),{capture:!0}),pn(t,window,"input",(()=>{i.input=!0}),{capture:!0})];return{stop:()=>{s.forEach((t=>t.stop()))}}}(r,{onPointerDown:o=>function(t,e,n,r,o){let i;i=t.enablePrivacyForActionName?ys(r.target,t.defaultPrivacyLevel):ds.ALLOW;if(i===ds.HIDDEN)return;const s=function(t,e,n){const r=t.target.getBoundingClientRect(),o=rs(t.target,n.actionNameAttribute);o&&Hs(t.timeStamp,o);const{name:i,nameSource:s}=function(t,e,n=ds.ALLOW){const{actionNameAttribute:r}=e,o=As(t,Qi)||r&&As(t,r);return o?{name:o,nameSource:"custom_attribute"}:n===ds.MASK?{name:"Masked Element",nameSource:"mask_placeholder"}:Os(t,Is,e)||Os(t,Rs,e)||{name:"",nameSource:"blank"}}(t.target,n,e);return{type:Co,target:{width:Math.round(r.width),height:Math.round(r.height),selector:o},position:{x:Math.round(t.clientX-r.left),y:Math.round(t.clientY-r.top)},name:i,nameSource:s}}(r,i,t);let a=!1;return Yi(e,n,o,t,(t=>{a=t.hadActivity}),Ki),{clickActionBase:s,hadActivityOnPointerDown:()=>a}}(r,t,e,o,n),onPointerUp:({clickActionBase:s,hadActivityOnPointerDown:a},u,l)=>{!function(t,e,n,r,o,i,s,a,c,u,l){var d;const f=Ws(e,o,u,a,c);s(f);const p=null===(d=null==a?void 0:a.target)||void 0===d?void 0:d.selector;p&&Hs(c.timeStamp,p);const{stop:m}=Yi(e,n,r,t,(t=>{t.hadActivity&&t.end<f.startClocks.timeStamp?f.discard():t.hadActivity?f.stop(t.end):l()?f.stop(f.startClocks.timeStamp):f.stop()}),qs),h=e.subscribe(5,(({endClocks:t})=>{f.stop(t.timeStamp)})),g=i.subscribe((()=>{f.stop()}));f.stopObservable.subscribe((()=>{h.unsubscribe(),m(),g.unsubscribe()}))}(r,t,e,n,o,i,c,s,u,l,a)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:t=>o.findAll(t)}};function c(t){if(!s||!s.tryAppend(t)){const e=t.clone();s=Cs(t,(t=>{!function(t,e){const{isRage:n}=Vs(t,e);n?(t.forEach((t=>t.discard())),e.stop(_()),e.validate(t.map((t=>t.event)))):(e.discard(),t.forEach((t=>t.validate())))}(t,e)}))}}function u(){s&&s.stop()}}function Ws(t,e,n,r,o){const i=rt(),s=S(),a=e.add(i,s.relative),c=Di({lifeCycle:t,isChildEvent:t=>void 0!==t.action&&(Array.isArray(t.action.id)?t.action.id.includes(i):t.action.id===i)});let u,l=0;const d=[],f=new X;function p(t){0===l&&(u=t,l=1,u?a.close(x(u)):a.remove(),c.stop(),f.notify())}return{event:o,stop:p,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return void 0!==u},getUserActivity:n,addFrustration:t=>{d.push(t)},startClocks:s,isStopped:()=>1===l||2===l,clone:()=>Ws(t,e,n,r,o),validate:e=>{if(p(),1!==l)return;const{resourceCount:n,errorCount:a,longTaskCount:f}=c.eventCounts,m={duration:u&&T(s.timeStamp,u),startClocks:s,id:i,frustrationTypes:d,counts:{resourceCount:n,errorCount:a,longTaskCount:f},events:null!=e?e:[o],event:o,...r};t.notify(0,m),l=2},discard:()=>{p(),l=2}}}function Ks(t){const e=Js(t)?{action:{id:t.id,loading_time:Pi(y(t.duration)),frustration:{type:t.frustrationTypes},error:{count:t.counts.errorCount},long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}},_dd:{action:{target:t.target,position:t.position,name_source:t.nameSource}}}:{context:t.context},n=En({action:{id:rt(),target:{name:t.name},type:t.type},date:t.startClocks.timeStamp,type:go},e),r=Js(t)?t.duration:void 0,o=Js(t)?{events:t.events}:{handlingStack:t.handlingStack};return{rawRumEvent:n,duration:r,startTime:t.startClocks.relative,domainContext:o}}function Js(t){return t.type!==Ao}function Ys(e,n,r){const o=new X;return r.subscribe((t=>{0===t.type&&o.notify(t.error)})),function(e){const n=zr([t.error]).subscribe((t=>e.notify(t.error)))}(o),function(t,e){const n=vn(t,[gn,hn]).subscribe((t=>e.notify(t)))}(n,o),o.subscribe((t=>e.notify(14,{error:t}))),function(t){return t.subscribe(14,(({error:e})=>{t.notify(12,function(t){const e={date:t.startClocks.timeStamp,error:{id:rt(),message:t.message,source:t.source,stack:t.stack,handling_stack:t.handlingStack,component_stack:t.componentStack,type:t.type,handling:t.handling,causes:t.causes,source_type:"browser",fingerprint:t.fingerprint,csp:t.csp},type:vo,context:t.context},n={error:t.originalError,handlingStack:t.handlingStack};return{rawRumEvent:e,startTime:t.startClocks.relative,domainContext:n}}(e))})),{addError:({error:e,handlingStack:n,componentStack:r,startClocks:o,context:i})=>{const s=Qe({originalError:e,handlingStack:n,componentStack:r,startClocks:o,nonErrorPrefix:"Provided",source:cn,handling:"handled"});s.context=En(s.context,i),t.notify(14,{error:s})}}}(e)}const Zs=new WeakSet;function Xs(t){if(!performance||!("getEntriesByName"in performance))return;const e=performance.getEntriesByName(t.url,"resource");if(!e.length||!("toJSON"in e[0]))return;const n=e.filter((t=>!Zs.has(t))).filter((t=>wi(t)&&Si(t))).filter((e=>function(t,e,n){const r=1;return t.startTime>=e-r&&Qs(t)<=E(n,r)}(e,t.startClocks.relative,Qs({startTime:t.startClocks.relative,duration:t.duration}))));return 1===n.length?(Zs.add(n[0]),n[0].toJSON()):void 0}function Qs(t){return E(t.startTime,t.duration)}function ta(t){const e=function(t){const e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return ea(e&&e.content,n&&n.content)}(t)||function(t){const e=function(t){for(let e=0;e<t.childNodes.length;e+=1){const n=na(t.childNodes[e]);if(n)return n}if(t.body)for(let e=t.body.childNodes.length-1;e>=0;e-=1){const n=t.body.childNodes[e],r=na(n);if(r)return r;if(!Fi(n))break}}(t);if(!e)return;return ea(it(e,"trace-id"),it(e,"trace-time"))}(t);if(e&&!(e.traceTime<=b()-12e4))return e.traceId}function ea(t,e){const n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function na(t){if(t&&function(t){return t.nodeType===Node.COMMENT_NODE}(t)){const e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function ra(){if(Bi(zi.NAVIGATION)){const t=performance.getEntriesByType(zi.NAVIGATION)[0];if(t)return t}const t=function(){const t={},e=performance.timing;for(const n in e)if(d(e[n])){const r=n,o=e[r];t[r]=0===o?0:x(o)}return t}(),e={entryType:zi.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:t.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...e,toJSON:void 0}),...t};return e}function oa(t,e,n=ra){Er(t,"interactive",(()=>{const t=n(),r=Object.assign(t.toJSON(),{entryType:zi.RESOURCE,initiatorType:hi,duration:t.responseEnd,traceId:ta(document),toJSON:()=>({...r,toJSON:void 0})});e(r)}))}function ia(t,e,n,r=function(){const t=[];function e(e){let r;if(e.didTimeout){const t=performance.now();r=()=>30-(performance.now()-t)}else r=e.timeRemaining.bind(e);for(;r()>0&&t.length;)t.shift()();t.length&&n()}function n(){Pr(e,{timeout:1e3})}return{push(e){1===t.push(e)&&n()},stop(){t.length=0}}}(),o=oa){let i;const s=e.trackEarlyRequests;s?i=function(t){const e=new Set,n=t.subscribe(8,(t=>{e.add(t),e.size>1e3&&(rr("Too many requests"),e.delete(e.values().next().value))}));return{getMatchingRequest(t){let n,r=1/0;for(const o of e){const e=t.startTime-o.startClocks.relative;0<=e&&e<r&&o.url===t.name&&(r=Math.abs(e),n=o)}return n&&e.delete(n),n},stop(){n.unsubscribe()}}}(t):t.subscribe(8,(t=>{c((()=>function(t,e,n){const r=Xs(t);return aa(r,t,n,e)}(t,e,n)))}));const a=$i(e,{type:zi.RESOURCE,buffered:!0}).subscribe((t=>{for(const r of t)!s&&bi(r)||c((()=>sa(r,e,n,i)))}));function c(e){r.push((()=>{const n=e();n&&t.notify(12,n)}))}return o(e,(t=>{c((()=>sa(t,e,n,i)))})),{stop:()=>{r.stop(),a.unsubscribe()}}}function sa(t,e,n,r){return aa(t,bi(t)&&r?r.getMatchingRequest(t):void 0,n,e)}function aa(t,e,n,r){if(!t&&!e)return;const o=e?function(t,e){const n=t.traceSampled&&t.traceId&&t.spanId;if(!n)return;return{_dd:{span_id:t.spanId.toString(),trace_id:t.traceId.toString(),rule_psr:e.rulePsr}}}(e,r):function(t,e){const n=t.traceId;if(!n)return;return{_dd:{trace_id:t.traceId,span_id:Bo().toString(),rule_psr:e.rulePsr}}}(t,r);if(!r.trackResources&&!o)return;const i=t?h(t.startTime):e.startClocks,s=t?function(t){const{duration:e,startTime:n,responseEnd:r}=t;return 0===e&&n<r?T(n,r):e}(t):function(t,e,n){return t.wasInPageStateDuringPeriod("frozen",e.relative,n)?void 0:n}(n,i,e.duration),a=e&&function(t,e){const n=Ni(t.url,e);if(!n)return;return Ri(t,n)}(e,r),c=En({date:i.timeStamp,resource:{id:rt(),duration:y(s),type:e?e.type===mo.XHR?oo:so:vi(t),method:e?e.method:void 0,status_code:e?e.status:(u=t.responseStatus,0===u?void 0:u),url:e?Ii(e.url):t.name,protocol:t&&Ti(t),delivery_type:t&&Ei(t),graphql:a},type:_o,_dd:{discarded:!r.trackResources}},o,t&&function(t){const{renderBlockingStatus:e}=t;return{resource:{render_blocking_status:e,...xi(t),..._i(t)}}}(t));var u;return{startTime:i.relative,duration:s,rawRumEvent:c,domainContext:ca(t,e)}}function ca(t,e){if(e){const n={performanceEntry:t,isAborted:e.isAborted,handlingStack:e.handlingStack};return e.type===mo.XHR?{xhr:e.xhr,...n}:{requestInput:e.input,requestInit:e.init,response:e.response,error:e.error,...n}}return{performanceEntry:t}}function ua(t,e,n=ra){return function(t,e){let n;const{stop:r}=Er(t,"complete",(()=>{n=W((()=>e()))}));return{stop:()=>{r(),K(n)}}}(t,(()=>{const t=n();(function(t){return t.loadEventEnd<=0})(t)||e(function(t){return{domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd,firstByte:t.responseStart>=0&&t.responseStart<=w()?t.responseStart:void 0}}(t))}))}function la(t,e,n=window){if("hidden"===document.visibilityState)return{timeStamp:0,stop:nt};if(Bi(zi.VISIBILITY_STATE)){const t=performance.getEntriesByType(zi.VISIBILITY_STATE).filter((t=>"hidden"===t.name)).find((t=>t.startTime>=e.relative));if(t)return{timeStamp:t.startTime,stop:nt}}let r=1/0;const{stop:o}=mn(t,n,["pagehide","visibilitychange"],(t=>{"pagehide"!==t.type&&"hidden"!==document.visibilityState||(r=t.timeStamp,o())}),{capture:!0});return{get timeStamp(){return r},stop:o}}function da(t,e,n,r){const o={},{stop:i}=ua(t,(t=>{n(t.loadEvent),o.navigationTimings=t,r()})),s=la(t,e),{stop:a}=function(t,e,n){return{stop:$i(t,{type:zi.PAINT,buffered:!0}).subscribe((t=>{const r=t.find((t=>"first-contentful-paint"===t.name&&t.startTime<e.timeStamp&&t.startTime<6e5));r&&n(r.startTime)})).unsubscribe}}(t,s,(t=>{o.firstContentfulPaint=t,r()})),{stop:c}=function(t,e,n,r){let o=1/0;const{stop:i}=mn(t,n,["pointerdown","keydown"],(t=>{o=t.timeStamp}),{capture:!0,once:!0});let s=0;const a=$i(t,{type:zi.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe((n=>{const i=wt(n,(t=>t.entryType===zi.LARGEST_CONTENTFUL_PAINT&&t.startTime<o&&t.startTime<e.timeStamp&&t.startTime<6e5&&t.size>s));if(i){let e;i.element&&(e=rs(i.element,t.actionNameAttribute)),r({value:i.startTime,targetSelector:e,resourceUrl:(a=i,""===a.url?void 0:a.url)}),s=i.size}var a}));return{stop:()=>{i(),a.unsubscribe()}}}(t,s,window,(t=>{o.largestContentfulPaint=t,r()})),{stop:u}=function(t,e,n){const r=$i(t,{type:zi.FIRST_INPUT,buffered:!0}).subscribe((r=>{const o=r.find((t=>t.startTime<e.timeStamp));if(o){const e=T(o.startTime,o.processingStart);let r;o.target&&qi(o.target)&&(r=rs(o.target,t.actionNameAttribute)),n({delay:e>=0?e:0,time:o.startTime,targetSelector:r})}}));return{stop:()=>{r.unsubscribe()}}}(t,s,(t=>{o.firstInput=t,r()}));return{stop:function(){i(),a(),c(),u(),s.stop()},initialViewMetrics:o}}const fa=(t,e)=>t*e,pa=t=>fa(t.previousRect.width,t.previousRect.height)+fa(t.currentRect.width,t.currentRect.height)-((t,e)=>{const n=Math.max(t.left,e.left),r=Math.max(t.top,e.top),o=Math.min(t.right,e.right),i=Math.min(t.bottom,e.bottom);return n>=o||r>=i?0:fa(o-n,i-r)})(t.previousRect,t.currentRect);function ma(t,e,n){if(!Bi(zi.LAYOUT_SHIFT)||!("WeakRef"in window))return{stop:nt};let r,o=0;n({value:0});const i=function(){let t,e,n=0,r=0;return{update:o=>{let i;return void 0===t||o.startTime-e>=ya||o.startTime-t>=va?(t=e=o.startTime,r=n=o.value,i=!0):(n+=o.value,e=o.startTime,i=o.value>r,i&&(r=o.value)),{cumulatedValue:n,isMaxValue:i}}}}(),s=$i(t,{type:zi.LAYOUT_SHIFT,buffered:!0}).subscribe((s=>{var a;for(const c of s){if(c.hadRecentInput||c.startTime<e)continue;const{cumulatedValue:s,isMaxValue:u}=i.update(c);if(u){const t=ha(c.sources);r={target:(null==t?void 0:t.node)?new WeakRef(t.node):void 0,time:T(e,c.startTime),previousRect:null==t?void 0:t.previousRect,currentRect:null==t?void 0:t.currentRect,devicePixelRatio:window.devicePixelRatio}}if(s>o){o=s;const e=null===(a=null==r?void 0:r.target)||void 0===a?void 0:a.deref();n({value:l(o,4),targetSelector:e&&rs(e,t.actionNameAttribute),time:null==r?void 0:r.time,previousRect:(null==r?void 0:r.previousRect)?ga(r.previousRect):void 0,currentRect:(null==r?void 0:r.currentRect)?ga(r.currentRect):void 0,devicePixelRatio:null==r?void 0:r.devicePixelRatio})}}}));return{stop:()=>{s.unsubscribe()}}}function ha(t){let e;for(const n of t)if(n.node&&qi(n.node)){const t=pa(n);(!e||pa(e)<t)&&(e=n)}return e}function ga({x:t,y:e,width:n,height:r}){return{x:t,y:e,width:n,height:r}}const va=5e3,ya=f;let ba,_a=0,wa=1/0,Sa=0;const ka=()=>ba?_a:window.performance.interactionCount||0;function Ta(t,e,n){if(!(Bi(zi.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return{getInteractionToNextPaint:()=>{},setViewEnd:nt,stop:nt};const{getViewInteractionCount:r,stopViewInteractionCount:o}=function(t){"interactionCount"in performance||ba||(ba=new window.PerformanceObserver(q((t=>{t.getEntries().forEach((t=>{const e=t;e.interactionId&&(wa=Math.min(wa,e.interactionId),Sa=Math.max(Sa,e.interactionId),_a=(Sa-wa)/7+1)}))}))),ba.observe({type:"event",buffered:!0,durationThreshold:0}));const e=t===To?0:ka();let n={stopped:!1};function r(){return ka()-e}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}(n);let i=1/0;const s=function(t){const e=[];function n(){e.sort(((t,e)=>e.duration-t.duration)).splice(10)}return{process(t){const r=e.findIndex((e=>t.interactionId===e.interactionId)),o=e[e.length-1];-1!==r?t.duration>e[r].duration&&(e[r]=t,n()):(e.length<10||t.duration>o.duration)&&(e.push(t),n())},estimateP98Interaction(){const n=Math.min(e.length-1,Math.floor(t()/50));return e[n]}}}(r);let a,c,u=-1;function l(n){for(const t of n)t.interactionId&&t.startTime>=e&&t.startTime<=i&&s.process(t);const r=s.estimateP98Interaction();r&&r.duration!==u&&(u=r.duration,c=T(e,r.startTime),a=function(t){const e=js.get(t);return js.delete(t),e}(r.startTime),!a&&r.target&&qi(r.target)&&(a=rs(r.target,t.actionNameAttribute)))}const d=$i(t,{type:zi.FIRST_INPUT,buffered:!0}).subscribe(l),f=$i(t,{type:zi.EVENT,durationThreshold:40,buffered:!0}).subscribe(l);return{getInteractionToNextPaint:()=>u>=0?{value:Math.min(u,6e4),targetSelector:a,time:c}:r()?{value:0}:void 0,setViewEnd:t=>{i=t,o()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function Ea(){let t;const e=window.visualViewport;return t=e?e.pageLeft-e.offsetLeft:void 0!==window.scrollX?window.scrollX:window.pageXOffset||0,Math.round(t)}function xa(){let t;const e=window.visualViewport;return t=e?e.pageTop-e.offsetTop:void 0!==window.scrollY?window.scrollY:window.pageYOffset||0,Math.round(t)}let Ca;function Aa(t){return Ca||(Ca=function(t){return new X((e=>{const{throttled:n}=et((()=>{e.notify(Ia())}),200);return pn(t,window,"resize",n,{capture:!0,passive:!0}).stop}))}(t)),Ca}function Ia(){const t=window.visualViewport;return t?{width:Number(t.width*t.scale),height:Number(t.height*t.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}function Ra(t,e,n,r=function(t,e=1e3){return new X((n=>{function r(){n.notify(function(){const t=xa(),{height:e}=Ia(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(e+t);return{scrollHeight:n,scrollDepth:r,scrollTop:t}}())}if(window.ResizeObserver){const n=et(r,e,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,i=new ResizeObserver(q(n.throttled));o&&i.observe(o);const s=pn(t,window,"scroll",n.throttled,{passive:!0});return()=>{n.cancel(),i.disconnect(),s.stop()}}}))}(t)){let o=0,i=0,s=0;const a=r.subscribe((({scrollDepth:t,scrollTop:r,scrollHeight:a})=>{let c=!1;if(t>o&&(o=t,c=!0),a>i){i=a;const t=w();s=T(e.relative,t),c=!0}c&&n({maxDepth:Math.min(o,i),maxDepthScrollTop:r,maxScrollHeight:i,maxScrollHeightTime:s})}));return{stop:()=>a.unsubscribe()}}function Na(t,e,n,r,o,i,s){const a={},{stop:c,setLoadEvent:u}=function(t,e,n,r,o,i,s){let a=o===To,c=!0;const u=[],l=la(r,i);function d(){if(!c&&!a&&u.length>0){const t=Math.max(...u);t<l.timeStamp-i.relative&&s(t)}}const{stop:f}=Yi(t,e,n,r,(t=>{c&&(c=!1,t.hadActivity&&u.push(T(i.timeStamp,t.end)),d())}));return{stop:()=>{f(),l.stop()},setLoadEvent:t=>{a&&(a=!1,u.push(t),d())}}}(t,e,n,r,i,s,(t=>{a.loadingTime=t,o()})),{stop:l}=Ra(r,s,(t=>{a.scroll=t})),{stop:d}=ma(r,s.relative,(t=>{a.cumulativeLayoutShift=t,o()})),{stop:f,getInteractionToNextPaint:p,setViewEnd:m}=Ta(r,s.relative,i);return{stop:()=>{c(),d(),l()},stopINPTracking:f,setLoadEvent:u,setViewEnd:m,getCommonViewMetrics:()=>(a.interactionToNextPaint=p(),a)}}function Oa(t,e,n){var r,o;r=t.relative,o=t=>{e.firstContentfulPaint=t,e.largestContentfulPaint={value:t},n()},requestAnimationFrame((()=>{requestAnimationFrame((()=>{o(T(r,w()))}))}))}const La=3e5,Ma=3e5;function Pa(t,e,n,r,i,s,a,c){const u=new Set;let l,d,f=p(To,k(),c);function p(s,a,c){const l=function(t,e,n,r,i,s,a=S(),c){const u=rt(),l=new X,d={};let f,p=0;const h=O(i),g=Br();let v=!0,y=null==c?void 0:c.name;const b=(null==c?void 0:c.service)||r.service,w=(null==c?void 0:c.version)||r.version,k=null==c?void 0:c.context;k&&g.setContext(k);const E={id:u,name:y,startClocks:a,service:b,version:w,context:k};t.notify(1,E),t.notify(2,E);const{throttled:x,cancel:C}=et(F,3e3,{leading:!1}),{setLoadEvent:A,setViewEnd:I,stop:R,stopINPTracking:N,getCommonViewMetrics:L}=Na(t,e,n,r,B,s,a),{stop:M,initialViewMetrics:P}=s===To?da(r,a,A,B):{stop:nt,initialViewMetrics:{}};s===xo&&Oa(a,P,B);const{stop:D,eventCounts:U}=function(t,e,n){const{stop:r,eventCounts:o}=Di({lifeCycle:t,isChildEvent:t=>t.view.id===e,onChange:n});return{stop:r,eventCounts:o}}(t,u,B),z=J(F,La),$=t.subscribe(11,(t=>{t.reason===Fn.UNLOADING&&F()}));function V(){t.notify(3,{id:u,name:y,context:g.getContext(),startClocks:a,sessionIsActive:v})}function B(){V(),x()}function F(){C(),V(),p+=1;const e=void 0===f?_():f.timeStamp;t.notify(4,{customTimings:d,documentVersion:p,id:u,name:y,service:b,version:w,context:g.getContext(),loadingType:s,location:h,startClocks:a,commonViewMetrics:L(),initialViewMetrics:P,duration:T(a.timeStamp,e),isActive:void 0===f,sessionIsActive:v,eventCounts:U})}return F(),g.changeObservable.subscribe(B),{get name(){return y},service:b,version:w,contextManager:g,stopObservable:l,end(e={}){var n,r;f||(f=null!==(n=e.endClocks)&&void 0!==n?n:S(),v=null===(r=e.sessionIsActive)||void 0===r||r,t.notify(5,{endClocks:f}),t.notify(6,{endClocks:f}),Y(z),I(f.relative),R(),$.unsubscribe(),F(),W((()=>{this.stop()}),Ma))},stop(){M(),D(),N(),l.notify()},addTiming(t,e){if(f)return;const n=function(t){return t<m}(e)?e:T(a.timeStamp,e);d[function(t){const e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&o.warn(`Invalid timing name: ${t}, sanitized to: ${e}`);return e}(t)]=n,B()},setViewName(t){y=t,F()}}}(e,n,r,i,t,s,a,c);return u.add(l),l.stopObservable.subscribe((()=>{u.delete(l)})),l}return e.subscribe(10,(()=>{f=p(Eo,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})})),e.subscribe(9,(()=>{f.end({sessionIsActive:!1})})),a&&(d=function(t){return t.subscribe((({oldLocation:t,newLocation:e})=>{var n,r;r=e,((n=t).pathname!==r.pathname||!function(t){const e=t.substring(1);return""!==e&&!!document.getElementById(e)}(r.hash)&&Da(r.hash)!==Da(n.hash))&&(f.end(),f=p(Eo))}))}(s),i.trackBfcacheViews&&(l=function(t,e){const{stop:n}=pn(t,window,"pageshow",(t=>{t.persisted&&e(t)}),{capture:!0});return n}(i,(t=>{f.end();const e=h(t.timeStamp);f=p(xo,e,void 0)})))),{addTiming:(t,e=_())=>{f.addTiming(t,e)},startView:(t,e)=>{f.end({endClocks:e}),f=p(Eo,e,t)},setViewContext:t=>{f.contextManager.setContext(t)},setViewContextProperty:(t,e)=>{f.contextManager.setContextProperty(t,e)},setViewName:t=>{f.setViewName(t)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{d&&d.unsubscribe(),l&&l(),f.end(),u.forEach((t=>t.stop()))}}}function Da(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}function Ua(t,e,n,r,o,i,s,a,c,u){return t.subscribe(4,(e=>t.notify(12,function(t,e,n){var r,o,i,s,a,c,u,l,d,f,p,m,h,g,v,b,_,w;const S=n.getReplayStats(t.id),k=null===(o=null===(r=t.commonViewMetrics)||void 0===r?void 0:r.cumulativeLayoutShift)||void 0===o?void 0:o.devicePixelRatio,T={_dd:{document_version:t.documentVersion,replay_stats:S,cls:k?{device_pixel_ratio:k}:void 0,configuration:{start_session_replay_recording_manually:e.startSessionReplayRecordingManually}},date:t.startClocks.timeStamp,type:bo,view:{action:{count:t.eventCounts.actionCount},frustration:{count:t.eventCounts.frustrationCount},cumulative_layout_shift:null===(i=t.commonViewMetrics.cumulativeLayoutShift)||void 0===i?void 0:i.value,cumulative_layout_shift_time:y(null===(s=t.commonViewMetrics.cumulativeLayoutShift)||void 0===s?void 0:s.time),cumulative_layout_shift_target_selector:null===(a=t.commonViewMetrics.cumulativeLayoutShift)||void 0===a?void 0:a.targetSelector,first_byte:y(null===(c=t.initialViewMetrics.navigationTimings)||void 0===c?void 0:c.firstByte),dom_complete:y(null===(u=t.initialViewMetrics.navigationTimings)||void 0===u?void 0:u.domComplete),dom_content_loaded:y(null===(l=t.initialViewMetrics.navigationTimings)||void 0===l?void 0:l.domContentLoaded),dom_interactive:y(null===(d=t.initialViewMetrics.navigationTimings)||void 0===d?void 0:d.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:y(t.initialViewMetrics.firstContentfulPaint),first_input_delay:y(null===(f=t.initialViewMetrics.firstInput)||void 0===f?void 0:f.delay),first_input_time:y(null===(p=t.initialViewMetrics.firstInput)||void 0===p?void 0:p.time),first_input_target_selector:null===(m=t.initialViewMetrics.firstInput)||void 0===m?void 0:m.targetSelector,interaction_to_next_paint:y(null===(h=t.commonViewMetrics.interactionToNextPaint)||void 0===h?void 0:h.value),interaction_to_next_paint_time:y(null===(g=t.commonViewMetrics.interactionToNextPaint)||void 0===g?void 0:g.time),interaction_to_next_paint_target_selector:null===(v=t.commonViewMetrics.interactionToNextPaint)||void 0===v?void 0:v.targetSelector,is_active:t.isActive,name:t.name,largest_contentful_paint:y(null===(b=t.initialViewMetrics.largestContentfulPaint)||void 0===b?void 0:b.value),largest_contentful_paint_target_selector:null===(_=t.initialViewMetrics.largestContentfulPaint)||void 0===_?void 0:_.targetSelector,load_event:y(null===(w=t.initialViewMetrics.navigationTimings)||void 0===w?void 0:w.loadEvent),loading_time:Pi(y(t.commonViewMetrics.loadingTime)),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},performance:za(t.commonViewMetrics,t.initialViewMetrics),resource:{count:t.eventCounts.resourceCount},time_spent:y(t.duration)},display:t.commonViewMetrics.scroll?{scroll:{max_depth:t.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:t.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:t.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:y(t.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:e.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:ho()}};M(t.customTimings)||(T.view.custom_timings=P(t.customTimings,y));return{rawRumEvent:T,startTime:t.startClocks.relative,duration:t.duration,domainContext:{location:t.location}}}(e,n,a)))),e.register(0,(({startTime:t,eventType:e})=>{const n=c.findView(t);return n?{type:e,service:n.service,version:n.version,context:n.context,view:{id:n.id,name:n.name}}:Wn})),e.register(1,(({startTime:t})=>{var e;return{view:{id:null===(e=c.findView(t))||void 0===e?void 0:e.id}}})),Pa(r,t,o,i,n,s,!n.trackViewsManually,u)}function za({cumulativeLayoutShift:t,interactionToNextPaint:e},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:o}){return{cls:t&&{score:t.value,timestamp:y(t.time),target_selector:t.targetSelector,previous_rect:t.previousRect,current_rect:t.currentRect},fcp:n&&{timestamp:y(n)},fid:r&&{duration:y(r.delay),timestamp:y(r.time),target_selector:r.targetSelector},inp:e&&{duration:y(e.value),timestamp:y(e.time),target_selector:e.targetSelector},lcp:o&&{timestamp:y(o.value),target_selector:o.targetSelector,resource_url:o.resourceUrl}}}function $a(t,e,n){const r=wr(t,"rum",(e=>function(t,e){if(n=e,"0"===n||"1"===n||"2"===n)return e;var n;if(!u(t.sessionSampleRate))return"0";if(!u(t.sessionReplaySampleRate))return"2";return"1"}(t,e)),n);return r.expireObservable.subscribe((()=>{e.notify(9)})),r.renewObservable.subscribe((()=>{e.notify(10)})),r.sessionStateUpdateObservable.subscribe((({previousState:t,newState:e})=>{if(!t.forcedReplay&&e.forcedReplay){const t=r.findSession();t&&(t.isReplayForced=!0)}})),{findTrackedSession:t=>{const e=r.findSession(t);if(e&&"0"!==e.trackingType)return{id:e.id,sessionReplay:"1"===e.trackingType?1:e.isReplayForced?2:0,anonymousId:e.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}const Va=Tt;function Ba(t,e){let n=O(e);return new X((r=>{const{stop:o}=function(t,e){const{stop:n}=je(Fa("pushState"),"pushState",(({onPostCall:t})=>{t(e)})),{stop:r}=je(Fa("replaceState"),"replaceState",(({onPostCall:t})=>{t(e)})),{stop:o}=pn(t,window,"popstate",e);return{stop:()=>{n(),r(),o()}}}(t,s),{stop:i}=function(t,e){return pn(t,window,"hashchange",e)}(t,s);function s(){if(n.href===e.href)return;const t=O(e);r.notify({newLocation:t,oldLocation:n}),n=t}return()=>{o(),i()}}))}function Fa(t){return Object.prototype.hasOwnProperty.call(history,t)?history:History.prototype}const qa=Tt;let ja,Ha;function Ga(){0!==ja.batchCount&&(ir("Customer data measures",ja),Ka())}function Wa(t,e){t.sum+=e,t.min=Math.min(t.min,e),t.max=Math.max(t.max,e)}function Ka(){ja={batchCount:0,batchBytesCount:{min:1/0,max:0,sum:0},batchMessagesCount:{min:1/0,max:0,sum:0}}}const Ja=Tt;function Ya(t,e,n=500){const r=mr({expireDelay:Ja,maxEntries:4e3});let o;if(Bi(zi.VISIBILITY_STATE)){performance.getEntriesByType(zi.VISIBILITY_STATE).forEach((t=>{s("hidden"===t.name?"hidden":"active",t.startTime)}))}s(Xa(),w());const{stop:i}=mn(e,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],(t=>{s(function(t){if("freeze"===t.type)return"frozen";if("pagehide"===t.type)return t.persisted?"frozen":"terminated";return Xa()}(t),t.timeStamp)}),{capture:!0});function s(t,e=w()){t!==o&&(o=t,r.closeActive(e),r.add({state:o,startTime:e},e))}function a(t,e,n){return r.findAll(e,n).some((e=>e.state===t))}return t.register(0,(({startTime:t,duration:e=0,eventType:o})=>{if(o===bo){return{type:o,_dd:{page_states:Za(r.findAll(t,e),t,n)}}}return o===go||o===vo?{type:o,view:{in_foreground:a("active",t,0)}}:Kn})),{wasInPageStateDuringPeriod:a,addPageState:s,stop:()=>{i(),r.stop()}}}function Za(t,e,n){if(0!==t.length)return t.slice(-n).reverse().map((({state:t,startTime:n})=>({state:t,start:y(T(e,n))})))}function Xa(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}function Qa(t,e){const n=window.cookieStore?function(t){return(e,n)=>pn(t,window.cookieStore,"change",(t=>{const r=t.changed.find((t=>t.name===e))||t.deleted.find((t=>t.name===e));r&&n(r.value)})).stop}(t):ec;return new X((t=>n(e,(e=>t.notify(e)))))}const tc=f;function ec(t,e){const n=it(document.cookie,t),r=J((()=>{const r=it(document.cookie,t);r!==n&&e(r)}),tc);return()=>{Y(r)}}const nc="datadog-ci-visibility-test-execution-id";function rc(t,e,n){const r=Tn(t),o=n(r);return kt(e).forEach((([e,n])=>oc(t,r,e.split(/\.|(?=\[\])/),n))),o}function oc(t,e,n,r){const[o,...i]=n;if("[]"!==o){if(ic(t)&&ic(e))return i.length>0?oc(t[o],e[o],i,r):void function(t,e,n,r){const o=re(n);o===r?t[e]=Ke(n):"object"!==r||"undefined"!==o&&"null"!==o||(t[e]={})}(t,o,e[o],r)}else Array.isArray(t)&&Array.isArray(e)&&t.forEach(((t,n)=>oc(t,e[n],i,r)))}function ic(t){return"object"===re(t)}const sc={"view.name":"string","view.url":"string","view.referrer":"string"},ac={context:"object"},cc={service:"string",version:"string"};let uc;function lc(t,e,n,r){uc={[bo]:{"view.performance.lcp.resource_url":"string",...ac,...sc,...cc},[vo]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...ac,...sc,...cc},[_o]:{"resource.url":"string","resource.graphql.variables":"string",...ac,...sc,...cc},[go]:{"action.target.name":"string",...ac,...sc,...cc},[yo]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...ac,...sc,...cc},[wo]:{...ac,...sc,...cc}};const i={[vo]:Tr(vo,t.eventRateLimiterThreshold,r),[go]:Tr(go,t.eventRateLimiterThreshold,r),[wo]:Tr(wo,t.eventRateLimiterThreshold,r)};e.subscribe(12,(({startTime:r,duration:s,rawRumEvent:a,domainContext:c})=>{const u=n.triggerHook(0,{eventType:a.type,startTime:r,duration:s});if(u===Wn)return;const l=En(u,a,{ddtags:_n(t).join(",")});(function(t,e,n,r){var i;if(e){const r=rc(t,uc[t.type],(t=>e(t,n)));if(!1===r&&t.type!==bo)return!1;!1===r&&o.warn("Can't dismiss view events using beforeSend!")}const s=null===(i=r[t.type])||void 0===i?void 0:i.isLimitReached();return!s})(l,t.beforeSend,c,i)&&(M(l.context)&&delete l.context,e.notify(13,l))}))}const dc=function(){const t={};return{register:(e,n)=>(t[e]||(t[e]=[]),t[e].push(n),{unregister:()=>{t[e]=t[e].filter((t=>t!==n))}}),triggerHook(e,n){const r=t[e]||[],o=[];for(const t of r){const e=t(n);if(e===Wn)return Wn;e!==Kn&&o.push(e)}return En(...o)}}},fc=[go,vo,yo,_o,wo];function pc(t,{session:e,viewContext:n,errorType:r}){const o=e?e.id:"no-session-id",i=[];void 0!==r&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const s=function(t){const e=t.site,n=t.subdomain||function(t){switch(t.site){case le:case de:return"app";case ue:return"dd";default:return}}(t);return`https://${n?`${n}.`:""}${e}`}(t);return`${s}${`/rum/replay/sessions/${o}`}?${i.join("&")}`}function mc(t,e){return new Promise((n=>{t.write(e),t.finish((t=>{n(t)}))}))}let hc;function gc(t){let e;return hc||(hc=new Map),hc.has(t)?e=hc.get(t):(e={records_count:0,segments_count:0,segments_total_raw_size:0},hc.set(t,e),hc.size>1e3&&function(){if(!hc)return;const t=hc.keys().next().value;t&&hc.delete(t)}()),e}function vc(t,e,n){let r,o=0,i=[],s=!0,a=0;const c=[],{stop:u}=pn(t,e,"message",(({data:t})=>{if("wrote"!==t.type||t.streamId!==n)return;const e=c[0];e&&(e.id===t.id?(c.shift(),o+=t.additionalBytesCount,i.push(t.result),r=t.trailer,e.writeCallback?e.writeCallback(t.result.byteLength):e.finishCallback&&e.finishCallback()):e.id<t.id&&u())}));function l(){const t=0===i.length?new Uint8Array(0):N(i.concat(r)),e={rawBytesCount:o,output:t,outputBytesCount:t.byteLength,encoding:"deflate"};return o=0,i=[],e}function d(){s||(e.postMessage({action:"reset",streamId:n}),s=!0)}return{isAsync:!0,get isEmpty(){return s},write(t,r){e.postMessage({action:"write",id:a,data:t,streamId:n}),c.push({id:a,writeCallback:r,data:t}),s=!1,a+=1},finish(t){d(),c.length?(c.forEach((t=>{delete t.writeCallback})),c[c.length-1].finishCallback=()=>t(l())):t(l())},finishSync(){d();const t=c.map((t=>t.data)).join("");return c.length=0,{...l(),pendingData:t}},estimateEncodedBytesCount:t=>t.length/8,stop(){u()}}}function yc({configuredUrl:t,error:e,source:n,scriptType:r}){if(o.error(`${n} failed to start: an error occurred while initializing the ${r}:`,e),e instanceof Event||e instanceof Error&&((s=e.message).includes("Content Security Policy")||s.includes("requires 'TrustedScriptURL'"))){let e;e=t?`Please make sure the ${r} URL ${t} is correct and CSP is correctly configured.`:"Please make sure CSP is correctly configured.",o.error(`${e} See documentation at ${i}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else"worker"===r&&or(e);var s}function bc(t){return new Worker(t.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let _c={status:0};function wc(t,e,n,r=bc){switch(0===_c.status&&function(t,e,n=bc){try{const r=n(t),{stop:i}=pn(t,r,"error",(n=>{kc(t,e,n)})),{stop:s}=pn(t,r,"message",(({data:n})=>{var r;"errored"===n.type?kc(t,e,n.error,n.streamId):"initialized"===n.type&&(r=n.version,1===_c.status&&(_c={status:3,worker:_c.worker,stop:_c.stop,version:r}))}));r.postMessage({action:"init"}),W((()=>function(t){1===_c.status&&(o.error(`${t} failed to start: a timeout occurred while initializing the Worker`),_c.initializationFailureCallbacks.forEach((t=>t())),_c={status:2})}(e)),3e4);_c={status:1,worker:r,stop:()=>{i(),s()},initializationFailureCallbacks:[]}}catch(n){kc(t,e,n)}}(t,e,r),_c.status){case 1:return _c.initializationFailureCallbacks.push(n),_c.worker;case 3:return _c.worker}}function Sc(){return _c.status}function kc(t,e,n,r){1===_c.status||0===_c.status?(yc({configuredUrl:t.workerUrl,error:n,source:e,scriptType:"worker"}),1===_c.status&&_c.initializationFailureCallbacks.forEach((t=>t())),_c={status:2}):or(n,{worker_version:3===_c.status&&_c.version,stream_id:r})}function Tc(){return"function"==typeof Array.from&&"function"==typeof CSSSupportsRule&&"function"==typeof URL.createObjectURL&&"forEach"in NodeList.prototype}function Ec(t,e,n,r){const o=e.findTrackedSession(),i=function(t,e){if(!Tc())return"browser-not-supported";if(!t)return"rum-not-tracked";if(0===t.sessionReplay)return"incorrect-session-plan";if(!e)return"replay-not-started"}(o,r);return pc(t,{viewContext:n.findView(),errorType:i,session:o})}function xc(t,e,n,r,o,i,s){let a,c=0;e.subscribe(9,(()=>{2!==c&&3!==c||(f(),c=1)})),e.subscribe(10,(()=>{1===c&&d()}));const u=new X;!function(t,e){if(!t.metricsEnabled)return{stop:nt};let n,r,o;const{unsubscribe:i}=e.subscribe((t=>{switch(t.type){case"start":n={forced:t.forced,timestamp:_()},r=void 0,o=void 0;break;case"document-ready":n&&(r=T(n.timestamp,_()));break;case"recorder-settled":n&&(o=T(n.timestamp,_()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":i(),n&&ir("Recorder init metrics",{metrics:(e=n.forced,s=o,a=T(n.timestamp,_()),c=t.type,u=r,{forced:e,loadRecorderModuleDuration:s,recorderInitDuration:a,result:c,waitForDocReadyDuration:u})})}var e,s,a,c,u}))}(s,u);const l=async l=>{u.notify({type:"start",forced:l});const[d]=await Promise.all([Cc(u,{type:"recorder-settled"},o()),Cc(u,{type:"document-ready"},xr(t,"interactive"))]);if(2!==c)return void u.notify({type:"aborted"});if(!d)return c=0,void u.notify({type:"recorder-load-failed"});const f=i();if(!f)return c=0,void u.notify({type:"deflate-encoder-load-failed"});({stop:a}=d(e,t,n,r,f,s)),c=3,u.notify({type:"succeeded"})};function d(t){const e=n.findTrackedSession();if(function(t,e){return!t||0===t.sessionReplay&&(!e||!e.force)}(e,t))return void(c=1);if(function(t){return 2===t||3===t}(c))return;c=2;const r=function(t,e){return e&&e.force&&0===t.sessionReplay}(e,t)||!1;l(r).catch(H),r&&n.setForcedReplay()}function f(){3===c&&(null==a||a()),c=0}return{start:d,stop:f,getSessionReplayLink:()=>Ec(t,n,r,0!==c),isRecording:()=>3===c}}async function Cc(t,e,n){try{return await n}finally{t.notify(e)}}async function Ac(){return(await Promise.resolve().then((function(){return Ku}))).startRecording}async function Ic(t=Rc){try{return await t()}catch(t){yc({error:t,source:"Profiler",scriptType:"module"})}}async function Rc(){return(await Promise.resolve().then((function(){return rl}))).createRumProfiler}const Nc=function(t,e){if(Bn()&&!Vn("records")||!Tc())return{start:nt,stop:nt,getReplayStats:()=>{},onRumStart:nt,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=function(){let t=0;return{strategy:{start(){t=1},stop(){t=2},isRecording:()=>!1,getSessionReplayLink:nt},shouldStartImmediately:e=>1===t||0===t&&!e.startSessionReplayRecordingManually}}();return{start:t=>n.start(t),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:function(o,i,s,a,c,u){let l;n=xc(i,o,s,a,t,(function(){l||(null!=c||(c=wc(i,"Datadog Session Replay",(()=>{n.stop()}),e)),c&&(l=vc(i,c,1)));return l}),u),r(i)&&n.start()},isRecording:()=>3===Sc()&&n.isRecording(),getReplayStats:t=>3===Sc()?function(t){return null==hc?void 0:hc.get(t)}(t):void 0}}((async function(t=Ac){try{return await t()}catch(t){yc({error:t,source:"Recorder",scriptType:"module"})}})),Oc=function(){let t;return{onRumStart:function(e,n,r,o,i,s){const a=o.findTrackedSession();if(!a)return;if(!Vo(a.id,r.profilingSampleRate))return;const c=(t=>{let e={status:"starting"};return t.register(0,(({eventType:t})=>t!==bo&&t!==yo?Kn:{type:t,_dd:{profiling:e}})),{get:()=>e,set:t=>{e=t}}})(n);void 0!==D().Profiler?Ic().then((n=>{if(!n)return rr("[DD_RUM] Failed to lazy load the RUM Profiler"),void c.set({status:"error",error_reason:"failed-to-lazy-load"});t=n(r,e,o,c,s),t.start(i.findView())})).catch(H):c.set({status:"error",error_reason:"not-supported-by-browser"})},stop:()=>{null==t||t.stop().catch(H)}}}(),Lc=function(t,e,n,r={}){const o=function(t){const e=new X;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===ne.GRANTED,observable:e}}(),i={vitalsByName:new Map,vitalsByReference:new WeakMap},s=function(t=dn){const e=new tt(500),n=t().subscribe((t=>{e.notify({type:0,error:t})}));return{observable:e,stop:()=>{n.unsubscribe()}}}().observable;let a=li(r,o,i,((c,u,l)=>{const d=u&&r.createDeflateEncoder?t=>r.createDeflateEncoder(c,u,t):kr,f=t(c,e,n,l,d,o,i,s,r.sdkName);return e.onRumStart(f.lifeCycle,c,f.session,f.viewHistory,u,f.telemetry),n.onRumStart(f.lifeCycle,f.hooks,c,f.session,f.viewHistory,d),a=function(t,e){return{init:t=>{fn("DD_RUM",t)},initConfiguration:t.initConfiguration,...e}}(a,f),zo(c.plugins,"onRumStart",{strategy:a,addEvent:f.addEvent}),f}));const c=()=>a,u=q((t=>{const e="object"==typeof t?t:{name:t};a.startView(e),sr({feature:"start-view"})})),l=function(t){const e={version:"6.24.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>F,enumerable:!1}),e}({init:t=>{const e=(new Error).stack;j((()=>a.init(t,l,e)))},setTrackingConsent:q((t=>{o.update(t),sr({feature:"set-tracking-consent",tracking_consent:t})})),setViewName:q((t=>{a.setViewName(t),sr({feature:"set-view-name"})})),setViewContext:q((t=>{a.setViewContext(t),sr({feature:"set-view-context"})})),setViewContextProperty:q(((t,e)=>{a.setViewContextProperty(t,e),sr({feature:"set-view-context-property"})})),getViewContext:q((()=>(sr({feature:"set-view-context-property"}),a.getViewContext()))),getInternalContext:q((t=>a.getInternalContext(t))),getInitConfiguration:q((()=>Tn(a.initConfiguration))),addAction:(t,e)=>{const n=Be("action");j((()=>{a.addAction({name:Ke(t),context:Ke(e),startClocks:S(),type:Ao,handlingStack:n}),sr({feature:"add-action"})}))},addError:(t,e)=>{const n=Be("error");j((()=>{a.addError({error:t,handlingStack:n,context:Ke(e),startClocks:S()}),sr({feature:"add-error"})}))},addTiming:q(((t,e)=>{a.addTiming(Ke(t),e)})),setGlobalContext:Fr(c,Yr,Qr,"set-global-context"),getGlobalContext:Fr(c,Yr,Xr,"get-global-context"),setGlobalContextProperty:Fr(c,Yr,to,"set-global-context-property"),removeGlobalContextProperty:Fr(c,Yr,eo,"remove-global-context-property"),clearGlobalContext:Fr(c,Yr,no,"clear-global-context"),setUser:Fr(c,Jr,Qr,"set-user"),getUser:Fr(c,Jr,Xr,"get-user"),setUserProperty:Fr(c,Jr,to,"set-user-property"),removeUserProperty:Fr(c,Jr,eo,"remove-user-property"),clearUser:Fr(c,Jr,no,"clear-user"),setAccount:Fr(c,Zr,Qr,"set-account"),getAccount:Fr(c,Zr,Xr,"get-account"),setAccountProperty:Fr(c,Zr,to,"set-account-property"),removeAccountProperty:Fr(c,Zr,eo,"remove-account-property"),clearAccount:Fr(c,Zr,no,"clear-account"),startView:u,stopSession:q((()=>{a.stopSession(),sr({feature:"stop-session"})})),addFeatureFlagEvaluation:q(((t,e)=>{a.addFeatureFlagEvaluation(Ke(t),Ke(e)),sr({feature:"add-feature-flag-evaluation"})})),getSessionReplayLink:q((()=>e.getSessionReplayLink())),startSessionReplayRecording:q((t=>{e.start(t),sr({feature:"start-session-replay-recording",force:t&&t.force})})),stopSessionReplayRecording:q((()=>e.stop())),addDurationVital:q(((t,e)=>{var n;sr({feature:"add-duration-vital"}),a.addDurationVital({name:Ke(t),type:Oo,startClocks:(n=e.startTime,{relative:x(n),timeStamp:n}),duration:e.duration,context:Ke(e&&e.context),description:Ke(e&&e.description)})})),startDurationVital:q(((t,e)=>(sr({feature:"start-duration-vital"}),a.startDurationVital(Ke(t),{context:Ke(e&&e.context),description:Ke(e&&e.description)})))),stopDurationVital:q(((t,e)=>{sr({feature:"stop-duration-vital"}),a.stopDurationVital("string"==typeof t?Ke(t):t,{context:Ke(e&&e.context),description:Ke(e&&e.description)})})),startFeatureOperation:q(((t,e)=>{sr({feature:"add-operation-step-vital",action_type:"start"}),a.addOperationStepVital(t,"start",e)})),succeedFeatureOperation:q(((t,e)=>{sr({feature:"add-operation-step-vital",action_type:"succeed"}),a.addOperationStepVital(t,"end",e)})),failFeatureOperation:q(((t,e,n)=>{sr({feature:"add-operation-step-vital",action_type:"fail"}),a.addOperationStepVital(t,"end",n,e)}))});return l}((function(t,e,n,r,o,i,s,a,c){const u=[],d=new pi,f=dc();d.subscribe(13,(t=>Sn("rum",t)));const p=t=>{d.notify(14,{error:t}),rr("Error reported to customer",{"error.message":t.message})},m=function(t){return new X((e=>{const{stop:n}=mn(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Fn.HIDDEN}):"freeze"===t.type&&e.notify({reason:Fn.FROZEN})}),{capture:!0}),r=pn(t,window,"beforeunload",(()=>{e.notify({reason:Fn.UNLOADING})})).stop;return()=>{n(),r()}}))}(t),g=m.subscribe((t=>{d.notify(11,t)}));u.push((()=>g.unsubscribe()));const b=nr("browser-rum-sdk",t,f,p,m,o);u.push(b.stop);const S=Bn()?function(){const t={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:Vn("records")?1:0};return{findTrackedSession:()=>t,expire:nt,expireObservable:new X,setForcedReplay:nt}}():$a(t,d,i);if(Bn())!function(t){const e=$n();t.subscribe(13,(t=>{e.send("rum",t)}))}(d);else{const e=function(t,e,n,r,o,i){const s=[t.rumEndpointBuilder];t.replica&&s.push(t.replica.rumEndpointBuilder);const a=jn({encoder:i(2),request:Mn(s,t.batchBytesLimit,n),flushController:Gn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:o}),messageBytesLimit:t.messageBytesLimit});return e.subscribe(13,(t=>{t.type===bo?a.upsert(t,t.view.id):a.add(t)})),a}(t,d,p,m,S.expireObservable,o);u.push((()=>e.stop())),function(t,e,n){t.metricsEnabled&&(Ka(),Ha=!1,e.subscribe(13,(()=>{Ha=!0})),n.subscribe((({bytesCount:t,messagesCount:e})=>{Ha&&(Ha=!1,ja.batchCount+=1,Wa(ja.batchBytesCount,t),Wa(ja.batchMessagesCount,e))})),J(Ga,1e4))}(b,d,e.flushController.flushObservable)}const k=function(){const t=fi();return new X((e=>{if(!t)return;const n=new t(q((t=>e.notify(t))));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()}))}(),T=Ba(t,location),{observable:E,stop:x}=function(){const t=new X,{stop:e}=je(window,"open",(()=>t.notify()));return{observable:t,stop:e}}();u.push(x),function(t,e,n){t.register(0,(({eventType:t})=>{const r=e.source;return{type:t,_dd:{format_version:2,drift:v(),configuration:{session_sample_rate:l(e.sessionSampleRate,3),session_replay_sample_rate:l(e.sessionReplaySampleRate,3),profiling_sample_rate:l(e.profilingSampleRate,3),beta_encode_cookie_options:e.betaEncodeCookieOptions},browser_sdk_version:Bn()?"6.24.0":void 0,sdk_name:n},application:{id:e.applicationId},date:_(),source:r}})),t.register(1,(()=>({application:{id:e.applicationId}})))}(f,t,c);const C=Ya(f,t),A=function(t){const e=mr({expireDelay:mi});return t.subscribe(1,(t=>{e.add(function(t){return{service:t.service,version:t.version,context:t.context,id:t.id,name:t.name,startClocks:t.startClocks}}(t),t.startClocks.relative)})),t.subscribe(6,(({endClocks:t})=>{e.closeActive(t.relative)})),t.subscribe(3,(t=>{const n=e.find(t.startClocks.relative);n&&(t.name&&(n.name=t.name),t.context&&(n.context=t.context),n.sessionIsActive=t.sessionIsActive)})),t.subscribe(10,(()=>{e.reset()})),{findView:t=>e.find(t),stop:()=>{e.stop()}}}(d);u.push((()=>A.stop()));const I=function(t,e,n,r){const o=mr({expireDelay:Va});let i;t.subscribe(1,(({startClocks:t})=>{const e=r.href;o.add(a({url:e,referrer:i||document.referrer}),t.relative),i=e})),t.subscribe(6,(({endClocks:t})=>{o.closeActive(t.relative)}));const s=n.subscribe((({newLocation:t})=>{const e=o.find();if(e){const n=w();o.closeActive(n),o.add(a({url:t.href,referrer:e.referrer}),n)}}));function a({url:t,referrer:e}){return{url:t,referrer:e}}return e.register(0,(({startTime:t,eventType:e})=>{const n=o.find(t);return n?{type:e,view:{url:n.url,referrer:n.referrer}}:Wn})),{findUrl:t=>o.find(t),stop:()=>{s.unsubscribe(),o.stop()}}}(d,f,T,location);u.push((()=>I.stop()));const R=function(t,e,n){const r=mr({expireDelay:qa});return t.subscribe(1,(({startClocks:t})=>{r.add({},t.relative)})),t.subscribe(6,(({endClocks:t})=>{r.closeActive(t.relative)})),e.register(0,(({startTime:t,eventType:e})=>{if(!n.trackFeatureFlagsForEvents.concat([bo,vo]).includes(e))return Kn;const o=r.find(t);return!o||M(o)?Kn:{type:e,feature_flags:o}})),{addFeatureFlagEvaluation:(t,e)=>{const n=r.find();n&&(n[t]=e)}}}(d,f,t);!function(t,e,n,r){t.register(0,(({eventType:t,startTime:o})=>{const i=e.findTrackedSession(o),s=r.findView(o);if(!i||!s)return Wn;let a,c,u;return t===bo?(a=!!n.getReplayStats(s.id)||void 0,c=1===i.sessionReplay,u=!!s.sessionIsActive&&void 0):a=!!n.isRecording()||void 0,{type:t,session:{id:i.id,type:"user",has_replay:a,sampled_for_replay:c,is_active:u}}})),t.register(1,(({startTime:t})=>{const n=e.findTrackedSession(t);return n?{session:{id:n.id}}:Kn}))}(f,S,e,A),function(t){t.register(0,(({eventType:t})=>({type:t,connectivity:xn()})))}(f),function(t,e){t.register(1,(()=>e.isGranted()?Kn:Wn))}(f,i);const N=function(t,e,n){const r=Wr();return e.storeContextsAcrossPages&&Hr(e,r,n,2),t.register(0,(()=>({context:r.getContext()}))),r}(f,t,"rum"),O=function(t,e,n,r){const o=Kr();return e.storeContextsAcrossPages&&Hr(e,o,r,1),t.register(0,(({eventType:t,startTime:r})=>{const i=o.getContext(),s=n.findTrackedSession(r);return s&&s.anonymousId&&!i.anonymous_id&&e.trackAnonymousUser&&(i.anonymous_id=s.anonymousId),M(i)?Kn:{type:t,usr:i}})),t.register(1,(({startTime:t})=>{var e;return{anonymous_id:null===(e=n.findTrackedSession(t))||void 0===e?void 0:e.anonymousId}})),o}(f,t,S,"rum"),L=function(t,e,n){const r=Gr();return e.storeContextsAcrossPages&&Hr(e,r,n,4),t.register(0,(()=>{const t=r.getContext();return M(t)||!t.id?Kn:{account:t}})),r}(f,t,"rum"),{actionContexts:P,addAction:D,addEvent:U,stop:z}=function(t,e,n,r,o,i,s){const a=function(t,e,n,r,o){const{unsubscribe:i}=t.subscribe(0,(e=>{t.notify(12,Ks(e))}));e.register(0,(({startTime:t,eventType:e})=>{if(e!==vo&&e!==_o&&e!==yo)return Kn;const n=s.findActionId(t);return n?{type:e,action:{id:n}}:Kn})),e.register(1,(({startTime:t})=>({action:{id:s.findActionId(t)}})));let s={findActionId:nt},a=nt;return o.trackUserInteractions&&({actionContexts:s,stop:a}=Gs(t,n,r,o)),{addAction:e=>{t.notify(12,Ks(e))},actionContexts:s,stop:()=>{i(),a()}}}(t,e,o,i,n),c=function(t){return{addEvent:(e,n,r,o)=>{fc.includes(n.type)&&t.notify(12,{startTime:e,rawRumEvent:n,domainContext:r,duration:o})}}}(t),u=function(t,e){let n;const r=requestAnimationFrame(q((()=>{n=Ia()}))),o=Aa(e).subscribe((t=>{n=t})).unsubscribe;return t.register(0,(({eventType:t})=>({type:t,display:n?{viewport:n}:void 0}))),{stop:()=>{o(),r&&cancelAnimationFrame(r)}}}(e,n),l=function(t,e,n=Qa(t,nc)){var r;let o=vt(nc)||(null===(r=window.Cypress)||void 0===r?void 0:r.env("traceId"));const i=n.subscribe((t=>{o=t}));return e.register(0,(({eventType:t})=>"string"!=typeof o?Kn:{type:t,session:{type:"ci_test"},ci_test:{test_execution_id:o}})),{stop:()=>{i.unsubscribe()}}}(n,e);return function(t){t.register(0,(({eventType:t})=>yr()?{type:t,session:{type:"synthetics"},synthetics:{test_id:gr(),result_id:vr(),injected:hr()}}:Kn))}(e),lc(n,t,e,s),{pageStateHistory:r,addAction:a.addAction,addEvent:c.addEvent,actionContexts:a.actionContexts,stop:()=>{a.stop(),l.stop(),u.stop(),r.stop()}}}(d,f,t,C,k,E,p);u.push(z);const{addTiming:$,startView:V,setViewName:B,setViewContext:F,setViewContextProperty:j,getViewContext:H,stop:G}=Ua(d,f,t,location,k,E,T,e,A,r);u.push(G);const{stop:W}=function(t,e){if(!e.metricsEnabled)return{stop:nt};const{unsubscribe:n}=t.subscribe(4,(({initialViewMetrics:t})=>{var e,r;t.largestContentfulPaint&&t.navigationTimings&&(ir("Initial view metrics",{metrics:(e=t.largestContentfulPaint,r=t.navigationTimings,{lcp:{value:e.value},navigation:{domComplete:r.domComplete,domContentLoaded:r.domContentLoaded,domInteractive:r.domInteractive,firstByte:r.firstByte,loadEvent:r.loadEvent}})}),n())}));return{stop:n}}(d,b);u.push(W);const{stop:K}=ia(d,t,C);if(u.push(K),t.trackLongTasks)if(Bi(zi.LONG_ANIMATION_FRAME)){const{stop:e}=function(t,e){const n=$i(e,{type:zi.LONG_ANIMATION_FRAME,buffered:!0}).subscribe((e=>{for(const n of e){const e=h(n.startTime),r={date:e.timeStamp,long_task:{id:rt(),entry_type:ko,duration:y(n.duration),blocking_duration:y(n.blockingDuration),first_ui_event_timestamp:y(n.firstUIEventTimestamp),render_start:y(n.renderStart),style_and_layout_start:y(n.styleAndLayoutStart),start_time:y(n.startTime),scripts:n.scripts.map((t=>({duration:y(t.duration),pause_duration:y(t.pauseDuration),forced_style_and_layout_duration:y(t.forcedStyleAndLayoutDuration),start_time:y(t.startTime),execution_start:y(t.executionStart),source_url:t.sourceURL,source_function_name:t.sourceFunctionName,source_char_position:t.sourceCharPosition,invoker:t.invoker,invoker_type:t.invokerType,window_attribution:t.windowAttribution})))},type:yo,_dd:{discarded:!1}};t.notify(12,{rawRumEvent:r,startTime:e.relative,duration:n.duration,domainContext:{performanceEntry:n}})}}));return{stop:()=>n.unsubscribe()}}(d,t);u.push(e)}else!function(t,e){const n=$i(e,{type:zi.LONG_TASK,buffered:!0}).subscribe((n=>{for(const r of n){if(r.entryType!==zi.LONG_TASK)break;if(!e.trackLongTasks)break;const n=h(r.startTime),o={date:n.timeStamp,long_task:{id:rt(),entry_type:So,duration:y(r.duration)},type:yo,_dd:{discarded:!1}};t.notify(12,{rawRumEvent:o,startTime:n.relative,duration:r.duration,domainContext:{performanceEntry:r}})}}))}(d,t);const{addError:Y}=Ys(d,t,a);a.unbuffer(),Li(d,t,S,O,L);const Z=Mo(d,C,s),Q=function(t,e,n,r,o){return{get:i=>{const s=n.findView(i),a=o.findUrl(i),c=e.findTrackedSession(i);if(c&&s&&a){const e=r.findActionId(i);return{application_id:t,session_id:c.id,user_action:e?{id:e}:void 0,view:{id:s.id,name:s.name,referrer:a.referrer,url:a.url}}}}}}(t.applicationId,S,A,P,I);return u.push((()=>n.stop())),{addAction:D,addEvent:U,addError:Y,addTiming:$,addFeatureFlagEvaluation:R.addFeatureFlagEvaluation,startView:V,setViewContext:F,setViewContextProperty:j,getViewContext:H,setViewName:B,lifeCycle:d,viewHistory:A,session:S,stopSession:()=>S.expire(),getInternalContext:Q.get,startDurationVital:Z.startDurationVital,stopDurationVital:Z.stopDurationVital,addDurationVital:Z.addDurationVital,addOperationStepVital:Z.addOperationStepVital,globalContext:N,userContext:O,accountContext:L,telemetry:b,stop:()=>{u.forEach((t=>t()))},hooks:f}}),Nc,Oc,{startDeflateWorker:wc,createDeflateEncoder:vc,sdkName:"rum"});!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach((t=>c(t,"onReady callback threw an error:")()))}(D(),"DD_RUM",Lc);globalThis.DD_RUM=Lc;const Mc=2,Pc=3,Dc=4,Uc=6,zc=7,$c=8,Vc=9,Bc=0,Fc=1,qc=2,jc=3,Hc=4,Gc=11,Wc=0,Kc=1,Jc=2,Yc=3,Zc=4,Xc=5,Qc=6,tu=7,eu=8,nu=5,ru=6,ou=0,iu=1;function su(t){return Boolean(t.changedTouches)}function au(t){return!0===t.composed&&ji(t.target)?t.composedPath()[0]:t.target}const cu=(t,e)=>{const n=window.visualViewport,r={layoutViewportX:t,layoutViewportY:e,visualViewportX:t,visualViewportY:e};return n?(!function(t){return Math.abs(t.pageTop-t.offsetTop-window.scrollY)>25||Math.abs(t.pageLeft-t.offsetLeft-window.scrollX)>25}(n)?(r.visualViewportX=Math.round(t-n.offsetLeft),r.visualViewportY=Math.round(e-n.offsetTop)):(r.layoutViewportX=Math.round(t+n.offsetLeft),r.layoutViewportY=Math.round(e+n.offsetTop)),r):r},uu=t=>({scale:t.scale,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,pageLeft:t.pageLeft,pageTop:t.pageTop,height:t.height,width:t.width});function lu(t,e){return{data:{source:t,...e},type:Pc,timestamp:_()}}function du(t,e,n){const{throttled:r,cancel:o}=et((t=>{const r=au(t),o=e.nodeIds.get(r);if(void 0===o)return;const i=fu(t);if(!i)return;const s={id:o,timeOffset:0,x:i.x,y:i.y};n(lu(su(t)?Qc:Kc,{positions:[s]}))}),50,{trailing:!1}),{stop:i}=mn(t,document,["mousemove","touchmove"],r,{capture:!0,passive:!0});return{stop:()=>{i(),o()}}}function fu(t){let{clientX:e,clientY:n}=su(t)?t.changedTouches[0]:t;if(window.visualViewport){const{visualViewportX:t,visualViewportY:r}=cu(e,n);e=t,n=r}if(Number.isFinite(e)&&Number.isFinite(n))return{x:e,y:n}}const pu={pointerup:0,mousedown:1,click:2,contextmenu:3,dblclick:4,focus:nu,blur:ru,touchstart:7,touchend:9};function mu(t,e,n,r){return mn(t,document,Object.keys(pu),(o=>{const i=au(o),s=e.nodeIds.get(i);if(void 0===s||ys(i,t.defaultPrivacyLevel)===ds.HIDDEN)return;const a=pu[o.type];let c;if(a!==ru&&a!==nu){const t=fu(o);if(!t)return;c={id:s,type:a,x:t.x,y:t.y}}else c={id:s,type:a};const u={id:r.getIdForEvent(o),...lu(Jc,c)};n(u)}),{capture:!0,passive:!0})}function hu(t,e,n,r,o=document){const{throttled:i,cancel:s}=et((o=>{const i=au(o);if(!i)return;const s=e.nodeIds.get(i);if(void 0===s||ys(i,t.defaultPrivacyLevel)===ds.HIDDEN)return;const a=i===document?{scrollTop:xa(),scrollLeft:Ea()}:{scrollTop:Math.round(i.scrollTop),scrollLeft:Math.round(i.scrollLeft)};r.set(i,a),n(lu(Yc,{id:s,x:a.scrollLeft,y:a.scrollTop}))}),100),{stop:a}=pn(t,o,"scroll",i,{capture:!0,passive:!0});return{stop:()=>{a(),s()}}}function gu(t,e){const n=Aa(t).subscribe((t=>{e(lu(Zc,t))}));return{stop:()=>{n.unsubscribe()}}}function vu(t,e){const n=window.visualViewport;if(!n)return{stop:nt};const{throttled:r,cancel:o}=et((()=>{e({data:uu(n),type:$c,timestamp:_()})}),200,{trailing:!1}),{stop:i}=mn(t,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),o()}}}function yu(t,e,n){return mn(t,document,["play","pause"],(r=>{const o=au(r);if(!o)return;const i=e.nodeIds.get(o);void 0!==i&&ys(o,t.defaultPrivacyLevel)!==ds.HIDDEN&&n(lu(tu,{id:i,type:"play"===r.type?ou:iu}))}),{capture:!0,passive:!0})}function bu(t,e){function n(e,n){if(!e||!e.ownerNode)return;const r=t.nodeIds.get(e.ownerNode);void 0!==r&&n(r)}const r=[je(CSSStyleSheet.prototype,"insertRule",(({target:t,parameters:[r,o]})=>{n(t,(t=>e(lu(eu,{id:t,adds:[{rule:r,index:o}]}))))})),je(CSSStyleSheet.prototype,"deleteRule",(({target:t,parameters:[r]})=>{n(t,(t=>e(lu(eu,{id:t,removes:[{index:r}]}))))}))];function o(t){r.push(je(t.prototype,"insertRule",(({target:t,parameters:[r,o]})=>{n(t.parentStyleSheet,(n=>{const i=_u(t);i&&(i.push(o||0),e(lu(eu,{id:n,adds:[{rule:r,index:i}]})))}))})),je(t.prototype,"deleteRule",(({target:t,parameters:[r]})=>{n(t.parentStyleSheet,(n=>{const o=_u(t);o&&(o.push(r),e(lu(eu,{id:n,removes:[{index:o}]})))}))})))}return"undefined"!=typeof CSSGroupingRule?o(CSSGroupingRule):(o(CSSMediaRule),o(CSSSupportsRule)),{stop:()=>{r.forEach((t=>t.stop()))}}}function _u(t){const e=[];let n=t;for(;n.parentRule;){const t=Array.from(n.parentRule.cssRules).indexOf(n);e.unshift(t),n=n.parentRule}if(!n.parentStyleSheet)return;const r=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return e.unshift(r),e}function wu(t,e){return mn(t,window,["focus","blur"],(()=>{e({data:{has_focus:document.hasFocus()},type:Uc,timestamp:_()})}))}function Su(t,e,n){const r=t.subscribe(12,(t=>{var r,o;t.rawRumEvent.type===go&&t.rawRumEvent.action.type===Co&&(null===(o=null===(r=t.rawRumEvent.action.frustration)||void 0===r?void 0:r.type)||void 0===o?void 0:o.length)&&"events"in t.domainContext&&t.domainContext.events&&t.domainContext.events.length&&e({timestamp:t.rawRumEvent.date,type:Vc,data:{frustrationTypes:t.rawRumEvent.action.frustration.type,recordIds:t.domainContext.events.map((t=>n.getIdForEvent(t)))}})}));return{stop:()=>{r.unsubscribe()}}}function ku(t,e){const n=t.subscribe(5,(()=>{e({timestamp:_(),type:zc})}));return{stop:()=>{n.unsubscribe()}}}function Tu(t,e){const n=t.tagName,r=t.value;if(ws(t,e)){const e=t.type;if("INPUT"===n&&("button"===e||"submit"===e||"reset"===e))return r;if(!r||"OPTION"===n)return;return ms}return"OPTION"===n||"SELECT"===n?t.value:"INPUT"===n||"TEXTAREA"===n?r:void 0}const Eu=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,xu=/^[A-Za-z]+:|^\/\//,Cu=/^["']?data:.*,/i;function Au(t,e){return t.replace(Eu,((t,n,r,o,i,s)=>{const a=r||i||s;if(!e||!a||xu.test(a)||Cu.test(a))return t;const c=n||o||"";return`url(${c}${function(t,e){try{return pt(t,e).href}catch(e){return t}}(a,e)}${c})`}))}const Iu=/[^a-z1-6-_]/;function Ru(t){const e=t.toLowerCase().trim();return Iu.test(e)?"div":e}function Nu(t,e){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${e}' style='background-color:silver'%3E%3C/svg%3E`}function Ou(t){if(void 0!==t&&0!==t.length)return t.map((t=>{const e=t.cssRules||t.rules;return{cssRules:Array.from(e,(t=>t.cssText)),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}}))}function Lu(t,e,n,r){if(e===ds.HIDDEN)return null;const o=t.getAttribute(n);if(e===ds.MASK&&n!==fs&&!ts.includes(n)&&n!==r.actionNameAttribute){const e=t.tagName;switch(n){case"title":case"alt":case"placeholder":return ms}if("IMG"===e&&("src"===n||"srcset"===n)){const e=t;if(e.naturalWidth>0)return Nu(e.naturalWidth,e.naturalHeight);const{width:n,height:r}=t.getBoundingClientRect();return n>0||r>0?Nu(n,r):hs}if("SOURCE"===e&&("src"===n||"srcset"===n))return hs;if("A"===e&&"href"===n)return ms;if(o&&n.startsWith("data-"))return ms;if("IFRAME"===e&&"srcdoc"===n)return ms}return o&&"string"==typeof o?Ii(o,1e6):o}function Mu(t,e,n){t[e].count+=1,t[e].max=Math.max(t[e].max,n),t[e].sum+=n}function Pu(t){if(!t)return null;let e;try{e=t.rules||t.cssRules}catch(t){}if(!e)return null;return Au(Array.from(e,1===dt()?Du:Uu).join(""),t.href)}function Du(t){if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")){const e=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return t.cssText.replace(e,"$1\\$2")}return Uu(t)}function Uu(t){return function(t){return"styleSheet"in t}(t)&&Pu(t.styleSheet)||t.cssText}function zu(t,e,n){const r=function(t,e,n){switch(t.nodeType){case t.DOCUMENT_NODE:return function(t,e,n){return{type:Bc,childNodes:$u(t,e,n),adoptedStyleSheets:Ou(t.adoptedStyleSheets)}}(t,e,n);case t.DOCUMENT_FRAGMENT_NODE:return function(t,e,n){const r=Hi(t);r&&n.serializationContext.shadowRootsController.addShadowRoot(t);return{type:Gc,childNodes:$u(t,e,n),isShadowRoot:r,adoptedStyleSheets:r?Ou(t.adoptedStyleSheets):void 0}}(t,e,n);case t.DOCUMENT_TYPE_NODE:return{type:Fc,name:(r=t).name,publicId:r.publicId,systemId:r.systemId};case t.ELEMENT_NODE:return function(t,e,n){const r=Ru(t.tagName),o=(s=t,"svg"===s.tagName||s instanceof SVGElement||void 0),i=bs(_s(t),e);var s;if(i===ds.HIDDEN){const{width:e,height:n}=t.getBoundingClientRect();return{type:qc,tagName:r,attributes:{rr_width:`${e}px`,rr_height:`${n}px`,[fs]:ps},childNodes:[],isSVG:o}}if(i===ds.IGNORE)return;const a=function(t,e,n){if(e===ds.HIDDEN)return{};const r={},o=Ru(t.tagName),i=t.ownerDocument;for(let o=0;o<t.attributes.length;o+=1){const i=t.attributes.item(o).name,s=Lu(t,e,i,n.configuration);null!==s&&(r[i]=s)}if(t.value&&("textarea"===o||"select"===o||"option"===o||"input"===o)){const n=Tu(t,e);void 0!==n&&(r.value=n)}if("option"===o&&e===ds.ALLOW){const e=t;e.selected&&(r.selected=e.selected)}if("link"===o){const e=Array.from(i.styleSheets).find((e=>e.href===t.href)),o=Pu(e);o&&e&&(Mu(n.serializationContext.serializationStats,"cssText",o.length),r._cssText=o)}if("style"===o&&t.sheet){const e=Pu(t.sheet);e&&(Mu(n.serializationContext.serializationStats,"cssText",e.length),r._cssText=e)}const s=t;if("input"!==o||"radio"!==s.type&&"checkbox"!==s.type||(e===ds.ALLOW?r.checked=!!s.checked:ws(s,e)&&delete r.checked),"audio"===o||"video"===o){const e=t;r.rr_mediaState=e.paused?"paused":"played"}let a,c;const u=n.serializationContext;switch(u.status){case 0:a=Math.round(t.scrollTop),c=Math.round(t.scrollLeft),(a||c)&&u.elementsScrollPositions.set(t,{scrollTop:a,scrollLeft:c});break;case 1:u.elementsScrollPositions.has(t)&&({scrollTop:a,scrollLeft:c}=u.elementsScrollPositions.get(t))}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}(t,i,n);let c=[];(function(t){return t.childNodes.length>0||ji(t)})(t)&&"style"!==r&&(c=$u(t,i,n));return{type:qc,tagName:r,attributes:a,childNodes:c,isSVG:o}}(t,e,n);case t.TEXT_NODE:return function(t,e){const n=Ts(t,e);if(void 0===n)return;return{type:jc,textContent:n}}(t,e);case t.CDATA_SECTION_NODE:return{type:Hc,textContent:""}}var r}(t,e,n);if(!r)return null;const o=n.scope.nodeIds.assign(t),i=r;return i.id=o,n.serializedNodeIds&&n.serializedNodeIds.add(o),i}function $u(t,e,n){const r=[];return Gi(t,(t=>{const o=zu(t,e,n);o&&r.push(o)})),r}function Vu(t,e,n,r){const o=_(),i=zu(t,e.defaultPrivacyLevel,{serializationContext:r,configuration:e,scope:n});return Mu(r.serializationStats,"serializationDuration",T(o,_())),i}function Bu(t,e,n,r=document){const o=t.defaultPrivacyLevel,i=new WeakMap,s=r!==document,{stop:a}=mn(t,r,s?["change"]:["input","change"],(t=>{const e=au(t);(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&u(e)}),{capture:!0,passive:!0});let c;if(s)c=nt;else{const t=[He(HTMLInputElement.prototype,"value",u),He(HTMLInputElement.prototype,"checked",u),He(HTMLSelectElement.prototype,"value",u),He(HTMLTextAreaElement.prototype,"value",u),He(HTMLSelectElement.prototype,"selectedIndex",u)];c=()=>{t.forEach((t=>t.stop()))}}return{stop:()=>{c(),a()}};function u(t){const n=ys(t,o);if(n===ds.HIDDEN)return;const r=t.type;let i;if("radio"===r||"checkbox"===r){if(ws(t,n))return;i={isChecked:t.checked}}else{const e=Tu(t,n);if(void 0===e)return;i={text:e}}l(t,i,e);const s=t.name;"radio"===r&&s&&t.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(s)}"]`).forEach((n=>{n!==t&&l(n,{isChecked:!1},e)}))}function l(t,e,r){const o=r.nodeIds.get(t);if(void 0===o)return;const s=i.get(t);s&&s.text===e.text&&s.isChecked===e.isChecked||(i.set(t,e),n(lu(Xc,{id:o,...e})))}}function Fu(t,e,n,r,o){const i=fi();if(!i)return{stop:nt,flush:nt};const s=function(t){let e=nt,n=[];function r(){e(),t(n),n=[]}const{throttled:o,cancel:i}=et(r,16,{leading:!1});return{addMutations:t=>{0===n.length&&(e=Pr(o,{timeout:100})),n.push(...t)},flush:r,stop:()=>{e(),i()}}}((o=>{!function(t,e,n,r,o){const i=new Map;t.filter((t=>"childList"===t.type)).forEach((t=>{t.removedNodes.forEach((t=>{qu(t,o.removeShadowRoot)}))}));const s=t.filter((t=>t.target.isConnected&&r.nodeIds.areAssignedForNodeAndAncestors(t.target)&&ys(t.target,n.defaultPrivacyLevel,i)!==ds.HIDDEN)),a={cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}},{adds:c,removes:u,hasBeenSerialized:l}=function(t,e,n,r,o,i){const s=new Set,a=new Map;for(const e of t)e.addedNodes.forEach((t=>{s.add(t)})),e.removedNodes.forEach((t=>{s.has(t)||a.set(t,e.target),s.delete(t)}));const c=Array.from(s);u=c,u.sort(((t,e)=>{const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_CONTAINS||n&Node.DOCUMENT_POSITION_FOLLOWING?1:n&Node.DOCUMENT_POSITION_PRECEDING?-1:0}));var u;const l=new Set,d={status:2,serializationStats:r,shadowRootsController:o},f=[];for(const t of c){if(m(t))continue;const o=ys(t.parentNode,e.defaultPrivacyLevel,i);if(o===ds.HIDDEN||o===ds.IGNORE)continue;const s=_(),a=zu(t,o,{serializedNodeIds:l,serializationContext:d,configuration:e,scope:n});if(Mu(r,"serializationDuration",T(s,_())),!a)continue;const c=Wi(t);f.push({nextId:h(t),parentId:n.nodeIds.get(c),node:a})}const p=[];return a.forEach(((t,e)=>{const r=n.nodeIds.get(t),o=n.nodeIds.get(e);void 0!==r&&void 0!==o&&p.push({parentId:r,id:o})})),{adds:f,removes:p,hasBeenSerialized:m};function m(t){const e=n.nodeIds.get(t);return void 0!==e&&l.has(e)}function h(t){let e=t.nextSibling;for(;e;){const t=n.nodeIds.get(e);if(void 0!==t)return t;e=e.nextSibling}return null}}(s.filter((t=>"childList"===t.type)),n,r,a,o,i),d=function(t,e,n,r){var o;const i=[],s=new Set,a=t.filter((t=>!s.has(t.target)&&(s.add(t.target),!0)));for(const t of a){if(t.target.textContent===t.oldValue)continue;const s=n.nodeIds.get(t.target);if(void 0===s)continue;const a=ys(Wi(t.target),e.defaultPrivacyLevel,r);a!==ds.HIDDEN&&a!==ds.IGNORE&&i.push({id:s,value:null!==(o=Ts(t.target,a))&&void 0!==o?o:null})}return i}(s.filter((t=>"characterData"===t.type&&!l(t.target))),n,r,i),f=function(t,e,n,r){const o=[],i=new Map,s=t.filter((t=>{const e=i.get(t.target);return(!e||!e.has(t.attributeName))&&(e?e.add(t.attributeName):i.set(t.target,new Set([t.attributeName])),!0)})),a=new Map;for(const t of s){if(t.target.getAttribute(t.attributeName)===t.oldValue)continue;const i=n.nodeIds.get(t.target);if(void 0===i)continue;const s=ys(t.target,e.defaultPrivacyLevel,r),c=Lu(t.target,s,t.attributeName,e);let u;if("value"===t.attributeName){const e=Tu(t.target,s);if(void 0===e)continue;u=e}else u="string"==typeof c?c:null;let l=a.get(t.target);l||(l={id:i,attributes:{}},o.push(l),a.set(t.target,l)),l.attributes[t.attributeName]=u}return o}(s.filter((t=>"attributes"===t.type&&!l(t.target))),n,r,i);if(!(d.length||f.length||u.length||c.length))return;e(lu(Wc,{adds:c,removes:u,texts:d,attributes:f}),a)}(o.concat(a.takeRecords()),t,e,n,r)})),a=new i(q(s.addMutations));return a.observe(o,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{a.disconnect(),s.stop()},flush:()=>{s.flush()}}}function qu(t,e){ji(t)&&e(t.shadowRoot),Gi(t,(t=>qu(t,e)))}function ju(t){const{emit:e,configuration:n,lifeCycle:r}=t;if(!e)throw new Error("emit function is required");const o=(n,r)=>{e(n,r),Sn("record",{record:n});const o=t.viewHistory.findView();gc(o.id).records_count+=1},i=function(){const t=new WeakMap;return{set(e,n){(e!==document||document.scrollingElement)&&t.set(e===document?document.scrollingElement:e,n)},get:e=>t.get(e),has:e=>t.has(e)}}(),s={nodeIds:function(){const t=new WeakMap;let e=1;const n=e=>t.get(e);return{assign:r=>{let o=n(r);return void 0===o&&(o=e++,t.set(r,o)),o},get:n,areAssignedForNodeAndAncestors:t=>{let e=t;for(;e;){if(void 0===n(e)&&!Hi(e))return!1;e=Wi(e)}return!0}}}()};const a=((t,e,n,r)=>{const o=new Map,i={addShadowRoot:s=>{if(o.has(s))return;const a=Fu(n,t,e,i,s),c=Bu(t,e,n,s),u=hu(t,e,n,r,s);o.set(s,{flush:()=>a.flush(),stop:()=>{a.stop(),c.stop(),u.stop()}})},removeShadowRoot:t=>{const e=o.get(t);e&&(e.stop(),o.delete(t))},stop:()=>{o.forEach((({stop:t})=>t()))},flush:()=>{o.forEach((({flush:t})=>t()))}};return i})(n,s,o,i),{stop:c}=function(t,e,n,r,o,i,s){const a=(n,i)=>{const{width:a,height:c}=Ia();s({data:{height:c,href:window.location.href,width:a},type:Dc,timestamp:n}),s({data:{has_focus:document.hasFocus()},type:Uc,timestamp:n});const u={cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}};s({data:{node:Vu(document,r,o,{status:i,elementsScrollPositions:t,serializationStats:u,shadowRootsController:e}),initialOffset:{left:Ea(),top:xa()}},type:Mc,timestamp:n},u),window.visualViewport&&s({data:uu(window.visualViewport),type:$c,timestamp:n})};a(_(),0);const{unsubscribe:c}=n.subscribe(2,(t=>{i(),a(t.startClocks.timeStamp,1)}));return{stop:c}}(i,a,r,n,s,u,o);function u(){a.flush(),d.flush()}const l=function(){const t=new WeakMap;let e=1;return{getIdForEvent:n=>(t.has(n)||t.set(n,e++),t.get(n))}}(),d=Fu(o,n,s,a,document),f=[d,du(n,s,o),mu(n,s,o,l),hu(n,s,o,i,document),gu(n,o),Bu(n,s,o),yu(n,s,o),bu(s,o),wu(n,o),vu(n,o),Su(r,o,l),ku(r,(t=>{u(),o(t)}))];return{stop:()=>{a.stop(),f.forEach((t=>t.stop())),c()},flushMutations:u,shadowRootsController:a}}function Hu({context:t,creationReason:e,encoder:n}){let r=0;const o=t.view.id,i=function(t){return gc(t).segments_count}(o),s={start:1/0,end:-1/0,creation_reason:e,records_count:0,has_full_snapshot:!1,index_in_view:i,source:"browser",...t},a={cssText:{count:0,max:0,sum:0},serializationDuration:{count:0,max:0,sum:0}};return function(t){gc(t).segments_count+=1}(o),{addRecord:function(t,e,o){s.start=Math.min(s.start,t.timestamp),s.end=Math.max(s.end,t.timestamp),s.records_count+=1,s.has_full_snapshot||(s.has_full_snapshot=t.type===Mc),e&&function(t,e){for(const n of["cssText","serializationDuration"])t[n].count+=e[n].count,t[n].max=Math.max(t[n].max,e[n].max),t[n].sum+=e[n].sum}(a,e);const i=n.isEmpty?'{"records":[':",";n.write(i+JSON.stringify(t),(t=>{r+=t,o(r)}))},flush:function(t){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(s).slice(1)}\n`),n.finish((e=>{!function(t,e){gc(t).segments_total_raw_size+=e}(s.view.id,e.rawBytesCount),t(s,a,e)}))}}}let Gu=6e4;function Wu(t,e,n,r,o,i){return function(t,e,n,r){let o={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=t.subscribe(2,(()=>{a("view_change")})),{unsubscribe:s}=t.subscribe(11,(t=>{a(t.reason)}));function a(t){1===o.status&&(o.segment.flush(((e,r,o)=>{const i=function(t,e,n,r){const o=new FormData;o.append("segment",new Blob([t],{type:"application/octet-stream"}),`${e.session.id}-${e.start}`);const i={raw_segment_size:r,compressed_segment_size:t.byteLength,...e},s=JSON.stringify(i);return o.append("event",new Blob([s],{type:"application/json"})),{data:o,bytesCount:t.byteLength,cssText:n.cssText,isFullSnapshot:0===e.index_in_view,rawSize:r,recordCount:e.records_count,serializationDuration:n.serializationDuration}}(o.output,e,r,o.rawBytesCount);qn(t)?n.sendOnExit(i):n.send(i)})),K(o.expirationTimeoutId)),o="stop"!==t?{status:0,nextSegmentCreationReason:t}:{status:2}}return{addRecord:(t,n)=>{if(2!==o.status){if(0===o.status){const t=e();if(!t)return;o={status:1,segment:Hu({encoder:r,context:t,creationReason:o.nextSegmentCreationReason}),expirationTimeoutId:W((()=>{a("segment_duration_limit")}),5e3)}}o.segment.addRecord(t,n,(t=>{t>Gu&&a("segment_bytes_limit")}))}},stop:()=>{a("stop"),i(),s()}}}(t,(()=>function(t,e,n){const r=e.findTrackedSession(),o=n.findView();if(!r||!o)return;return{application:{id:t},session:{id:r.id},view:{id:o.id}}}(e.applicationId,n,r)),o,i)}var Ku=Object.freeze({__proto__:null,startRecording:function(t,e,n,r,o,i,s){const a=[],c=s||Mn([e.sessionReplayEndpointBuilder],Gu,(e=>{t.notify(14,{error:e}),rr("Error reported to customer",{"error.message":e.message})}));let u;if(Bn())({addRecord:u}=function(t){const e=$n();return{addRecord:n=>{const r=t.findView();e.send("record",n,r.id)}}}(r));else{const s=Wu(t,e,n,r,c,o);u=s.addRecord,a.push(s.stop);const l=function(t,e){if(!t.metricsEnabled)return{stop:nt};const{unsubscribe:n}=e.subscribe((t=>{var e,n,r;("failure"===t.type||"queue-full"===t.type||"success"===t.type&&t.payload.isFullSnapshot)&&ir("Segment network request metrics",{metrics:(e=t.type,n=t.bandwidth,{cssText:{count:(r=t.payload).cssText.count,max:r.cssText.max,sum:r.cssText.sum},isFullSnapshot:r.isFullSnapshot,ongoingRequests:{count:n.ongoingRequestCount,totalSize:n.ongoingByteCount},recordCount:r.recordCount,result:e,serializationDuration:{count:r.serializationDuration.count,max:r.serializationDuration.max,sum:r.serializationDuration.sum},size:{compressed:r.bytesCount,raw:r.rawSize}})})}));return{stop:n}}(i,c.observable);a.push(l.stop)}const{stop:l}=ju({emit:u,configuration:e,lifeCycle:t,viewHistory:r});return a.push(l),{stop:()=>{a.forEach((t=>t()))}}}});const Ju=new Map;function Yu(t){for(const e of Ju.keys())e<t&&Ju.delete(e)}function Zu({rawRumEvent:t,startTime:e}){if(t.type!==yo)return;!function(t,e){Ju.set(e,t)}(t.long_task.id,e)}const Xu=/\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;const Qu=(t,e)=>t||function(t){return t?t.replace(Xu,"/?"):"/"}(e);function tl(t,e,n){const r={application:{id:e}};n&&(r.session={id:n});const{ids:o,names:i}=function(t){const e={ids:[],names:[]};for(const n of t)e.ids.push(n.viewId),n.viewName&&e.names.push(n.viewName);return e.names=Array.from(new Set(e.names)),e}(t.views);o.length&&(r.view={id:o,name:i});const s=t.longTasks.map((t=>t.id)).filter((t=>void 0!==t));return s.length&&(r.long_task={id:s}),r}function el(t,e,n){const r=function(t,e,n){const r=_n(e),o=tl(t,e.applicationId,n),i=function(t){const e=t.concat(["language:javascript","runtime:chrome","family:chrome","host:browser"]);return e}(r),s={...o,attachments:["wall-time.json"],start:new Date(t.startClocks.timeStamp).toISOString(),end:new Date(t.endClocks.timeStamp).toISOString(),family:"chrome",runtime:"chrome",format:"json",version:4,tags_profiler:i.join(","),_dd:{clock_drift:v()}};return s}(t,e,n);return{event:r,"wall-time.json":t}}const nl={sampleIntervalMs:10,collectIntervalMs:6e4,minProfileDurationMs:5e3,minNumberOfSamples:50};var rl=Object.freeze({__proto__:null,DEFAULT_RUM_PROFILER_CONFIGURATION:nl,createRumProfiler:function(t,e,n,r,i,s=nl){const a=function(t,e,n,r){const o=Mn([t.profilingEndpointBuilder],t.batchBytesLimit,(t=>{e.notify(14,{error:t}),rr("Error reported to customer",{"error.message":t.message})})),i=n(r);return{async send({event:t,...e}){const n=new FormData,r=Ge(t);if(!r)throw new Error("Failed to serialize event");n.append("event",new Blob([r],{type:"application/json"}),"event.json");let s=r.length;for(const[t,r]of kt(e)){const e=Ge(r);if(!e)throw new Error("Failed to serialize attachment");const o=await mc(i,e);s+=o.outputBytesCount,n.append(t,new Blob([o.output]),t)}o.send({data:n,bytesCount:s})}}}(t,e,i,6),c=Bi(zi.LONG_ANIMATION_FRAME);let u;const l=[];let d={state:"stopped"};function f(){const n=D().Profiler;if(!n)throw r.set({status:"error",error_reason:"not-supported-by-browser"}),new Error("RUM Profiler is not supported in this browser.");p(d).catch(H);const{cleanupTasks:i,observer:a}=function(n){if("running"===n.state)return{cleanupTasks:n.cleanupTasks,observer:n.observer};const r=[];let o;if(t.trackLongTasks){o=new PerformanceObserver(y),o.observe({entryTypes:[c?"long-animation-frame":"longtask"]});const t=e.subscribe(12,(t=>{Zu(t)}));r.push((()=>null==o?void 0:o.disconnect())),r.push(t.unsubscribe)}const i=e.subscribe(2,(t=>{const e={viewId:t.id,viewName:Qu(t.name,document.location.pathname),startClocks:t.startClocks};g(e),u=e}));return r.push(i.unsubscribe),{cleanupTasks:r,observer:o}}(d);let l;try{l=new n({sampleInterval:s.sampleIntervalMs,maxBufferSize:Math.round(1.5*s.collectIntervalMs/s.sampleIntervalMs)})}catch(t){return void(t instanceof Error&&t.message.includes("disabled by Document Policy")?(o.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.",t),r.set({status:"error",error_reason:"missing-document-policy-header"})):r.set({status:"error",error_reason:"unexpected-exception"}))}r.set({status:"running",error_reason:void 0}),d={state:"running",startClocks:S(),profiler:l,timeoutId:W(f,s.collectIntervalMs),longTasks:[],views:[],cleanupTasks:i,observer:a},g(u),l.addEventListener("samplebufferfull",v)}async function p(e){var r,o;if("running"!==e.state)return;b(null!==(o=null===(r=e.observer)||void 0===r?void 0:r.takeRecords())&&void 0!==o?o:[]),K(e.timeoutId),e.profiler.removeEventListener("samplebufferfull",v);const{startClocks:i,longTasks:c,views:u}=e,l=S();await e.profiler.stop().then((e=>{const r=S(),o=c.length>0,d=T(i.timeStamp,r.timeStamp)<s.minProfileDurationMs,f=function(t){let e=0;for(const n of t)void 0!==n.stackId&&e++;return e}(e.samples)<s.minNumberOfSamples;(o||!d&&!f)&&(!function(e){var r;const o=null===(r=n.findTrackedSession())||void 0===r?void 0:r.id,i=el(e,t,o);a.send(i)}(Object.assign(e,{startClocks:i,endClocks:r,clocksOrigin:k(),longTasks:c,views:u,sampleInterval:s.sampleIntervalMs})),Yu(l.relative))})).catch(H)}async function m(t){"running"===d.state&&(d.cleanupTasks.forEach((t=>t())),await p(d),d={state:t})}function g(t){"running"===d.state&&t&&d.views.push(t)}function v(){f()}function y(t){b(t.getEntries())}function b(t){var e;if("running"===d.state)for(const n of t){if(n.duration<s.sampleIntervalMs)continue;const t=h(n.startTime),r=(e=t.relative,Ju.get(e));d.longTasks.push({id:r,duration:n.duration,entryType:n.entryType,startClocks:t})}}function _(){"hidden"===document.visibilityState&&"running"===d.state?m("paused").catch(H):"visible"===document.visibilityState&&"paused"===d.state&&f()}function w(){f()}return{start:function(e){"running"!==d.state&&(u=e?{startClocks:e.startClocks,viewId:e.id,viewName:Qu(e.name,document.location.pathname)}:void 0,l.push(pn(t,window,"visibilitychange",_).stop,pn(t,window,"beforeunload",w).stop),f())},stop:async function(){await m("stopped"),l.forEach((t=>t())),Yu(S().relative),r.set({status:"stopped",error_reason:void 0})},isStopped:function(){return"stopped"===d.state},isRunning:function(){return"running"===d.state},isPaused:function(){return"paused"===d.state}}}});