Socket
Socket
Sign inDemoInstall

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
256
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.23.0 to 5.23.3

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)},i="https://docs.datadoghq.com";function a(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 s,u=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))},c=!1;function f(e){c=e}function l(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(s?d(r):r).apply(this,e)}}function d(e){return function(){return p(e,this,arguments)}}function p(e,t,n){try{return e.apply(t,n)}catch(e){if(v(e),s)try{s(e)}catch(e){v(e)}}}function v(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];c&&o.error.apply(o,u(["[MONITOR]"],e,!1))}function g(e,t){return-1!==e.indexOf(t)}function h(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 m(e){return Object.keys(e).map((function(t){return e[t]}))}function y(e,t){return e.slice(0,t.length)===t}function b(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 S(){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 w=1024,C=1024*w,E=/[^\u0000-\u007F]/;function k(e){return E.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function _(e,t){var n,r=S();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function x(e,t){return _(S(),"setTimeout")(d(e),t)}function O(e){_(S(),"clearTimeout")(e)}function T(e,t){return _(S(),"setInterval")(d(e),t)}function R(e){_(S(),"clearInterval")(e)}function L(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 A(){}function I(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=P(Object.prototype),o=P(Array.prototype),i=P(Object.getPrototypeOf(e)),a=P(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function P(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):A}function U(e,t){return Object.keys(e).some((function(n){return e[n]===t}))}function N(e){return 0===Object.keys(e).length}var D=3*w,B=16*w,M=200;function q(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var a=2===e?D:B,s=r;t.forEach((function(e){s+=e.getBytesCount()})),s>a&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/w,"KiB threshold. More details: ").concat(i,"/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}(a),n=!0)}}return{createDetachedTracker:function(){var e=j((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,j(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}function j(e){var t=0,n=L((function(n){t=k(I(n)),e()}),M),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){N(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function G(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function H(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]=H(o[i],t[i],n);return o}var a="object"===G(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=H(a[s],t[s],n));return a}}function F(e){return H(void 0,e)}function V(){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=H(e,i))}return e}var z=220*w,W="$",J=3;function Y(e,t){var n;void 0===t&&(t=z);var r=P(Object.prototype),o=P(Array.prototype),i=[],a=new WeakMap,s=K(e,W,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=K(c.source[l],c.path,l,i,a))?JSON.stringify(d).length:4,u+=f,f=1,u>t){Z(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=K(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+J,f=1),u>t){Z(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}Z(t,"discarded",e)}function K(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 Z(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var $=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{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 X(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new $((function(t){var n=e.map((function(e){return e.subscribe((function(e){return t.notify(e)}))}));return function(){return n.forEach((function(e){return e.unsubscribe()}))}}))}function Q(e){var t={},n=new $,r={getContext:function(){return F(t)},setContext:function(o){"object"===G(o)?(t=Y(o),e.updateCustomerData(t)):r.clearContext(),n.notify()},setContextProperty:function(r,o){t[r]=Y(o),e.updateCustomerData(t),n.notify()},removeContextProperty:function(r){delete t[r],e.updateCustomerData(t),n.notify()},clearContext:function(){t={},e.resetCustomerData(),n.notify()},changeObservable:n};return r}var ee,te={GRANTED:"granted",NOT_GRANTED:"not-granted"};function ne(e,t,n,r,o){return re(e,t,[n],r,o)}function re(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,u=i.passive,c=d((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&p(),r(t))})),f=u?{capture:s,passive:u}:s,l=_(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 l.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"}(ee||(ee={}));var oe="_dd_c",ie=[];function ae(e,t,n,r){var o=function(e,t){return"".concat(oe,"_").concat(e,"_").concat(t)}(n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}ie.push(ne(e,window,ee.STORAGE,(function(e){var n=e.key;o===n&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(t.getContext()))})),t.setContext(V(i(),t.getContext()))}var se="?";function ue(e){var t=[],n=me(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=le.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=de.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]||se,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=pe.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:se,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=ve.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||se,line:+t[3],url:t[2]}}(e)||function(e){var t=ge.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=he.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]||se,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=se),t.push(n))})),{message:me(e,"message"),name:me(e,"name"),stack:t}}var ce="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",fe="(?::(\\d+))",le=new RegExp("^\\s*at (.*?) ?\\(".concat(ce).concat(fe,"?").concat(fe,"?\\)?\\s*$"),"i"),de=new RegExp("\\((\\S*)".concat(fe).concat(fe,"\\)"));var pe=new RegExp("^\\s*at ?".concat(ce).concat(fe,"?").concat(fe,"??\\s*$"),"i");var ve=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var ge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,he=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function me(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function ye(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=be.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var be=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Se(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return p((function(){var n=ue(t);n.stack=n.stack.slice(2),e=we(n)})),e}function we(e){var t=Ce(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 Ce(e){return"".concat(e.name||"Error",": ").concat(e.message)}var Ee,ke="No stack, consider using an instance of Error";function _e(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(I(Y(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)?we(t):ke,l=u?Oe(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:xe(n)}}function xe(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Oe(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ue(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&we(o)}),n=n.cause}return r.length?r:void 0}!function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.CUSTOM_VITALS="custom_vitals",e.TOLERANT_RESOURCE_TIMINGS="tolerant_resource_timings",e.REMOTE_CONFIGURATION="remote_configuration",e.UPDATE_VIEW_NAME="update_view_name",e.PLUGINS="plugins"}(Ee||(Ee={}));var Te=new Set;function Re(e){Array.isArray(e)&&e.filter((function(e){return U(Ee,e)})).forEach((function(e){Te.add(e)}))}function Le(){return Te}var Ae,Ie="datad0g.com",Pe="dd0g-gov.com",Ue="datadoghq.com",Ne="pci.browser-intake-datadoghq.com",De=1e3,Be=60*De,Me=60*Be;function qe(){return(new Date).getTime()}function je(){return qe()}function Ge(){return performance.now()}function He(){return{relative:Ge(),timeStamp:je()}}function Fe(e,t){return e+t}function Ve(e){return e-ze()}function ze(){return void 0===Ae&&(Ae=performance.timing.navigationStart),Ae}function We(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Je(e){return 0!==e&&100*Math.random()<=e}function Ye(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Ke(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}function Ze(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var $e=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.remove=function(e){Ze(this.buffer,e)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return t(e)})),this.buffer.length=0},e}(),Xe={log:"log",configuration:"configuration",usage:"usage"},Qe=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],et=["ddog-gov.com"],tt=new $e,nt=function(e){tt.add((function(){return nt(e)}))};function rt(e,t){var n,r,o=new $,i=new Set,a=!g(et,t.site)&&Je(t.telemetrySampleRate),u=((n={})[Xe.log]=a,n[Xe.configuration]=a&&Je(t.telemetryConfigurationSampleRate),n[Xe.usage]=a&&Je(t.telemetryUsageSampleRate),n),c={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return nt=function(n){var a=I(n);if(u[n.type]&&i.size<t.maxTelemetryEventsPerPage&&!i.has(a)){var s=function(e,t,n){return V({type:"telemetry",date:je(),service:e,version:"5.23.0",source:"browser",_dd:{format_version:2},telemetry:V(t,{runtime_env:n,connectivity:Ke()}),experimental_features:h(Le())},void 0!==r?r():{})}(e,n,c);o.notify(s),We("telemetry",s),i.add(a)}},s=it,{setContextProvider:function(e){r=e},observable:o,enabled:a}}function ot(t,n){v(e.debug,t,n),nt(b({type:Xe.log,message:t,status:"debug"},n))}function it(e,t){nt(b({type:Xe.log,status:"error"},function(e){if(e instanceof Error){var t=ue(e);return{error:{kind:t.name,stack:we(at(t))},message:t.message}}return{error:{stack:ke},message:"".concat("Uncaught"," ").concat(I(e))}}(e),t))}function at(e){return e.stack=e.stack.filter((function(e){return!e.url||Qe.some((function(t){return y(e.url,t)}))})),e}function st(e){var t=b({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}function ut(e,t){t.silentMultipleInit||o.error("".concat(e," is already initialized."))}var ct,ft={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function lt(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return pt[e]>=pt[n.getLevel()]&&g(o,t)}var dt={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},pt=((ct={})[dt.ok]=0,ct[dt.debug]=1,ct[dt.info]=2,ct[dt.notice]=4,ct[dt.warn]=5,ct[dt.error]=6,ct[dt.critical]=7,ct[dt.alert]=8,ct[dt.emerg]=9,ct),vt=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},gt={console:"console",http:"http",silent:"silent"},ht=Object.keys(dt),mt=function(){function e(e,t,n,r,o,i){void 0===r&&(r=gt.http),void 0===o&&(o=dt.debug),void 0===i&&(i={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=Q(t),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.logImplementation=function(e,t,n,r,o){var i;if(void 0===n&&(n=dt.info),null!=r){var a=_e({stackTrace:r instanceof Error?ue(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:ft.LOGGER,handling:"handled",startClocks:He()});i={stack:a.stack,kind:a.type,message:a.message,causes:a.causes}}var s=Y(t),u=i?V({error:i},s):s;this.handleLogStrategy({message:Y(e),context:u,status:n},this,o)},e.prototype.log=function(e,t,n,r){var o;void 0===n&&(n=dt.info),lt(n,gt.http,this)&&(o=Se()),this.logImplementation(e,t,n,r,o)},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},vt([l],e.prototype,"logImplementation",null),e}();function yt(e){return function(t,n,r){var o;lt(e,gt.http,this)&&(o=Se()),this.logImplementation(t,n,e,r,o)}}function bt(){var e=S().DatadogEventBridge;if(e)return{getCapabilities:function(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n,r){var o=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:o}))}}}function St(e){var t;void 0===e&&(e=null===(t=S().location)||void 0===t?void 0:t.hostname);var n=bt();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function wt(e,t,n,r){var o=(void 0===r?{}:r).computeHandlingStack,i=e[t];if("function"!=typeof i){if(!y(t,"on"))return{stop:A};i=A}var a=!1,s=function(){if(a)return i.apply(this,arguments);var e,t=h(arguments);p(n,null,[{target:this,parameters:t,onPostCall:function(t){e=t},handlingStack:o?Se():void 0}]);var r=i.apply(this,t);return e&&p(e,null,[r]),r};return e[t]=s,{stop:function(){a=!0,e[t]===s&&(e[t]=i)}}}function Ct(e){return Et(e,location.href).href}function Et(e,t){var n=function(){if(void 0===kt)try{var e=new xt("http://test/path");kt="http://test/path"===e.href}catch(e){kt=!1}return kt?xt: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(I({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}mt.prototype.ok=yt(dt.ok),mt.prototype.debug=yt(dt.debug),mt.prototype.info=yt(dt.info),mt.prototype.notice=yt(dt.notice),mt.prototype.warn=yt(dt.warn),mt.prototype.error=yt(dt.error),mt.prototype.critical=yt(dt.critical),mt.prototype.alert=yt(dt.alert),mt.prototype.emerg=yt(dt.emerg);var kt,_t,xt=URL;function Ot(){return _t||(_t=new $((function(e){if(window.fetch){var t=wt(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],a=n[1],s=a&&a.method;void 0===s&&i instanceof Request&&(s=i.method);var u=void 0!==s?String(s).toUpperCase():"GET",c=i instanceof Request?i.url:Ct(String(i)),f=He(),l={state:"start",init:a,input:i,method:u,startClocks:f,url:c,handlingStack:o};t.notify(l),n[0]=l.input,n[1]=l.init,r((function(e){return function(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(d(r),d(r))}(t,e,l)}))}(t,e)}),{computeHandlingStack:!0}).stop;return t}}))),_t}function Tt(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,Tt)}var Rt,Lt,At,It=/([\w-]+)\s*=\s*([^;]+)/g;function Pt(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)}function Ut(){return null!=Rt?Rt:Rt=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 Nt(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":"",c=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(u).concat(c)}function Dt(e){return function(e,t){for(It.lastIndex=0;;){var n=It.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Bt(e){return Lt||(Lt=function(e){var t=new Map;for(It.lastIndex=0;;){var n=It.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),Lt.get(e)}function Mt(e,t){Nt(e,"",0,t)}var qt="_dd_s",jt=4*Me,Gt=15*Be,Ht=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Ft="&",Vt="1";function zt(){return{isExpired:Vt}}function Wt(e){return N(e)}function Jt(e){return!Wt(e)}function Yt(e){return void 0!==e.isExpired||!((void 0===(t=e).created||qe()-Number(t.created)<jt)&&(void 0===t.expire||qe()<Number(t.expire)));var t}function Kt(e){e.expire=String(qe()+Gt)}function Zt(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(Ft);var t}function $t(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(Ft)||Ht.test(e))}(e)&&e.split(Ft).forEach((function(e){var n=Ht.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var Xt="_dd",Qt="_dd_r",en="_dd_l",tn="rum",nn="logs";function rn(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===At){for(var e="dd_site_test_".concat(Tt()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Dt(e);)n="".concat(t.pop(),".").concat(n),Nt(e,"test",De,{domain:n});Mt(e,{domain:n}),At=n}return At}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(Tt()),n="test";Nt(t,n,Be,e);var r=Dt(t)===n;return Mt(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function on(e){var t,n={isLockEnabled:1===Ut(),persistSession:(t=e,function(e){Nt(qt,Zt(e),Gt,t)}),retrieveSession:an,expireSession:function(){return function(e){Nt(qt,Zt(zt()),jt,e)}(e)}};return function(e){if(!Bt(qt)){var t=Bt(Xt),n=Bt(Qt),r=Bt(en),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[nn]=r),n&&/^[012]$/.test(n)&&(o[tn]=n),Jt(o)&&(Kt(o),e.persistSession(o))}}(n),n}function an(){return $t(Dt(qt))}var sn="_dd_test_";function un(e){localStorage.setItem(qt,Zt(e))}function cn(){return $t(localStorage.getItem(qt))}function fn(){un(zt())}var ln,dn=10,pn=100,vn=[];function gn(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.persistSession,a=t.expireSession,s=function(e){return i(b({},e,{lock:c}))},u=function(){var e=t.retrieveSession(),n=e.lock;return e.lock&&delete e.lock,{session:e,lock:n}};if(ln||(ln=e),e===ln)if(o&&n>=pn)mn(t);else{var c,f=u();if(o){if(f.lock)return void hn(e,t,n);if(c=Tt(),s(f.session),(f=u()).lock!==c)return void hn(e,t,n)}var l=e.process(f.session);if(o&&(f=u()).lock!==c)hn(e,t,n);else{if(l&&(Yt(l)?a():(Kt(l),o?s(l):i(l))),o&&(!l||!Yt(l))){if((f=u()).lock!==c)return void hn(e,t,n);i(f.session),l=f.session}null===(r=e.after)||void 0===r||r.call(e,l||f.session),mn(t)}}else vn.push(e)}function hn(e,t,n){x((function(){gn(e,t,n+1)}),dn)}function mn(e){ln=void 0;var t=vn.shift();t&&gn(t,e)}var yn=De;function bn(e){var t=rn(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=Tt(),t="".concat(sn).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 Sn(e,t,n){var r,o=new $,i=new $,a=new $,s="Cookie"===e.type?on(e.cookieOptions):{isLockEnabled:!1,persistSession:un,retrieveSession:cn,expireSession:fn},u=s.expireSession,c=T((function(){gn({process:function(e){return Yt(e)?zt():void 0},after:p},s)}),yn);v();var f=L((function(){gn({process:function(e){if(!Wt(e)){var r=p(e);return function(e){if(Wt(e))return!1;var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,delete e.isExpired,i&&!e.id&&(e.id=Tt(),e.created=String(qe()))}(r),r}},after:function(e){Jt(e)&&!g()&&function(e){r=e,o.notify()}(e),r=e}},s)}),yn),l=f.throttled,d=f.cancel;function p(e){return Yt(e)&&(e=zt()),g()&&(!function(e){return r.id!==e.id||r[t]!==e[t]}(e)?(a.notify({previousState:r,newState:e}),r=e):(r=zt(),i.notify())),e}function v(){gn({process:function(e){if(Wt(e))return zt()},after:function(e){r=e}},s)}function g(){return void 0!==r[t]}return{expandOrRenewSession:l,expandSession:function(){gn({process:function(e){return g()?p(e):void 0}},s)},getSession:function(){return r},renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a,restartSession:v,expire:function(){d(),u(),p(zt())},stop:function(){R(c)},updateSessionState:function(e){gn({process:function(t){return b({},t,e)},after:p},s)}}}function wn(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=Ct(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,t){var n=t.site,r=void 0===n?Ue:n,o=t.internalAnalyticsSubdomain;if("logs"===e&&t.usePciIntake&&r===Ue)return Ne;if(o&&r===Ue)return"".concat(o,".").concat(Ue);if(r===Pe)return"http-intake.logs.".concat(r);var i=r.split("."),a=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(a)}(t,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.encoding,c=["sdk_version:".concat("5.23.0"),"api:".concat(r)].concat(n);s&&c.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var f=["ddsource=browser","ddtags=".concat(encodeURIComponent(c.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.23.0")),"dd-evp-origin=browser","dd-request-id=".concat(Tt())];u&&f.push("dd-evp-encoding=".concat(u));"rum"===t&&f.push("batch_time=".concat(je()));a&&f.reverse();return f.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var Cn=200;var En=/[^a-z0-9_:./-]/;function kn(e,t){var n=Cn-e.length-1;(t.length>n||En.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized. More details: ").concat(i,"/getting_started/tagging/#defining-tags"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function _n(e){var t=e.site||Ue,n=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(kn("env",t)),n&&i.push(kn("service",n)),r&&i.push(kn("version",r)),o&&i.push(kn("datacenter",o)),i}(e),r=function(e,t){return{logsEndpointBuilder:wn(e,"logs",t),rumEndpointBuilder:wn(e,"rum",t),sessionReplayEndpointBuilder:wn(e,"replay",t)}}(e,n),o=function(e,t){var n=m(e).map((function(e){return e.urlPrefix}));t===Ue&&n.push("https://".concat(Ne,"/"));return n}(r,t),i=function(e,t,n){if(!e.replica)return;var r=b({},e,{site:Ue,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:wn(r,"logs",n),rumEndpointBuilder:wn(r,"rum",n)};return t.push.apply(t,m(o).map((function(e){return e.urlPrefix}))),b({applicationId:e.replica.applicationId},o)}(e,o,n);return b({isIntakeUrl:function(e){return o.some((function(t){return 0===e.indexOf(t)}))},replica:i,site:t},r)}function xn(e,t){return null==e||"string"==typeof e||(o.error("".concat(t," must be defined as a string")),!1)}var On={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Tn(e,t){var n=[];g(t,On.cspViolation)&&n.push(function(e){return new $((function(t){return ne(e,document,ee.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=On.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:On.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:Rn(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(Pt(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==On.cspViolation}));return r.length&&n.push(function(e){return new $((function(t){if(window.ReportingObserver){var n=d((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),originalReport:e,stack:Rn(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()}}}))}(r)),X.apply(void 0,n)}function Rn(e,t,n,r,o){return n?we({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var Ln=32*w;function An(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&o.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var n=function(e){var t,n,r,s,u;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||Ye(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||Ye(e.telemetrySampleRate))if(void 0===e.telemetryConfigurationSampleRate||Ye(e.telemetryConfigurationSampleRate))if(void 0===e.telemetryUsageSampleRate||Ye(e.telemetryUsageSampleRate)){if(xn(e.version,"Version")&&xn(e.env,"Env")&&xn(e.service,"Service"))if(void 0===e.trackingConsent||U(te,e.trackingConsent)){var c;if(!e.site||(c=e.site,/(datadog|ddog|datad0g|dd0g)/.test(c)))return b({beforeSend:e.beforeSend&&a(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:bn(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,telemetryUsageSampleRate:null!==(s=e.telemetryUsageSampleRate)&&void 0!==s?s:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(u=e.trackingConsent)&&void 0!==u?u:te.GRANTED,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*w,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*De,batchMessagesLimit:50,messageBytesLimit:256*w},_n(e));o.error("Site should be a valid Datadog site. Learn more here: ".concat(i,"/getting_started/site/."))}else o.error('Tracking Consent should be either "granted" or "not-granted"')}else o.error("Telemetry Usage Sample Rate should be a number between 0 and 100");else 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.")}(t),r=In(t.forwardConsoleLogs,m(e),"Forward Console Logs"),s=In(t.forwardReports,m(On),"Forward Reports");if(n&&r&&s)return t.forwardErrorsToLogs&&!g(r,e.error)&&r.push(e.error),b({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:s,requestErrorResponseLengthLimit:Ln,sendLogsAfterSessionExpiration:!!t.sendLogsAfterSessionExpiration},n)}function In(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return g(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),h(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}function Pn(e,t,n){var r,i,a=new $e,s=t.observable.subscribe(u);function u(){if(i&&r&&t.isGranted()){s.unsubscribe();var e=n(r,i);a.drain(e)}}return{init:function(e){if(e)if(Re(e.enableExperimentalFeatures),St()&&(e=function(e){return b({},e,{clientToken:"empty"})}(e)),r=e,i)ut("DD_LOGS",e);else{var n=An(e);n&&(i=n,Ot().subscribe(A),t.tryToInit(n.trackingConsent),u())}else o.error("Missing configuration")},get initConfiguration(){return r},getInternalContext:A,handleLog:function(t,n,r,o,i){void 0===o&&(o=e()),void 0===i&&(i=je()),a.add((function(e){return e.handleLog(t,n,r,o,i)}))}}}var Un="logs";var Nn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var Dn="datadog-synthetics-public-id",Bn="datadog-synthetics-result-id",Mn="datadog-synthetics-injects-rum";function qn(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Bt(Mn))}function jn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Bt(Bn);return"string"==typeof e?e:void 0}var Gn=1/0,Hn=Be,Fn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=T((function(){return n.clearOldValues()}),Hn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:Gn,remove:function(){Ze(n.entries,r)},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,t){void 0===e&&(e=Gn),void 0===t&&(t={returnInactive:!1});for(var n=0,r=this.entries;n<r.length;n++){var o=r[n];if(o.startTime<=e){if(t.returnInactive||e<=o.endTime)return o.value;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===Gn&&t.close(e)},e.prototype.findAll=function(e,t){void 0===e&&(e=Gn),void 0===t&&(t=0);var n=Fe(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(){R(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var e=Ge()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}(),Vn=Be,zn=jt,Wn=[];function Jn(e,t,n,r){var o=new $,i=new $,a=Sn(e.sessionStoreStrategyType,t,n);Wn.push((function(){return a.stop()}));var s=new Fn(zn);function u(){return{id:a.getSession().id,trackingType:a.getSession()[t],isReplayForced:!!a.getSession().forcedReplay}}return Wn.push((function(){return s.stop()})),a.renewObservable.subscribe((function(){s.add(u(),Ge()),o.notify()})),a.expireObservable.subscribe((function(){i.notify(),s.closeActive(Ge())})),a.expandOrRenewSession(),s.add(u(),[0,ze()][0]),r.observable.subscribe((function(){r.isGranted()?a.expandOrRenewSession():a.expire()})),function(e,t){var n=re(e,window,[ee.CLICK,ee.TOUCH_START,ee.KEY_DOWN,ee.SCROLL],t,{capture:!0,passive:!0}).stop;Wn.push(n)}(e,(function(){r.isGranted()&&a.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=ne(e,document,ee.VISIBILITY_CHANGE,n).stop;Wn.push(r);var o=T(n,Vn);Wn.push((function(){R(o)}))}(e,(function(){return a.expandSession()})),function(e,t){var n=ne(e,window,ee.RESUME,t,{capture:!0}).stop;Wn.push(n)}(e,(function(){return a.restartSession()})),{findSession:function(e,t){return s.find(e,t)},renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}var Yn="logs";function Kn(e,t){var n=Jn(e,Yn,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Zn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}),t);return{findTrackedSession:function(e,t){void 0===t&&(t={returnInactive:!1});var r=n.findSession(e,t);return r&&"1"===r.trackingType?{id:r.id}:void 0},expireObservable:n.expireObservable}}function Zn(e){return Je(e.sessionSampleRate)?"1":"0"}var $n=!1;function Xn(e){var t,n=window;if(qn()){var r=o(n.DD_RUM_SYNTHETICS);return r||$n||($n=!0,ot("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Bt(Dn),"string"==typeof t?t:void 0),resultId:jn()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function Qn(e,t,n,r,o){var i=ht.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}),Be),(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:ft.AGENT,startClocks:He()})}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=o.domainContext,v=Ve(u.date),g=e.findTrackedSession(v);if(g||t.sendLogsAfterSessionExpiration&&e.findTrackedSession(v,{returnInactive:!0})){var h=d||r(),m=V({service:t.service,session_id:null==g?void 0:g.id,usr:N(h.user)?void 0:h.user,view:h.view},h.context,Xn(v),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,m,p))||m.origin!==ft.AGENT&&(null!==(s=a[m.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,m)}}))}var er,tr={};function nr(n){var r=n.map((function(n){return tr[n]||(tr[n]=function(n){return new $((function(r){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=Se();p((function(){r.notify(function(t,n,r){var o,i,a,s=t.map((function(e){return function(e){if("string"==typeof e)return Y(e);if(e instanceof Error)return Ce(ue(e));return I(Y(e),void 0,2)}(e)})).join(" ");if(n===e.error){var u=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=u?we(ue(u)):void 0,i=xe(u),a=u?Oe(u,"console"):void 0}return{api:n,message:s,stack:o,handlingStack:r,fingerprint:i,causes:a}}(t,n,a))}))},function(){t[n]=o}}))}(n)),tr[n]}));return X.apply(void 0,r)}var rr,or=((er={})[e.log]=dt.info,er[e.debug]=dt.debug,er[e.info]=dt.info,er[e.warn]=dt.warn,er[e.error]=dt.error,er);var ir,ar=((rr={})[On.cspViolation]=dt.error,rr[On.intervention]=dt.error,rr[On.deprecation]=dt.warn,rr);var sr=new WeakMap;function ur(e){return ir||(ir=function(e){return new $((function(t){var n=wt(XMLHttpRequest.prototype,"open",cr).stop,r=wt(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=e.handlingStack,i=sr.get(r);if(!i)return;var a=i;a.state="start",a.startClocks=He(),a.isAborted=!1,a.xhr=r,a.handlingStack=o;var s=!1,u=wt(r,"onreadystatechange",(function(){r.readyState===XMLHttpRequest.DONE&&c()})).stop,c=function(){if(f(),u(),!s){s=!0;var e,t=i;t.state="complete",t.duration=(e=a.startClocks.timeStamp,je()-e),t.status=r.status,n.notify(b({},t))}},f=ne(t,r,"loadend",c).stop;n.notify(a)}(n,e,t)}),{computeHandlingStack:!0}).stop,o=wt(XMLHttpRequest.prototype,"abort",fr).stop;return function(){n(),r(),o()}}))}(e)),ir}function cr(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];sr.set(t,{state:"open",method:String(r).toUpperCase(),url:Ct(String(o))})}function fr(e){var t=e.target,n=sr.get(t);n&&(n.isAborted=!0)}function lr(e){return e>=500}function dr(e,t){if(!e.forwardErrorsToLogs)return{stop:A};var n=ur(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=Ot().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){var o={isAborted:r.isAborted,handlingStack:r.handlingStack};t.notify(0,{rawLogsEvent:{message:"".concat(vr(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:dt.error,origin:ft.NETWORK},domainContext:o})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!lr(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(pr(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(A),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(d((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),d((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(d((function(e){return n(pr(e,t))})),d((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(pr(we(ue(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function pr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function vr(e){return"xhr"===e?"XHR":"Fetch"}function gr(e){var t,n=function(t,n){var r=_e({stackTrace:t,originalError:n,startClocks:He(),nonErrorPrefix:"Uncaught",source:ft.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,wt(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],i=r[1],a=r[2],s=r[3],u=r[4];n=u instanceof Error?ue(u):ye(o,i,a,s),t(n,null!=u?u:o)}))).stop,o=function(e){return wt(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=ue(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var hr,mr=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}();function yr(e){return{handleLog:function(r,o,i,a,s){var u=V(o.getContext(),r.context);if(lt(r.status,gt.console,o)&&function(e,r){var o=e.status,i=e.message;n[br[o]].call(t,i,r)}(r,u),lt(r.status,gt.http,o)){var c={rawLogsEvent:{date:s||je(),message:r.message,status:r.status,origin:ft.LOGGER},messageContext:u,savedCommonContext:a};i&&(c.domainContext={handlingStack:i}),e.notify(0,c)}}}}var br=((hr={})[dt.ok]=e.debug,hr[dt.debug]=e.debug,hr[dt.info]=e.info,hr[dt.notice]=e.info,hr[dt.warn]=e.warn,hr[dt.error]=e.error,hr[dt.critical]=e.error,hr[dt.alert]=e.error,hr[dt.emerg]=e.error,hr);var Sr=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=m(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,g(m(Nn),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(wr(i));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:k(a)})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(e){o(wr(e))}))},e.prototype.addOrUpdate=function(e,t){var n=I(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. More details: ").concat(i,"/real_user_monitoring/browser/troubleshooting/#technical-limitations")):(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 wr(e){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding}}var Cr=80*w,Er=32,kr=3*C,_r=Be,xr=De;function Or(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Rr(e,t,n,{onSuccess:function(){return Lr(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Tr(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Tr(e,t,n,r){2===e.transportStatus&&x((function(){Rr(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=xr,Lr(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(_r,2*e.currentBackoffTime),Tr(e,t,n,r)}})}),e.currentBackoffTime)}function Rr(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||lr(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 Lr(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(kr/C,"MiB"),source:ft.AGENT,startClocks:He()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=Ar();i.size()>0;)Or(i.dequeue(),t,n,r,o)}function Ar(){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>=kr}}}function Ir(e,t,n,r){var o={transportStatus:0,currentBackoffTime:xr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=Cr&&this.ongoingRequestCount<Er},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Ar(),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(d((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),d((function(){var n=t.build("xhr",r);Ur(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Ur(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){Or(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){Pr||(Pr=!0,it(e))}(e)}var a=t.build("xhr",r);Ur(e,a,r.data)}(e,t,n,r)}}}var Pr=!1;function Ur(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),ne(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Nr(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 $((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 Dr(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 Sr(a,Ir(e,n,e.batchBytesLimit,r),Nr({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 Br(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=k(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}}}function Mr(e,t,n,r,o){var i=rt("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=Xn())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=Xn())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=Xn())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if(St()){var s=bt(),u=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return u.unsubscribe()}))}else{var c=Dr(t,{endpoint:t.rumEndpointBuilder,encoder:Br()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:Br()},n,r,o.expireObservable);a.push((function(){return c.stop()}));var f=i.observable.subscribe((function(e){return c.add(e,function(e){return e.site===Ie}(t))}));a.push((function(){return f.unsubscribe()}))}return tt.drain(),function(e){nt({type:Xe.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,telemetry_usage_sample_rate:t.telemetryUsageSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,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,tracking_consent:t.trackingConsent};return b({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var qr,jr,Gr,Hr,Fr=function(e){var t,n,r=q(),i=Q(r.getOrCreateTracker(2)),a=Q(r.getOrCreateTracker(1)),s={tryToInit:function(e){t||(t=e)},update:function(e){t=e,n.notify()},isGranted:function(){return t===te.GRANTED},observable:n=new $};function u(){return function(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}(i,a)}var c,l,p=Pn(u,s,(function(t,n){t.storeContextsAcrossPages&&(ae(n,i,Un,2),ae(n,a,Un,1));var r=e(t,n,u,s);return p=function(e,t){return b({init:function(e){ut("DD_LOGS",e)},initConfiguration:e},t)}(t,r),r})),v={},g=new mt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.handleLog.apply(p,e)}),r.createDetachedTracker());return c={logger:g,init:d((function(e){return p.init(e)})),setTrackingConsent:d((function(e){var t;s.update(e),t={feature:"set-tracking-consent",tracking_consent:e},nt({type:Xe.usage,usage:t})})),getGlobalContext:d((function(){return i.getContext()})),setGlobalContext:d((function(e){return i.setContext(e)})),setGlobalContextProperty:d((function(e,t){return i.setContextProperty(e,t)})),removeGlobalContextProperty:d((function(e){return i.removeContextProperty(e)})),clearGlobalContext:d((function(){return i.clearContext()})),createLogger:d((function(e,t){return void 0===t&&(t={}),v[e]=new mt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.handleLog.apply(p,e)}),r.createDetachedTracker(),Y(e),t.handler,t.level,Y(t.context)),v[e]})),getLogger:d((function(e){return v[e]})),getInitConfiguration:d((function(){return F(p.initConfiguration)})),getInternalContext:d((function(e){return p.getInternalContext(e)})),setUser:d((function(e){(function(e){var t="object"===G(e);return t||o.error("Unsupported user:",e),t})(e)&&a.setContext(st(e))})),getUser:d((function(){return a.getContext()})),setUserProperty:d((function(e,t){var n,r=st((n={},n[e]=t,n))[e];a.setContextProperty(e,r)})),removeUserProperty:d((function(e){return a.removeContextProperty(e)})),clearUser:d((function(){return a.clearContext()}))},l=b({version:"5.23.0",onReady:function(e){e()}},c),Object.defineProperty(l,"_setDebug",{get:function(){return f},enumerable:!1}),l}((function(t,n,r,o){var i=new mr,a=[];i.subscribe(1,(function(e){return We("logs",e)}));var s=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:ft.AGENT,status:dt.error}}),ot("Error reported to customer",{"error.message":t.message})}}(i),u=function(e){return new $((function(t){var n=re(e,window,[ee.VISIBILITY_CHANGE,ee.FREEZE],(function(e){e.type===ee.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:Nn.HIDDEN}):e.type===ee.FREEZE&&t.notify({reason:Nn.FROZEN})}),{capture:!0}).stop,r=ne(e,window,ee.BEFORE_UNLOAD,(function(){t.notify({reason:Nn.UNLOADING})})).stop;return function(){n(),r()}}))}(n),c=!n.sessionStoreStrategyType||St()||qn()?function(e){var t="1"===Zn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new $}}(n):Kn(n,o),f=Mr(t,n,s,u,c).stop;a.push((function(){return f()})),dr(n,i),function(e,t){if(!e.forwardErrorsToLogs)return{stop:A};var n=new $,r=gr(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,causes:e.causes},origin:ft.SOURCE,status:dt.error}})}))}(n,i),function(t,n){var r=nr(t.forwardConsoleLogs).subscribe((function(t){var r={rawLogsEvent:{date:je(),message:t.message,origin:ft.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint,causes:t.causes}:void 0,status:or[t.api]},domainContext:{handlingStack:t.handlingStack}};n.notify(0,r)}))}(n,i),function(e,t){var n=Tn(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=ar[e.type];o===dt.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:je(),message:r,origin:ft.REPORT,error:n,status:o}})}))}(n,i);var l,d=yr(i).handleLog;if(Qn(c,n,i,r,s),St())!function(e){var t=bt();e.subscribe(1,(function(e){t.send("log",e)}))}(i);else{var p=function(e,t,n,r,o){var i=Dr(e,{endpoint:e.logsEndpointBuilder,encoder:Br()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Br()},n,r,o.expireObservable);return t.subscribe(1,(function(e){i.add(e)})),i}(n,i,s,u,c).stop;a.push((function(){return p()}))}return{handleLog:d,getInternalContext:(l=c,{get:function(e){var t=l.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop:function(){a.forEach((function(e){return e()}))}}}));qr=S(),Gr=Fr,(Hr=qr[jr="DD_LOGS"])&&!Hr.q&&Hr.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),qr[jr]=Gr,Hr&&Hr.q&&Hr.q.forEach((function(e){return a(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)},i="https://docs.datadoghq.com",a="".concat(i,"/real_user_monitoring/browser/troubleshooting"),s="More details:";function c(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 u,f=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))},l=!1;function d(e){l=e}function v(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(u?p(r):r).apply(this,e)}}function p(e){return function(){return g(e,this,arguments)}}function g(e,t,n){try{return e.apply(t,n)}catch(e){if(m(e),u)try{u(e)}catch(e){m(e)}}}function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];l&&o.error.apply(o,f(["[MONITOR]"],e,!1))}function y(e,t){return-1!==e.indexOf(t)}function h(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 b(e){return Object.keys(e).map((function(t){return e[t]}))}function S(e,t){return e.slice(0,t.length)===t}function w(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 k(){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 C=1024,x=1024*C,E=/[^\u0000-\u007F]/;function _(e){return E.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function T(e,t){var n,r=k();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function O(e,t){return T(k(),"setTimeout")(p(e),t)}function R(e){T(k(),"clearTimeout")(e)}function L(e,t){return T(k(),"setInterval")(p(e),t)}function A(e){T(k(),"clearInterval")(e)}function I(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=[],c=0;c<arguments.length;c++)n[c]=arguments[c];s?r=n:(i?e.apply(void 0,n):r=n,s=!0,o=O((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){R(o),s=!1,r=void 0}}}function P(){}function D(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=B(Object.prototype),o=B(Array.prototype),i=B(Object.getPrototypeOf(e)),a=B(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function B(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):P}function U(e,t){return Object.keys(e).some((function(n){return e[n]===t}))}function M(e){return 0===Object.keys(e).length}var N=3*C,q=16*C,j=200;function G(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var i=2===e?N:q,c=r;t.forEach((function(e){c+=e.getBytesCount()})),c>i&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/C,"KiB threshold. ").concat(s," ").concat(a,"/#customer-data-exceeds-the-recommended-threshold-warning"))}(i),n=!0)}}return{createDetachedTracker:function(){var e=F((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,F(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}function F(e){var t=0,n=I((function(n){t=_(D(n)),e()}),j),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){M(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function H(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function z(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]=z(o[i],t[i],n);return o}var a="object"===H(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=z(a[s],t[s],n));return a}}function J(e){return z(void 0,e)}function V(){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=z(e,i))}return e}var W=220*C,$="$",K=3;function X(e,t){void 0===t&&(t=W);var n=B(Object.prototype),r=B(Array.prototype),o=[],i=new WeakMap,a=Z(e,$,void 0,o,i),s=JSON.stringify(a),c=s?s.length:0;if(!(c>t)){for(;o.length>0&&c<t;){var u=o.shift(),f=0;if(Array.isArray(u.source))for(var l=0;l<u.source.length;l++){if(c+=void 0!==(d=Z(u.source[l],u.path,l,o,i))?JSON.stringify(d).length:4,c+=f,f=1,c>t){Y(t,"truncated",e);break}u.target[l]=d}else for(var l in u.source)if(Object.prototype.hasOwnProperty.call(u.source,l)){var d;if(void 0!==(d=Z(u.source[l],u.path,l,o,i))&&(c+=JSON.stringify(d).length+f+l.length+K,f=1),c>t){Y(t,"truncated",e);break}u.target[l]=d}}return n(),r(),a}Y(t,"discarded",e)}function Z(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 c=void 0!==n?"".concat(t,".").concat(n):t,u=Array.isArray(i)?[]:{};return o.set(s,c),r.push({source:i,target:u,path:c}),u}function Y(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var Q=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{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 ee(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new Q((function(t){var n=e.map((function(e){return e.subscribe((function(e){return t.notify(e)}))}));return function(){return n.forEach((function(e){return e.unsubscribe()}))}}))}function te(e){var t={},n=new Q,r={getContext:function(){return J(t)},setContext:function(o){"object"===H(o)?(t=X(o),e.updateCustomerData(t)):r.clearContext(),n.notify()},setContextProperty:function(r,o){t[r]=X(o),e.updateCustomerData(t),n.notify()},removeContextProperty:function(r){delete t[r],e.updateCustomerData(t),n.notify()},clearContext:function(){t={},e.resetCustomerData(),n.notify()},changeObservable:n};return r}var ne={GRANTED:"granted",NOT_GRANTED:"not-granted"};function re(e,t,n,r,o){return oe(e,t,[n],r,o)}function oe(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,c=i.passive,u=p((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&d(),r(t))})),f=c?{capture:s,passive:c}:s,l=T(t,"addEventListener");function d(){var e=T(t,"removeEventListener");n.forEach((function(n){return e.call(t,n,u,f)}))}return n.forEach((function(e){return l.call(t,e,u,f)})),{stop:d}}var ie="_dd_c",ae=[];function se(e,t,n,r){var o=function(e,t){return"".concat(ie,"_").concat(e,"_").concat(t)}(n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}ae.push(re(e,window,"storage",(function(e){var n=e.key;o===n&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(t.getContext()))})),t.setContext(V(i(),t.getContext()))}var ce="?";function ue(e){var t=[],n=he(e,"stack"),r=String(e);return n&&S(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=de.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=ve.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]||ce,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=pe.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:ce,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=ge.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||ce,line:+t[3],url:t[2]}}(e)||function(e){var t=me.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=ye.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]||ce,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=ce),t.push(n))})),{message:he(e,"message"),name:he(e,"name"),stack:t}}var fe="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",le="(?::(\\d+))",de=new RegExp("^\\s*at (.*?) ?\\(".concat(fe).concat(le,"?").concat(le,"?\\)?\\s*$"),"i"),ve=new RegExp("\\((\\S*)".concat(le).concat(le,"\\)"));var pe=new RegExp("^\\s*at ?".concat(fe).concat(le,"?").concat(le,"??\\s*$"),"i");var ge=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var me=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ye=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function he(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function be(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=Se.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var Se=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function we(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return g((function(){var n=ue(t);n.stack=n.stack.slice(2),e=ke(n)})),e}function ke(e){var t=Ce(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 Ce(e){return"".concat(e.name||"Error",": ").concat(e.message)}var xe,Ee="No stack, consider using an instance of Error";function _e(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,s=e.handling,c=n instanceof Error,u=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(D(X(r)))}(t,c,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)}(c,t)?ke(t):Ee,l=c?Oe(n,a):void 0;return{startClocks:o,source:a,handling:s,handlingStack:r,originalError:n,type:t?t.name:void 0,message:u,stack:f,causes:l,fingerprint:Te(n)}}function Te(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Oe(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ue(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&ke(o)}),n=n.cause}return r.length?r:void 0}!function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.CUSTOM_VITALS="custom_vitals",e.TOLERANT_RESOURCE_TIMINGS="tolerant_resource_timings",e.REMOTE_CONFIGURATION="remote_configuration",e.UPDATE_VIEW_NAME="update_view_name"}(xe||(xe={}));var Re=new Set;function Le(e){Array.isArray(e)&&e.filter((function(e){return U(xe,e)})).forEach((function(e){Re.add(e)}))}function Ae(){return Re}var Ie,Pe="datad0g.com",De="dd0g-gov.com",Be="datadoghq.com",Ue="pci.browser-intake-datadoghq.com",Me=1e3,Ne=60*Me,qe=60*Ne;function je(){return(new Date).getTime()}function Ge(){return je()}function Fe(){return performance.now()}function He(){return{relative:Fe(),timeStamp:Ge()}}function ze(e,t){return e+t}function Je(e){return e-Ve()}function Ve(){return void 0===Ie&&(Ie=performance.timing.navigationStart),Ie}function We(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function $e(e){return 0!==e&&100*Math.random()<=e}function Ke(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}function Xe(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Ze=500;function Ye(){var e=[];return{add:function(t){e.push(t)>Ze&&e.splice(0,1)},remove:function(t){Xe(e,t)},drain:function(t){e.forEach((function(e){return e(t)})),e.length=0}}}var Qe={log:"log",configuration:"configuration",usage:"usage"},et=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],tt=["ddog-gov.com"],nt=Ye(),rt=function(e){nt.add((function(){return rt(e)}))};function ot(e,t){var n,r,o=new Q,i=new Set,a=!y(tt,t.site)&&$e(t.telemetrySampleRate),s=((n={})[Qe.log]=a,n[Qe.configuration]=a&&$e(t.telemetryConfigurationSampleRate),n[Qe.usage]=a&&$e(t.telemetryUsageSampleRate),n),c={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return rt=function(n){var a=D(n);if(s[n.type]&&i.size<t.maxTelemetryEventsPerPage&&!i.has(a)){var u=function(e,t,n){return V({type:"telemetry",date:Ge(),service:e,version:"5.23.3",source:"browser",_dd:{format_version:2},telemetry:V(t,{runtime_env:n,connectivity:Ke()}),experimental_features:h(Ae())},void 0!==r?r():{})}(e,n,c);o.notify(u),We("telemetry",u),i.add(a)}},u=at,{setContextProvider:function(e){r=e},observable:o,enabled:a}}function it(t,n){m(e.debug,t,n),rt(w({type:Qe.log,message:t,status:"debug"},n))}function at(e,t){rt(w({type:Qe.log,status:"error"},function(e){if(e instanceof Error){var t=ue(e);return{error:{kind:t.name,stack:ke(st(t))},message:t.message}}return{error:{stack:Ee},message:"".concat("Uncaught"," ").concat(D(e))}}(e),t))}function st(e){return e.stack=e.stack.filter((function(e){return!e.url||et.some((function(t){return S(e.url,t)}))})),e}function ct(e){var t=w({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}function ut(e,t){t.silentMultipleInit||o.error("".concat(e," is already initialized."))}var ft,lt={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function dt(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return pt[e]>=pt[n.getLevel()]&&y(o,t)}var vt={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},pt=((ft={})[vt.ok]=0,ft[vt.debug]=1,ft[vt.info]=2,ft[vt.notice]=4,ft[vt.warn]=5,ft[vt.error]=6,ft[vt.critical]=7,ft[vt.alert]=8,ft[vt.emerg]=9,ft),gt=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},mt={console:"console",http:"http",silent:"silent"},yt=Object.keys(vt),ht=function(){function e(e,t,n,r,o,i){void 0===r&&(r=mt.http),void 0===o&&(o=vt.debug),void 0===i&&(i={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=te(t),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.logImplementation=function(e,t,n,r,o){var i;if(void 0===n&&(n=vt.info),null!=r){var a=_e({stackTrace:r instanceof Error?ue(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:lt.LOGGER,handling:"handled",startClocks:He()});i={stack:a.stack,kind:a.type,message:a.message,causes:a.causes}}var s=X(t),c=i?V({error:i},s):s;this.handleLogStrategy({message:X(e),context:c,status:n},this,o)},e.prototype.log=function(e,t,n,r){var o;void 0===n&&(n=vt.info),dt(n,mt.http,this)&&(o=we()),this.logImplementation(e,t,n,r,o)},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},gt([v],e.prototype,"logImplementation",null),e}();function bt(e){return function(t,n,r){var o;dt(e,mt.http,this)&&(o=we()),this.logImplementation(t,n,e,r,o)}}function St(){var e=k().DatadogEventBridge;if(e)return{getCapabilities:function(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n,r){var o=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:o}))}}}function wt(e){var t;void 0===e&&(e=null===(t=k().location)||void 0===t?void 0:t.hostname);var n=St();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function kt(e,t,n,r){var o=(void 0===r?{}:r).computeHandlingStack,i=e[t];if("function"!=typeof i){if(!S(t,"on"))return{stop:P};i=P}var a=!1,s=function(){if(a)return i.apply(this,arguments);var e,t=h(arguments);g(n,null,[{target:this,parameters:t,onPostCall:function(t){e=t},handlingStack:o?we():void 0}]);var r=i.apply(this,t);return e&&g(e,null,[r]),r};return e[t]=s,{stop:function(){a=!0,e[t]===s&&(e[t]=i)}}}function Ct(e){return xt(e,location.href).href}function xt(e,t){var n=function(){if(void 0===Et)try{var e=new Tt("http://test/path");Et="http://test/path"===e.href}catch(e){Et=!1}return Et?Tt: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(D({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}ht.prototype.ok=bt(vt.ok),ht.prototype.debug=bt(vt.debug),ht.prototype.info=bt(vt.info),ht.prototype.notice=bt(vt.notice),ht.prototype.warn=bt(vt.warn),ht.prototype.error=bt(vt.error),ht.prototype.critical=bt(vt.critical),ht.prototype.alert=bt(vt.alert),ht.prototype.emerg=bt(vt.emerg);var Et,_t,Tt=URL;function Ot(){return _t||(_t=new Q((function(e){if(window.fetch){var t=kt(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],a=n[1],s=a&&a.method;void 0===s&&i instanceof Request&&(s=i.method);var c=void 0!==s?String(s).toUpperCase():"GET",u=i instanceof Request?i.url:Ct(String(i)),f=He(),l={state:"start",init:a,input:i,method:c,startClocks:f,url:u,handlingStack:o};t.notify(l),n[0]=l.input,n[1]=l.init,r((function(e){return function(e,t,n){var r=n;function o(t){r.state="resolve",w(r,t),e.notify(r)}t.then(p((function(e){o({response:e,responseType:e.type,status:e.status,isAborted:!1})})),p((function(e){var t,n;o({status:0,isAborted:(null===(n=null===(t=r.init)||void 0===t?void 0:t.signal)||void 0===n?void 0:n.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,error:e})})))}(t,e,l)}))}(t,e)}),{computeHandlingStack:!0}).stop;return t}}))),_t}function Rt(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,Rt)}var Lt,At,It,Pt=/([\w-]+)\s*=\s*([^;]+)/g;function Dt(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)}function Bt(){return null!=Lt?Lt:Lt=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 Ut(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):"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(c).concat(u)}function Mt(e){return function(e,t){for(Pt.lastIndex=0;;){var n=Pt.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Nt(e){return At||(At=function(e){var t=new Map;for(Pt.lastIndex=0;;){var n=Pt.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),At.get(e)}function qt(e,t){Ut(e,"",0,t)}var jt="_dd_s",Gt=4*qe,Ft=15*Ne,Ht=/^([a-zA-Z]+)=([a-z0-9-]+)$/,zt="&",Jt="1";function Vt(){return{isExpired:Jt}}function Wt(e){return M(e)}function $t(e){return!Wt(e)}function Kt(e){return void 0!==e.isExpired||!((void 0===(t=e).created||je()-Number(t.created)<Gt)&&(void 0===t.expire||je()<Number(t.expire)));var t}function Xt(e){e.expire=String(je()+Ft)}function Zt(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(zt);var t}function Yt(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(zt)||Ht.test(e))}(e)&&e.split(zt).forEach((function(e){var n=Ht.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var Qt="_dd",en="_dd_r",tn="_dd_l",nn="rum",rn="logs";function on(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===It){for(var e="dd_site_test_".concat(Rt()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Mt(e);)n="".concat(t.pop(),".").concat(n),Ut(e,"test",Me,{domain:n});qt(e,{domain:n}),It=n}return It}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(Rt()),n="test";Ut(t,n,Ne,e);var r=Mt(t)===n;return qt(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function an(e){var t,n={isLockEnabled:1===Bt(),persistSession:(t=e,function(e){Ut(jt,Zt(e),Ft,t)}),retrieveSession:sn,expireSession:function(){return function(e){Ut(jt,Zt(Vt()),Gt,e)}(e)}};return function(e){if(!Nt(jt)){var t=Nt(Qt),n=Nt(en),r=Nt(tn),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[rn]=r),n&&/^[012]$/.test(n)&&(o[nn]=n),$t(o)&&(Xt(o),e.persistSession(o))}}(n),n}function sn(){return Yt(Mt(jt))}var cn="_dd_test_";function un(e){localStorage.setItem(jt,Zt(e))}function fn(){return Yt(localStorage.getItem(jt))}function ln(){un(Vt())}var dn,vn=10,pn=100,gn=[];function mn(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.persistSession,a=t.expireSession,s=function(e){return i(w({},e,{lock:u}))},c=function(){var e=t.retrieveSession(),n=e.lock;return e.lock&&delete e.lock,{session:e,lock:n}};if(dn||(dn=e),e===dn)if(o&&n>=pn)hn(t);else{var u,f=c();if(o){if(f.lock)return void yn(e,t,n);if(u=Rt(),s(f.session),(f=c()).lock!==u)return void yn(e,t,n)}var l=e.process(f.session);if(o&&(f=c()).lock!==u)yn(e,t,n);else{if(l&&(Kt(l)?a():(Xt(l),o?s(l):i(l))),o&&(!l||!Kt(l))){if((f=c()).lock!==u)return void yn(e,t,n);i(f.session),l=f.session}null===(r=e.after)||void 0===r||r.call(e,l||f.session),hn(t)}}else gn.push(e)}function yn(e,t,n){O((function(){mn(e,t,n+1)}),vn)}function hn(e){dn=void 0;var t=gn.shift();t&&mn(t,e)}var bn=Me;function Sn(e){var t=on(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=Rt(),t="".concat(cn).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 wn(e,t,n){var r,o=new Q,i=new Q,a=new Q,s="Cookie"===e.type?an(e.cookieOptions):{isLockEnabled:!1,persistSession:un,retrieveSession:fn,expireSession:ln},c=s.expireSession,u=L((function(){mn({process:function(e){return Kt(e)?Vt():void 0},after:v},s)}),bn);p();var f=I((function(){mn({process:function(e){if(!Wt(e)){var r=v(e);return function(e){if(Wt(e))return!1;var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,delete e.isExpired,i&&!e.id&&(e.id=Rt(),e.created=String(je()))}(r),r}},after:function(e){$t(e)&&!g()&&function(e){r=e,o.notify()}(e),r=e}},s)}),bn),l=f.throttled,d=f.cancel;function v(e){return Kt(e)&&(e=Vt()),g()&&(!function(e){return r.id!==e.id||r[t]!==e[t]}(e)?(a.notify({previousState:r,newState:e}),r=e):(r=Vt(),i.notify())),e}function p(){mn({process:function(e){if(Wt(e))return Vt()},after:function(e){r=e}},s)}function g(){return void 0!==r[t]}return{expandOrRenewSession:l,expandSession:function(){mn({process:function(e){return g()?v(e):void 0}},s)},getSession:function(){return r},renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a,restartSession:p,expire:function(){d(),c(),v(Vt())},stop:function(){A(u)},updateSessionState:function(e){mn({process:function(t){return w({},t,e)},after:v},s)}}}function kn(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=Ct(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,t){var n=t.site,r=void 0===n?Be:n,o=t.internalAnalyticsSubdomain;if("logs"===e&&t.usePciIntake&&r===Be)return Ue;if(o&&r===Be)return"".concat(o,".").concat(Be);if(r===De)return"http-intake.logs.".concat(r);var i=r.split("."),a=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(a)}(t,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,c=o.encoding,u=["sdk_version:".concat("5.23.3"),"api:".concat(r)].concat(n);s&&u.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var f=["ddsource=browser","ddtags=".concat(encodeURIComponent(u.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.23.3")),"dd-evp-origin=browser","dd-request-id=".concat(Rt())];c&&f.push("dd-evp-encoding=".concat(c));"rum"===t&&f.push("batch_time=".concat(Ge()));a&&f.reverse();return f.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var Cn=200;var xn=/[^a-z0-9_:./-]/;function En(e,t){var n=Cn-e.length-1;(t.length>n||xn.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized. ").concat(s," ").concat(i,"/getting_started/tagging/#defining-tags"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function _n(e){var t=e.site||Be,n=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(En("env",t)),n&&i.push(En("service",n)),r&&i.push(En("version",r)),o&&i.push(En("datacenter",o)),i}(e),r=function(e,t){return{logsEndpointBuilder:kn(e,"logs",t),rumEndpointBuilder:kn(e,"rum",t),sessionReplayEndpointBuilder:kn(e,"replay",t)}}(e,n),o=function(e,t){var n=b(e).map((function(e){return e.urlPrefix}));t===Be&&n.push("https://".concat(Ue,"/"));return n}(r,t),i=function(e,t,n){if(!e.replica)return;var r=w({},e,{site:Be,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:kn(r,"logs",n),rumEndpointBuilder:kn(r,"rum",n)};return t.push.apply(t,b(o).map((function(e){return e.urlPrefix}))),w({applicationId:e.replica.applicationId},o)}(e,o,n);return w({isIntakeUrl:function(e){return o.some((function(t){return 0===e.indexOf(t)}))},replica:i,site:t},r)}function Tn(e,t){return null==e||"string"==typeof e||(o.error("".concat(t," must be defined as a string")),!1)}function On(e,t){return!!(void 0===e||(n=e,function(e){return"number"==typeof e}(n)&&n>=0&&n<=100))||(o.error("".concat(t," Sample Rate should be a number between 0 and 100")),!1);var n}function Rn(e){var t,n,r,a,u;if(e&&e.clientToken){if((!(f=e.site)||"string"!=typeof f||/(datadog|ddog|datad0g|dd0g)/.test(f)||(o.error("Site should be a valid Datadog site. ".concat(s," ").concat(i,"/getting_started/site/.")),0))&&On(e.sessionSampleRate,"Session")&&On(e.telemetrySampleRate,"Telemetry")&&On(e.telemetryConfigurationSampleRate,"Telemetry Configuration")&&On(e.telemetryUsageSampleRate,"Telemetry Usage")&&Tn(e.version,"Version")&&Tn(e.env,"Env")&&Tn(e.service,"Service")){var f;if(void 0===e.trackingConsent||U(ne,e.trackingConsent))return w({beforeSend:e.beforeSend&&c(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Sn(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,telemetryUsageSampleRate:null!==(a=e.telemetryUsageSampleRate)&&void 0!==a?a:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(u=e.trackingConsent)&&void 0!==u?u:ne.GRANTED,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*C,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Me,batchMessagesLimit:50,messageBytesLimit:256*C},_n(e));o.error('Tracking Consent should be either "granted" or "not-granted"')}}else o.error("Client Token is not configured, we will not send any data.")}var Ln={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function An(e,t){var n=[];y(t,Ln.cspViolation)&&n.push(function(e){return new Q((function(t){return re(e,document,"securitypolicyviolation",(function(e){t.notify(function(e){var t=Ln.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Ln.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:In(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(Dt(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==Ln.cspViolation}));return r.length&&n.push(function(e){return new Q((function(t){if(window.ReportingObserver){var n=p((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),originalReport:e,stack:In(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()}}}))}(r)),ee.apply(void 0,n)}function In(e,t,n,r,o){return n?ke({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var Pn=32*C;function Dn(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return y(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),h(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}function Bn(t,n,r){var i,a,s=Ye(),c=n.observable.subscribe(u);function u(){if(a&&i&&n.isGranted()){c.unsubscribe();var e=r(i,a);s.drain(e)}}return{init:function(t){if(t)if(Le(t.enableExperimentalFeatures),wt()&&(t=function(e){return w({},e,{clientToken:"empty"})}(t)),i=t,a)ut("DD_LOGS",t);else{var r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&o.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var n=Rn(t),r=Dn(t.forwardConsoleLogs,b(e),"Forward Console Logs"),i=Dn(t.forwardReports,b(Ln),"Forward Reports");if(n&&r&&i)return t.forwardErrorsToLogs&&!y(r,e.error)&&r.push(e.error),w({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:Pn,sendLogsAfterSessionExpiration:!!t.sendLogsAfterSessionExpiration},n)}(t);r&&(a=r,Ot().subscribe(P),n.tryToInit(r.trackingConsent),u())}else o.error("Missing configuration")},get initConfiguration(){return i},getInternalContext:P,handleLog:function(e,n,r,o,i){void 0===o&&(o=t()),void 0===i&&(i=Ge()),s.add((function(t){return t.handleLog(e,n,r,o,i)}))}}}var Un="logs";var Mn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var Nn="datadog-synthetics-public-id",qn="datadog-synthetics-result-id",jn="datadog-synthetics-injects-rum";function Gn(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Nt(jn))}function Fn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Nt(qn);return"string"==typeof e?e:void 0}var Hn=1/0,zn=Ne;function Jn(e){var t=e.expireDelay,n=e.maxEntries,r=[],o=L((function(){return function(){var e=Fe()-t;for(;r.length>0&&r[r.length-1].endTime<e;)r.pop()}()}),zn);return{add:function(e,t){var o={value:e,startTime:t,endTime:Hn,remove:function(){Xe(r,o)},close:function(e){o.endTime=e}};return n&&r.length>=n&&r.pop(),r.unshift(o),o},find:function(e,t){void 0===e&&(e=Hn),void 0===t&&(t={returnInactive:!1});for(var n=0,o=r;n<o.length;n++){var i=o[n];if(i.startTime<=e){if(t.returnInactive||e<=i.endTime)return i.value;break}}},closeActive:function(e){var t=r[0];t&&t.endTime===Hn&&t.close(e)},findAll:function(e,t){void 0===e&&(e=Hn),void 0===t&&(t=0);var n=ze(e,t);return r.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},reset:function(){r=[]},stop:function(){A(o)}}}var Vn=Ne,Wn=Gt,$n=[];function Kn(e,t,n,r){var o=new Q,i=new Q,a=wn(e.sessionStoreStrategyType,t,n);$n.push((function(){return a.stop()}));var s=Jn({expireDelay:Wn});function c(){return{id:a.getSession().id,trackingType:a.getSession()[t],isReplayForced:!!a.getSession().forcedReplay}}return $n.push((function(){return s.stop()})),a.renewObservable.subscribe((function(){s.add(c(),Fe()),o.notify()})),a.expireObservable.subscribe((function(){i.notify(),s.closeActive(Fe())})),a.expandOrRenewSession(),s.add(c(),[0,Ve()][0]),r.observable.subscribe((function(){r.isGranted()?a.expandOrRenewSession():a.expire()})),function(e,t){var n=oe(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0}).stop;$n.push(n)}(e,(function(){r.isGranted()&&a.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=re(e,document,"visibilitychange",n).stop;$n.push(r);var o=L(n,Vn);$n.push((function(){A(o)}))}(e,(function(){return a.expandSession()})),function(e,t){var n=re(e,window,"resume",t,{capture:!0}).stop;$n.push(n)}(e,(function(){return a.restartSession()})),{findSession:function(e,t){return s.find(e,t)},renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}var Xn="logs";function Zn(e,t){var n=Kn(e,Xn,(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)}),t);return{findTrackedSession:function(e,t){void 0===t&&(t={returnInactive:!1});var r=n.findSession(e,t);return r&&"1"===r.trackingType?{id:r.id}:void 0},expireObservable:n.expireObservable}}function Yn(e){return $e(e.sessionSampleRate)?"1":"0"}var Qn=!1;function er(e){var t,n=window;if(Gn()){var r=o(n.DD_RUM_SYNTHETICS);return r||Qn||(Qn=!0,it("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Nt(Nn),"string"==typeof t?t:void 0),resultId:Fn()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function tr(e,t,n,r,o){var i=yt.concat(["custom"]),a={};i.forEach((function(e){var n,r,i,s,c;a[e]=(n=e,r=t.eventRateLimiterThreshold,i=o,s=0,c=!1,{isLimitReached:function(){if(0===s&&O((function(){s=0}),Ne),(s+=1)<=r||c)return c=!1,!1;if(s===r+1){c=!0;try{i({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:lt.AGENT,startClocks:He()})}finally{c=!1}}return!0}})})),n.subscribe(0,(function(o){var i,s,c=o.rawLogsEvent,u=o.messageContext,f=void 0===u?void 0:u,l=o.savedCommonContext,d=void 0===l?void 0:l,v=o.domainContext,p=Je(c.date),g=e.findTrackedSession(p);if(g||t.sendLogsAfterSessionExpiration&&e.findTrackedSession(p,{returnInactive:!0})){var m=d||r(),y=V({service:t.service,session_id:g?g.id:void 0,usr:M(m.user)?void 0:m.user,view:m.view},m.context,er(p),c,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,y,v))||y.origin!==lt.AGENT&&(null!==(s=a[y.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,y)}}))}var nr,rr={};function or(n){var r=n.map((function(n){return rr[n]||(rr[n]=function(n){return new Q((function(r){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=we();g((function(){r.notify(function(t,n,r){var o,i,a,s=t.map((function(e){return function(e){if("string"==typeof e)return X(e);if(e instanceof Error)return Ce(ue(e));return D(X(e),void 0,2)}(e)})).join(" ");if(n===e.error){var c=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=c?ke(ue(c)):void 0,i=Te(c),a=c?Oe(c,"console"):void 0}return{api:n,message:s,stack:o,handlingStack:r,fingerprint:i,causes:a}}(t,n,a))}))},function(){t[n]=o}}))}(n)),rr[n]}));return ee.apply(void 0,r)}var ir,ar=((nr={})[e.log]=vt.info,nr[e.debug]=vt.debug,nr[e.info]=vt.info,nr[e.warn]=vt.warn,nr[e.error]=vt.error,nr);var sr,cr=((ir={})[Ln.cspViolation]=vt.error,ir[Ln.intervention]=vt.error,ir[Ln.deprecation]=vt.warn,ir);var ur=new WeakMap;function fr(e){return sr||(sr=function(e){return new Q((function(t){var n=kt(XMLHttpRequest.prototype,"open",lr).stop,r=kt(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=e.handlingStack,i=ur.get(r);if(!i)return;var a=i;a.state="start",a.startClocks=He(),a.isAborted=!1,a.xhr=r,a.handlingStack=o;var s=!1,c=kt(r,"onreadystatechange",(function(){r.readyState===XMLHttpRequest.DONE&&u()})).stop,u=function(){if(f(),c(),!s){s=!0;var e,t=i;t.state="complete",t.duration=(e=a.startClocks.timeStamp,Ge()-e),t.status=r.status,n.notify(w({},t))}},f=re(t,r,"loadend",u).stop;n.notify(a)}(n,e,t)}),{computeHandlingStack:!0}).stop,o=kt(XMLHttpRequest.prototype,"abort",dr).stop;return function(){n(),r(),o()}}))}(e)),sr}function lr(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];ur.set(t,{state:"open",method:String(r).toUpperCase(),url:Ct(String(o))})}function dr(e){var t=e.target,n=ur.get(t);n&&(n.isAborted=!0)}function vr(e){return e>=500}function pr(e,t){if(!e.forwardErrorsToLogs)return{stop:P};var n=fr(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=Ot().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){var o={isAborted:r.isAborted,handlingStack:r.handlingStack};t.notify(0,{rawLogsEvent:{message:"".concat(mr(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:vt.error,origin:lt.NETWORK},domainContext:o})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!vr(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(gr(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(P),n.collectStreamBody){var s;if(1===o.length)s=o[0];else{s=new Uint8Array(i);var c=0;o.forEach((function(e){s.set(e,c),c+=e.length}))}e=s.slice(0,n.bytesLimit),a=s.length>n.bytesLimit}t(void 0,e,a)}!function e(){r.read().then(p((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),p((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(p((function(e){return n(gr(e,t))})),p((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(gr(ke(ue(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function gr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function mr(e){return"xhr"===e?"XHR":"Fetch"}function yr(e){var t,n=function(t,n){var r=_e({stackTrace:t,originalError:n,startClocks:He(),nonErrorPrefix:"Uncaught",source:lt.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,kt(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],i=r[1],a=r[2],s=r[3],c=r[4];n=c instanceof Error?ue(c):be(o,i,a,s),t(n,null!=c?c:o)}))).stop,o=function(e){return kt(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=ue(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var hr,br=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}();function Sr(e){return{handleLog:function(r,o,i,a,s){var c=V(o.getContext(),r.context);if(dt(r.status,mt.console,o)&&function(e,r){var o=e.status,i=e.message;n[wr[o]].call(t,i,r)}(r,c),dt(r.status,mt.http,o)){var u={rawLogsEvent:{date:s||Ge(),message:r.message,status:r.status,origin:lt.LOGGER},messageContext:c,savedCommonContext:a};i&&(u.domainContext={handlingStack:i}),e.notify(0,u)}}}}var wr=((hr={})[vt.ok]=e.debug,hr[vt.debug]=e.debug,hr[vt.info]=e.info,hr[vt.notice]=e.info,hr[vt.warn]=e.warn,hr[vt.error]=e.error,hr[vt.critical]=e.error,hr[vt.alert]=e.error,hr[vt.emerg]=e.error,hr);function kr(e){var t=e.encoder,n=e.request,r=e.flushController,i=e.messageBytesLimit,c={},u=r.flushObservable.subscribe((function(e){return function(e){var r=b(c).join("\n");c={};var o=(a=e.reason,y(b(Mn),a)),i=o?n.sendOnExit:n.send;var a;if(o&&t.isAsync){var s=t.finishSync();s.outputBytesCount&&i(Cr(s));var u=[s.pendingData,r].filter(Boolean).join("\n");u&&i({data:u,bytesCount:_(u)})}else r&&t.write(t.isEmpty?r:"\n".concat(r)),t.finish((function(e){i(Cr(e))}))}(e)}));function f(e,n){var u=D(e),f=t.estimateEncodedBytesCount(u);f>=i?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(i,"KB. ").concat(s," ").concat(a,"/#technical-limitations")):(function(e){return void 0!==e&&void 0!==c[e]}(n)&&function(e){var n=c[e];delete c[e];var o=t.estimateEncodedBytesCount(n);r.notifyAfterRemoveMessage(o)}(n),function(e,n,o){r.notifyBeforeAddMessage(n),void 0!==o?(c[o]=e,r.notifyAfterAddMessage()):t.write(t.isEmpty?e:"\n".concat(e),(function(e){r.notifyAfterAddMessage(e-n)}))}(u,f,n))}return{flushController:r,add:f,upsert:f,stop:u.unsubscribe}}function Cr(e){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding}}var xr=80*C,Er=32,_r=3*x,Tr=Ne,Or=Me;function Rr(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Ar(e,t,n,{onSuccess:function(){return Ir(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Lr(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Lr(e,t,n,r){2===e.transportStatus&&O((function(){Ar(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=Or,Ir(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(Tr,2*e.currentBackoffTime),Lr(e,t,n,r)}})}),e.currentBackoffTime)}function Ar(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||vr(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 Ir(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(_r/x,"MiB"),source:lt.AGENT,startClocks:He()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=Pr();i.size()>0;)Rr(i.dequeue(),t,n,r,o)}function Pr(){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>=_r}}}function Dr(e,t,n,r){var o={transportStatus:0,currentBackoffTime:Or,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=xr&&this.ongoingRequestCount<Er},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Pr(),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(p((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),p((function(){var n=t.build("xhr",r);Ur(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Ur(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){Rr(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){Br||(Br=!0,at(e))}(e)}var a=t.build("xhr",r);Ur(e,a,r.data)}(e,t,n,r)}}}var Br=!1;function Ur(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),re(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Mr(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)})),c=a.subscribe((function(){return d("session_expire")})),u=new Q((function(){return function(){s.unsubscribe(),c.unsubscribe()}})),f=0,l=0;function d(e){if(0!==l){var t=l,n=f;l=0,f=0,v(),u.notify({reason:e,messagesCount:t,bytesCount:n})}}function v(){R(t),t=void 0}return{flushObservable:u,get messagesCount(){return l},notifyBeforeAddMessage:function(e){f+e>=r&&d("bytes_limit"),l+=1,f+=e,void 0===t&&(t=O((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)&&v()}}}function Nr(e,t,n,r,o,i,a){void 0===a&&(a=kr);var s=u(e,t),c=n&&u(e,n);function u(e,t){var n=t.endpoint,s=t.encoder;return a({encoder:s,request:Dr(e,n,e.batchBytesLimit,r),flushController:Mr({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),s.add(e),c&&t&&c.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){s.upsert(e,t),c&&c.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){s.stop(),c&&c.stop()}}}function qr(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=_(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}}}function jr(e,t,n,r,o){var i=ot("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=er())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=er())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=er())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if(wt()){var s=St(),c=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return c.unsubscribe()}))}else{var u=Nr(t,{endpoint:t.rumEndpointBuilder,encoder:qr()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:qr()},n,r,o.expireObservable);a.push((function(){return u.stop()}));var f=i.observable.subscribe((function(e){return u.add(e,function(e){return e.site===Pe}(t))}));a.push((function(){return f.unsubscribe()}))}return nt.drain(),function(e){rt({type:Qe.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,telemetry_usage_sample_rate:t.telemetryUsageSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,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,tracking_consent:t.trackingConsent};return w({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var Gr,Fr,Hr,zr,Jr=function(e){var t,n,r=G(),i=te(r.getOrCreateTracker(2)),a=te(r.getOrCreateTracker(1)),s={tryToInit:function(e){t||(t=e)},update:function(e){t=e,n.notify()},isGranted:function(){return t===ne.GRANTED},observable:n=new Q};function c(){return function(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}(i,a)}var u,f,l=Bn(c,s,(function(t,n){t.storeContextsAcrossPages&&(se(n,i,Un,2),se(n,a,Un,1));var r=e(t,n,c,s);return l=function(e,t){return w({init:function(e){ut("DD_LOGS",e)},initConfiguration:e},t)}(t,r),r})),v={},g=new ht((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.handleLog.apply(l,e)}),r.createDetachedTracker());return u={logger:g,init:p((function(e){return l.init(e)})),setTrackingConsent:p((function(e){var t;s.update(e),t={feature:"set-tracking-consent",tracking_consent:e},rt({type:Qe.usage,usage:t})})),getGlobalContext:p((function(){return i.getContext()})),setGlobalContext:p((function(e){return i.setContext(e)})),setGlobalContextProperty:p((function(e,t){return i.setContextProperty(e,t)})),removeGlobalContextProperty:p((function(e){return i.removeContextProperty(e)})),clearGlobalContext:p((function(){return i.clearContext()})),createLogger:p((function(e,t){return void 0===t&&(t={}),v[e]=new ht((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l.handleLog.apply(l,e)}),r.createDetachedTracker(),X(e),t.handler,t.level,X(t.context)),v[e]})),getLogger:p((function(e){return v[e]})),getInitConfiguration:p((function(){return J(l.initConfiguration)})),getInternalContext:p((function(e){return l.getInternalContext(e)})),setUser:p((function(e){(function(e){var t="object"===H(e);return t||o.error("Unsupported user:",e),t})(e)&&a.setContext(ct(e))})),getUser:p((function(){return a.getContext()})),setUserProperty:p((function(e,t){var n,r=ct((n={},n[e]=t,n))[e];a.setContextProperty(e,r)})),removeUserProperty:p((function(e){return a.removeContextProperty(e)})),clearUser:p((function(){return a.clearContext()}))},f=w({version:"5.23.3",onReady:function(e){e()}},u),Object.defineProperty(f,"_setDebug",{get:function(){return d},enumerable:!1}),f}((function(t,n,r,o){var i=new br,a=[];i.subscribe(1,(function(e){return We("logs",e)}));var s=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:lt.AGENT,status:vt.error}}),it("Error reported to customer",{"error.message":t.message})}}(i),c=function(e){return new Q((function(t){var n=oe(e,window,["visibilitychange","freeze"],(function(e){"visibilitychange"===e.type&&"hidden"===document.visibilityState?t.notify({reason:Mn.HIDDEN}):"freeze"===e.type&&t.notify({reason:Mn.FROZEN})}),{capture:!0}).stop,r=re(e,window,"beforeunload",(function(){t.notify({reason:Mn.UNLOADING})})).stop;return function(){n(),r()}}))}(n),u=!n.sessionStoreStrategyType||wt()||Gn()?function(e){var t="1"===Yn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new Q}}(n):Zn(n,o),f=jr(t,n,s,c,u).stop;a.push((function(){return f()})),pr(n,i),function(e,t){if(!e.forwardErrorsToLogs)return{stop:P};var n=new Q,r=yr(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,causes:e.causes},origin:lt.SOURCE,status:vt.error}})}))}(n,i),function(t,n){var r=or(t.forwardConsoleLogs).subscribe((function(t){var r={rawLogsEvent:{date:Ge(),message:t.message,origin:lt.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint,causes:t.causes}:void 0,status:ar[t.api]},domainContext:{handlingStack:t.handlingStack}};n.notify(0,r)}))}(n,i),function(e,t){var n=An(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=cr[e.type];o===vt.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:Ge(),message:r,origin:lt.REPORT,error:n,status:o}})}))}(n,i);var l,d=Sr(i).handleLog;if(tr(u,n,i,r,s),wt())!function(e){var t=St();e.subscribe(1,(function(e){t.send("log",e)}))}(i);else{var v=function(e,t,n,r,o){var i=Nr(e,{endpoint:e.logsEndpointBuilder,encoder:qr()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:qr()},n,r,o.expireObservable);return t.subscribe(1,(function(e){i.add(e)})),i}(n,i,s,c,u).stop;a.push((function(){return v()}))}return{handleLog:d,getInternalContext:(l=u,{get:function(e){var t=l.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop:function(){a.forEach((function(e){return e()}))}}}));Gr=k(),Hr=Jr,(zr=Gr[Fr="DD_LOGS"])&&!zr.q&&zr.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),Gr[Fr]=Hr,zr&&zr.q&&zr.q.forEach((function(e){return c(e,"onReady callback threw an error:")()}))}();

@@ -7,3 +7,3 @@ "use strict";

function createPreStartStrategy(getCommonContext, trackingConsentState, doStartLogs) {
var bufferApiCalls = new browser_core_1.BoundedBuffer();
var bufferApiCalls = (0, browser_core_1.createBoundedBuffer)();
var cachedInitConfiguration;

@@ -10,0 +10,0 @@ var cachedConfiguration;

@@ -26,3 +26,3 @@ "use strict";

service: configuration.service,
session_id: session === null || session === void 0 ? void 0 : session.id,
session_id: session ? session.id : undefined,
// Insert user first to allow overrides from global context

@@ -29,0 +29,0 @@ usr: !(0, browser_core_1.isEmptyObject)(commonContext.user) ? commonContext.user : undefined,

@@ -19,3 +19,3 @@ "use strict";

// note: it is safe to merge declarations as long as the methods are actually defined on the prototype
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging, no-restricted-syntax
var Logger = /** @class */ (function () {

@@ -22,0 +22,0 @@ function Logger(handleLogStrategy, customerDataTracker, name, handlerType, level, loggerContext) {

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

import { BoundedBuffer, assign, canUseEventBridge, display, displayAlreadyInitializedError, initFeatureFlags, initFetchObservable, noop, timeStampNow, } from '@datadog/browser-core';
import { createBoundedBuffer, assign, canUseEventBridge, display, displayAlreadyInitializedError, initFeatureFlags, initFetchObservable, noop, timeStampNow, } from '@datadog/browser-core';
import { validateAndBuildLogsConfiguration, } from '../domain/configuration';
export function createPreStartStrategy(getCommonContext, trackingConsentState, doStartLogs) {
var bufferApiCalls = new BoundedBuffer();
var bufferApiCalls = createBoundedBuffer();
var cachedInitConfiguration;

@@ -6,0 +6,0 @@ var cachedConfiguration;

@@ -23,3 +23,3 @@ import { ErrorSource, combine, createEventRateLimiter, getRelativeTime, isEmptyObject } from '@datadog/browser-core';

service: configuration.service,
session_id: session === null || session === void 0 ? void 0 : session.id,
session_id: session ? session.id : undefined,
// Insert user first to allow overrides from global context

@@ -26,0 +26,0 @@ usr: !isEmptyObject(commonContext.user) ? commonContext.user : undefined,

@@ -16,3 +16,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

// note: it is safe to merge declarations as long as the methods are actually defined on the prototype
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging, no-restricted-syntax
var Logger = /** @class */ (function () {

@@ -19,0 +19,0 @@ function Logger(handleLogStrategy, customerDataTracker, name, handlerType, level, loggerContext) {

{
"name": "@datadog/browser-logs",
"version": "5.23.0",
"version": "5.23.3",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "5.23.0"
"@datadog/browser-core": "5.23.3"
},
"peerDependencies": {
"@datadog/browser-rum": "5.23.0"
"@datadog/browser-rum": "5.23.3"
},

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

},
"gitHead": "11c8da555ab131e2b0c1b53e9908fbde64c388c8"
"gitHead": "276d1141c77dfaafcd5fc16a8cb7baf6221cfff4"
}
import type { TrackingConsentState } from '@datadog/browser-core'
import {
BoundedBuffer,
createBoundedBuffer,
assign,

@@ -27,3 +27,3 @@ canUseEventBridge,

): Strategy {
const bufferApiCalls = new BoundedBuffer<StartLogsResult>()
const bufferApiCalls = createBoundedBuffer<StartLogsResult>()
let cachedInitConfiguration: LogsInitConfiguration | undefined

@@ -30,0 +30,0 @@ let cachedConfiguration: LogsConfiguration | undefined

@@ -42,3 +42,3 @@ import type { EventRateLimiter, RawError } from '@datadog/browser-core'

service: configuration.service,
session_id: session?.id,
session_id: session ? session.id : undefined,
// Insert user first to allow overrides from global context

@@ -45,0 +45,0 @@ usr: !isEmptyObject(commonContext.user) ? commonContext.user : undefined,

@@ -35,3 +35,3 @@ import type { Context, ContextManager, CustomerDataTracker } from '@datadog/browser-core'

// note: it is safe to merge declarations as long as the methods are actually defined on the prototype
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging, no-restricted-syntax
export class Logger {

@@ -38,0 +38,0 @@ private contextManager: ContextManager

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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