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 2.13.0 to 2.14.0

2

bundle/datadog-logs.js

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

!function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function t(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function n(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}var r={log:console.log.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)},o=function(e){return Array.isArray(e)},i=function(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e};function a(){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=u(e,i,s()))}return e}function s(){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}}}function u(e,t,n){if(void 0===t)return e;if(!i(t)&&!o(t))return t;if(!n.hasAlreadyBeenSeen(t)){if(i(t)&&(void 0===e||i(e))){var r=e||{};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=u(r[a],t[a],n));return r}if(o(t)&&(void 0===e||o(e))){(r=e||[]).length=Math.max(r.length,t.length);for(var s=0;s<t.length;s+=1)r[s]=u(r[s],t[s],n);return r}return t}}var c="agent",f="console",l="logger",d="network",p="source";function h(e){var t=v(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function v(e){return(e.name||"Error")+": "+e.message}var g=/[^\u0000-\u007F]/,m=function(){function e(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return e.prototype.send=function(e,t){var n=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&t<this.bytesLimit)try{if(navigator.sendBeacon(n,e))return}catch(e){!function(e){y||(y=!0,J(e))}(e)}var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var y=!1;var b=function(){function e(e,t,n,r,o,i){void 0===i&&(i=re),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.beforeUnloadCallback=i,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(){if(0!==this.bufferMessageCount){var e=n(this.pushOnlyBuffer,(t=this.upsertBuffer,r=[],Object.keys(t).forEach((function(e){r.push(t[e])})),r));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,r},e.prototype.sizeInBytes=function(e){return g.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),o=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(o,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=oe(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout(K((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(se(window,"beforeunload",this.beforeUnloadCallback),se(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flush()})),se(window,"beforeunload",(function(){return e.flush()})))},e}(),w=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function x(e){if(k){if(E===e)return;A()}var t=_(e);throw k=t,E=e,setTimeout(K((function(){E===e&&A()})),t.incomplete?2e3:0),e}var E,k,S,T,M,O=[];function R(e){!function(){if(T)return;S=window.onerror,window.onerror=K(L),T=!0}(),function(){if(M)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=K(B),M=!0}(),O.push(e)}function C(e,t,n){var r;if(O.forEach((function(o){try{o(e,t,n)}catch(e){r=e}})),r)throw r}function L(e,t,n,r,o){if(k)D(k,t,n),A();else if(o)C(_(o),!0,o);else{var i,a={url:t,column:r,line:n},s=e;if("[object String]"==={}.toString.call(e)){var u=w.exec(s);u&&(i=u[1],s=u[2])}C({name:i,message:"string"==typeof s?s:void 0,stack:[a]},!0,e)}return!!S&&S.apply(this,arguments)}function B(e){var t=e.reason||"Empty reason";C(_(t),!0,t)}function A(){var e=k,t=E;k=void 0,E=void 0,C(e,!1,t)}var I="?";function _(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=z(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s<i.length;s+=2){var u=void 0;r.exec(i[s])?u={args:[],column:void 0,func:(n=r.exec(i[s]))[3],line:+n[1],url:n[2]}:o.exec(i[s])&&(u={args:(n=o.exec(i[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=I),u.context=[i[s+1]],a.push(u))}if(!a.length)return;return{stack:a,message:z(e,"message"),name:z(e,"name")}}(e))return n}catch(e){if(N)throw e}try{if(n=function(e){var t=z(e,"stack");if(!t)return;for(var n,r,o,i,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=t.split("\n"),d=[],p=0,h=l.length;p<h;p+=1){if(a.exec(l[p])){var v=(o=a.exec(l[p]))[2]&&0===o[2].indexOf("native");n=o[2]&&0===o[2].indexOf("eval"),r=f.exec(o[2]),n&&r&&(o[2]=r[1],o[3]=r[2],o[4]=r[3]),i={args:v?[o[2]]:[],column:o[4]?+o[4]:void 0,func:o[1]||I,line:o[3]?+o[3]:void 0,url:v?void 0:o[2]}}else if(u.exec(l[p]))i={args:[],column:(o=u.exec(l[p]))[4]?+o[4]:void 0,func:o[1]||I,line:+o[3],url:o[2]};else{if(!s.exec(l[p]))continue;n=(o=s.exec(l[p]))[3]&&o[3].indexOf(" > eval")>-1,r=c.exec(o[3]),n&&r?(o[3]=r[1],o[4]=r[2],o[5]=void 0):0!==p||o[5]||U(e.columnNumber)||(d[0].column=e.columnNumber+1),i={args:o[2]?o[2].split(","):[],column:o[5]?+o[5]:void 0,func:o[1]||I,line:o[4]?+o[4]:void 0,url:o[3]}}!i.func&&i.line&&(i.func=I),d.push(i)}if(!d.length)return;return{stack:d,message:z(e,"message"),name:z(e,"name")}}(e))return n}catch(e){if(N)throw e}try{if(n=function(e){var t=z(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,o=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in u)H(u,f)&&!u[f].src&&c.push(u[f]);for(var l=2;l<n.length;l+=2){var d=void 0;if(o.exec(n[l]))d={args:[],column:void 0,func:(r=o.exec(n[l]))[3],line:+r[1],url:r[2]};else if(i.exec(n[l]))d={args:[],column:void 0,func:(r=i.exec(n[l]))[4],line:+r[1],url:r[3]};else if(a.exec(n[l])){r=a.exec(n[l]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}d&&(d.func||(d.func=I),d.context=[n[l+1]],s.push(d))}if(!s.length)return;return{stack:s,message:n[0],name:z(e,"name")}}(e))return n}catch(e){if(N)throw e}try{if(n=P(e,r+1))return n}catch(e){if(N)throw e}return{message:z(e,"message"),name:z(e,"name"),stack:[]}}var j,N=!1;function D(e,t,n){var r={url:t,line:n?+n:void 0};if(r.url&&r.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===r.url){if(o[0].line===r.line)return!1;if(!o[0].line&&o[0].func===r.func)return o[0].line=r.line,o[0].context=r.context,!1}return o.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function P(e,t){for(var n,r,o=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,i=[],a={},s=!1,u=P.caller;u&&!s;u=u.caller)u!==_&&u!==x&&(r={args:[],column:void 0,func:I,line:void 0,url:void 0},n=o.exec(u.toString()),u.name?r.func=u.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[u.toString()]?s=!0:a[u.toString()]=!0,i.push(r));t&&i.splice(0,t);var c={stack:i,message:z(e,"message"),name:z(e,"name")};return D(c,z(e,"sourceURL")||z(e,"fileName"),z(e,"line")||z(e,"lineNumber")),c}function z(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function H(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function U(e){return void 0===e}!function(e){e.info="info",e.error="error"}(j||(j={}));var q,F={maxMessagesPerPage:0,sentMessageCount:0};function G(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new b(new m(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}function o(e){return a({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==q?q():{},e)}return{add:function(e){var r=o(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}(F,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){q=e}}}function $(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=F.batch?K(r):r;return n.apply(this,e)}}function K(e){return function(){return X(e,this,arguments)}}function X(e,t,n){try{return e.apply(t,n)}catch(e){Z(e);try{J(e)}catch(e){Z(e)}}}function J(t){V(e(e({},function(e){if(e instanceof Error){var t=_(e);return{error:{kind:t.name,stack:h(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+oe(e)}}(t)),{status:j.error}))}function V(e){F.batch&&F.sentMessageCount<F.maxMessagesPerPage&&(F.sentMessageCount+=1,F.batch.add(e))}function W(e){F.debugMode=e}function Z(e){F.debugMode&&r.error("[INTERNAL ERROR]",e)}var Y,Q,ee=1e3,te=6e4;function ne(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ne)}function re(){}function oe(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];ie(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&ie(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,t,n)}catch(e){i="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(o.toJSON=a[1])}return i}function ie(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function ae(e,t){return-1!==e.indexOf(t)}function se(e,t,n,r){return ue(e,[t],n,r)}function ue(e,t,n,r){var o=void 0===r?{}:r,i=o.once,a=o.capture,s=o.passive,u=K(i?function(e){f(),n(e)}:n),c=s?{capture:a,passive:s}:a;t.forEach((function(t){return e.addEventListener(t,u,c)}));var f=function(){return t.forEach((function(t){return e.removeEventListener(t,u,c)}))};return{stop:f}}!function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(Y||(Y={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(Q||(Q={}));var ce,fe;function le(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires="+o.toUTCString(),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+i+";path=/;samesite="+a+s+u}function de(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)").exec(e);return n?n[1]:void 0}(document.cookie,e)}function pe(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];try{return e.apply(void 0,n)}catch(e){r.error(t,e)}}}var he={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay",trace:"trace"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0,trace:"public-trace"}},ve="eu",ge="us",me=((fe={})[ve]="datadoghq.eu",fe[ge]="datadoghq.com",fe),ye=[me[ge],me[ve]];function be(t,n){var r={buildMode:n.buildMode,clientToken:t.clientToken,env:t.env,proxyHost:t.proxyHost,sdkVersion:n.sdkVersion,service:t.service,site:t.site||me[t.datacenter||n.datacenter],version:t.version},o=function(e,t){return!t.useAlternateIntakeDomains&&ae(ye,e)?"classic":"alternate"}(r.site,t),i=function(e,t,n){if(t.proxyHost)return["https://"+t.proxyHost+"/v1/input/"];var r=[t.site];t.buildMode===Ee.STAGING&&n&&r.push(me[ge]);for(var o=[],i=Object.keys(he[e]),a=0,s=r;a<s.length;a++)for(var u=s[a],c=0,f=i;c<f.length;c++){var l=f[c];o.push("https://"+we(e,l,u)+"/v1/input/")}return o}(o,r,void 0!==t.replica),a={isIntakeUrl:function(e){return i.some((function(t){return 0===e.indexOf(t)}))},logsEndpoint:xe(o,"logs",r),rumEndpoint:xe(o,"rum",r),sessionReplayEndpoint:xe(o,"sessionReplay",r),traceEndpoint:xe(o,"trace",r)};if(t.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=xe(o,"logs",r,"browser-agent-internal-monitoring")),r.buildMode===Ee.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),r.buildMode===Ee.STAGING&&void 0!==t.replica){var s=e(e({},r),{applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,site:me[ge]});a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:xe(o,"logs",s,"browser-agent-internal-monitoring"),logsEndpoint:xe(o,"logs",s),rumEndpoint:xe(o,"rum",s)}}return a}function we(e,t,n){return"classic"===e&&function(e,t){var n=he.classic[e];return n&&n+"-http-intake.logs."+t}(t,n)||function(e,t){var n=he.alternate[e],r=t.split("."),o=r.pop(),i=r.join("-")+"."+o;return n+".browser-intake-"+i}(t,n)}function xe(e,t,n,r){var o="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),i=we(e,t,n.site),a=n.proxyHost?n.proxyHost:i,s=(n.proxyHost?"ddhost="+i+"&":"")+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(o);return"https://"+a+"/v1/input/"+n.clientToken+"?"+s}var Ee,ke={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,trackViewsManually:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Se(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===ce){for(var e="dd_site_test_"+ne(),t=window.location.hostname.split("."),n=t.pop();t.length&&!de(e);)n=t.pop()+"."+n,le(e,"test",ee,{domain:n});ce=n}return ce}()),t}function Te(t,n){var r=function(t,n){var r=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],o=e(e({beforeSend:t.beforeSend&&pe(t.beforeSend,"beforeSend threw an error:"),cookieOptions:Se(t),isEnabled:function(e){return ae(r,e)},service:t.service},be(t,n)),ke);return"allowedTracingOrigins"in t&&(o.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(o.sampleRate=t.sampleRate),"resourceSampleRate"in t&&(o.resourceSampleRate=t.resourceSampleRate),"trackInteractions"in t&&(o.trackInteractions=!!t.trackInteractions),"trackViewsManually"in t&&(o.trackViewsManually=!!t.trackViewsManually),o}(t,n);return{configuration:r,internalMonitoring:G(r)}}function Me(){var e={};return{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t}}}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Ee||(Ee={}));var Oe,Re,Ce,Le,Be=function(){function e(e){void 0===e&&(e=1e4),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),Ae={debug:"debug",error:"error",info:"info",warn:"warn"},Ie=((Oe={})[Ae.debug]=0,Oe[Ae.info]=1,Oe[Ae.warn]=2,Oe[Ae.error]=3,Oe),_e=(Object.keys(Ae),"console"),je="http",Ne=function(){function t(e,t,n,r){void 0===t&&(t=je),void 0===n&&(n=Ae.debug),void 0===r&&(r={}),this.sendLog=e,this.handlerType=t,this.level=n,this.contextManager=Me(),this.contextManager.set(r)}return t.prototype.log=function(t,n,o){if(void 0===o&&(o=Ae.info),Ie[o]>=Ie[this.level]){var i=Array.isArray(this.handlerType)?this.handlerType:[this.handlerType];ae(i,je)&&this.sendLog(e({message:t,status:o},a(this.contextManager.get(),n))),ae(i,_e)&&r.log(o+": "+t,a(this.contextManager.get(),n))}},t.prototype.debug=function(e,t){this.log(e,t,Ae.debug)},t.prototype.info=function(e,t){this.log(e,t,Ae.info)},t.prototype.warn=function(e,t){this.log(e,t,Ae.warn)},t.prototype.error=function(e,t){var n={error:{origin:l}};this.log(e,a(n,t),Ae.error)},t.prototype.setContext=function(e){this.contextManager.set(e)},t.prototype.addContext=function(e,t){this.contextManager.add(e,t)},t.prototype.removeContext=function(e){this.contextManager.remove(e)},t.prototype.setHandler=function(e){this.handlerType=e},t.prototype.setLevel=function(e){this.level=e},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);i>3&&a&&Object.defineProperty(t,n,a)}([$],t.prototype,"log",null),t}();function De(){return Date.now()}function Pe(){return performance.now()}function ze(){return{relative:Pe(),timeStamp:De()}}function He(e,t){return t-e}function Ue(e){return qe(e,function(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}(window.location)).href}function qe(e,t){if(function(){if(void 0!==Re)return Re;try{var e=new URL("http://test/path");return Re="http://test/path"===e.href}catch(e){Re=!1}return Re}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '"+e+"'");var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var Fe,Ge=[],$e=[];function Ke(){return Ce||(!function(){if(!window.fetch)return;Le=window.fetch,window.fetch=function(e,t){var n,r=X(Xe,null,[e,t]);return r?X(Je,null,[n=Le.call(this,r.input,r.init),r]):n=Le.call(this,e,t),n}}(),Ce={beforeSend:function(e){Ge.push(e)},onRequestComplete:function(e){$e.push(e)}}),Ce}function Xe(e,t){var n=t&&t.method||"object"==typeof e&&e.method||"GET",r=Ue("object"==typeof e&&e.url||e),o={init:t,input:e,method:n,startClocks:ze(),url:r};return Ge.forEach((function(e){return e(o)})),o}function Je(e,n){var r=this,o=function(e){return o=r,i=void 0,s=function(){var r,o;return t(this,(function(t){switch(t.label){case 0:return n.duration=He(n.startClocks.timeStamp,De()),"stack"in e||e instanceof Error?(n.status=0,n.responseText=h(_(e)),n.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,n.error=e,$e.forEach((function(e){return e(n)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];r=void 0,t.label=2;case 2:return t.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return r=t.sent(),[3,5];case 4:return o=t.sent(),r="Unable to retrieve response: "+o,[3,5];case 5:n.response=e,n.responseText=r,n.responseType=e.type,n.status=e.status,n.isAborted=!1,$e.forEach((function(e){return e(n)})),t.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(n,r)}u((s=s.apply(o,i||[])).next())}));var o,i,a,s};e.then(K(o),K(o))}var Ve,We,Ze,Ye=[],Qe=[];function et(){return Fe||(Ve=XMLHttpRequest.prototype.open,We=XMLHttpRequest.prototype.send,Ze=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(e,t){var n=this;return X((function(){n._datadog_xhr={method:e,url:Ue(t)}})),Ve.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){var t=this;return X((function(){if(t._datadog_xhr){var n=t._datadog_xhr;n.startTime=Pe(),n.startClocks=ze(),n.isAborted=!1;var r=t.onreadystatechange;t.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&X(i),r&&r.apply(this,arguments)};var o=!1,i=function(){if(!o){o=!0;var r=e(e({},n),{duration:He(n.startClocks.timeStamp,De()),responseText:t.response,status:t.status,xhr:t});Qe.forEach((function(e){return e(r)}))}};t.addEventListener("loadend",K(i)),Ye.forEach((function(e){return e(n,t)}))}})),We.apply(this,arguments)},XMLHttpRequest.prototype.abort=function(){var e=this;return X((function(){e._datadog_xhr&&(e._datadog_xhr.isAborted=!0)})),Ze.apply(this,arguments)},Fe={beforeSend:function(e){Ye.push(e)},onRequestComplete:function(e){Qe.push(e)}}),Fe}var tt,nt,rt=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t}))}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function ot(t){return tt||(function(e,t){function n(n,r){e.isIntakeUrl(r.url)||e.isEnabled("remove-network-errors")&&r.isAborted||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:st(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:d,stack:at(r.responseText,e)||"Failed to load",startClocks:r.startClocks})}et().onRequestComplete((function(e){return n(Q.XHR,e)})),Ke().onRequestComplete((function(e){return n(Q.FETCH,e)}))}(t,tt=new rt),function(t){nt=console.error,console.error=K((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];nt.apply(console,n),t.notify(e(e({},it(n)),{source:f,startClocks:ze()}))}))}(tt),function(e){R((function(t,n,r){var o=function(e,t,n){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:h(e),type:e.name}:{message:n+" "+oe(t),stack:"No stack, consider using an instance of Error",type:e&&e.name}}(t,r,"Uncaught"),i=o.stack,a=o.message,s=o.type;e.notify({message:a,stack:i,type:s,source:p,startClocks:ze(),originalError:r})}))}(tt)),tt}function it(e){var t=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));return{message:n(["console error:"],e).map((function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return v(_(e));return oe(e,void 0,2)}(e)})).join(" "),stack:t?h(_(t)):void 0}}function at(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function st(e){return Q.XHR===e?"XHR":"Fetch"}function ut(e,t,n){var r=u(void 0,e,s()),o=n(r);return t.forEach((function(t){var n=ct(e,t),o=ct(r,t),i=dt(n),a=dt(o);a===i?ft(e,t,o):"object"!==i||"undefined"!==a&&"null"!==a||ft(e,t,{})})),o}function ct(e,t){for(var n=e,r=0,o=t.split(".");r<o.length;r++){var i=o[r];if(!lt(n,i))return;n=n[i]}return n}function ft(e,t,n){for(var r=e,o=t.split("."),i=0;i<o.length;i+=1){var a=o[i];if(!lt(r,a))return;i!==o.length-1?r=r[a]:r[a]=n}}function lt(e,t){return"object"==typeof e&&null!==e&&t in e}function dt(e){return null===e?"null":Array.isArray(e)?"array":typeof e}var pt=9e5,ht=144e5;function vt(e,t,n){var r=function(e,t){var n,r,o=!1,i=function(){o=!0,clearTimeout(n),n=setTimeout((function(){o=!1}),1e3)};return{get:function(){return o||(r=de(e),i()),r},set:function(n,o){le(e,n,o,t),r=n,i()}}}("_dd_s",e);!function(e){var t=e.get(),n=de("_dd"),r=de("_dd_r"),o=de("_dd_l");if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i.logs=o),r&&/^[012]$/.test(r)&&(i.rum=r),bt(i,e)}}(r);var o=new rt,i=yt(r).id,a=function(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=setTimeout((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){clearTimeout(o),s=!1,r=void 0}}}(K((function(){var e=yt(r),a=n(e[t]),s=a.trackingType,u=a.isTracked;e[t]=s,u&&!e.id&&(e.id=ne(),e.created=String(Date.now())),bt(e,r),u&&i!==e.id&&(i=e.id,o.notify())})),1e3).throttled;return a(),function(e){var t=ue(window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0}).stop;xt.push(t)}(a),function(e){var t=K((function(){"visible"===document.visibilityState&&e()})),n=se(document,"visibilitychange",t).stop;xt.push(n);var r=setInterval(t,6e4);xt.push((function(){clearInterval(r)}))}((function(){bt(yt(r),r)})),{getId:function(){return yt(r).id},getTrackingType:function(){return yt(r)[t]},renewObservable:o}}var gt=/^([a-z]+)=([a-z0-9-]+)$/,mt="&";function yt(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||gt.test(e))})(t)&&t.split(mt).forEach((function(e){var t=gt.exec(e);if(null!==t){var r=t[1],o=t[2];n[r]=o}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<ht)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(wt(e),{})}function bt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+pt);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(mt);t.set(r,pt)}else wt(t)}function wt(e){e.set("",0)}var xt=[];var Et;function kt(e,t){if(!t){var n=St(e)===Et.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=vt(e.cookieOptions,"logs",(function(t){return function(e,t){var n=function(e){return e===Et.NOT_TRACKED||e===Et.TRACKED}(t)?t:St(e);return{trackingType:n,isTracked:n===Et.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Et.TRACKED}}}function St(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Et.TRACKED:Et.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Et||(Et={}));var Tt={buildMode:"release",datacenter:"us",sdkVersion:"2.13.0"},Mt=["view.url","view.referrer","message","error.stack","http.url"];function Ot(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var Rt,Ct,Lt,Bt,At=function(t){var n=!1,o=Me(),i={},s=new Be,u=function(e,t){s.add((function(){return u(e,t)}))},c=new Ne(d);return f={logger:c,init:K((function(e){(function(e){return n?(e.silentMultipleInit||r.error("DD_LOGS is already initialized."),!1):e&&(e.publicApiKey||e.clientToken)?!!(void 0===e.sampleRate||(t=e.sampleRate,function(e){return"number"==typeof e}(t)&&t>=0&&t<=100))||(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Client Token is not configured, we will not send any data."),!1);var t})(e)&&(e.publicApiKey&&(e.clientToken=e.publicApiKey,r.warn("Public API Key is deprecated. Please use Client Token instead.")),u=t(e,c,o.get),s.drain(),n=!0)})),getLoggerGlobalContext:K(o.get),setLoggerGlobalContext:K(o.set),addLoggerGlobalContext:K(o.add),removeLoggerGlobalContext:K(o.remove),createLogger:K((function(t,n){return void 0===n&&(n={}),i[t]=new Ne(d,n.handler,n.level,e(e({},n.context),{logger:{name:t}})),i[t]})),getLogger:K((function(e){return i[e]}))},l=e(e({},f),{onReady:function(e){e()}}),Object.defineProperty(l,"_setDebug",{get:function(){return W},enumerable:!1}),l;var f,l;function d(e){u(e,a({date:Date.now(),view:{referrer:document.referrer,url:window.location.href}},o.get()))}}((function(e,t,n){var o=Te(e,Tt),i=o.configuration,s=o.internalMonitoring;return function(e,t,n,r,o,i){n.setExternalContextProvider((function(){return a({session_id:r.getId()},i(),Ot())}));var s=function(e,t,n){var r=function(e,t){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),te),(n+=1)<=e.maxErrorsByMinute||r)return r=!1,!1;if(n===e.maxErrorsByMinute+1){r=!0;try{t({message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,source:c,startClocks:ze()})}finally{r=!1}}return!0}}}(t,n);return function(n,o){if(e.isTracked()){var i=a({service:t.service,session_id:e.getId()},o,Ot(),n);if(t.beforeSend)if(!1===ut(i,Mt,t.beforeSend))return;if(i.status!==Ae.error||!r.isLimitReached())return i}}}(r,e,f),u=function(e){var t,n=r(e.logsEndpoint);void 0!==e.replica&&(t=r(e.replica.logsEndpoint));function r(t){return new b(new m(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){n.add(e),t&&t.add(e)}}}(e);function f(e){o.error(e.message,a({date:e.startClocks.timeStamp,error:{kind:e.type,origin:e.source,stack:e.stack}},e.resource?{http:{method:e.resource.method,status_code:e.resource.statusCode,url:e.resource.url}}:void 0,Ot(e.startClocks.relative)))}return t.subscribe(f),function(e,t){var n=s(e,t);n&&u.add(n)}}(i,!1!==e.forwardErrorsToLogs?ot(i):new rt,s,kt(i,function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_"+ne(),n="test";return le(t,n,ee,e),de(t)===n}catch(e){return r.error(e),!1}}(i.cookieOptions)),t,n)}));Rt=function(){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}(),Lt=At,Bt=Rt[Ct="DD_LOGS"],Rt[Ct]=Lt,Bt&&Bt.q&&Bt.q.forEach((function(e){return pe(e,"onReady callback threw an error:")()}))}();
!function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function t(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function n(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}var r={log:console.log.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)},o=function(e){return Array.isArray(e)},i=function(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e};function a(){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=u(e,i,s()))}return e}function s(){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}}}function u(e,t,n){if(void 0===t)return e;if(!i(t)&&!o(t))return t;if(!n.hasAlreadyBeenSeen(t)){if(i(t)&&(void 0===e||i(e))){var r=e||{};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=u(r[a],t[a],n));return r}if(o(t)&&(void 0===e||o(e))){(r=e||[]).length=Math.max(r.length,t.length);for(var s=0;s<t.length;s+=1)r[s]=u(r[s],t[s],n);return r}return t}}var c,f="agent",l="console",d="logger",p="network",h="source";function v(e){var t=g(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function g(e){return(e.name||"Error")+": "+e.message}!function(e){e.HANDLED="handled",e.UNHANDLED="unhandled"}(c||(c={}));var m=/[^\u0000-\u007F]/,y=function(){function e(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return e.prototype.send=function(e,t){var n=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&t<this.bytesLimit)try{if(navigator.sendBeacon(n,e))return}catch(e){!function(e){b||(b=!0,V(e))}(e)}var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var b=!1;var w=function(){function e(e,t,n,r,o,i){void 0===i&&(i=oe),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.beforeUnloadCallback=i,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(){if(0!==this.bufferMessageCount){var e=n(this.pushOnlyBuffer,(t=this.upsertBuffer,r=[],Object.keys(t).forEach((function(e){r.push(t[e])})),r));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,r},e.prototype.sizeInBytes=function(e){return m.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),o=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(o,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=ie(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout(X((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(ue(window,"beforeunload",this.beforeUnloadCallback),ue(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flush()})),ue(window,"beforeunload",(function(){return e.flush()})))},e}(),x=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function E(e){if(S){if(k===e)return;B()}var t=N(e);throw S=t,k=e,setTimeout(X((function(){k===e&&B()})),t.incomplete?2e3:0),e}var k,S,T,M,O,R=[];function C(e){!function(){if(M)return;T=window.onerror,window.onerror=X(L),M=!0}(),function(){if(O)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=X(A),O=!0}(),R.push(e)}function _(e,t,n){var r;if(R.forEach((function(o){try{o(e,t,n)}catch(e){r=e}})),r)throw r}function L(e,t,n,r,o){if(S)P(S,t,n),B();else if(o)_(N(o),!0,o);else{var i,a={url:t,column:r,line:n},s=e;if("[object String]"==={}.toString.call(e)){var u=x.exec(s);u&&(i=u[1],s=u[2])}_({name:i,message:"string"==typeof s?s:void 0,stack:[a]},!0,e)}return!!T&&T.apply(this,arguments)}function A(e){var t=e.reason||"Empty reason";_(N(t),!0,t)}function B(){var e=S,t=k;S=void 0,k=void 0,_(e,!1,t)}var I="?";function N(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=H(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s<i.length;s+=2){var u=void 0;r.exec(i[s])?u={args:[],column:void 0,func:(n=r.exec(i[s]))[3],line:+n[1],url:n[2]}:o.exec(i[s])&&(u={args:(n=o.exec(i[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=I),u.context=[i[s+1]],a.push(u))}if(!a.length)return;return{stack:a,message:H(e,"message"),name:H(e,"name")}}(e))return n}catch(e){if(j)throw e}try{if(n=function(e){var t=H(e,"stack");if(!t)return;for(var n,r,o,i,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=t.split("\n"),d=[],p=0,h=l.length;p<h;p+=1){if(a.exec(l[p])){var v=(o=a.exec(l[p]))[2]&&0===o[2].indexOf("native");n=o[2]&&0===o[2].indexOf("eval"),r=f.exec(o[2]),n&&r&&(o[2]=r[1],o[3]=r[2],o[4]=r[3]),i={args:v?[o[2]]:[],column:o[4]?+o[4]:void 0,func:o[1]||I,line:o[3]?+o[3]:void 0,url:v?void 0:o[2]}}else if(u.exec(l[p]))i={args:[],column:(o=u.exec(l[p]))[4]?+o[4]:void 0,func:o[1]||I,line:+o[3],url:o[2]};else{if(!s.exec(l[p]))continue;n=(o=s.exec(l[p]))[3]&&o[3].indexOf(" > eval")>-1,r=c.exec(o[3]),n&&r?(o[3]=r[1],o[4]=r[2],o[5]=void 0):0!==p||o[5]||q(e.columnNumber)||(d[0].column=e.columnNumber+1),i={args:o[2]?o[2].split(","):[],column:o[5]?+o[5]:void 0,func:o[1]||I,line:o[4]?+o[4]:void 0,url:o[3]}}!i.func&&i.line&&(i.func=I),d.push(i)}if(!d.length)return;return{stack:d,message:H(e,"message"),name:H(e,"name")}}(e))return n}catch(e){if(j)throw e}try{if(n=function(e){var t=H(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,o=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in u)U(u,f)&&!u[f].src&&c.push(u[f]);for(var l=2;l<n.length;l+=2){var d=void 0;if(o.exec(n[l]))d={args:[],column:void 0,func:(r=o.exec(n[l]))[3],line:+r[1],url:r[2]};else if(i.exec(n[l]))d={args:[],column:void 0,func:(r=i.exec(n[l]))[4],line:+r[1],url:r[3]};else if(a.exec(n[l])){r=a.exec(n[l]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}d&&(d.func||(d.func=I),d.context=[n[l+1]],s.push(d))}if(!s.length)return;return{stack:s,message:n[0],name:H(e,"name")}}(e))return n}catch(e){if(j)throw e}try{if(n=z(e,r+1))return n}catch(e){if(j)throw e}return{message:H(e,"message"),name:H(e,"name"),stack:[]}}var D,j=!1;function P(e,t,n){var r={url:t,line:n?+n:void 0};if(r.url&&r.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===r.url){if(o[0].line===r.line)return!1;if(!o[0].line&&o[0].func===r.func)return o[0].line=r.line,o[0].context=r.context,!1}return o.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function z(e,t){for(var n,r,o=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,i=[],a={},s=!1,u=z.caller;u&&!s;u=u.caller)u!==N&&u!==E&&(r={args:[],column:void 0,func:I,line:void 0,url:void 0},n=o.exec(u.toString()),u.name?r.func=u.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[u.toString()]?s=!0:a[u.toString()]=!0,i.push(r));t&&i.splice(0,t);var c={stack:i,message:H(e,"message"),name:H(e,"name")};return P(c,H(e,"sourceURL")||H(e,"fileName"),H(e,"line")||H(e,"lineNumber")),c}function H(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function q(e){return void 0===e}!function(e){e.info="info",e.error="error"}(D||(D={}));var F,G={maxMessagesPerPage:0,sentMessageCount:0};function $(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new w(new y(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}function o(e){return a({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==F?F():{},e)}return{add:function(e){var r=o(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}(G,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){F=e}}}function K(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=G.batch?X(r):r;return n.apply(this,e)}}function X(e){return function(){return J(e,this,arguments)}}function J(e,t,n){try{return e.apply(t,n)}catch(e){Y(e);try{V(e)}catch(e){Y(e)}}}function V(t){W(e(e({},function(e){if(e instanceof Error){var t=N(e);return{error:{kind:t.name,stack:v(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+ie(e)}}(t)),{status:D.error}))}function W(e){G.batch&&G.sentMessageCount<G.maxMessagesPerPage&&(G.sentMessageCount+=1,G.batch.add(e))}function Z(e){G.debugMode=e}function Y(e){G.debugMode&&r.error("[INTERNAL ERROR]",e)}var Q,ee,te=1e3,ne=6e4;function re(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,re)}function oe(){}function ie(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];ae(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&ae(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,t,n)}catch(e){i="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(o.toJSON=a[1])}return i}function ae(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function se(e,t){return-1!==e.indexOf(t)}function ue(e,t,n,r){return ce(e,[t],n,r)}function ce(e,t,n,r){var o=void 0===r?{}:r,i=o.once,a=o.capture,s=o.passive,u=X(i?function(e){f(),n(e)}:n),c=s?{capture:a,passive:s}:a;t.forEach((function(t){return e.addEventListener(t,u,c)}));var f=function(){return t.forEach((function(t){return e.removeEventListener(t,u,c)}))};return{stop:f}}!function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(Q||(Q={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(ee||(ee={}));var fe,le;function de(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires="+o.toUTCString(),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+i+";path=/;samesite="+a+s+u}function pe(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)").exec(e);return n?n[1]:void 0}(document.cookie,e)}function he(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];try{return e.apply(void 0,n)}catch(e){r.error(t,e)}}}var ve={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay",trace:"trace"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0,trace:"public-trace"}},ge="eu",me="us",ye=((le={})[ge]="datadoghq.eu",le[me]="datadoghq.com",le),be=[ye[me],ye[ge]];function we(t,n){var r={buildMode:n.buildMode,clientToken:t.clientToken,env:t.env,proxyHost:t.proxyHost,sdkVersion:n.sdkVersion,service:t.service,site:t.site||ye[t.datacenter||n.datacenter],version:t.version},o=function(e,t){return!t.useAlternateIntakeDomains&&se(be,e)?"classic":"alternate"}(r.site,t),i=function(e,t,n){if(t.proxyHost)return["https://"+t.proxyHost+"/v1/input/"];var r=[t.site];t.buildMode===ke.STAGING&&n&&r.push(ye[me]);for(var o=[],i=Object.keys(ve[e]),a=0,s=r;a<s.length;a++)for(var u=s[a],c=0,f=i;c<f.length;c++){var l=f[c];o.push("https://"+xe(e,l,u)+"/v1/input/")}return o}(o,r,void 0!==t.replica),a={isIntakeUrl:function(e){return i.some((function(t){return 0===e.indexOf(t)}))},logsEndpoint:Ee(o,"logs",r),rumEndpoint:Ee(o,"rum",r),sessionReplayEndpoint:Ee(o,"sessionReplay",r),traceEndpoint:Ee(o,"trace",r)};if(t.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=Ee(o,"logs",r,"browser-agent-internal-monitoring")),r.buildMode===ke.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),r.buildMode===ke.STAGING&&void 0!==t.replica){var s=e(e({},r),{applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,site:ye[me]});a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:Ee(o,"logs",s,"browser-agent-internal-monitoring"),logsEndpoint:Ee(o,"logs",s),rumEndpoint:Ee(o,"rum",s)}}return a}function xe(e,t,n){return"classic"===e&&function(e,t){var n=ve.classic[e];return n&&n+"-http-intake.logs."+t}(t,n)||function(e,t){var n=ve.alternate[e],r=t.split("."),o=r.pop(),i=r.join("-")+"."+o;return n+".browser-intake-"+i}(t,n)}function Ee(e,t,n,r){var o="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),i=xe(e,t,n.site),a=n.proxyHost?n.proxyHost:i,s=(n.proxyHost?"ddhost="+i+"&":"")+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(o);return"https://"+a+"/v1/input/"+n.clientToken+"?"+s}var ke,Se={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,trackViewsManually:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Te(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===fe){for(var e="dd_site_test_"+re(),t=window.location.hostname.split("."),n=t.pop();t.length&&!pe(e);)n=t.pop()+"."+n,de(e,"test",te,{domain:n});fe=n}return fe}()),t}function Me(t,n){var r=function(t,n){var r=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],o=e(e({beforeSend:t.beforeSend&&he(t.beforeSend,"beforeSend threw an error:"),cookieOptions:Te(t),isEnabled:function(e){return se(r,e)},service:t.service},we(t,n)),Se);return"allowedTracingOrigins"in t&&(o.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(o.sampleRate=t.sampleRate),"resourceSampleRate"in t&&(o.resourceSampleRate=t.resourceSampleRate),"trackInteractions"in t&&(o.trackInteractions=!!t.trackInteractions),"trackViewsManually"in t&&(o.trackViewsManually=!!t.trackViewsManually),o}(t,n);return{configuration:r,internalMonitoring:$(r)}}function Oe(){var e={};return{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t}}}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(ke||(ke={}));var Re,Ce,_e,Le,Ae=function(){function e(e){void 0===e&&(e=1e4),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),Be={debug:"debug",error:"error",info:"info",warn:"warn"},Ie=((Re={})[Be.debug]=0,Re[Be.info]=1,Re[Be.warn]=2,Re[Be.error]=3,Re),Ne=(Object.keys(Be),"console"),De="http",je=function(){function t(e,t,n,r){void 0===t&&(t=De),void 0===n&&(n=Be.debug),void 0===r&&(r={}),this.sendLog=e,this.handlerType=t,this.level=n,this.contextManager=Oe(),this.contextManager.set(r)}return t.prototype.log=function(t,n,o){if(void 0===o&&(o=Be.info),Ie[o]>=Ie[this.level]){var i=Array.isArray(this.handlerType)?this.handlerType:[this.handlerType];se(i,De)&&this.sendLog(e({message:t,status:o},a(this.contextManager.get(),n))),se(i,Ne)&&r.log(o+": "+t,a(this.contextManager.get(),n))}},t.prototype.debug=function(e,t){this.log(e,t,Be.debug)},t.prototype.info=function(e,t){this.log(e,t,Be.info)},t.prototype.warn=function(e,t){this.log(e,t,Be.warn)},t.prototype.error=function(e,t){var n={error:{origin:d}};this.log(e,a(n,t),Be.error)},t.prototype.setContext=function(e){this.contextManager.set(e)},t.prototype.addContext=function(e,t){this.contextManager.add(e,t)},t.prototype.removeContext=function(e){this.contextManager.remove(e)},t.prototype.setHandler=function(e){this.handlerType=e},t.prototype.setLevel=function(e){this.level=e},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);i>3&&a&&Object.defineProperty(t,n,a)}([K],t.prototype,"log",null),t}();function Pe(){return Date.now()}function ze(){return performance.now()}function He(){return{relative:ze(),timeStamp:Pe()}}function Ue(e,t){return t-e}function qe(e){return Fe(e,function(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}(window.location)).href}function Fe(e,t){if(function(){if(void 0!==Ce)return Ce;try{var e=new URL("http://test/path");return Ce="http://test/path"===e.href}catch(e){Ce=!1}return Ce}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '"+e+"'");var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var Ge,$e=[],Ke=[];function Xe(){return _e||(!function(){if(!window.fetch)return;Le=window.fetch,window.fetch=function(e,t){var n,r=J(Je,null,[e,t]);return r?J(Ve,null,[n=Le.call(this,r.input,r.init),r]):n=Le.call(this,e,t),n}}(),_e={beforeSend:function(e){$e.push(e)},onRequestComplete:function(e){Ke.push(e)}}),_e}function Je(e,t){var n=t&&t.method||"object"==typeof e&&e.method||"GET",r=qe("object"==typeof e&&e.url||e),o={init:t,input:e,method:n,startClocks:He(),url:r};return $e.forEach((function(e){return e(o)})),o}function Ve(e,n){var r=this,o=function(e){return o=r,i=void 0,s=function(){var r,o;return t(this,(function(t){switch(t.label){case 0:return n.duration=Ue(n.startClocks.timeStamp,Pe()),"stack"in e||e instanceof Error?(n.status=0,n.responseText=v(N(e)),n.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,n.error=e,Ke.forEach((function(e){return e(n)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];r=void 0,t.label=2;case 2:return t.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return r=t.sent(),[3,5];case 4:return o=t.sent(),r="Unable to retrieve response: "+o,[3,5];case 5:n.response=e,n.responseText=r,n.responseType=e.type,n.status=e.status,n.isAborted=!1,Ke.forEach((function(e){return e(n)})),t.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(n,r)}u((s=s.apply(o,i||[])).next())}));var o,i,a,s};e.then(X(o),X(o))}var We,Ze,Ye,Qe=[],et=[];function tt(e,t){var n=this;return J((function(){n._datadog_xhr={method:e,url:qe(t)}})),We.apply(this,arguments)}function nt(){var e=this;return J((function(){if(e._datadog_xhr){e._datadog_xhr.startTime=ze(),e._datadog_xhr.startClocks=He(),e._datadog_xhr.isAborted=!1;var t=!1,n=e.onreadystatechange,r=function(){this.readyState===XMLHttpRequest.DONE&&o(),n&&n.apply(this,arguments)},o=X((function(){e.removeEventListener("loadend",o),e.onreadystatechange===r&&(e.onreadystatechange=n),t||(t=!0,ot(e))}));e.onreadystatechange=r,e.addEventListener("loadend",o),Qe.forEach((function(t){return t(e._datadog_xhr,e)}))}})),Ze.apply(this,arguments)}function rt(){var e=this;return J((function(){e._datadog_xhr&&(e._datadog_xhr.isAborted=!0)})),Ye.apply(this,arguments)}function ot(t){t._datadog_xhr.duration=Ue(t._datadog_xhr.startClocks.timeStamp,Pe()),t._datadog_xhr.responseText=t.response,t._datadog_xhr.status=t.status,t._datadog_xhr.xhr=t,et.forEach((function(n){return n(e({},t._datadog_xhr))}))}var it,at,st=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t}))}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function ut(t){return it||(function(e,t){function n(n,r){e.isIntakeUrl(r.url)||e.isEnabled("remove-network-errors")&&r.isAborted||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:lt(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:p,stack:ft(r.responseText,e)||"Failed to load",startClocks:r.startClocks})}(function(){return Ge||(We=XMLHttpRequest.prototype.open,Ze=XMLHttpRequest.prototype.send,Ye=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=tt,XMLHttpRequest.prototype.send=nt,XMLHttpRequest.prototype.abort=rt,Ge={beforeSend:function(e){Qe.push(e)},onRequestComplete:function(e){et.push(e)}}),Ge})().onRequestComplete((function(e){return n(ee.XHR,e)})),Xe().onRequestComplete((function(e){return n(ee.FETCH,e)}))}(t,it=new st),function(t){at=console.error,console.error=X((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];at.apply(console,n),t.notify(e(e({},ct(n)),{source:l,startClocks:He(),handling:c.HANDLED}))}))}(it),function(e){C((function(t,n,r){var o=function(e,t,n){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:v(e),type:e.name}:{message:n+" "+ie(t),stack:"No stack, consider using an instance of Error",type:e&&e.name}}(t,r,"Uncaught"),i=o.stack,a=o.message,s=o.type;e.notify({message:a,stack:i,type:s,source:h,startClocks:He(),originalError:r,handling:c.UNHANDLED})}))}(it)),it}function ct(e){var t=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));return{message:n(["console error:"],e).map((function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return g(N(e));return ie(e,void 0,2)}(e)})).join(" "),stack:t?v(N(t)):void 0}}function ft(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function lt(e){return ee.XHR===e?"XHR":"Fetch"}function dt(e,t,n){var r=u(void 0,e,s()),o=n(r);return t.forEach((function(t){var n=pt(e,t),o=pt(r,t),i=gt(n),a=gt(o);a===i?ht(e,t,o):"object"!==i||"undefined"!==a&&"null"!==a||ht(e,t,{})})),o}function pt(e,t){for(var n=e,r=0,o=t.split(".");r<o.length;r++){var i=o[r];if(!vt(n,i))return;n=n[i]}return n}function ht(e,t,n){for(var r=e,o=t.split("."),i=0;i<o.length;i+=1){var a=o[i];if(!vt(r,a))return;i!==o.length-1?r=r[a]:r[a]=n}}function vt(e,t){return"object"==typeof e&&null!==e&&t in e}function gt(e){return null===e?"null":Array.isArray(e)?"array":typeof e}var mt=9e5,yt=144e5;function bt(e,t,n){var r=function(e,t){var n,r,o=!1,i=function(){o=!0,clearTimeout(n),n=setTimeout((function(){o=!1}),1e3)};return{get:function(){return o||(r=pe(e),i()),r},set:function(n,o){de(e,n,o,t),r=n,i()}}}("_dd_s",e);!function(e){var t=e.get(),n=pe("_dd"),r=pe("_dd_r"),o=pe("_dd_l");if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i.logs=o),r&&/^[012]$/.test(r)&&(i.rum=r),kt(i,e)}}(r);var o=new st,i=Et(r).id,a=function(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=setTimeout((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){clearTimeout(o),s=!1,r=void 0}}}(X((function(){var e=Et(r),a=n(e[t]),s=a.trackingType,u=a.isTracked;e[t]=s,u&&!e.id&&(e.id=re(),e.created=String(Date.now())),kt(e,r),u&&i!==e.id&&(i=e.id,o.notify())})),1e3).throttled;return a(),function(e){var t=ce(window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0}).stop;Tt.push(t)}(a),function(e){var t=X((function(){"visible"===document.visibilityState&&e()})),n=ue(document,"visibilitychange",t).stop;Tt.push(n);var r=setInterval(t,6e4);Tt.push((function(){clearInterval(r)}))}((function(){kt(Et(r),r)})),{getId:function(){return Et(r).id},getTrackingType:function(){return Et(r)[t]},renewObservable:o}}var wt=/^([a-z]+)=([a-z0-9-]+)$/,xt="&";function Et(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||wt.test(e))})(t)&&t.split(xt).forEach((function(e){var t=wt.exec(e);if(null!==t){var r=t[1],o=t[2];n[r]=o}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<yt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(St(e),{})}function kt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+mt);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(xt);t.set(r,mt)}else St(t)}function St(e){e.set("",0)}var Tt=[];var Mt;function Ot(e,t){if(!t){var n=Rt(e)===Mt.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=bt(e.cookieOptions,"logs",(function(t){return function(e,t){var n=function(e){return e===Mt.NOT_TRACKED||e===Mt.TRACKED}(t)?t:Rt(e);return{trackingType:n,isTracked:n===Mt.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Mt.TRACKED}}}function Rt(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Mt.TRACKED:Mt.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Mt||(Mt={}));var Ct={buildMode:"release",datacenter:"us",sdkVersion:"2.14.0"},_t=["view.url","view.referrer","message","error.stack","http.url"];function Lt(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var At,Bt,It,Nt,Dt=function(t){var n=!1,o=Oe(),i={},s=new Ae,u=function(e,t){s.add((function(){return u(e,t)}))},c=new je(d);return f={logger:c,init:X((function(e){(function(e){return n?(e.silentMultipleInit||r.error("DD_LOGS is already initialized."),!1):e&&(e.publicApiKey||e.clientToken)?!!(void 0===e.sampleRate||(t=e.sampleRate,function(e){return"number"==typeof e}(t)&&t>=0&&t<=100))||(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Client Token is not configured, we will not send any data."),!1);var t})(e)&&(e.publicApiKey&&(e.clientToken=e.publicApiKey,r.warn("Public API Key is deprecated. Please use Client Token instead.")),u=t(e,c,o.get),s.drain(),n=!0)})),getLoggerGlobalContext:X(o.get),setLoggerGlobalContext:X(o.set),addLoggerGlobalContext:X(o.add),removeLoggerGlobalContext:X(o.remove),createLogger:X((function(t,n){return void 0===n&&(n={}),i[t]=new je(d,n.handler,n.level,e(e({},n.context),{logger:{name:t}})),i[t]})),getLogger:X((function(e){return i[e]}))},l=e(e({},f),{onReady:function(e){e()}}),Object.defineProperty(l,"_setDebug",{get:function(){return Z},enumerable:!1}),l;var f,l;function d(e){u(e,a({date:Date.now(),view:{referrer:document.referrer,url:window.location.href}},o.get()))}}((function(e,t,n){var o=Me(e,Ct),i=o.configuration,s=o.internalMonitoring;return function(e,t,n,r,o,i){n.setExternalContextProvider((function(){return a({session_id:r.getId()},i(),Lt())}));var s=function(e,t,n){var r=function(e,t){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),ne),(n+=1)<=e.maxErrorsByMinute||r)return r=!1,!1;if(n===e.maxErrorsByMinute+1){r=!0;try{t({message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,source:f,startClocks:He()})}finally{r=!1}}return!0}}}(t,n);return function(n,o){if(e.isTracked()){var i=a({service:t.service,session_id:e.getId()},o,Lt(),n);if(t.beforeSend)if(!1===dt(i,_t,t.beforeSend))return;if(i.status!==Be.error||!r.isLimitReached())return i}}}(r,e,c),u=function(e){var t,n=r(e.logsEndpoint);void 0!==e.replica&&(t=r(e.replica.logsEndpoint));function r(t){return new w(new y(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){n.add(e),t&&t.add(e)}}}(e);function c(e){o.error(e.message,a({date:e.startClocks.timeStamp,error:{kind:e.type,origin:e.source,stack:e.stack}},e.resource?{http:{method:e.resource.method,status_code:e.resource.statusCode,url:e.resource.url}}:void 0,Lt(e.startClocks.relative)))}return t.subscribe(c),function(e,t){var n=s(e,t);n&&u.add(n)}}(i,!1!==e.forwardErrorsToLogs?ut(i):new st,s,Ot(i,function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_"+re(),n="test";return de(t,n,te,e),pe(t)===n}catch(e){return r.error(e),!1}}(i.cookieOptions)),t,n)}));At=function(){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}(),It=Dt,Nt=At[Bt="DD_LOGS"],At[Bt]=It,Nt&&Nt.q&&Nt.q.forEach((function(e){return he(e,"onReady callback threw an error:")()}))}();

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

datacenter: 'us',
sdkVersion: '2.13.0',
sdkVersion: '2.14.0',
};
//# sourceMappingURL=buildEnv.js.map
export var buildEnv = {
buildMode: 'release',
datacenter: 'us',
sdkVersion: '2.13.0',
sdkVersion: '2.14.0',
};
//# sourceMappingURL=buildEnv.js.map
{
"name": "@datadog/browser-logs",
"version": "2.13.0",
"version": "2.14.0",
"license": "Apache-2.0",

@@ -16,3 +16,3 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "2.13.0",
"@datadog/browser-core": "2.14.0",
"tslib": "^1.10.0"

@@ -29,3 +29,3 @@ },

},
"gitHead": "fac76433fe8eb0f107c47628b88fedc918eea641"
"gitHead": "0f132b95b3071926e6d63b8dc70389da93840553"
}
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