Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-logs - npm Package Compare versions

Comparing version 5.3.0 to 5.4.0

2

bundle/datadog-logs.js

@@ -1,1 +0,1 @@

!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((function(e){n[e]=t[e]}));var r="Datadog Browser SDK:",o={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)};function i(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return e.apply(void 0,n)}catch(e){o.error(t,e)}}}var a,s=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},u=!1;function c(e){u=e}function f(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(a?l(r):r).apply(this,e)}}function l(e){return function(){return d(e,this,arguments)}}function d(e,t,n){try{return e.apply(t,n)}catch(e){if(p(e),a)try{a(e)}catch(e){p(e)}}}function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&o.error.apply(o,s(["[MONITOR]"],e,!1))}function v(e,t){return-1!==e.indexOf(t)}function g(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){return t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function h(e){return Object.keys(e).map((function(t){return e[t]}))}function y(e,t){return e.slice(0,t.length)===t}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function b(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}var E=1024,w=1024*E,S=/[^\u0000-\u007F]/;function C(e){return S.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function _(e,t){var n,r=b();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function x(e,t){return _(b(),"setTimeout")(l(e),t)}function O(e){_(b(),"clearTimeout")(e)}function k(e,t){return _(b(),"setInterval")(l(e),t)}function T(e){_(b(),"clearInterval")(e)}function R(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,s=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];s?r=n:(i?e.apply(void 0,n):r=n,s=!0,o=x((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){O(o),s=!1,r=void 0}}}function L(){}function A(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function I(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=I(o[i],t[i],n);return o}var a="object"===A(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=I(a[s],t[s],n));return a}}function P(e){return I(void 0,e)}function B(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];null!=i&&(e=I(e,i))}return e}function N(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=U(Object.prototype),o=U(Array.prototype),i=U(Object.getPrototypeOf(e)),a=U(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function U(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):L}var D=220*E,M="$",q=3;function j(e,t){var n;void 0===t&&(t=D);var r=U(Object.prototype),o=U(Array.prototype),i=[],a=new WeakMap,s=H(e,M,void 0,i,a),u=(null===(n=JSON.stringify(s))||void 0===n?void 0:n.length)||0;if(!(u>t)){for(;i.length>0&&u<t;){var c=i.shift(),f=0;if(Array.isArray(c.source))for(var l=0;l<c.source.length;l++){if(u+=void 0!==(d=H(c.source[l],c.path,l,i,a))?JSON.stringify(d).length:4,u+=f,f=1,u>t){G(t,"truncated",e);break}c.target[l]=d}else for(var l in c.source)if(Object.prototype.hasOwnProperty.call(c.source,l)){var d;if(void 0!==(d=H(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+q,f=1),u>t){G(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}G(t,"discarded",e)}function H(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!=typeof i)return function(e){if("bigint"==typeof e)return"[BigInt] ".concat(e.toString());if("function"==typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"==typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(i);var a=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;var s=e;if(o.has(s))return"[Reference seen at ".concat(o.get(s),"]");var u=void 0!==n?"".concat(t,".").concat(n):t,c=Array.isArray(i)?[]:{};return o.set(s,u),r.push({source:i,target:c,path:u}),c}function G(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var F,V=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new V((function(){var t=e.map((function(e){return e.subscribe((function(e){return n.notify(e)}))}));return function(){return t.forEach((function(e){return e.unsubscribe()}))}}));return n}var W=3*E,Y=((F={})[0]="feature flag evaluation",F[1]="user",F[2]="global context",F[3]="logger context",F);var J=200;function K(e,t){void 0===t&&(t=C);var n,r={},i=!1,a=new V,s=R((function(r){n=t(N(r)),i||(i=function(e,t){return e>W&&(o.warn("The ".concat(Y[t]," data exceeds the recommended ").concat(W/E,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-3kib-warning")),!0)}(n,e))}),J).throttled,u={getBytesCount:function(){return n},getContext:function(){return P(r)},setContext:function(e){"object"===A(e)?(r=j(e),s(r)):u.clearContext(),a.notify()},setContextProperty:function(e,t){r[e]=j(t),s(r),a.notify()},removeContextProperty:function(e){delete r[e],s(r),a.notify()},clearContext:function(){r={},n=0,a.notify()},changeObservable:a};return u}var $,Z,X=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),Q=1e3,ee=60*Q,te=60*ee;function ne(){return(new Date).getTime()}function re(){return ne()}function oe(){return performance.now()}function ie(){return{relative:oe(),timeStamp:re()}}function ae(e,t){return e+t}function se(){return void 0===$&&($=performance.timing.navigationStart),$}function ue(){var e=b().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function ce(e){var t;void 0===e&&(e=null===(t=b().location)||void 0===t?void 0:t.hostname);var n=ue();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function fe(e,t,n,r,o){return le(e,t,[n],r,o)}function le(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,u=i.passive,c=l((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&p(),r(t))})),f=u?{capture:s,passive:u}:s,d=_(t,"addEventListener");function p(){var e=_(t,"removeEventListener");n.forEach((function(n){return e.call(t,n,c,f)}))}return n.forEach((function(e){return d.call(t,e,c,f)})),{stop:p}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.DBL_CLICK="dblclick",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.TOUCH_MOVE="touchmove",e.VISIBILITY_CHANGE="visibilitychange",e.PAGE_SHOW="pageshow",e.FREEZE="freeze",e.RESUME="resume",e.DOM_CONTENT_LOADED="DOMContentLoaded",e.POINTER_DOWN="pointerdown",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.HASH_CHANGE="hashchange",e.PAGE_HIDE="pagehide",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.MOUSE_MOVE="mousemove",e.FOCUS="focus",e.BLUR="blur",e.CONTEXT_MENU="contextmenu",e.RESIZE="resize",e.CHANGE="change",e.INPUT="input",e.PLAY="play",e.PAUSE="pause",e.SECURITY_POLICY_VIOLATION="securitypolicyviolation",e.SELECTION_CHANGE="selectionchange",e.STORAGE="storage"}(Z||(Z={}));var de,pe="_dd_c",ve=[];function ge(e,t,n,r){void 0===r&&(r=C);var o=function(e,t){return"".concat(pe,"_").concat(e,"_").concat(t)}(t,n),i=K(n,r);return a(),ve.push(fe(e,window,Z.STORAGE,(function(e){var t=e.key;o===t&&a()}))),i.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(i.getContext()))})),i;function a(){var e=localStorage.getItem(o),t=null!==e?JSON.parse(e):{};i.setContext(t)}}function he(e){var t=m({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}!function(e){e.PAGEHIDE="pagehide",e.FEATURE_FLAGS="feature_flags",e.RESOURCE_PAGE_STATES="resource_page_states",e.COLLECT_FLUSH_REASON="collect_flush_reason",e.SCROLLMAP="scrollmap",e.WEB_VITALS_ATTRIBUTION="web_vitals_attribution",e.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css"}(de||(de={}));var ye=new Set;function me(e){return ye.has(e)}function be(){return ye}function Ee(e){return 0!==e&&100*Math.random()<=e}function we(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Se(e){return 0===Object.keys(e).length}function Ce(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,Ce)}var _e=/([\w-]+)\s*=\s*([^;]+)/g;function xe(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}var Oe,ke,Te,Re=4*te,Le=15*ee;function Ae(){return null!=Oe?Oe:Oe=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return 1;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 2;if(e.document.documentMode)return 0;return 3}()}function Ie(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(u)}function Pe(e){return function(e,t){for(_e.lastIndex=0;;){var n=_e.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Be(e){return ke||(ke=function(e){var t=new Map;for(_e.lastIndex=0;;){var n=_e.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),ke.get(e)}function Ne(e,t){Ie(e,"",0,t)}var Ue="_dd_s",De=/^([a-z]+)=([a-z0-9-]+)$/,Me="&";function qe(e){return Se(e)}function je(e){e.expire=String(ne()+Le)}function He(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(Me);var t}function Ge(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(Me)||De.test(e))}(e)&&e.split(Me).forEach((function(e){var n=De.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var Fe="_dd",Ve="_dd_r",ze="_dd_l",We="rum",Ye="logs";function Je(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===Te){for(var e="dd_site_test_".concat(Ce()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Pe(e);)n="".concat(t.pop(),".").concat(n),Ie(e,"test",Q,{domain:n});Ne(e,{domain:n}),Te=n}return Te}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(Ce()),n="test";Ie(t,n,ee,e);var r=Pe(t)===n;return Ne(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function Ke(e){var t,n={isLockEnabled:1===Ae(),persistSession:(t=e,function(e){Ie(Ue,He(e),Le,t)}),retrieveSession:$e,clearSession:Ze(e)};return function(e){if(!Be(Ue)){var t=Be(Fe),n=Be(Ve),r=Be(ze),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[Ye]=r),n&&/^[012]$/.test(n)&&(o[We]=n),qe(o)||(je(o),e.persistSession(o))}}(n),n}function $e(){return Ge(Pe(Ue))}function Ze(e){return function(){Ne(Ue,e)}}var Xe="_dd_test_";function Qe(e){localStorage.setItem(Ue,He(e))}function et(){return Ge(localStorage.getItem(Ue))}function tt(){localStorage.removeItem(Ue)}var nt,rt=10,ot=100,it=[];function at(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.retrieveSession,a=t.persistSession,s=t.clearSession;if(nt||(nt=e),e===nt)if(o&&n>=ot)ut(t);else{var u,c=i();if(o){if(c.lock)return void st(e,t,n);if(u=Ce(),c.lock=u,a(c),(c=i()).lock!==u)return void st(e,t,n)}var f=e.process(c);if(o&&(c=i()).lock!==u)st(e,t,n);else{if(f&&(qe(f)?s():(je(f),a(f))),o&&(!f||!qe(f))){if((c=i()).lock!==u)return void st(e,t,n);delete c.lock,a(c),f=c}null===(r=e.after)||void 0===r||r.call(e,f||c),ut(t)}}else it.push(e)}function st(e,t,n){x((function(){at(e,t,n+1)}),rt)}function ut(e){nt=void 0;var t=it.shift();t&&at(t,e)}var ct=Q;function ft(e){var t=Je(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=Ce(),t="".concat(Xe).concat(e);localStorage.setItem(t,e);var n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:"LocalStorage"}:void 0}catch(e){return}}()),t}function lt(e,t,n){var r=new V,o=new V,i="Cookie"===e.type?Ke(e.cookieOptions):{isLockEnabled:!1,persistSession:Qe,retrieveSession:et,clearSession:tt},a=i.clearSession,s=i.retrieveSession,u=k((function(){at({process:function(e){return d(e)?void 0:{}},after:f},i)}),ct),c=function(){var e=s();if(d(e))return e;return{}}();function f(e){return d(e)||(e={}),l()&&(!function(e){return c.id!==e.id||c[t]!==e[t]}(e)?c=e:(c={},o.notify())),e}function l(){return void 0!==c[t]}function d(e){return(void 0===e.created||ne()-Number(e.created)<Re)&&(void 0===e.expire||ne()<Number(e.expire))}return{expandOrRenewSession:R((function(){var e;at({process:function(r){var o=f(r);return e=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=Ce(),e.created=String(ne()));return i}(o),o},after:function(t){e&&!l()&&function(e){c=e,r.notify()}(t),c=t}},i)}),ct).throttled,expandSession:function(){at({process:function(e){return l()?f(e):void 0}},i)},getSession:function(){return c},renewObservable:r,expireObservable:o,expire:function(){a(),f({})},stop:function(){T(u)}}}function dt(e){return pt(e,ht(window.location)).href}function pt(e,t){var n=function(){if(void 0===vt)try{var e=new gt("http://test/path");vt="http://test/path"===e.href}catch(e){vt=!1}return vt?gt:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw new Error("Failed to construct URL: ".concat(String(n)," ").concat(N({url:e,base:t})))}if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var r=document,o=r.createElement("a");if(void 0!==t){var i=(r=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(o)}return o.href=e,o}var vt,gt=URL;function ht(e){if(e.origin&&"null"!==e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return"".concat(e.protocol,"//").concat(t)}var yt="datad0g.com",mt="datadoghq.com";function bt(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if(r){var o=dt(r);return function(e){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(e)))}}var i=function(e){var t=e.site,n=void 0===t?mt:t,r=e.internalAnalyticsSubdomain;if(r&&n===mt)return"".concat(r,".").concat(mt);var o=n.split("."),i=o.pop();return"browser-intake-".concat(o.join("-"),".").concat(i)}(e);return function(e){return"https://".concat(i).concat(n,"?").concat(e)}}(e,t);return{build:function(o,i){var a=function(e,t,n,r,o){var i=e.clientToken,a=e.internalAnalyticsSubdomain,s=o.retry,u=o.flushReason,c=o.encoding,f=["sdk_version:".concat("5.3.0"),"api:".concat(r)].concat(n);u&&me(de.COLLECT_FLUSH_REASON)&&f.push("flush_reason:".concat(u));s&&f.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var l=["ddsource=browser","ddtags=".concat(encodeURIComponent(f.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.3.0")),"dd-evp-origin=browser","dd-request-id=".concat(Ce())];c&&l.push("dd-evp-encoding=".concat(c));"rum"===t&&l.push("batch_time=".concat(re()));a&&l.reverse();return l.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var Et=200;var wt=/[^a-z0-9_:./-]/;function St(e,t){var n=Et-e.length-1;(t.length>n||wt.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function Ct(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(St("env",t)),n&&i.push(St("service",n)),r&&i.push(St("version",r)),o&&i.push(St("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:bt(e,"logs",t),rumEndpointBuilder:bt(e,"rum",t),sessionReplayEndpointBuilder:bt(e,"replay",t)}}(e,t),r=h(n).map((function(e){return e.urlPrefix})),o=function(e,t,n){if(!e.replica)return;var r=m({},e,{site:mt,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:bt(r,"logs",n),rumEndpointBuilder:bt(r,"rum",n)};return t.push.apply(t,h(o).map((function(e){return e.urlPrefix}))),m({applicationId:e.replica.applicationId},o)}(e,r,t);return m({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||mt},n)}function _t(e){var t,n,r;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||we(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||we(e.telemetrySampleRate)){if(void 0===e.telemetryConfigurationSampleRate||we(e.telemetryConfigurationSampleRate))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return t=de,n=e,Object.keys(t).some((function(e){return t[e]===n}));var t,n})).forEach((function(e){ye.add(e)})),m({beforeSend:e.beforeSend&&i(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:ft(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,batchBytesLimit:16*E,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Q,batchMessagesLimit:50,messageBytesLimit:256*E},Ct(e));o.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else o.error("Telemetry Sample Rate should be a number between 0 and 100");else o.error("Session Sample Rate should be a number between 0 and 100");else o.error("Client Token is not configured, we will not send any data.")}var xt="?";function Ot(e){var t=[],n=Nt(e,"stack"),r=String(e);return n&&y(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=Rt.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=Lt.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||xt,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=At.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:xt,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=It.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||xt,line:+t[3],url:t[2]}}(e)||function(e){var t=Pt.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=Bt.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||xt,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=xt),t.push(n))})),{message:Nt(e,"message"),name:Nt(e,"name"),stack:t}}var kt="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Tt="(?::(\\d+))",Rt=new RegExp("^\\s*at (.*?) ?\\(".concat(kt).concat(Tt,"?").concat(Tt,"?\\)?\\s*$"),"i"),Lt=new RegExp("\\((\\S*)".concat(Tt).concat(Tt,"\\)"));var At=new RegExp("^\\s*at ?".concat(kt).concat(Tt,"?").concat(Tt,"??\\s*$"),"i");var It=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Pt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Bt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Nt(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function Ut(e,t,n,r){var o=[{url:t,column:r,line:n}],i=function(e){var t,n,r;"[object String]"==={}.toString.call(e)&&(n=(t=Dt.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var Dt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;var Mt="No stack, consider using an instance of Error";function qt(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,s=e.handling,u=n instanceof Error,c=function(e,t,n,r){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(N(j(r)))}(t,u,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(u,t)?Ht(t):Mt,l=u?function(e,t){var n=e,r=[];for(;(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=Ot(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&Ht(o)}),n=n.cause}return r.length?r:void 0}(n,a):void 0;return{startClocks:o,source:a,handling:s,handlingStack:r,originalError:n,type:null==t?void 0:t.name,message:c,stack:f,causes:l,fingerprint:jt(n)}}function jt(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Ht(e){var t=Gt(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function Gt(e){return"".concat(e.name||"Error",": ").concat(e.message)}var Ft={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Vt(e,t){var n=[];v(t,Ft.cspViolation)&&n.push(function(e){var t=new V((function(){return fe(e,document,Z.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=Ft.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Ft.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:zt(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(xe(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)}}(e))})).stop}));return t}(e));var r=t.filter((function(e){return e!==Ft.cspViolation}));return r.length&&n.push(function(e){var t=new V((function(){if(window.ReportingObserver){var n=l((function(e,n){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),stack:zt(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}));return t}(r)),z.apply(void 0,n)}function zt(e,t,n,r,o){return n?Ht({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var Wt=32*E;function Yt(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return v(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),g(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}var Jt={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},Kt=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$t={debug:"debug",error:"error",info:"info",warn:"warn"},Zt={console:"console",http:"http",silent:"silent"},Xt=Object.keys($t),Qt=function(){function e(e,t,n,r,o){void 0===n&&(n=Zt.http),void 0===r&&(r=$t.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager=K(3),this.contextManager.setContext(o),t&&this.contextManager.setContextProperty("logger",{name:t})}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=$t.info),null!=r){var i=qt({stackTrace:r instanceof Error?Ot(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Jt.LOGGER,handling:"handled",startClocks:ie()});o={stack:i.stack,kind:i.type,message:i.message}}var a=j(t),s=o?B({error:o},a):a;this.handleLogStrategy({message:j(e),context:s,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,$t.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,$t.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,$t.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,$t.error,n)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},Kt([f],e.prototype,"log",null),e}(),en="logs";function tn(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var nn,rn={log:"log",configuration:"configuration"},on=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],an=["ddog-gov.com"],sn={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function un(e,t){var n,r=new V;sn.telemetryEnabled=!v(an,t.site)&&Ee(t.telemetrySampleRate),sn.telemetryConfigurationEnabled=sn.telemetryEnabled&&Ee(t.telemetryConfigurationSampleRate);var o={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return nn=function(t){if(sn.telemetryEnabled){var i=function(e,t,r){return B({type:"telemetry",date:re(),service:e,version:"5.3.0",source:"browser",_dd:{format_version:2},telemetry:B(t,{runtime_env:r}),experimental_features:g(be())},void 0!==n?n():{})}(e,t,o);r.notify(i),tn("telemetry",i)}},a=fn,m(sn,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:sn.telemetryEnabled}}function cn(t,n){p(e.debug,t,n),ln(m({type:rn.log,message:t,status:"debug"},n))}function fn(e,t){ln(m({type:rn.log,status:"error"},function(e){if(e instanceof Error){var t=Ot(e);return{error:{kind:t.name,stack:Ht(dn(t))},message:t.message}}return{error:{stack:Mt},message:"".concat("Uncaught"," ").concat(N(e))}}(e),t))}function ln(e){nn&&sn.sentEventCount<sn.maxEventsPerPage&&(sn.sentEventCount+=1,nn(e))}function dn(e){return e.stack=e.stack.filter((function(e){return!e.url||on.some((function(t){return y(e.url,t)}))})),e}var pn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var vn="datadog-synthetics-public-id",gn="datadog-synthetics-result-id",hn="datadog-synthetics-injects-rum";function yn(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Be(hn))}function mn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Be(gn);return"string"==typeof e?e:void 0}var bn=function(){function e(e,t,n,r){var o=this;this.encoder=e,this.request=t,this.flushController=n,this.messageBytesLimit=r,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe((function(e){return o.flush(e)}))}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(e){var t=h(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,v(h(pn),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(En(i,e));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:C(a),flushReason:e.reason})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(t){o(En(t,e))}))},e.prototype.addOrUpdate=function(e,t){var n=N(e),r=this.encoder.estimateEncodedBytesCount(n);r>=this.messageBytesLimit?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.push(n,r,t))},e.prototype.push=function(e,t,n){var r=this;this.flushController.notifyBeforeAddMessage(t),void 0!==n?(this.upsertBuffer[n]=e,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?e:"\n".concat(e),(function(e){r.flushController.notifyAfterAddMessage(e-t)}))},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.encoder.estimateEncodedBytesCount(t);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e}();function En(e,t){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding,flushReason:t.reason}}function wn(e){return e>=500}var Sn=80*E,Cn=32,_n=3*w,xn=ee,On=Q;function kn(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Rn(e,t,n,{onSuccess:function(){return Ln(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Tn(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Tn(e,t,n,r){2===e.transportStatus&&x((function(){Rn(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=On,Ln(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(xn,2*e.currentBackoffTime),Tn(e,t,n,r)}})}),e.currentBackoffTime)}function Rn(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||wn(e.status))}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},i())}))}function Ln(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(_n/w,"MiB"),source:Jt.AGENT,startClocks:ie()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=An();i.size()>0;)kn(i.dequeue(),t,n,r,o)}function An(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=_n}}}function In(e,t,n,r){var o={transportStatus:0,currentBackoffTime:On,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=Sn&&this.ongoingRequestCount<Cn},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:An(),queueFullReported:!1},i=function(r,o){return function(e,t,n,r,o){var i=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&r.bytesCount<n;if(i){var a=t.build("fetch",r);fetch(a,{method:"POST",body:r.data,keepalive:!0,mode:"cors"}).then(l((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),l((function(){var n=t.build("xhr",r);Bn(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Bn(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){kn(e,o,i,t.trackType,r)},sendOnExit:function(r){!function(e,t,n,r){var o=!!navigator.sendBeacon&&r.bytesCount<n;if(o)try{var i=t.build("beacon",r);if(navigator.sendBeacon(i,r.data))return}catch(e){!function(e){Pn||(Pn=!0,fn(e))}(e)}var a=t.build("xhr",r);Bn(e,a,r.data)}(e,t,n,r)}}}var Pn=!1;function Bn(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),fe(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Nn(e){var t,n=e.messagesLimit,r=e.bytesLimit,o=e.durationLimit,i=e.pageExitObservable,a=e.sessionExpireObservable,s=i.subscribe((function(e){return d(e.reason)})),u=a.subscribe((function(){return d("session_expire")})),c=new V((function(){return function(){s.unsubscribe(),u.unsubscribe()}})),f=0,l=0;function d(e){if(0!==l){var t=l,n=f;l=0,f=0,p(),c.notify({reason:e,messagesCount:t,bytesCount:n})}}function p(){O(t),t=void 0}return{flushObservable:c,get messagesCount(){return l},notifyBeforeAddMessage:function(e){f+e>=r&&d("bytes_limit"),l+=1,f+=e,void 0===t&&(t=x((function(){d("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),f+=e,l>=n?d("messages_limit"):f>=r&&d("bytes_limit")},notifyAfterRemoveMessage:function(e){f-=e,0===(l-=1)&&p()}}}function Un(e,t,n,r,o,i){var a=u(e,t),s=n&&u(e,n);function u(e,t){var n=t.endpoint,a=t.encoder;return new bn(a,In(e,n,e.batchBytesLimit,r),Nn({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),e.messageBytesLimit)}return{flushObservable:a.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),a.add(e),s&&t&&s.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){a.upsert(e,t),s&&s.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){a.stop(),null==s||s.stop()}}}function Dn(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=C(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}var Mn=1/0,qn=ee,jn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=k((function(){return n.clearOldValues()}),qn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:Mn,remove:function(){var e=n.entries.indexOf(r);e>=0&&n.entries.splice(e,1)},close:function(e){r.endTime=e}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=Mn);for(var t=0,n=this.entries;t<n.length;t++){var r=n[t];if(r.startTime<=e){if(e<=r.endTime)return r.value;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===Mn&&t.close(e)},e.prototype.findAll=function(e,t){void 0===e&&(e=Mn),void 0===t&&(t=0);var n=ae(e,t);return this.entries.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){T(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var e=oe()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}(),Hn=ee,Gn=Re,Fn=[];function Vn(e,t,n){var r=lt(e.sessionStoreStrategyType,t,n);Fn.push((function(){return r.stop()}));var o=new jn(Gn);function i(){return{id:r.getSession().id,trackingType:r.getSession()[t]}}return Fn.push((function(){return o.stop()})),r.renewObservable.subscribe((function(){o.add(i(),oe())})),r.expireObservable.subscribe((function(){o.closeActive(oe())})),r.expandOrRenewSession(),o.add(i(),[0,se()][0]),function(e,t){var n=le(e,window,[Z.CLICK,Z.TOUCH_START,Z.KEY_DOWN,Z.SCROLL],t,{capture:!0,passive:!0}).stop;Fn.push(n)}(e,(function(){return r.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=fe(e,document,Z.VISIBILITY_CHANGE,n).stop;Fn.push(r);var o=k(n,Hn);Fn.push((function(){T(o)}))}(e,(function(){return r.expandSession()})),{findActiveSession:function(e){return o.find(e)},renewObservable:r.renewObservable,expireObservable:r.expireObservable,expire:r.expire}}var zn="logs";function Wn(e){var t=Vn(e,zn,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Yn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&"1"===n.trackingType?{id:n.id}:void 0},expireObservable:t.expireObservable}}function Yn(e){return Ee(e.sessionSampleRate)?"1":"0"}function Jn(e,t,n,r,o){var i=Xt.concat(["custom"]),a={};i.forEach((function(e){var n,r,i,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,i=o,s=0,u=!1,{isLimitReached:function(){if(0===s&&x((function(){s=0}),ee),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{i({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:Jt.AGENT,startClocks:ie()})}finally{u=!1}}return!0}})})),n.subscribe(0,(function(o){var i,s,u=o.rawLogsEvent,c=o.messageContext,f=void 0===c?void 0:c,l=o.savedCommonContext,d=void 0===l?void 0:l,p=u.date-se(),v=e.findTrackedSession(p);if(v){var g=d||r(),h=B({service:t.service,session_id:v.id,usr:Se(g.user)?void 0:g.user,view:g.view},g.context,$n(p),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,h))||h.origin!==Jt.AGENT&&(null!==(s=a[h.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,h)}}))}var Kn=!1;function $n(e){var t,n=window;if(yn()){var r=o(n.DD_RUM_SYNTHETICS);return r||Kn||(Kn=!0,cn("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Be(vn),"string"==typeof t?t:void 0),resultId:mn()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}var Zn,Xn={};function Qn(n){var r=n.map((function(n){return Xn[n]||(Xn[n]=function(n){var r=new V((function(){var o=t[n];return t[n]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];o.apply(console,t);var a=function(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return d((function(){var n=Ot(t);n.stack=n.stack.slice(2),e=Ht(n)})),e}();d((function(){r.notify(function(t,n,r){var o,i,a=t.map((function(e){return function(e){if("string"==typeof e)return j(e);if(e instanceof Error)return Gt(Ot(e));return N(j(e),void 0,2)}(e)})).join(" ");if(n===e.error){var s=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}(t,(function(e){return e instanceof Error}));o=s?Ht(Ot(s)):void 0,i=jt(s)}return{api:n,message:a,stack:o,handlingStack:r,fingerprint:i}}(t,n,a))}))},function(){t[n]=o}}));return r}(n)),Xn[n]}));return z.apply(void 0,r)}var er,tr=((Zn={})[e.log]=$t.info,Zn[e.debug]=$t.debug,Zn[e.info]=$t.info,Zn[e.warn]=$t.warn,Zn[e.error]=$t.error,Zn);var nr,rr=((er={})[Ft.cspViolation]=$t.error,er[Ft.intervention]=$t.error,er[Ft.deprecation]=$t.warn,er);function or(e,t,n){var r=e[t],o=n(r),i=function(){if("function"==typeof o)return o.apply(this,arguments)};return e[t]=i,{stop:function(){e[t]===i?e[t]=r:o=r}}}function ir(e,t,n){var r=n.before,o=n.after;return or(e,t,(function(e){return function(){var t,n=arguments;return r&&d(r,this,n),"function"==typeof e&&(t=e.apply(this,n)),o&&d(o,this,n),t}}))}var ar,sr=new WeakMap;function ur(e){return nr||(nr=function(e){var t=new V((function(){var n=ir(XMLHttpRequest.prototype,"open",{before:cr}).stop,r=ir(XMLHttpRequest.prototype,"send",{before:function(){fr.call(this,e,t)}}).stop,o=ir(XMLHttpRequest.prototype,"abort",{before:lr}).stop;return function(){n(),r(),o()}}));return t}(e)),nr}function cr(e,t){sr.set(this,{state:"open",method:e.toUpperCase(),url:dt(String(t))})}function fr(e,t){var n=this,r=sr.get(this);if(r){var o=r;o.state="start",o.startClocks=ie(),o.isAborted=!1,o.xhr=this;var i=!1,a=ir(this,"onreadystatechange",{before:function(){this.readyState===XMLHttpRequest.DONE&&s()}}).stop,s=function(){if(u(),a(),!i){i=!0;var e,s=r;s.state="complete",s.duration=(e=o.startClocks.timeStamp,re()-e),s.status=n.status,t.notify(m({},s))}},u=fe(e,this,"loadend",s).stop;t.notify(o)}}function lr(){var e=sr.get(this);e&&(e.isAborted=!0)}function dr(){var e;return ar||(e=new V((function(){if(window.fetch)return or(window,"fetch",(function(t){return function(n,r){var o,i=d(pr,null,[e,n,r]);return i?(o=t.call(this,i.input,i.init),d(vr,null,[e,o,i])):o=t.call(this,n,r),o}})).stop})),ar=e),ar}function pr(e,t,n){var r=n&&n.method||t instanceof Request&&t.method,o=r?r.toUpperCase():"GET",i=t instanceof Request?t.url:dt(String(t)),a={state:"start",init:n,input:t,method:o,startClocks:ie(),url:i};return e.notify(a),a}function vr(e,t,n){var r=function(t){var r=n;r.state="resolve","stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1),e.notify(r)};t.then(l(r),l(r))}function gr(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=ur(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=dr().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(yr(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:$t.error,origin:Jt.NETWORK}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!wn(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(hr(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,a;if(r.cancel().catch(L),n.collectStreamBody){var s;if(1===o.length)s=o[0];else{s=new Uint8Array(i);var u=0;o.forEach((function(e){s.set(e,u),u+=e.length}))}e=s.slice(0,n.bytesLimit),a=s.length>n.bytesLimit}t(void 0,e,a)}!function e(){r.read().then(l((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),l((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(l((function(e){return n(hr(e,t))})),l((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(hr(Ht(Ot(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function hr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function yr(e){return"xhr"===e?"XHR":"Fetch"}function mr(e){var t,n=function(t,n){var r=qt({stackTrace:t,originalError:n,startClocks:ie(),nonErrorPrefix:"Uncaught",source:Jt.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,ir(window,"onerror",{before:function(e,n,r,o,i){var a;a=i instanceof Error?Ot(i):Ut(e,n,r,o),t(a,null!=i?i:e)}})).stop,o=function(e){return ir(window,"onunhandledrejection",{before:function(t){var n=t.reason||"Empty reason",r=Ot(n);e(r,n)}})}(n).stop;return{stop:function(){r(),o()}}}var br,Er=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}(),wr=((br={})[$t.debug]=0,br[$t.info]=1,br[$t.warn]=2,br[$t.error]=3,br);function Sr(e){return{handleLog:function(r,o,i,a){var s=B(o.getContext(),r.context);Cr(r.status,Zt.console,o)&&function(e,r){n[e.status].call(t,e.message,r)}(r,s),Cr(r.status,Zt.http,o)&&e.notify(0,{rawLogsEvent:{date:a||re(),message:r.message,status:r.status,origin:Jt.LOGGER},messageContext:s,savedCommonContext:i})}}}function Cr(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return wr[e]>=wr[n.getLevel()]&&v(o,t)}var _r,xr,Or,kr,Tr=function(t){var n,r,i=!1,a=K(2),s=K(1),u={},f=function(){},d=new X,p=function(e,t,n,r){void 0===n&&(n=P(b())),void 0===r&&(r=re()),d.add((function(){return p(e,t,n,r)}))},g=function(){},y=new Qt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.apply(void 0,e)}));function b(){return{view:{referrer:document.referrer,url:window.location.href},context:a.getContext(),user:s.getContext()}}return n={logger:y,init:l((function(n){var r;if(n){if(g=function(){return P(n)},ce()&&(n=function(e){return m({},e,{clientToken:"empty"})}(n)),function(e){return!i||(e.silentMultipleInit||o.error("DD_LOGS is already initialized."),!1)}(n)){var u=function(t){var n=_t(t),r=Yt(t.forwardConsoleLogs,h(e),"Forward Console Logs"),o=Yt(t.forwardReports,h(Ft),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!v(r,e.error)&&r.push(e.error),m({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:Wt},n)}(n);if(u){if(n.storeContextsAcrossPages){var c=a.getContext();(a=ge(u,en,2)).setContext(B(a.getContext(),c));var l=s.getContext();(s=ge(u,en,1)).setContext(B(s.getContext(),l))}r=t(n,u,b),p=r.handleLog,f=r.getInternalContext,d.drain(),i=!0}}}else o.error("Missing configuration")})),getGlobalContext:l((function(){return a.getContext()})),setGlobalContext:l((function(e){return a.setContext(e)})),setGlobalContextProperty:l((function(e,t){return a.setContextProperty(e,t)})),removeGlobalContextProperty:l((function(e){return a.removeContextProperty(e)})),clearGlobalContext:l((function(){return a.clearContext()})),createLogger:l((function(e,t){return void 0===t&&(t={}),u[e]=new Qt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.apply(void 0,e)}),j(e),t.handler,t.level,j(t.context)),u[e]})),getLogger:l((function(e){return u[e]})),getInitConfiguration:l((function(){return g()})),getInternalContext:l((function(e){return f(e)})),setUser:l((function(e){(function(e){var t="object"===A(e);return t||o.error("Unsupported user:",e),t})(e)&&s.setContext(he(e))})),getUser:l((function(){return s.getContext()})),setUserProperty:l((function(e,t){var n,r=he((n={},n[e]=t,n))[e];s.setContextProperty(e,r)})),removeUserProperty:l((function(e){return s.removeContextProperty(e)})),clearUser:l((function(){return s.clearContext()}))},r=m({version:"5.3.0",onReady:function(e){e()}},n),Object.defineProperty(r,"_setDebug",{get:function(){return c},enumerable:!1}),r}((function(t,n,r){var o=new Er,i=[];o.subscribe(1,(function(e){return tn("logs",e)}));var a=function(e){o.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Jt.AGENT,status:$t.error}}),cn("Error reported to customer",{"error.message":e.message})},s=function(e){var t=new V((function(){var n=me(de.PAGEHIDE),r=le(e,window,[Z.VISIBILITY_CHANGE,Z.FREEZE,Z.PAGE_HIDE],(function(e){e.type===Z.PAGE_HIDE&&n?t.notify({reason:pn.PAGEHIDE}):e.type===Z.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:pn.HIDDEN}):e.type===Z.FREEZE&&t.notify({reason:pn.FROZEN})}),{capture:!0}).stop,o=L;return n||(o=fe(e,window,Z.BEFORE_UNLOAD,(function(){t.notify({reason:pn.UNLOADING})})).stop),function(){r(),o()}}));return t}(n),u=!n.sessionStoreStrategyType||ce()||yn()?function(e){var t="1"===Yn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new V}}(n):Wn(n),c=function(e,t,n,r){var o=un("browser-logs-sdk",e),i=[];if(ce()){var a=ue(),s=o.observable.subscribe((function(e){return a.send("internal_telemetry",e)}));i.push((function(){return s.unsubscribe()}))}else{var u=Un(e,{endpoint:e.rumEndpointBuilder,encoder:Dn()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:Dn()},t,n,r);i.push((function(){return u.stop()}));var c=o.observable.subscribe((function(t){return u.add(t,function(e){return e.site===yt}(e))}));i.push((function(){return c.unsubscribe()}))}return{telemetry:o,stop:function(){i.forEach((function(e){return e()}))}}}(n,a,s,u.expireObservable),f=c.telemetry,l=c.stop;i.push((function(){return l()})),f.setContextProvider((function(){var e,t,n,r,o,i;return{application:{id:null===(e=$n())||void 0===e?void 0:e.application_id},session:{id:null===(t=u.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=$n())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(i=null===(o=$n())||void 0===o?void 0:o.user_action)||void 0===i?void 0:i.id}}})),gr(n,o),function(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=new V,r=mr(n).stop,o=n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack},origin:Jt.SOURCE,status:$t.error}})}))}(n,o),function(t,n){var r=Qn(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:re(),message:t.message,origin:Jt.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint}:void 0,status:tr[t.api]}})}))}(n,o),function(e,t){var n=Vt(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=rr[e.type];o===$t.error?n={kind:e.subtype,stack:e.stack}:e.stack&&(r+=" Found in ".concat(function(e){var t;return null===(t=/@ (.+)/.exec(e))||void 0===t?void 0:t[1]}(e.stack))),t.notify(0,{rawLogsEvent:{date:re(),message:r,origin:Jt.REPORT,error:n,status:o}})}))}(n,o);var d,p=Sr(o).handleLog;if(Jn(u,n,o,r,a),ce())!function(e){var t=ue();e.subscribe(1,(function(e){t.send("log",e)}))}(o);else{var v=function(e,t,n,r,o){var i=Un(e,{endpoint:e.logsEndpointBuilder,encoder:Dn()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Dn()},n,r,o);return t.subscribe(1,(function(e){i.add(e)})),i}(n,o,a,s,u.expireObservable).stop;i.push((function(){return v()}))}return function(e){sn.telemetryConfigurationEnabled&&ln({type:rn.configuration,configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents};return m({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},n)}(t)),{handleLog:p,getInternalContext:(d=u,{get:function(e){var t=d.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop:function(){i.forEach((function(e){return e()}))}}}));_r=b(),Or=Tr,kr=_r[xr="DD_LOGS"],_r[xr]=Or,kr&&kr.q&&kr.q.forEach((function(e){return i(e,"onReady callback threw an error:")()}))}();
!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((function(e){n[e]=t[e]}));var r="Datadog Browser SDK:",o={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)};function i(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return e.apply(void 0,n)}catch(e){o.error(t,e)}}}var a,s=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},u=!1;function c(e){u=e}function f(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(a?l(r):r).apply(this,e)}}function l(e){return function(){return d(e,this,arguments)}}function d(e,t,n){try{return e.apply(t,n)}catch(e){if(p(e),a)try{a(e)}catch(e){p(e)}}}function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&o.error.apply(o,s(["[MONITOR]"],e,!1))}function v(e,t){return-1!==e.indexOf(t)}function g(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){return t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function h(e){return Object.keys(e).map((function(t){return e[t]}))}function y(e,t){return e.slice(0,t.length)===t}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function b(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}var E=1024,w=1024*E,S=/[^\u0000-\u007F]/;function C(e){return S.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function _(e,t){var n,r=b();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function x(e,t){return _(b(),"setTimeout")(l(e),t)}function O(e){_(b(),"clearTimeout")(e)}function k(e,t){return _(b(),"setInterval")(l(e),t)}function T(e){_(b(),"clearInterval")(e)}function R(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,s=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];s?r=n:(i?e.apply(void 0,n):r=n,s=!0,o=x((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){O(o),s=!1,r=void 0}}}function L(){}function A(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function I(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=I(o[i],t[i],n);return o}var a="object"===A(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=I(a[s],t[s],n));return a}}function P(e){return I(void 0,e)}function N(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];null!=i&&(e=I(e,i))}return e}function B(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=U(Object.prototype),o=U(Array.prototype),i=U(Object.getPrototypeOf(e)),a=U(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function U(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):L}var D=220*E,M="$",q=3;function j(e,t){var n;void 0===t&&(t=D);var r=U(Object.prototype),o=U(Array.prototype),i=[],a=new WeakMap,s=H(e,M,void 0,i,a),u=(null===(n=JSON.stringify(s))||void 0===n?void 0:n.length)||0;if(!(u>t)){for(;i.length>0&&u<t;){var c=i.shift(),f=0;if(Array.isArray(c.source))for(var l=0;l<c.source.length;l++){if(u+=void 0!==(d=H(c.source[l],c.path,l,i,a))?JSON.stringify(d).length:4,u+=f,f=1,u>t){G(t,"truncated",e);break}c.target[l]=d}else for(var l in c.source)if(Object.prototype.hasOwnProperty.call(c.source,l)){var d;if(void 0!==(d=H(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+q,f=1),u>t){G(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}G(t,"discarded",e)}function H(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!=typeof i)return function(e){if("bigint"==typeof e)return"[BigInt] ".concat(e.toString());if("function"==typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"==typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(i);var a=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;var s=e;if(o.has(s))return"[Reference seen at ".concat(o.get(s),"]");var u=void 0!==n?"".concat(t,".").concat(n):t,c=Array.isArray(i)?[]:{};return o.set(s,u),r.push({source:i,target:c,path:u}),c}function G(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var F,V=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new V((function(){var t=e.map((function(e){return e.subscribe((function(e){return n.notify(e)}))}));return function(){return t.forEach((function(e){return e.unsubscribe()}))}}));return n}var Y=3*E,J=((F={})[0]="feature flag evaluation",F[1]="user",F[2]="global context",F[3]="logger context",F);var W=200;function K(e,t){void 0===t&&(t=C);var n,r={},i=!1,a=new V,s=R((function(r){n=t(B(r)),i||(i=function(e,t){return e>Y&&(o.warn("The ".concat(J[t]," data exceeds the recommended ").concat(Y/E,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-3kib-warning")),!0)}(n,e))}),W).throttled,u={getBytesCount:function(){return n},getContext:function(){return P(r)},setContext:function(e){"object"===A(e)?(r=j(e),s(r)):u.clearContext(),a.notify()},setContextProperty:function(e,t){r[e]=j(t),s(r),a.notify()},removeContextProperty:function(e){delete r[e],s(r),a.notify()},clearContext:function(){r={},n=0,a.notify()},changeObservable:a};return u}var $,Z,X=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),Q=1e3,ee=60*Q,te=60*ee;function ne(){return(new Date).getTime()}function re(){return ne()}function oe(){return performance.now()}function ie(){return{relative:oe(),timeStamp:re()}}function ae(e,t){return e+t}function se(){return void 0===$&&($=performance.timing.navigationStart),$}function ue(){var e=b().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function ce(e){var t;void 0===e&&(e=null===(t=b().location)||void 0===t?void 0:t.hostname);var n=ue();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function fe(e,t,n,r,o){return le(e,t,[n],r,o)}function le(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,u=i.passive,c=l((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&p(),r(t))})),f=u?{capture:s,passive:u}:s,d=_(t,"addEventListener");function p(){var e=_(t,"removeEventListener");n.forEach((function(n){return e.call(t,n,c,f)}))}return n.forEach((function(e){return d.call(t,e,c,f)})),{stop:p}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.DBL_CLICK="dblclick",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.TOUCH_MOVE="touchmove",e.VISIBILITY_CHANGE="visibilitychange",e.PAGE_SHOW="pageshow",e.FREEZE="freeze",e.RESUME="resume",e.DOM_CONTENT_LOADED="DOMContentLoaded",e.POINTER_DOWN="pointerdown",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.HASH_CHANGE="hashchange",e.PAGE_HIDE="pagehide",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.MOUSE_MOVE="mousemove",e.FOCUS="focus",e.BLUR="blur",e.CONTEXT_MENU="contextmenu",e.RESIZE="resize",e.CHANGE="change",e.INPUT="input",e.PLAY="play",e.PAUSE="pause",e.SECURITY_POLICY_VIOLATION="securitypolicyviolation",e.SELECTION_CHANGE="selectionchange",e.STORAGE="storage"}(Z||(Z={}));var de,pe="_dd_c",ve=[];function ge(e,t,n,r){void 0===r&&(r=C);var o=function(e,t){return"".concat(pe,"_").concat(e,"_").concat(t)}(t,n),i=K(n,r);return a(),ve.push(fe(e,window,Z.STORAGE,(function(e){var t=e.key;o===t&&a()}))),i.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(i.getContext()))})),i;function a(){var e=localStorage.getItem(o),t=null!==e?JSON.parse(e):{};i.setContext(t)}}function he(e){var t=m({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}!function(e){e.PAGEHIDE="pagehide",e.FEATURE_FLAGS="feature_flags",e.RESOURCE_PAGE_STATES="resource_page_states",e.COLLECT_FLUSH_REASON="collect_flush_reason",e.SCROLLMAP="scrollmap",e.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css"}(de||(de={}));var ye=new Set;function me(e){return ye.has(e)}function be(){return ye}function Ee(e){return 0!==e&&100*Math.random()<=e}function we(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Se(e){return 0===Object.keys(e).length}function Ce(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,Ce)}var _e=/([\w-]+)\s*=\s*([^;]+)/g;function xe(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}var Oe,ke,Te,Re=4*te,Le=15*ee;function Ae(){return null!=Oe?Oe:Oe=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return 1;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 2;if(e.document.documentMode)return 0;return 3}()}function Ie(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(u)}function Pe(e){return function(e,t){for(_e.lastIndex=0;;){var n=_e.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Ne(e){return ke||(ke=function(e){var t=new Map;for(_e.lastIndex=0;;){var n=_e.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),ke.get(e)}function Be(e,t){Ie(e,"",0,t)}var Ue="_dd_s",De=/^([a-z]+)=([a-z0-9-]+)$/,Me="&";function qe(e){return Se(e)}function je(e){e.expire=String(ne()+Le)}function He(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(Me);var t}function Ge(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(Me)||De.test(e))}(e)&&e.split(Me).forEach((function(e){var n=De.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var Fe="_dd",Ve="_dd_r",ze="_dd_l",Ye="rum",Je="logs";function We(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===Te){for(var e="dd_site_test_".concat(Ce()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Pe(e);)n="".concat(t.pop(),".").concat(n),Ie(e,"test",Q,{domain:n});Be(e,{domain:n}),Te=n}return Te}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(Ce()),n="test";Ie(t,n,ee,e);var r=Pe(t)===n;return Be(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function Ke(e){var t,n={isLockEnabled:1===Ae(),persistSession:(t=e,function(e){Ie(Ue,He(e),Le,t)}),retrieveSession:$e,clearSession:Ze(e)};return function(e){if(!Ne(Ue)){var t=Ne(Fe),n=Ne(Ve),r=Ne(ze),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[Je]=r),n&&/^[012]$/.test(n)&&(o[Ye]=n),qe(o)||(je(o),e.persistSession(o))}}(n),n}function $e(){return Ge(Pe(Ue))}function Ze(e){return function(){Be(Ue,e)}}var Xe="_dd_test_";function Qe(e){localStorage.setItem(Ue,He(e))}function et(){return Ge(localStorage.getItem(Ue))}function tt(){localStorage.removeItem(Ue)}var nt,rt=10,ot=100,it=[];function at(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.retrieveSession,a=t.persistSession,s=t.clearSession;if(nt||(nt=e),e===nt)if(o&&n>=ot)ut(t);else{var u,c=i();if(o){if(c.lock)return void st(e,t,n);if(u=Ce(),c.lock=u,a(c),(c=i()).lock!==u)return void st(e,t,n)}var f=e.process(c);if(o&&(c=i()).lock!==u)st(e,t,n);else{if(f&&(qe(f)?s():(je(f),a(f))),o&&(!f||!qe(f))){if((c=i()).lock!==u)return void st(e,t,n);delete c.lock,a(c),f=c}null===(r=e.after)||void 0===r||r.call(e,f||c),ut(t)}}else it.push(e)}function st(e,t,n){x((function(){at(e,t,n+1)}),rt)}function ut(e){nt=void 0;var t=it.shift();t&&at(t,e)}var ct=Q;function ft(e){var t=We(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=Ce(),t="".concat(Xe).concat(e);localStorage.setItem(t,e);var n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:"LocalStorage"}:void 0}catch(e){return}}()),t}function lt(e,t,n){var r=new V,o=new V,i="Cookie"===e.type?Ke(e.cookieOptions):{isLockEnabled:!1,persistSession:Qe,retrieveSession:et,clearSession:tt},a=i.clearSession,s=i.retrieveSession,u=k((function(){at({process:function(e){return d(e)?void 0:{}},after:f},i)}),ct),c=function(){var e=s();if(d(e))return e;return{}}();function f(e){return d(e)||(e={}),l()&&(!function(e){return c.id!==e.id||c[t]!==e[t]}(e)?c=e:(c={},o.notify())),e}function l(){return void 0!==c[t]}function d(e){return(void 0===e.created||ne()-Number(e.created)<Re)&&(void 0===e.expire||ne()<Number(e.expire))}return{expandOrRenewSession:R((function(){var e;at({process:function(r){var o=f(r);return e=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=Ce(),e.created=String(ne()));return i}(o),o},after:function(t){e&&!l()&&function(e){c=e,r.notify()}(t),c=t}},i)}),ct).throttled,expandSession:function(){at({process:function(e){return l()?f(e):void 0}},i)},getSession:function(){return c},renewObservable:r,expireObservable:o,expire:function(){a(),f({})},stop:function(){T(u)}}}function dt(e){return pt(e,ht(window.location)).href}function pt(e,t){var n=function(){if(void 0===vt)try{var e=new gt("http://test/path");vt="http://test/path"===e.href}catch(e){vt=!1}return vt?gt:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw new Error("Failed to construct URL: ".concat(String(n)," ").concat(B({url:e,base:t})))}if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var r=document,o=r.createElement("a");if(void 0!==t){var i=(r=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(o)}return o.href=e,o}var vt,gt=URL;function ht(e){if(e.origin&&"null"!==e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return"".concat(e.protocol,"//").concat(t)}var yt="datad0g.com",mt="datadoghq.com";function bt(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=dt(r);return function(e){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(e)))}}if("function"==typeof r)return function(e){return r({path:n,parameters:e})};var i=function(e){var t=e.site,n=void 0===t?mt:t,r=e.internalAnalyticsSubdomain;if(r&&n===mt)return"".concat(r,".").concat(mt);var o=n.split("."),i=o.pop();return"browser-intake-".concat(o.join("-"),".").concat(i)}(e);return function(e){return"https://".concat(i).concat(n,"?").concat(e)}}(e,t);return{build:function(o,i){var a=function(e,t,n,r,o){var i=e.clientToken,a=e.internalAnalyticsSubdomain,s=o.retry,u=o.flushReason,c=o.encoding,f=["sdk_version:".concat("5.4.0"),"api:".concat(r)].concat(n);u&&me(de.COLLECT_FLUSH_REASON)&&f.push("flush_reason:".concat(u));s&&f.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var l=["ddsource=browser","ddtags=".concat(encodeURIComponent(f.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.4.0")),"dd-evp-origin=browser","dd-request-id=".concat(Ce())];c&&l.push("dd-evp-encoding=".concat(c));"rum"===t&&l.push("batch_time=".concat(re()));a&&l.reverse();return l.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var Et=200;var wt=/[^a-z0-9_:./-]/;function St(e,t){var n=Et-e.length-1;(t.length>n||wt.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function Ct(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(St("env",t)),n&&i.push(St("service",n)),r&&i.push(St("version",r)),o&&i.push(St("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:bt(e,"logs",t),rumEndpointBuilder:bt(e,"rum",t),sessionReplayEndpointBuilder:bt(e,"replay",t)}}(e,t),r=h(n).map((function(e){return e.urlPrefix})),o=function(e,t,n){if(!e.replica)return;var r=m({},e,{site:mt,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:bt(r,"logs",n),rumEndpointBuilder:bt(r,"rum",n)};return t.push.apply(t,h(o).map((function(e){return e.urlPrefix}))),m({applicationId:e.replica.applicationId},o)}(e,r,t);return m({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||mt},n)}function _t(e){var t,n,r;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||we(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||we(e.telemetrySampleRate)){if(void 0===e.telemetryConfigurationSampleRate||we(e.telemetryConfigurationSampleRate))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return t=de,n=e,Object.keys(t).some((function(e){return t[e]===n}));var t,n})).forEach((function(e){ye.add(e)})),m({beforeSend:e.beforeSend&&i(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:ft(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,batchBytesLimit:16*E,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Q,batchMessagesLimit:50,messageBytesLimit:256*E},Ct(e));o.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else o.error("Telemetry Sample Rate should be a number between 0 and 100");else o.error("Session Sample Rate should be a number between 0 and 100");else o.error("Client Token is not configured, we will not send any data.")}var xt="?";function Ot(e){var t=[],n=Bt(e,"stack"),r=String(e);return n&&y(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=Rt.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=Lt.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||xt,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=At.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:xt,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=It.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||xt,line:+t[3],url:t[2]}}(e)||function(e){var t=Pt.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=Nt.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||xt,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=xt),t.push(n))})),{message:Bt(e,"message"),name:Bt(e,"name"),stack:t}}var kt="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Tt="(?::(\\d+))",Rt=new RegExp("^\\s*at (.*?) ?\\(".concat(kt).concat(Tt,"?").concat(Tt,"?\\)?\\s*$"),"i"),Lt=new RegExp("\\((\\S*)".concat(Tt).concat(Tt,"\\)"));var At=new RegExp("^\\s*at ?".concat(kt).concat(Tt,"?").concat(Tt,"??\\s*$"),"i");var It=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Pt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Nt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Bt(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function Ut(e,t,n,r){var o=[{url:t,column:r,line:n}],i=function(e){var t,n,r;"[object String]"==={}.toString.call(e)&&(n=(t=Dt.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var Dt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;var Mt="No stack, consider using an instance of Error";function qt(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,s=e.handling,u=n instanceof Error,c=function(e,t,n,r){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(B(j(r)))}(t,u,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(u,t)?Ht(t):Mt,l=u?function(e,t){var n=e,r=[];for(;(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=Ot(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&Ht(o)}),n=n.cause}return r.length?r:void 0}(n,a):void 0;return{startClocks:o,source:a,handling:s,handlingStack:r,originalError:n,type:null==t?void 0:t.name,message:c,stack:f,causes:l,fingerprint:jt(n)}}function jt(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Ht(e){var t=Gt(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function Gt(e){return"".concat(e.name||"Error",": ").concat(e.message)}var Ft={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Vt(e,t){var n=[];v(t,Ft.cspViolation)&&n.push(function(e){var t=new V((function(){return fe(e,document,Z.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=Ft.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Ft.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:zt(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(xe(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)}}(e))})).stop}));return t}(e));var r=t.filter((function(e){return e!==Ft.cspViolation}));return r.length&&n.push(function(e){var t=new V((function(){if(window.ReportingObserver){var n=l((function(e,n){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),stack:zt(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}));return t}(r)),z.apply(void 0,n)}function zt(e,t,n,r,o){return n?Ht({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var Yt=32*E;function Jt(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return v(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),g(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}var Wt={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},Kt=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$t={debug:"debug",error:"error",info:"info",warn:"warn"},Zt={console:"console",http:"http",silent:"silent"},Xt=Object.keys($t),Qt=function(){function e(e,t,n,r,o){void 0===n&&(n=Zt.http),void 0===r&&(r=$t.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager=K(3),this.contextManager.setContext(o),t&&this.contextManager.setContextProperty("logger",{name:t})}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=$t.info),null!=r){var i=qt({stackTrace:r instanceof Error?Ot(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Wt.LOGGER,handling:"handled",startClocks:ie()});o={stack:i.stack,kind:i.type,message:i.message}}var a=j(t),s=o?N({error:o},a):a;this.handleLogStrategy({message:j(e),context:s,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,$t.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,$t.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,$t.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,$t.error,n)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},Kt([f],e.prototype,"log",null),e}(),en="logs";function tn(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var nn,rn={log:"log",configuration:"configuration"},on=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],an=["ddog-gov.com"],sn={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function un(e,t){var n,r=new V;sn.telemetryEnabled=!v(an,t.site)&&Ee(t.telemetrySampleRate),sn.telemetryConfigurationEnabled=sn.telemetryEnabled&&Ee(t.telemetryConfigurationSampleRate);var o={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return nn=function(t){if(sn.telemetryEnabled){var i=function(e,t,r){return N({type:"telemetry",date:re(),service:e,version:"5.4.0",source:"browser",_dd:{format_version:2},telemetry:N(t,{runtime_env:r}),experimental_features:g(be())},void 0!==n?n():{})}(e,t,o);r.notify(i),tn("telemetry",i)}},a=fn,m(sn,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:sn.telemetryEnabled}}function cn(t,n){p(e.debug,t,n),ln(m({type:rn.log,message:t,status:"debug"},n))}function fn(e,t){ln(m({type:rn.log,status:"error"},function(e){if(e instanceof Error){var t=Ot(e);return{error:{kind:t.name,stack:Ht(dn(t))},message:t.message}}return{error:{stack:Mt},message:"".concat("Uncaught"," ").concat(B(e))}}(e),t))}function ln(e){nn&&sn.sentEventCount<sn.maxEventsPerPage&&(sn.sentEventCount+=1,nn(e))}function dn(e){return e.stack=e.stack.filter((function(e){return!e.url||on.some((function(t){return y(e.url,t)}))})),e}var pn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var vn="datadog-synthetics-public-id",gn="datadog-synthetics-result-id",hn="datadog-synthetics-injects-rum";function yn(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Ne(hn))}function mn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Ne(gn);return"string"==typeof e?e:void 0}var bn=function(){function e(e,t,n,r){var o=this;this.encoder=e,this.request=t,this.flushController=n,this.messageBytesLimit=r,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe((function(e){return o.flush(e)}))}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(e){var t=h(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,v(h(pn),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(En(i,e));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:C(a),flushReason:e.reason})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(t){o(En(t,e))}))},e.prototype.addOrUpdate=function(e,t){var n=B(e),r=this.encoder.estimateEncodedBytesCount(n);r>=this.messageBytesLimit?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.push(n,r,t))},e.prototype.push=function(e,t,n){var r=this;this.flushController.notifyBeforeAddMessage(t),void 0!==n?(this.upsertBuffer[n]=e,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?e:"\n".concat(e),(function(e){r.flushController.notifyAfterAddMessage(e-t)}))},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.encoder.estimateEncodedBytesCount(t);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e}();function En(e,t){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding,flushReason:t.reason}}function wn(e){return e>=500}var Sn=80*E,Cn=32,_n=3*w,xn=ee,On=Q;function kn(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Rn(e,t,n,{onSuccess:function(){return Ln(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Tn(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Tn(e,t,n,r){2===e.transportStatus&&x((function(){Rn(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=On,Ln(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(xn,2*e.currentBackoffTime),Tn(e,t,n,r)}})}),e.currentBackoffTime)}function Rn(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||wn(e.status))}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},i())}))}function Ln(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(_n/w,"MiB"),source:Wt.AGENT,startClocks:ie()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=An();i.size()>0;)kn(i.dequeue(),t,n,r,o)}function An(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=_n}}}function In(e,t,n,r){var o={transportStatus:0,currentBackoffTime:On,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=Sn&&this.ongoingRequestCount<Cn},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:An(),queueFullReported:!1},i=function(r,o){return function(e,t,n,r,o){var i=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&r.bytesCount<n;if(i){var a=t.build("fetch",r);fetch(a,{method:"POST",body:r.data,keepalive:!0,mode:"cors"}).then(l((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),l((function(){var n=t.build("xhr",r);Nn(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Nn(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){kn(e,o,i,t.trackType,r)},sendOnExit:function(r){!function(e,t,n,r){var o=!!navigator.sendBeacon&&r.bytesCount<n;if(o)try{var i=t.build("beacon",r);if(navigator.sendBeacon(i,r.data))return}catch(e){!function(e){Pn||(Pn=!0,fn(e))}(e)}var a=t.build("xhr",r);Nn(e,a,r.data)}(e,t,n,r)}}}var Pn=!1;function Nn(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),fe(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Bn(e){var t,n=e.messagesLimit,r=e.bytesLimit,o=e.durationLimit,i=e.pageExitObservable,a=e.sessionExpireObservable,s=i.subscribe((function(e){return d(e.reason)})),u=a.subscribe((function(){return d("session_expire")})),c=new V((function(){return function(){s.unsubscribe(),u.unsubscribe()}})),f=0,l=0;function d(e){if(0!==l){var t=l,n=f;l=0,f=0,p(),c.notify({reason:e,messagesCount:t,bytesCount:n})}}function p(){O(t),t=void 0}return{flushObservable:c,get messagesCount(){return l},notifyBeforeAddMessage:function(e){f+e>=r&&d("bytes_limit"),l+=1,f+=e,void 0===t&&(t=x((function(){d("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),f+=e,l>=n?d("messages_limit"):f>=r&&d("bytes_limit")},notifyAfterRemoveMessage:function(e){f-=e,0===(l-=1)&&p()}}}function Un(e,t,n,r,o,i){var a=u(e,t),s=n&&u(e,n);function u(e,t){var n=t.endpoint,a=t.encoder;return new bn(a,In(e,n,e.batchBytesLimit,r),Bn({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),e.messageBytesLimit)}return{flushObservable:a.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),a.add(e),s&&t&&s.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){a.upsert(e,t),s&&s.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){a.stop(),null==s||s.stop()}}}function Dn(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=C(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}var Mn=1/0,qn=ee,jn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=k((function(){return n.clearOldValues()}),qn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:Mn,remove:function(){var e=n.entries.indexOf(r);e>=0&&n.entries.splice(e,1)},close:function(e){r.endTime=e}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=Mn);for(var t=0,n=this.entries;t<n.length;t++){var r=n[t];if(r.startTime<=e){if(e<=r.endTime)return r.value;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===Mn&&t.close(e)},e.prototype.findAll=function(e,t){void 0===e&&(e=Mn),void 0===t&&(t=0);var n=ae(e,t);return this.entries.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){T(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var e=oe()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}(),Hn=ee,Gn=Re,Fn=[];function Vn(e,t,n){var r=lt(e.sessionStoreStrategyType,t,n);Fn.push((function(){return r.stop()}));var o=new jn(Gn);function i(){return{id:r.getSession().id,trackingType:r.getSession()[t]}}return Fn.push((function(){return o.stop()})),r.renewObservable.subscribe((function(){o.add(i(),oe())})),r.expireObservable.subscribe((function(){o.closeActive(oe())})),r.expandOrRenewSession(),o.add(i(),[0,se()][0]),function(e,t){var n=le(e,window,[Z.CLICK,Z.TOUCH_START,Z.KEY_DOWN,Z.SCROLL],t,{capture:!0,passive:!0}).stop;Fn.push(n)}(e,(function(){return r.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=fe(e,document,Z.VISIBILITY_CHANGE,n).stop;Fn.push(r);var o=k(n,Hn);Fn.push((function(){T(o)}))}(e,(function(){return r.expandSession()})),{findActiveSession:function(e){return o.find(e)},renewObservable:r.renewObservable,expireObservable:r.expireObservable,expire:r.expire}}var zn="logs";function Yn(e){var t=Vn(e,zn,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Jn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&"1"===n.trackingType?{id:n.id}:void 0},expireObservable:t.expireObservable}}function Jn(e){return Ee(e.sessionSampleRate)?"1":"0"}function Wn(e,t,n,r,o){var i=Xt.concat(["custom"]),a={};i.forEach((function(e){var n,r,i,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,i=o,s=0,u=!1,{isLimitReached:function(){if(0===s&&x((function(){s=0}),ee),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{i({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:Wt.AGENT,startClocks:ie()})}finally{u=!1}}return!0}})})),n.subscribe(0,(function(o){var i,s,u=o.rawLogsEvent,c=o.messageContext,f=void 0===c?void 0:c,l=o.savedCommonContext,d=void 0===l?void 0:l,p=u.date-se(),v=e.findTrackedSession(p);if(v){var g=d||r(),h=N({service:t.service,session_id:v.id,usr:Se(g.user)?void 0:g.user,view:g.view},g.context,$n(p),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,h))||h.origin!==Wt.AGENT&&(null!==(s=a[h.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,h)}}))}var Kn=!1;function $n(e){var t,n=window;if(yn()){var r=o(n.DD_RUM_SYNTHETICS);return r||Kn||(Kn=!0,cn("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Ne(vn),"string"==typeof t?t:void 0),resultId:mn()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}var Zn,Xn={};function Qn(n){var r=n.map((function(n){return Xn[n]||(Xn[n]=function(n){var r=new V((function(){var o=t[n];return t[n]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];o.apply(console,t);var a=function(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return d((function(){var n=Ot(t);n.stack=n.stack.slice(2),e=Ht(n)})),e}();d((function(){r.notify(function(t,n,r){var o,i,a=t.map((function(e){return function(e){if("string"==typeof e)return j(e);if(e instanceof Error)return Gt(Ot(e));return B(j(e),void 0,2)}(e)})).join(" ");if(n===e.error){var s=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}(t,(function(e){return e instanceof Error}));o=s?Ht(Ot(s)):void 0,i=jt(s)}return{api:n,message:a,stack:o,handlingStack:r,fingerprint:i}}(t,n,a))}))},function(){t[n]=o}}));return r}(n)),Xn[n]}));return z.apply(void 0,r)}var er,tr=((Zn={})[e.log]=$t.info,Zn[e.debug]=$t.debug,Zn[e.info]=$t.info,Zn[e.warn]=$t.warn,Zn[e.error]=$t.error,Zn);var nr,rr=((er={})[Ft.cspViolation]=$t.error,er[Ft.intervention]=$t.error,er[Ft.deprecation]=$t.warn,er);function or(e,t,n){var r=e[t],o=n(r),i=function(){if("function"==typeof o)return o.apply(this,arguments)};return e[t]=i,{stop:function(){e[t]===i?e[t]=r:o=r}}}function ir(e,t,n){var r=n.before,o=n.after;return or(e,t,(function(e){return function(){var t,n=arguments;return r&&d(r,this,n),"function"==typeof e&&(t=e.apply(this,n)),o&&d(o,this,n),t}}))}var ar,sr=new WeakMap;function ur(e){return nr||(nr=function(e){var t=new V((function(){var n=ir(XMLHttpRequest.prototype,"open",{before:cr}).stop,r=ir(XMLHttpRequest.prototype,"send",{before:function(){fr.call(this,e,t)}}).stop,o=ir(XMLHttpRequest.prototype,"abort",{before:lr}).stop;return function(){n(),r(),o()}}));return t}(e)),nr}function cr(e,t){sr.set(this,{state:"open",method:e.toUpperCase(),url:dt(String(t))})}function fr(e,t){var n=this,r=sr.get(this);if(r){var o=r;o.state="start",o.startClocks=ie(),o.isAborted=!1,o.xhr=this;var i=!1,a=ir(this,"onreadystatechange",{before:function(){this.readyState===XMLHttpRequest.DONE&&s()}}).stop,s=function(){if(u(),a(),!i){i=!0;var e,s=r;s.state="complete",s.duration=(e=o.startClocks.timeStamp,re()-e),s.status=n.status,t.notify(m({},s))}},u=fe(e,this,"loadend",s).stop;t.notify(o)}}function lr(){var e=sr.get(this);e&&(e.isAborted=!0)}function dr(){var e;return ar||(e=new V((function(){if(window.fetch)return or(window,"fetch",(function(t){return function(n,r){var o,i=d(pr,null,[e,n,r]);return i?(o=t.call(this,i.input,i.init),d(vr,null,[e,o,i])):o=t.call(this,n,r),o}})).stop})),ar=e),ar}function pr(e,t,n){var r=n&&n.method||t instanceof Request&&t.method,o=r?r.toUpperCase():"GET",i=t instanceof Request?t.url:dt(String(t)),a={state:"start",init:n,input:t,method:o,startClocks:ie(),url:i};return e.notify(a),a}function vr(e,t,n){var r=function(t){var r=n;r.state="resolve","stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1),e.notify(r)};t.then(l(r),l(r))}function gr(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=ur(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=dr().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(yr(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:$t.error,origin:Wt.NETWORK}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!wn(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(hr(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,a;if(r.cancel().catch(L),n.collectStreamBody){var s;if(1===o.length)s=o[0];else{s=new Uint8Array(i);var u=0;o.forEach((function(e){s.set(e,u),u+=e.length}))}e=s.slice(0,n.bytesLimit),a=s.length>n.bytesLimit}t(void 0,e,a)}!function e(){r.read().then(l((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),l((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(l((function(e){return n(hr(e,t))})),l((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(hr(Ht(Ot(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function hr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function yr(e){return"xhr"===e?"XHR":"Fetch"}function mr(e){var t,n=function(t,n){var r=qt({stackTrace:t,originalError:n,startClocks:ie(),nonErrorPrefix:"Uncaught",source:Wt.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,ir(window,"onerror",{before:function(e,n,r,o,i){var a;a=i instanceof Error?Ot(i):Ut(e,n,r,o),t(a,null!=i?i:e)}})).stop,o=function(e){return ir(window,"onunhandledrejection",{before:function(t){var n=t.reason||"Empty reason",r=Ot(n);e(r,n)}})}(n).stop;return{stop:function(){r(),o()}}}var br,Er=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}(),wr=((br={})[$t.debug]=0,br[$t.info]=1,br[$t.warn]=2,br[$t.error]=3,br);function Sr(e){return{handleLog:function(r,o,i,a){var s=N(o.getContext(),r.context);Cr(r.status,Zt.console,o)&&function(e,r){n[e.status].call(t,e.message,r)}(r,s),Cr(r.status,Zt.http,o)&&e.notify(0,{rawLogsEvent:{date:a||re(),message:r.message,status:r.status,origin:Wt.LOGGER},messageContext:s,savedCommonContext:i})}}}function Cr(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return wr[e]>=wr[n.getLevel()]&&v(o,t)}var _r,xr,Or,kr,Tr=function(t){var n,r,i=!1,a=K(2),s=K(1),u={},f=function(){},d=new X,p=function(e,t,n,r){void 0===n&&(n=P(b())),void 0===r&&(r=re()),d.add((function(){return p(e,t,n,r)}))},g=function(){},y=new Qt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.apply(void 0,e)}));function b(){return{view:{referrer:document.referrer,url:window.location.href},context:a.getContext(),user:s.getContext()}}return n={logger:y,init:l((function(n){var r;if(n){if(g=function(){return P(n)},ce()&&(n=function(e){return m({},e,{clientToken:"empty"})}(n)),function(e){return!i||(e.silentMultipleInit||o.error("DD_LOGS is already initialized."),!1)}(n)){var u=function(t){var n=_t(t),r=Jt(t.forwardConsoleLogs,h(e),"Forward Console Logs"),o=Jt(t.forwardReports,h(Ft),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!v(r,e.error)&&r.push(e.error),m({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:Yt},n)}(n);if(u){if(n.storeContextsAcrossPages){var c=a.getContext();(a=ge(u,en,2)).setContext(N(a.getContext(),c));var l=s.getContext();(s=ge(u,en,1)).setContext(N(s.getContext(),l))}r=t(n,u,b),p=r.handleLog,f=r.getInternalContext,d.drain(),i=!0}}}else o.error("Missing configuration")})),getGlobalContext:l((function(){return a.getContext()})),setGlobalContext:l((function(e){return a.setContext(e)})),setGlobalContextProperty:l((function(e,t){return a.setContextProperty(e,t)})),removeGlobalContextProperty:l((function(e){return a.removeContextProperty(e)})),clearGlobalContext:l((function(){return a.clearContext()})),createLogger:l((function(e,t){return void 0===t&&(t={}),u[e]=new Qt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.apply(void 0,e)}),j(e),t.handler,t.level,j(t.context)),u[e]})),getLogger:l((function(e){return u[e]})),getInitConfiguration:l((function(){return g()})),getInternalContext:l((function(e){return f(e)})),setUser:l((function(e){(function(e){var t="object"===A(e);return t||o.error("Unsupported user:",e),t})(e)&&s.setContext(he(e))})),getUser:l((function(){return s.getContext()})),setUserProperty:l((function(e,t){var n,r=he((n={},n[e]=t,n))[e];s.setContextProperty(e,r)})),removeUserProperty:l((function(e){return s.removeContextProperty(e)})),clearUser:l((function(){return s.clearContext()}))},r=m({version:"5.4.0",onReady:function(e){e()}},n),Object.defineProperty(r,"_setDebug",{get:function(){return c},enumerable:!1}),r}((function(t,n,r){var o=new Er,i=[];o.subscribe(1,(function(e){return tn("logs",e)}));var a=function(e){o.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Wt.AGENT,status:$t.error}}),cn("Error reported to customer",{"error.message":e.message})},s=function(e){var t=new V((function(){var n=me(de.PAGEHIDE),r=le(e,window,[Z.VISIBILITY_CHANGE,Z.FREEZE,Z.PAGE_HIDE],(function(e){e.type===Z.PAGE_HIDE&&n?t.notify({reason:pn.PAGEHIDE}):e.type===Z.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:pn.HIDDEN}):e.type===Z.FREEZE&&t.notify({reason:pn.FROZEN})}),{capture:!0}).stop,o=L;return n||(o=fe(e,window,Z.BEFORE_UNLOAD,(function(){t.notify({reason:pn.UNLOADING})})).stop),function(){r(),o()}}));return t}(n),u=!n.sessionStoreStrategyType||ce()||yn()?function(e){var t="1"===Jn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new V}}(n):Yn(n),c=function(e,t,n,r){var o=un("browser-logs-sdk",e),i=[];if(ce()){var a=ue(),s=o.observable.subscribe((function(e){return a.send("internal_telemetry",e)}));i.push((function(){return s.unsubscribe()}))}else{var u=Un(e,{endpoint:e.rumEndpointBuilder,encoder:Dn()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:Dn()},t,n,r);i.push((function(){return u.stop()}));var c=o.observable.subscribe((function(t){return u.add(t,function(e){return e.site===yt}(e))}));i.push((function(){return c.unsubscribe()}))}return{telemetry:o,stop:function(){i.forEach((function(e){return e()}))}}}(n,a,s,u.expireObservable),f=c.telemetry,l=c.stop;i.push((function(){return l()})),f.setContextProvider((function(){var e,t,n,r,o,i;return{application:{id:null===(e=$n())||void 0===e?void 0:e.application_id},session:{id:null===(t=u.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=$n())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(i=null===(o=$n())||void 0===o?void 0:o.user_action)||void 0===i?void 0:i.id}}})),gr(n,o),function(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=new V,r=mr(n).stop,o=n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack},origin:Wt.SOURCE,status:$t.error}})}))}(n,o),function(t,n){var r=Qn(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:re(),message:t.message,origin:Wt.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint}:void 0,status:tr[t.api]}})}))}(n,o),function(e,t){var n=Vt(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=rr[e.type];o===$t.error?n={kind:e.subtype,stack:e.stack}:e.stack&&(r+=" Found in ".concat(function(e){var t;return null===(t=/@ (.+)/.exec(e))||void 0===t?void 0:t[1]}(e.stack))),t.notify(0,{rawLogsEvent:{date:re(),message:r,origin:Wt.REPORT,error:n,status:o}})}))}(n,o);var d,p=Sr(o).handleLog;if(Wn(u,n,o,r,a),ce())!function(e){var t=ue();e.subscribe(1,(function(e){t.send("log",e)}))}(o);else{var v=function(e,t,n,r,o){var i=Un(e,{endpoint:e.logsEndpointBuilder,encoder:Dn()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Dn()},n,r,o);return t.subscribe(1,(function(e){i.add(e)})),i}(n,o,a,s,u.expireObservable).stop;i.push((function(){return v()}))}return function(e){sn.telemetryConfigurationEnabled&&ln({type:rn.configuration,configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents};return m({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},n)}(t)),{handleLog:p,getInternalContext:(d=u,{get:function(e){var t=d.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop:function(){i.forEach((function(e){return e()}))}}}));_r=b(),Or=Tr,kr=_r[xr="DD_LOGS"],_r[xr]=Or,kr&&kr.q&&kr.q.forEach((function(e){return i(e,"onReady callback threw an error:")()}))}();
{
"name": "@datadog/browser-logs",
"version": "5.3.0",
"version": "5.4.0",
"license": "Apache-2.0",

@@ -16,6 +16,6 @@ "main": "cjs/entries/main.js",

"dependencies": {
"@datadog/browser-core": "5.3.0"
"@datadog/browser-core": "5.4.0"
},
"peerDependencies": {
"@datadog/browser-rum": "5.3.0"
"@datadog/browser-rum": "5.4.0"
},

@@ -38,3 +38,3 @@ "peerDependenciesMeta": {

},
"gitHead": "5e8ff4fcbf59e397ae1e99bf76146be4b13c050b"
"gitHead": "9160f5cc9961c6f20055780d9880c572f6327992"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc