Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
2
Maintainers
1
Versions
249
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.15.1 to 1.15.2

2

bundle/datadog-rum.js

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

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";n.r(t),n.d(t,"datadogRum",(function(){return tn})),n.d(t,"makeRumGlobal",(function(){return nn}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],u=0,a=o.length;u<a;u++,i++)r[i]=o[u];return r}var u,a,s,c=6e4,f=60*c;function d(e,t,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,u=!1,a=!1,s=!1;return{throttled:function(){var n=this;s||(u?a=!0:(i?e.apply(this):a=!0,u=!0,r=window.setTimeout((function(){o&&a&&e.apply(n),u=!1,a=!1}),t)))},stop:function(){window.clearTimeout(r),s=!0}}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange"}(u||(u={})),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"}(a||(a={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(s||(s={}));var l,p=function(e){return Array.isArray(e)},m=function(e){return!Array.isArray(e)&&"object"==typeof e};function E(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return p(e)&&p(t)?o(Array(Math.max(e.length,t.length))).map((function(n,r){return E(e[r],t[r])})):m(e)&&m(t)?Object.keys(t).reduce((function(n,i){var o;return r(r({},n),((o={})[i]=E(e[i],t[i]),o))}),e):void 0===t?e:t}),e)}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return E.apply(void 0,o([e],t))}function h(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])}))}function T(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,T)}function g(e){return 0!==e&&100*Math.random()<=e}function b(e){return+(1e6*e).toFixed(0)}function y(e){var t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=function e(t){if(Array.isArray(t))return t.map((function(t){return e(t)}));if("object"==typeof t)return y(t);return t}(e[n])})),t}function C(){}function O(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];R(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,u=[!1,void 0];"object"==typeof e&&R(i=Object.getPrototypeOf(e))&&(u=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),u[0]&&(i.toJSON=u[1])}return o}function R(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function _(e,t){return-1!==e.indexOf(t)}function w(e){return S(e)&&e>=0&&e<=100}function S(e){return"number"==typeof e}function A(e){return Math.floor(I()+e)}function I(){return void 0===l&&(l=performance.timing.navigationStart),l}function D(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var L={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function x(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),i=e+"-http-intake.logs."+t.site,o=t.proxyHost?t.proxyHost:i,u=t.proxyHost?"ddhost="+i+"&":"",a=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+u+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+o+"/v1/input/"+t.clientToken+"?"+a}var N=1e3;function M(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var i="expires="+r.toUTCString();document.cookie=e+"="+t+";"+i+";path=/;samesite=strict"}function U(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}var k="?",B=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var H=function(){var e,t,n,r,i,o,u=[];function a(e,t,n){var r;for(var i in u)if(P(u,i))try{u[i](e,t,n)}catch(e){r=e}if(r)throw r}function s(e,r,i,o,u){if(t)j.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(u)a(j(u),!0,u);else{var s,c={url:r,column:o,line:i},d=e;if("[object String]"==={}.toString.call(e)){var l=d.match(B);l&&(s=l[1],d=l[2])}a({name:s,message:d,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";a(j(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,a(n,!1,r)}function d(n){if(t){if(e===n)return;f()}var r=j(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return d.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=J(s),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=J(c),o=!0}(),u.push(e)},d.unsubscribe=function(e){for(var t=u.length-1;t>=0;t-=1)u[t]===e&&u.splice(t,1);0===u.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},d.traceKitWindowOnError=s,d}(),j=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),d=[],l=0,p=f.length;l<p;l+=1){if(o.exec(f[l])){var m=(r=o.exec(f[l]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),i={args:m?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||k,line:r[3]?+r[3]:void 0,url:m?void 0:r[2]}}else if(a.exec(f[l]))i={args:[],column:(r=a.exec(f[l]))[4]?+r[4]:void 0,func:r[1]||k,line:+r[3],url:r[2]};else{if(!u.exec(f[l]))continue;t=(r=u.exec(f[l]))[3]&&r[3].indexOf(" > eval")>-1,n=s.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==l||r[5]||void 0===e.columnNumber||(d[0].column=e.columnNumber+1),i={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||k,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=k),d.push(i)}if(d.length)return{stack:d,message:e.message,name:e.name}}}function n(e,t,n,r){var i={url:t,line:n?+n:void 0};if(i.url&&i.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===i.url){if(o[0].line===i.line)return!1;if(!o[0].line&&o[0].func===i.func)return o[0].line=i.line,o[0].context=i.context,!1}return o.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var i,o,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],s={},c=!1,f=r.caller;f&&!c;f=f.caller)f!==j&&f!==H&&(o={args:[],column:void 0,func:k,line:void 0,url:void 0},i=u.exec(f.toString()),f.name?o.func=f.name:i&&(o.func=i[1]),void 0===o.func&&(o.func=i?i.input.substring(0,i.input.indexOf("{")):void 0),s[""+f]?c=!0:s[""+f]=!0,a.push(o));t&&a.splice(0,t);var d={stack:a,message:e.message,name:e.name};return n(d,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),d}function i(n,i){var o,u=void 0===i?0:+i;try{if(o=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),u=[],a=0;a<o.length;a+=2){var s=void 0;r.exec(o[a])?s={args:[],column:void 0,func:(n=r.exec(o[a]))[3],line:+n[1],url:n[2]}:i.exec(o[a])&&(s={args:(n=i.exec(o[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),s&&(!s.func&&s.line&&(s.func=k),s.context=[o[a+1]],u.push(s))}if(u.length)return{stack:u,message:e.message,name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=t(n))return o}catch(t){if(e)throw t}try{if(o=function(e){var t=e.message.split("\n");if(!(t.length<4)){var n,r=/^\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,o=/^\s*Line (\d+) of function script\s*$/i,u=[],a=window&&window.document&&window.document.getElementsByTagName("script"),s=[];for(var c in a)P(a,c)&&!a[c].src&&s.push(a[c]);for(var f=2;f<t.length;f+=2){var d=void 0;if(r.exec(t[f]))d={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(i.exec(t[f]))d={args:[],column:void 0,func:(n=i.exec(t[f]))[4],line:+n[1],url:n[3]};else if(o.exec(t[f])){n=o.exec(t[f]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}d&&(d.func||(d.func=k),d.context=[t[f+1]],u.push(d))}if(u.length)return{stack:u,message:t[0],name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=r(n,u+1))return o}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return i.augmentStackTraceWithInitialElement=n,i.computeStackTraceFromStackProp=t,i.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return j(e,t+1)}},i}();var F=/[^\u0000-\u007F]/,W=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&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var z,q=function(){function e(e,t,n,r,i,o){void 0===o&&(o=C),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,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=o(this.pushOnlyBuffer,(t=this.upsertBuffer,n=[],Object.keys(t).forEach((function(e){n.push(t[e])})),n));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,n},e.prototype.sizeInBytes=function(e){return F.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),r=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?console.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(r,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=O(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((function(){e.flush(),e.flushPeriodically()}),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(window.addEventListener(u.BEFORE_UNLOAD,J(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,J((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,J((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(z||(z={}));var G,V,K,$,Y={maxMessagesPerPage:0,sentMessageCount:0};function X(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 q(new W(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return E({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==G?G():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);h(Y,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function J(e){return function(){try{return e.apply(this,arguments)}catch(e){ne(e);try{Z(e)}catch(e){ne(e)}}}}function Q(e,t){!function(e){Y.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),ee(r(r({message:e},t),{status:z.info}))}function Z(e){ee(r(r({},function(e){if(e instanceof Error){var t=j(e);return{error:{kind:t.name,stack:_e(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+O(e)}}(e)),{status:z.error}))}function ee(e){Y.batch&&Y.sentMessageCount<Y.maxMessagesPerPage&&(Y.sentMessageCount+=1,Y.batch.add(e))}function te(e){Y.debugMode=e}function ne(e){Y.debugMode&&console.warn("[INTERNAL ERROR]",e)}function re(e){return ue(e,D(window.location)).href}function ie(e,t){return oe(e)===oe(t)}function oe(e){return D(ue(e))}function ue(e,t){if(function(){if(void 0!==V)return V;try{var e=new URL("http://test/path");return V="http://test/path"===e.href}catch(e){V=!1}return V}())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 i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var ae=[],se=[];function ce(){return K||(!function(){if(!window.fetch)return;$=window.fetch,window.fetch=J((function(e,t){var n=this,r={method:t&&t.method||"object"==typeof e&&e.method||"GET",startTime:performance.now()},o=function(t){return o=n,u=void 0,s=function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return r.duration=performance.now()-r.startTime,r.url=re("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(r.status=0,r.response=_e(j(t)),se.forEach((function(e){return e(r)})),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];n=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return n=i.sent(),[3,5];case 4:return o=i.sent(),n="Unable to retrieve response: "+o,[3,5];case 5:r.response=n,r.responseType=t.type,r.status=t.status,se.forEach((function(e){return e(r)})),i.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(n,r)}i((s=s.apply(o,u||[])).next())}));var o,u,a,s};ae.forEach((function(e){return e(r)}));var u=$.call(this,e,t);return u.then(J(o),J(o)),u}))}(),K={beforeSend:function(e){ae.push(e)},onRequestComplete:function(e){se.push(e)}}),K}var fe,de,le,pe,me,Ee,ve,he,Te,ge=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){this.observers.push(e)},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}(),be=[],ye=[];function Ce(){return fe||(de=XMLHttpRequest.prototype.open,le=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=J((function(e,t){return this._datadog_xhr={method:e,url:re(t)},de.apply(this,arguments)})),XMLHttpRequest.prototype.send=J((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&J(i)(),n&&n.apply(this,arguments)};var r=!1,i=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,ye.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",J(i)),be.forEach((function(e){return e(t._datadog_xhr)}))}return le.apply(this,arguments)})),fe={beforeSend:function(e){be.push(e)},onRequestComplete:function(e){ye.push(e)}}),fe}function Oe(e){if(!me){var t=new ge;e.isCollectingError&&(function(e,t){function n(n,r){(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r))&&t.notify({context:{error:{origin:pe.NETWORK,stack:we(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:Se(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}Ce().onRequestComplete((function(e){return n(s.XHR,e)})),ce().onRequestComplete((function(e){return n(s.FETCH,e)}))}(e,t),function(e){Ee=console.error,console.error=J((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Ee.apply(console,o([t],n)),e.notify({context:{error:{origin:pe.CONSOLE}},message:o(["console error:",t],n).map(Re).join(" "),startTime:performance.now()})}))}(t),function(e){ve=function(t,n,r){e.notify(function(e,t){var n,r;void 0!==e.message||t instanceof Error?(n=e.message||"Empty message",r=_e(e)):(n="Uncaught "+O(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:pe.SOURCE}},startTime:performance.now()}}(t,r))},H.subscribe(ve)}(t)),me=function(e,t){var n=0,r=new ge;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:pe.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return me}function Re(e){return"string"==typeof e?e:e instanceof Error?_e(j(e)):O(e,0,2)}function _e(e){var t=(e.name||"Error")+": "+e.message;return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}function we(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Se(e){return s.XHR===e?"XHR":"Fetch"}function Ae(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(pe||(pe={})),function(e){e.US="us",e.EU="eu"}(Te||(Te={}));var Ie,De=((he={})[Te.EU]="datadoghq.eu",he[Te.US]="datadoghq.com",he);function Le(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||De[e.datacenter||t.datacenter],version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({isEnabled:function(e){return _(i,e)},logsEndpoint:x("browser",n),rumEndpoint:x("rum",n),traceEndpoint:x("public-trace",n)},L);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=x("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in e&&(o.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),n.buildMode===Ie.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(o.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(o.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(o.rumEndpoint=e.rumEndpoint)),n.buildMode===Ie.STAGING&&void 0!==e.replica){var u=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:De[Te.US]});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:x("browser",u,"browser-agent-internal-monitoring"),logsEndpoint:x("browser",u),rumEndpoint:x("rum",u)}}return o}(e,t),i=X(n);return{configuration:n,errorObservable:Oe(n),internalMonitoring:i}}function xe(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return M("dd_rum_test","test",1e3),"test"===U("dd_rum_test")}catch(e){return console.error(e),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function Ne(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Ie||(Ie={}));var Me,Ue={buildMode:"release",datacenter:"us",sdkVersion:"1.15.1"};!function(e){e[e.ERROR_COLLECTED=0]="ERROR_COLLECTED",e[e.PERFORMANCE_ENTRY_COLLECTED=1]="PERFORMANCE_ENTRY_COLLECTED",e[e.CUSTOM_ACTION_COLLECTED=2]="CUSTOM_ACTION_COLLECTED",e[e.AUTO_ACTION_CREATED=3]="AUTO_ACTION_CREATED",e[e.AUTO_ACTION_COMPLETED=4]="AUTO_ACTION_COMPLETED",e[e.AUTO_ACTION_DISCARDED=5]="AUTO_ACTION_DISCARDED",e[e.VIEW_CREATED=6]="VIEW_CREATED",e[e.VIEW_UPDATED=7]="VIEW_UPDATED",e[e.REQUEST_STARTED=8]="REQUEST_STARTED",e[e.REQUEST_COMPLETED=9]="REQUEST_COMPLETED",e[e.SESSION_RENEWED=10]="SESSION_RENEWED",e[e.RESOURCE_ADDED_TO_BATCH=11]="RESOURCE_ADDED_TO_BATCH",e[e.DOM_MUTATED=12]="DOM_MUTATED",e[e.BEFORE_UNLOAD=13]="BEFORE_UNLOAD"}(Me||(Me={}));var ke=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 Be(e){var t,n=function(){var e,t=window;if(t.Zone){var n=t.Zone.__symbol__("MutationObserver");e=t[n]}return e||(e=t.MutationObserver),e}();return n&&(t=new n(J((function(){e.notify(Me.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Pe="initial_document",He=[[a.DOCUMENT,function(e){return Pe===e}],[a.XHR,function(e){return"xmlhttprequest"===e}],[a.FETCH,function(e){return"fetch"===e}],[a.BEACON,function(e){return"beacon"===e}],[a.CSS,function(e,t){return null!==t.match(/\.css$/i)}],[a.JS,function(e,t){return null!==t.match(/\.js$/i)}],[a.IMAGE,function(e,t){return _(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[a.FONT,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[a.MEDIA,function(e,t){return _(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function je(e){var t=e.name;if(!function(e){try{return!!ue(e)}catch(e){return!1}}(t))return Q('Failed to construct URL for "'+e.name+'"'),a.OTHER;for(var n=function(e){var t=ue(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=0,i=He;r<i.length;r++){var o=i[r],u=o[0];if((0,o[1])(e.initiatorType,n))return u}return a.OTHER}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=1;n<e.length;n+=1)if(e[n-1]>e[n])return!1;return!0}function We(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return b(0===t&&n<r?r-n:t)}function ze(e){var t=e.startTime,n=e.fetchStart,r=e.domainLookupStart,i=e.domainLookupEnd,o=e.connectStart,u=e.secureConnectionStart,a=e.connectEnd,s=e.requestStart,c=e.responseStart,f=e.responseEnd,d=e.redirectStart,l=e.redirectEnd;if(Fe(t,n,r,i,o,a,s,c,f)){var p=n!==t;if(!p||(d<t&&(d=t),l<t&&(l=n),Fe(t,d,l,n))){var m={download:qe(t,c,f),firstByte:qe(t,s,c)};return a!==n&&(m.connect=qe(t,o,a),Fe(o,u,a)&&(m.ssl=qe(t,u,a))),i!==n&&(m.dns=qe(t,r,i)),p&&(m.redirect=qe(t,d,l)),m}}}function qe(e,t,n){return{duration:b(n-t),start:b(t-e)}}function Ge(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function Ve(e,t){return e&&!function(e,t){return ie(e,t.logsEndpoint)||ie(e,t.rumEndpoint)||ie(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&ie(e,t.internalMonitoringEndpoint)}(e,t)}function Ke(){return void 0!==window.performance&&"getEntries"in performance}function $e(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Ye(e,t){if(function(e){var t;if($e()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];t=r({},n.toJSON())}else t=r(r({},Xe()),{name:window.location.href,decodedBodySize:0,startTime:0});t.entryType="resource",t.initiatorType=Pe,t.duration=t.responseEnd,e(t)}((function(n){Je(t,e,[n])})),Ke()&&Je(t,e,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(J((function(n){return Je(t,e,n.getEntries())}))),i=["resource","navigation","longtask"];"visible"===document.visibilityState&&i.push("paint"),n.observe({entryTypes:i}),Ke()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}$e()||function(e){function t(){var t=r(r({},Xe()),{entryType:"navigation"});e(t)}if("complete"===document.readyState)t();else{var n=J((function(){window.removeEventListener(u.LOAD,n),setTimeout(J(t))}));window.addEventListener(u.LOAD,n)}}((function(n){Je(t,e,[n])}))}function Xe(){var e={},t=performance.timing;for(var n in t)S(t[n])&&(e[n]=0===t[n]?0:t[n]-I());return e}function Je(e,t,n){function r(e){t.notify(Me.PERFORMANCE_ENTRY_COLLECTED,e)}e.isTrackedWithResource()&&n.filter((function(e){return"resource"===e.entryType})).forEach(r),n.filter((function(e){return"navigation"===e.entryType})).filter((function(e){return e.loadEventEnd>0})).forEach(r),n.filter((function(e){return"paint"===e.entryType})).forEach(r),n.filter((function(e){return"longtask"===e.entryType})).forEach(r)}var Qe=1;function Ze(){var e,t,n,r,i=[new ge,new ge];return t=(e=i)[0],n=e[1],(r=Ce()).beforeSend((function(e){var n=et();e.requestId=n,t.notify({requestId:n})})),r.onRequestComplete((function(e){n.notify({duration:e.duration,method:e.method,requestId:e.requestId,response:e.response,startTime:e.startTime,status:e.status,traceId:tt(),type:s.XHR,url:e.url})})),function(e){var t=e[0],n=e[1],r=ce();r.beforeSend((function(e){var n=et();e.requestId=n,t.notify({requestId:n})})),r.onRequestComplete((function(e){n.notify({duration:e.duration,method:e.method,requestId:e.requestId,response:e.response,responseType:e.responseType,startTime:e.startTime,status:e.status,traceId:tt(),type:s.FETCH,url:e.url})}))}(i),i}function et(){var e=Qe;return Qe+=1,e}function tt(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function nt(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").filter((function(t){return n=t,r=e.startTime,i=rt(e),n.startTime>=r&&rt(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&rt((t=n)[0])<=t[1].startTime?n[1]:void 0}}function rt(e){return e.startTime+e.duration}var it="_dd",ot="_dd_r",ut="_dd_l",at="rum",st="logs";var ct="_dd_s",ft=15*c,dt=4*f,lt=c;function pt(e,t){var n,r,i,o,a,s=(n=ct,o=!1,a=function(){o=!0,window.clearTimeout(r),r=window.setTimeout((function(){o=!1}),N)},{get:function(){return o?i:(i=U(n),a(),i)},set:function(e,t){M(n,e,t),i=e,a()}});!function(e){var t=e.get(),n=U(it),r=U(ot),i=U(ut);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[st]=i),r&&/^[012]$/.test(r)&&(o[at]=r),ht(o,e)}}(s);var c=new ge,f=vt(s).id,l=d((function(){var n=vt(s),r=t(n[e]),i=r.trackingType,o=r.isTracked;n[e]=i,o&&!n.id&&(n.id=T(),n.created=String(Date.now())),ht(n,s),o&&f!==n.id&&(f=n.id,c.notify())}),N).throttled;return l(),function(e){var t=J(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),gt.push((function(){return document.removeEventListener(e,t,n)}))}))}(l),function(e){var t=J((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,lt);document.addEventListener(u.VISIBILITY_CHANGE,t),gt.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){ht(vt(s),s)})),{getId:function(){return vt(s).id},getTrackingType:function(){return vt(s)[e]},renewObservable:c}}var mt=/^([a-z]+)=([a-z0-9-]+)$/,Et="&";function vt(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Et)||mt.test(e))})(t)&&t.split(Et).forEach((function(e){var t=mt.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<dt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Tt(e),{})}function ht(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ft);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(Et);t.set(r,ft)}else Tt(t)}function Tt(e){e.set("",0)}var gt=[];var bt=dt,yt=5*c,Ct=c;function Ot(e){return function(e){var t;if(function(){void 0===St&&(St="closest"in HTMLElement.prototype);return St}())t=e.closest("["+Rt+"]");else for(var n=e;n;){if(n.hasAttribute(Rt)){t=n;break}n=n.parentElement}if(!t)return;return Nt(xt(t.getAttribute(Rt).trim()))}(e)||Lt(e,At)||Lt(e,It)||""}var Rt="data-dd-action-name";var _t,wt,St,At=[function(e){if(function(){void 0===wt&&(wt="labels"in HTMLInputElement.prototype);return wt}()){if("labels"in e&&e.labels&&e.labels.length>0)return Mt(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Mt(t)}},function(e){if("INPUT"===e.nodeName){var t=e,n=t.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return t.value}},function(e){if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return Mt(e)},function(e){return e.getAttribute("aria-label")},function(e){var t=e.getAttribute("aria-labelledby");if(t)return t.split(/\s+/).map((function(t){return function(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}(e,t)})).filter((function(e){return Boolean(e)})).map(Mt).join(" ")},function(e){return e.getAttribute("alt")},function(e){return e.getAttribute("name")},function(e){return e.getAttribute("title")},function(e){return e.getAttribute("placeholder")},function(e){if("options"in e&&e.options.length>0)return Mt(e.options[0])}],It=[function(e){return Mt(e)}],Dt=10;function Lt(e,t){for(var n=e,r=0;r<=Dt&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=t;i<o.length;i++){var u=(0,o[i])(n);if("string"==typeof u){var a=u.trim();if(a)return Nt(xt(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function xt(e){return e.replace(/\s+/g," ")}function Nt(e){return e.length>100?e.slice(0,100)+" [...]":e}function Mt(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===_t){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),_t=""===t.innerText,document.body.removeChild(t)}return _t}())for(var n=e.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(t=t.replace(i,""))}return t}return e.textContent}}function Ut(e,t){void 0===t&&(t=C);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(e.subscribe(Me.ERROR_COLLECTED,(function(){n.errorCount+=1,t(n)}))),r.push(e.subscribe(Me.AUTO_ACTION_COMPLETED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Me.CUSTOM_ACTION_COLLECTED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Me.PERFORMANCE_ENTRY_COLLECTED,(function(e){"longtask"===e.entryType&&(n.longTaskCount+=1,t(n))}))),r.push(e.subscribe(Me.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,t(n)}))),{stop:function(){r.forEach((function(e){return e.unsubscribe()}))},eventCounts:n}}var kt,Bt=100,Pt=100,Ht=1e4;function jt(e,t){var n=function(e){var t,n=new ge,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(Me.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(Me.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(Me.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestId),i+=1,o()}))),r.push(e.subscribe(Me.REQUEST_COMPLETED,(function(e){void 0===t||e.requestId<t||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(e){return e.unsubscribe()}))}}}(e),r=n.observable,i=n.stop,o=function(e,t,n){var r,i=!1,o=setTimeout(J((function(){return s(!1,0)})),Bt),u=setTimeout(J((function(){return s(!0,performance.now())})),Ht);function a(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(u),t()}function s(e,t){i||(a(),n(e,t))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();t||(r=setTimeout(J((function(){return s(!0,n)})),Pt))})),{stop:a}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Ft(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new zt(e,r,i);t=o,n=jt(e,(function(e,n){e?o.complete(n):o.discard(),t=void 0}))}},discardCurrent:function(){t&&(n.stop(),t.discard(),t=void 0)}}}(e);function n(e){if(e.target instanceof Element){var n=Ot(e.target);n&&t.create(kt.CLICK,n)}}return e.subscribe(Me.VIEW_CREATED,(function(){t.discardCurrent()})),addEventListener(u.CLICK,n,{capture:!0}),{stop:function(){t.discardCurrent(),removeEventListener(u.CLICK,n,{capture:!0})}}}!function(e){e.CLICK="click",e.CUSTOM="custom"}(kt||(kt={}));var Wt,zt=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=T(),this.startTime=performance.now(),this.eventCountsSubscription=Ut(e),this.lifeCycle.notify(Me.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Me.AUTO_ACTION_COMPLETED,{duration:e-this.startTime,id:this.id,measures:{errorCount:t.errorCount,longTaskCount:t.longTaskCount,resourceCount:t.resourceCount},name:this.name,startTime:this.startTime,type:this.type}),this.eventCountsSubscription.stop()},e.prototype.discard=function(){this.lifeCycle.notify(Me.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(Wt||(Wt={}));var qt,Gt,Vt=3e3,Kt=5*c;function $t(e,t){var n,r=Yt(t,e,Wt.INITIAL_LOAD,0);function i(){r.isDifferentView(e)?(r.triggerUpdate(),r.end(),r=Yt(t,e,Wt.ROUTE_CHANGE)):(r.updateLocation(e),r.triggerUpdate())}!function(e){var t=history.pushState;history.pushState=J((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=J((function(){n.apply(this,arguments),e()})),window.addEventListener(u.POP_STATE,J(e))}(i),n=i,window.addEventListener("hashchange",J(n)),t.subscribe(Me.SESSION_RENEWED,(function(){r.end(),r=Yt(t,e,Wt.ROUTE_CHANGE)})),t.subscribe(Me.BEFORE_UNLOAD,(function(){r.triggerUpdate(),r.end()}));var o=window.setInterval(J((function(){r.triggerUpdate()})),Kt);return{stop:function(){r.end(),clearInterval(o)}}}function Yt(e,t,n,i){void 0===i&&(i=performance.now());var o,u=T(),a={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},s=0,c=r({},t);e.notify(Me.VIEW_CREATED,{id:u,startTime:i,location:c});var f=d(J(g),Vt,{leading:!1}),l=f.throttled,p=f.stop;function m(e){a=r(r({},a),e),l()}var E=function(e,t){var n={};return{stop:e.subscribe(Me.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("navigation"===e.entryType){var i=e;n=r(r({},n),{domComplete:b(i.domComplete),domContentLoaded:b(i.domContentLoadedEventEnd),domInteractive:b(i.domInteractive),loadEventEnd:b(i.loadEventEnd)}),t(n)}else if("paint"===e.entryType&&"first-contentful-paint"===e.name){var o=e;n=r(r({},n),{firstContentfulPaint:b(o.startTime)}),t(n)}})).unsubscribe}}(e,m).stop,v=Ut(e,m).stop;var h=function(e,t,n){var r=1,i=[],o=C;t===Wt.INITIAL_LOAD&&(r+=1,o=function(e,t){return{stop:e.subscribe(Me.PERFORMANCE_ENTRY_COLLECTED,(function(e){"navigation"===e.entryType&&t(e.loadEventEnd)})).unsubscribe}}(e,a).stop);var u=function(e,t){var n=performance.now();return{stop:jt(e,(function(e,r){t(e?r-n:void 0)})).stop}}(e,a).stop;function a(e){r-=1,e&&i.push(e),0===r&&i.length&&n(Math.max.apply(Math,i))}return{stop:function(){u(),o()}}}(e,n,(function(e){o=e,l()})).stop;function g(){s+=1,e.notify(Me.VIEW_UPDATED,{documentVersion:s,id:u,loadingTime:o,loadingType:n,location:c,measures:a,startTime:i,duration:performance.now()-i})}return g(),{end:function(){E(),v(),h(),p()},isDifferentView:function(e){return c.pathname!==e.pathname||(t=e.hash,n=t.substr(1),!document.getElementById(n)&&e.hash!==c.hash);var t,n},triggerUpdate:function(){g()},updateLocation:function(e){c=r({},e)}}}function Xt(e,t,n,i,o,u){var c={},f=function(e,t){var n,r,i,o=[],u=[];e.subscribe(Me.VIEW_CREATED,(function(e){n&&o.unshift({context:c(),endTime:e.startTime,startTime:n.startTime}),n=e,i=t.getId()})),e.subscribe(Me.VIEW_UPDATED,(function(e){n=e})),e.subscribe(Me.AUTO_ACTION_CREATED,(function(e){r=e})),e.subscribe(Me.AUTO_ACTION_COMPLETED,(function(e){r&&u.unshift({context:f(),endTime:r.startTime+e.duration,startTime:r.startTime}),r=void 0})),e.subscribe(Me.AUTO_ACTION_DISCARDED,(function(){r=void 0})),e.subscribe(Me.SESSION_RENEWED,(function(){o=[],u=[],n=void 0,r=void 0}));var a=window.setInterval(J((function(){s(o,bt),s(u,yt)})),Ct);function s(e,t){for(var n=performance.now()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function c(){return{sessionId:i,view:{id:n.id,url:n.location.href}}}function f(){return{userAction:{id:r.id}}}function d(e,t,n,r){if(!r)return n?e():void 0;if(n&&r>=n.startTime)return e();for(var i=0,o=t;i<o.length;i++){var u=o[i];if(r>u.endTime)break;if(r>=u.startTime)return u.context}}return{findAction:function(e){return d(f,u,r,e)},findView:function(e){return d(c,o,n,e)},stop:function(){window.clearInterval(a)}}}(n,o);u.setExternalContextProvider((function(){return E({application_id:e},f.findView(),c)}));var d=function(e,t){var n,r=o(e.rumEndpoint),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(n){return new q(new W(n,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return t.notify(Me.BEFORE_UNLOAD)}))}function u(e){return E(e,{application_id:i.applicationId})}var a=!1;return{add:function(e){a||(r.add(e),n&&n.add(u(e)))},stop:function(){a=!0},upsert:function(e,t){a||(r.upsert(e,t),n&&n.upsert(u(e),t))}}}(i,n),l=function(e,t,n,r){return function(i,o){return function(u,a,s){var c=e.findView(u);if(t.isTracked()&&c&&c.sessionId){var f=e.findAction(u),d=i(a,{action:f,view:c,rum:n()}),l=E(r(),s,y(d));o(l,d)}}}}(f,o,(function(){return{applicationId:e,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?Gt.USER:Gt.SYNTHETICS},view:{referrer:document.referrer}}}),(function(){return c}));return function(e,t,n,i,o){var u=function(e,t){var n=t.view;return v(t.rum,n,e)},c=function(e,t){var n=t.view,r=t.action;return v(t.rum,n,r,e)};(function(e,t){e.subscribe(Me.VIEW_UPDATED,(function(e){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:qt.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:e.loadingTime?b(e.loadingTime):void 0,loadingType:e.loadingType,measures:e.measures}})}))})(t,i(u,(function(e,t){return o.upsert(e,t.view.id)}))),function(e,t){e.subscribe(Me.ERROR_COLLECTED,(function(e){var n=e.message,i=e.startTime,o=e.context;t(i,r({message:n,date:A(i),evt:{category:qt.ERROR}},o))}))}(t,i(c,o.add)),function(e,t,n,r){t.subscribe(Me.REQUEST_COMPLETED,(function(i){if(n.isTrackedWithResource()&&Ve(i.url,e)){var o=nt(i),u=i.type===s.XHR?a.XHR:a.FETCH,c=o?o.startTime:i.startTime;r(c,{date:A(c),duration:o?We(o):b(i.duration),evt:{category:qt.RESOURCE},http:{method:i.method,performance:o?ze(o):void 0,statusCode:i.status,url:i.url},network:{bytesWritten:o?Ge(o):void 0},resource:{kind:u},traceId:i.traceId}),t.notify(Me.RESOURCE_ADDED_TO_BATCH)}}))}(e,t,n,i(c,o.add)),function(e,t,n){t.subscribe(Me.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(e,t,n,r){if(!Ve(t.name,e))return;var i=je(t);if(_([a.XHR,a.FETCH],i))return;n(t.startTime,{date:A(t.startTime),duration:We(t),evt:{category:qt.RESOURCE},http:{performance:ze(t),url:t.name},network:{bytesWritten:Ge(t)},resource:{kind:i}}),r.notify(Me.RESOURCE_ADDED_TO_BATCH)}(e,r,n,t);break;case"longtask":!function(e,t){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:qt.LONG_TASK}})}(r,n)}}))}(e,t,i(c,o.add)),function(e,t){e.subscribe(Me.CUSTOM_ACTION_COLLECTED,(function(e){t(performance.now(),{evt:{category:qt.USER_ACTION,name:e.name},userAction:{type:e.type}},e.context)}))}(t,i(u,o.add)),function(e,t){e.subscribe(Me.AUTO_ACTION_COMPLETED,(function(e){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:qt.USER_ACTION,name:e.name},userAction:{id:e.id,measures:e.measures,type:e.type}})}))}(t,i(u,o.add))}(i,n,o,l,d),$t(t,n),{globalApi:{addRumGlobalContext:J((function(e,t){c[e]=t})),addUserAction:J((function(e,t){n.notify(Me.CUSTOM_ACTION_COLLECTED,{context:t,name:e,type:kt.CUSTOM})})),getInternalContext:J((function(t){return y(E({applicationId:e},f.findView(t),f.findAction(t)))})),setRumGlobalContext:J((function(e){c=e}))},stop:function(){d.stop()}}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(qt||(qt={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(Gt||(Gt={}));var Jt,Qt="rum";function Zt(e,t){var n=pt(Qt,(function(t){return function(e,t){var n;n=function(e){return e===Jt.NOT_TRACKED||e===Jt.TRACKED_WITH_RESOURCES||e===Jt.TRACKED_WITHOUT_RESOURCES}(t)?t:g(e.sampleRate)?g(e.resourceSampleRate)?Jt.TRACKED_WITH_RESOURCES:Jt.TRACKED_WITHOUT_RESOURCES:Jt.NOT_TRACKED;return{trackingType:n,isTracked:en(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(Me.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&en(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Jt.TRACKED_WITH_RESOURCES}}}function en(e){return e===Jt.TRACKED_WITH_RESOURCES||e===Jt.TRACKED_WITHOUT_RESOURCES}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(Jt||(Jt={}));var tn=nn({init:function(e){Ae("core.init")},addRumGlobalContext:function(e,t){Ae("addRumGlobalContext")},setRumGlobalContext:function(e){Ae("setRumGlobalContext")},addUserAction:function(e,t){Ae("addUserAction")},getInternalContext:function(e){Ae("getInternalContext")}});function nn(e){var t=function(e){var t=r({},e);return Object.defineProperty(t,"_setDebug",{get:function(){return te},enumerable:!1}),t}(e),n=!1;return t.init=J((function(e){if(xe()&&Ne()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_RUM is already initialized."),!1;if(!e||!e.clientToken&&!e.publicApiKey)return console.error("Client Token is not configured, we will not send any data."),!1;if(!e.applicationId)return console.error("Application ID is not configured, no RUM data will be collected."),!1;if(void 0!==e.sampleRate&&!w(e.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==e.resourceSampleRate&&!w(e.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey);var i=r(r({},e),{isCollectingError:!0}),o=new ke,u=Le(i,Ue),a=u.errorObservable,s=u.configuration,c=u.internalMonitoring,f=Zt(s,o),d=Xt(i.applicationId,location,o,s,f,c).globalApi,l=Ze(),p=l[0],m=l[1];Ye(o,f),Be(o),s.trackInteractions&&Ft(o),a.subscribe((function(e){return o.notify(Me.ERROR_COLLECTED,e)})),p.subscribe((function(e){return o.notify(Me.REQUEST_STARTED,e)})),m.subscribe((function(e){return o.notify(Me.REQUEST_COMPLETED,e)})),h(t,d),n=!0}})),t}(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}()).DD_RUM=tn}]);
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";n.r(t),n.d(t,"datadogRum",(function(){return tn})),n.d(t,"makeRumGlobal",(function(){return nn}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],u=0,a=o.length;u<a;u++,i++)r[i]=o[u];return r}var u,a,s,c=6e4,f=60*c;function d(e,t,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,u=!1,a=!1;return{throttled:function(){var n=this;u?a=!0:(i?e.apply(this):a=!0,u=!0,r=window.setTimeout((function(){o&&a&&e.apply(n),u=!1,a=!1}),t))},cancel:function(){window.clearTimeout(r),u=!1,a=!1}}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange"}(u||(u={})),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"}(a||(a={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(s||(s={}));var l,p=function(e){return Array.isArray(e)},m=function(e){return!Array.isArray(e)&&"object"==typeof e};function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return p(e)&&p(t)?o(Array(Math.max(e.length,t.length))).map((function(n,r){return v(e[r],t[r])})):m(e)&&m(t)?Object.keys(t).reduce((function(n,i){var o;return r(r({},n),((o={})[i]=v(e[i],t[i]),o))}),e):void 0===t?e:t}),e)}function E(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return v.apply(void 0,o([e],t))}function h(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])}))}function T(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,T)}function g(e){return 0!==e&&100*Math.random()<=e}function b(e){return"number"!=typeof e?e:+(1e6*e).toFixed(0)}function y(e){var t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=function e(t){if(Array.isArray(t))return t.map((function(t){return e(t)}));if("object"==typeof t)return y(t);return t}(e[n])})),t}function C(){}function O(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];R(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,u=[!1,void 0];"object"==typeof e&&R(i=Object.getPrototypeOf(e))&&(u=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),u[0]&&(i.toJSON=u[1])}return o}function R(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function _(e,t){return-1!==e.indexOf(t)}function w(e){return S(e)&&e>=0&&e<=100}function S(e){return"number"==typeof e}function A(e){return Math.floor(I()+e)}function I(){return void 0===l&&(l=performance.timing.navigationStart),l}function D(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var L={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function x(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),i=e+"-http-intake.logs."+t.site,o=t.proxyHost?t.proxyHost:i,u=t.proxyHost?"ddhost="+i+"&":"",a=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+u+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+o+"/v1/input/"+t.clientToken+"?"+a}var M=1e3;function N(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var i="expires="+r.toUTCString();document.cookie=e+"="+t+";"+i+";path=/;samesite=strict"}function U(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}var k="?",B=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var H=function(){var e,t,n,r,i,o,u=[];function a(e,t,n){var r;for(var i in u)if(P(u,i))try{u[i](e,t,n)}catch(e){r=e}if(r)throw r}function s(e,r,i,o,u){if(t)j.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(u)a(j(u),!0,u);else{var s,c={url:r,column:o,line:i},d=e;if("[object String]"==={}.toString.call(e)){var l=d.match(B);l&&(s=l[1],d=l[2])}a({name:s,message:d,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";a(j(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,a(n,!1,r)}function d(n){if(t){if(e===n)return;f()}var r=j(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return d.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=J(s),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=J(c),o=!0}(),u.push(e)},d.unsubscribe=function(e){for(var t=u.length-1;t>=0;t-=1)u[t]===e&&u.splice(t,1);0===u.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},d.traceKitWindowOnError=s,d}(),j=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),d=[],l=0,p=f.length;l<p;l+=1){if(o.exec(f[l])){var m=(r=o.exec(f[l]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),i={args:m?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||k,line:r[3]?+r[3]:void 0,url:m?void 0:r[2]}}else if(a.exec(f[l]))i={args:[],column:(r=a.exec(f[l]))[4]?+r[4]:void 0,func:r[1]||k,line:+r[3],url:r[2]};else{if(!u.exec(f[l]))continue;t=(r=u.exec(f[l]))[3]&&r[3].indexOf(" > eval")>-1,n=s.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==l||r[5]||void 0===e.columnNumber||(d[0].column=e.columnNumber+1),i={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||k,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=k),d.push(i)}if(d.length)return{stack:d,message:e.message,name:e.name}}}function n(e,t,n,r){var i={url:t,line:n?+n:void 0};if(i.url&&i.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===i.url){if(o[0].line===i.line)return!1;if(!o[0].line&&o[0].func===i.func)return o[0].line=i.line,o[0].context=i.context,!1}return o.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var i,o,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],s={},c=!1,f=r.caller;f&&!c;f=f.caller)f!==j&&f!==H&&(o={args:[],column:void 0,func:k,line:void 0,url:void 0},i=u.exec(f.toString()),f.name?o.func=f.name:i&&(o.func=i[1]),void 0===o.func&&(o.func=i?i.input.substring(0,i.input.indexOf("{")):void 0),s[""+f]?c=!0:s[""+f]=!0,a.push(o));t&&a.splice(0,t);var d={stack:a,message:e.message,name:e.name};return n(d,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),d}function i(n,i){var o,u=void 0===i?0:+i;try{if(o=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),u=[],a=0;a<o.length;a+=2){var s=void 0;r.exec(o[a])?s={args:[],column:void 0,func:(n=r.exec(o[a]))[3],line:+n[1],url:n[2]}:i.exec(o[a])&&(s={args:(n=i.exec(o[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),s&&(!s.func&&s.line&&(s.func=k),s.context=[o[a+1]],u.push(s))}if(u.length)return{stack:u,message:e.message,name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=t(n))return o}catch(t){if(e)throw t}try{if(o=function(e){var t=e.message.split("\n");if(!(t.length<4)){var n,r=/^\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,o=/^\s*Line (\d+) of function script\s*$/i,u=[],a=window&&window.document&&window.document.getElementsByTagName("script"),s=[];for(var c in a)P(a,c)&&!a[c].src&&s.push(a[c]);for(var f=2;f<t.length;f+=2){var d=void 0;if(r.exec(t[f]))d={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(i.exec(t[f]))d={args:[],column:void 0,func:(n=i.exec(t[f]))[4],line:+n[1],url:n[3]};else if(o.exec(t[f])){n=o.exec(t[f]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}d&&(d.func||(d.func=k),d.context=[t[f+1]],u.push(d))}if(u.length)return{stack:u,message:t[0],name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=r(n,u+1))return o}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return i.augmentStackTraceWithInitialElement=n,i.computeStackTraceFromStackProp=t,i.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return j(e,t+1)}},i}();var F=/[^\u0000-\u007F]/,W=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&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var z,q=function(){function e(e,t,n,r,i,o){void 0===o&&(o=C),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,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=o(this.pushOnlyBuffer,(t=this.upsertBuffer,n=[],Object.keys(t).forEach((function(e){n.push(t[e])})),n));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,n},e.prototype.sizeInBytes=function(e){return F.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),r=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?console.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(r,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=O(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((function(){e.flush(),e.flushPeriodically()}),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(window.addEventListener(u.BEFORE_UNLOAD,J(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,J((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,J((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(z||(z={}));var G,V,K,$,Y={maxMessagesPerPage:0,sentMessageCount:0};function X(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 q(new W(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return v({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==G?G():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);h(Y,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function J(e){return function(){try{return e.apply(this,arguments)}catch(e){ne(e);try{Z(e)}catch(e){ne(e)}}}}function Q(e,t){!function(e){Y.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),ee(r(r({message:e},t),{status:z.info}))}function Z(e){ee(r(r({},function(e){if(e instanceof Error){var t=j(e);return{error:{kind:t.name,stack:_e(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+O(e)}}(e)),{status:z.error}))}function ee(e){Y.batch&&Y.sentMessageCount<Y.maxMessagesPerPage&&(Y.sentMessageCount+=1,Y.batch.add(e))}function te(e){Y.debugMode=e}function ne(e){Y.debugMode&&console.warn("[INTERNAL ERROR]",e)}function re(e){return ue(e,D(window.location)).href}function ie(e,t){return oe(e)===oe(t)}function oe(e){return D(ue(e))}function ue(e,t){if(function(){if(void 0!==V)return V;try{var e=new URL("http://test/path");return V="http://test/path"===e.href}catch(e){V=!1}return V}())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 i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var ae=[],se=[];function ce(){return K||(!function(){if(!window.fetch)return;$=window.fetch,window.fetch=J((function(e,t){var n=this,r={method:t&&t.method||"object"==typeof e&&e.method||"GET",startTime:performance.now()},o=function(t){return o=n,u=void 0,s=function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return r.duration=performance.now()-r.startTime,r.url=re("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(r.status=0,r.response=_e(j(t)),se.forEach((function(e){return e(r)})),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];n=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return n=i.sent(),[3,5];case 4:return o=i.sent(),n="Unable to retrieve response: "+o,[3,5];case 5:r.response=n,r.responseType=t.type,r.status=t.status,se.forEach((function(e){return e(r)})),i.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(n,r)}i((s=s.apply(o,u||[])).next())}));var o,u,a,s};ae.forEach((function(e){return e(r)}));var u=$.call(this,e,t);return u.then(J(o),J(o)),u}))}(),K={beforeSend:function(e){ae.push(e)},onRequestComplete:function(e){se.push(e)}}),K}var fe,de,le,pe,me,ve,Ee,he,Te,ge=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){this.observers.push(e)},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}(),be=[],ye=[];function Ce(){return fe||(de=XMLHttpRequest.prototype.open,le=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=J((function(e,t){return this._datadog_xhr={method:e,url:re(t)},de.apply(this,arguments)})),XMLHttpRequest.prototype.send=J((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&J(i)(),n&&n.apply(this,arguments)};var r=!1,i=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,ye.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",J(i)),be.forEach((function(e){return e(t._datadog_xhr)}))}return le.apply(this,arguments)})),fe={beforeSend:function(e){be.push(e)},onRequestComplete:function(e){ye.push(e)}}),fe}function Oe(e){if(!me){var t=new ge;e.isCollectingError&&(function(e,t){function n(n,r){(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r))&&t.notify({context:{error:{origin:pe.NETWORK,stack:we(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:Se(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}Ce().onRequestComplete((function(e){return n(s.XHR,e)})),ce().onRequestComplete((function(e){return n(s.FETCH,e)}))}(e,t),function(e){ve=console.error,console.error=J((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ve.apply(console,o([t],n)),e.notify({context:{error:{origin:pe.CONSOLE}},message:o(["console error:",t],n).map(Re).join(" "),startTime:performance.now()})}))}(t),function(e){Ee=function(t,n,r){e.notify(function(e,t){var n,r;void 0!==e.message||t instanceof Error?(n=e.message||"Empty message",r=_e(e)):(n="Uncaught "+O(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:pe.SOURCE}},startTime:performance.now()}}(t,r))},H.subscribe(Ee)}(t)),me=function(e,t){var n=0,r=new ge;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:pe.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return me}function Re(e){return"string"==typeof e?e:e instanceof Error?_e(j(e)):O(e,0,2)}function _e(e){var t=(e.name||"Error")+": "+e.message;return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}function we(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Se(e){return s.XHR===e?"XHR":"Fetch"}function Ae(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(pe||(pe={})),function(e){e.US="us",e.EU="eu"}(Te||(Te={}));var Ie,De=((he={})[Te.EU]="datadoghq.eu",he[Te.US]="datadoghq.com",he);function Le(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||De[e.datacenter||t.datacenter],version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({isEnabled:function(e){return _(i,e)},logsEndpoint:x("browser",n),rumEndpoint:x("rum",n),traceEndpoint:x("public-trace",n)},L);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=x("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in e&&(o.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),n.buildMode===Ie.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(o.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(o.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(o.rumEndpoint=e.rumEndpoint)),n.buildMode===Ie.STAGING&&void 0!==e.replica){var u=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:De[Te.US]});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:x("browser",u,"browser-agent-internal-monitoring"),logsEndpoint:x("browser",u),rumEndpoint:x("rum",u)}}return o}(e,t),i=X(n);return{configuration:n,errorObservable:Oe(n),internalMonitoring:i}}function xe(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return N("dd_rum_test","test",1e3),"test"===U("dd_rum_test")}catch(e){return console.error(e),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function Me(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Ie||(Ie={}));var Ne,Ue={buildMode:"release",datacenter:"us",sdkVersion:"1.15.2"};!function(e){e[e.ERROR_COLLECTED=0]="ERROR_COLLECTED",e[e.PERFORMANCE_ENTRY_COLLECTED=1]="PERFORMANCE_ENTRY_COLLECTED",e[e.CUSTOM_ACTION_COLLECTED=2]="CUSTOM_ACTION_COLLECTED",e[e.AUTO_ACTION_CREATED=3]="AUTO_ACTION_CREATED",e[e.AUTO_ACTION_COMPLETED=4]="AUTO_ACTION_COMPLETED",e[e.AUTO_ACTION_DISCARDED=5]="AUTO_ACTION_DISCARDED",e[e.VIEW_CREATED=6]="VIEW_CREATED",e[e.VIEW_UPDATED=7]="VIEW_UPDATED",e[e.REQUEST_STARTED=8]="REQUEST_STARTED",e[e.REQUEST_COMPLETED=9]="REQUEST_COMPLETED",e[e.SESSION_RENEWED=10]="SESSION_RENEWED",e[e.RESOURCE_ADDED_TO_BATCH=11]="RESOURCE_ADDED_TO_BATCH",e[e.DOM_MUTATED=12]="DOM_MUTATED",e[e.BEFORE_UNLOAD=13]="BEFORE_UNLOAD"}(Ne||(Ne={}));var ke=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 Be(e){var t,n=function(){var e,t=window;if(t.Zone){var n=t.Zone.__symbol__("MutationObserver");e=t[n]}return e||(e=t.MutationObserver),e}();return n&&(t=new n(J((function(){e.notify(Ne.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Pe="initial_document",He=[[a.DOCUMENT,function(e){return Pe===e}],[a.XHR,function(e){return"xmlhttprequest"===e}],[a.FETCH,function(e){return"fetch"===e}],[a.BEACON,function(e){return"beacon"===e}],[a.CSS,function(e,t){return null!==t.match(/\.css$/i)}],[a.JS,function(e,t){return null!==t.match(/\.js$/i)}],[a.IMAGE,function(e,t){return _(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[a.FONT,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[a.MEDIA,function(e,t){return _(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function je(e){var t=e.name;if(!function(e){try{return!!ue(e)}catch(e){return!1}}(t))return Q('Failed to construct URL for "'+e.name+'"'),a.OTHER;for(var n=function(e){var t=ue(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=0,i=He;r<i.length;r++){var o=i[r],u=o[0];if((0,o[1])(e.initiatorType,n))return u}return a.OTHER}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=1;n<e.length;n+=1)if(e[n-1]>e[n])return!1;return!0}function We(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return b(0===t&&n<r?r-n:t)}function ze(e){var t=e.startTime,n=e.fetchStart,r=e.domainLookupStart,i=e.domainLookupEnd,o=e.connectStart,u=e.secureConnectionStart,a=e.connectEnd,s=e.requestStart,c=e.responseStart,f=e.responseEnd,d=e.redirectStart,l=e.redirectEnd;if(Fe(t,n,r,i,o,a,s,c,f)){var p=n!==t;if(!p||(d<t&&(d=t),l<t&&(l=n),Fe(t,d,l,n))){var m={download:qe(t,c,f),firstByte:qe(t,s,c)};return a!==n&&(m.connect=qe(t,o,a),Fe(o,u,a)&&(m.ssl=qe(t,u,a))),i!==n&&(m.dns=qe(t,r,i)),p&&(m.redirect=qe(t,d,l)),m}}}function qe(e,t,n){return{duration:b(n-t),start:b(t-e)}}function Ge(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function Ve(e,t){return e&&!function(e,t){return ie(e,t.logsEndpoint)||ie(e,t.rumEndpoint)||ie(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&ie(e,t.internalMonitoringEndpoint)}(e,t)}function Ke(){return void 0!==window.performance&&"getEntries"in performance}function $e(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Ye(e,t){if(function(e){var t;if($e()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];t=r({},n.toJSON())}else t=r(r({},Xe()),{name:window.location.href,decodedBodySize:0,startTime:0});t.entryType="resource",t.initiatorType=Pe,t.duration=t.responseEnd,e(t)}((function(n){Je(t,e,[n])})),Ke()&&Je(t,e,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(J((function(n){return Je(t,e,n.getEntries())}))),i=["resource","navigation","longtask"];"visible"===document.visibilityState&&i.push("paint"),n.observe({entryTypes:i}),Ke()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}$e()||function(e){function t(){var t=r(r({},Xe()),{entryType:"navigation"});e(t)}if("complete"===document.readyState)t();else{var n=J((function(){window.removeEventListener(u.LOAD,n),setTimeout(J(t))}));window.addEventListener(u.LOAD,n)}}((function(n){Je(t,e,[n])}))}function Xe(){var e={},t=performance.timing;for(var n in t)S(t[n])&&(e[n]=0===t[n]?0:t[n]-I());return e}function Je(e,t,n){function r(e){t.notify(Ne.PERFORMANCE_ENTRY_COLLECTED,e)}e.isTrackedWithResource()&&n.filter((function(e){return"resource"===e.entryType})).forEach(r),n.filter((function(e){return"navigation"===e.entryType})).filter((function(e){return e.loadEventEnd>0})).forEach(r),n.filter((function(e){return"paint"===e.entryType})).forEach(r),n.filter((function(e){return"longtask"===e.entryType})).forEach(r)}var Qe=1;function Ze(){var e,t,n,r,i=[new ge,new ge];return t=(e=i)[0],n=e[1],(r=Ce()).beforeSend((function(e){var n=et();e.requestId=n,t.notify({requestId:n})})),r.onRequestComplete((function(e){n.notify({duration:e.duration,method:e.method,requestId:e.requestId,response:e.response,startTime:e.startTime,status:e.status,traceId:tt(),type:s.XHR,url:e.url})})),function(e){var t=e[0],n=e[1],r=ce();r.beforeSend((function(e){var n=et();e.requestId=n,t.notify({requestId:n})})),r.onRequestComplete((function(e){n.notify({duration:e.duration,method:e.method,requestId:e.requestId,response:e.response,responseType:e.responseType,startTime:e.startTime,status:e.status,traceId:tt(),type:s.FETCH,url:e.url})}))}(i),i}function et(){var e=Qe;return Qe+=1,e}function tt(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function nt(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").filter((function(t){return n=t,r=e.startTime,i=rt(e),n.startTime>=r&&rt(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&rt((t=n)[0])<=t[1].startTime?n[1]:void 0}}function rt(e){return e.startTime+e.duration}var it="_dd",ot="_dd_r",ut="_dd_l",at="rum",st="logs";var ct="_dd_s",ft=15*c,dt=4*f,lt=c;function pt(e,t){var n,r,i,o,a,s=(n=ct,o=!1,a=function(){o=!0,window.clearTimeout(r),r=window.setTimeout((function(){o=!1}),M)},{get:function(){return o?i:(i=U(n),a(),i)},set:function(e,t){N(n,e,t),i=e,a()}});!function(e){var t=e.get(),n=U(it),r=U(ot),i=U(ut);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[st]=i),r&&/^[012]$/.test(r)&&(o[at]=r),ht(o,e)}}(s);var c=new ge,f=Et(s).id,l=d((function(){var n=Et(s),r=t(n[e]),i=r.trackingType,o=r.isTracked;n[e]=i,o&&!n.id&&(n.id=T(),n.created=String(Date.now())),ht(n,s),o&&f!==n.id&&(f=n.id,c.notify())}),M).throttled;return l(),function(e){var t=J(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),gt.push((function(){return document.removeEventListener(e,t,n)}))}))}(l),function(e){var t=J((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,lt);document.addEventListener(u.VISIBILITY_CHANGE,t),gt.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){ht(Et(s),s)})),{getId:function(){return Et(s).id},getTrackingType:function(){return Et(s)[e]},renewObservable:c}}var mt=/^([a-z]+)=([a-z0-9-]+)$/,vt="&";function Et(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(vt)||mt.test(e))})(t)&&t.split(vt).forEach((function(e){var t=mt.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<dt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Tt(e),{})}function ht(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ft);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(vt);t.set(r,ft)}else Tt(t)}function Tt(e){e.set("",0)}var gt=[];var bt=dt,yt=5*c,Ct=c;function Ot(e){return function(e){var t;if(function(){void 0===St&&(St="closest"in HTMLElement.prototype);return St}())t=e.closest("["+Rt+"]");else for(var n=e;n;){if(n.hasAttribute(Rt)){t=n;break}n=n.parentElement}if(!t)return;return Mt(xt(t.getAttribute(Rt).trim()))}(e)||Lt(e,At)||Lt(e,It)||""}var Rt="data-dd-action-name";var _t,wt,St,At=[function(e){if(function(){void 0===wt&&(wt="labels"in HTMLInputElement.prototype);return wt}()){if("labels"in e&&e.labels&&e.labels.length>0)return Nt(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Nt(t)}},function(e){if("INPUT"===e.nodeName){var t=e,n=t.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return t.value}},function(e){if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return Nt(e)},function(e){return e.getAttribute("aria-label")},function(e){var t=e.getAttribute("aria-labelledby");if(t)return t.split(/\s+/).map((function(t){return function(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}(e,t)})).filter((function(e){return Boolean(e)})).map(Nt).join(" ")},function(e){return e.getAttribute("alt")},function(e){return e.getAttribute("name")},function(e){return e.getAttribute("title")},function(e){return e.getAttribute("placeholder")},function(e){if("options"in e&&e.options.length>0)return Nt(e.options[0])}],It=[function(e){return Nt(e)}],Dt=10;function Lt(e,t){for(var n=e,r=0;r<=Dt&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=t;i<o.length;i++){var u=(0,o[i])(n);if("string"==typeof u){var a=u.trim();if(a)return Mt(xt(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function xt(e){return e.replace(/\s+/g," ")}function Mt(e){return e.length>100?e.slice(0,100)+" [...]":e}function Nt(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===_t){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),_t=""===t.innerText,document.body.removeChild(t)}return _t}())for(var n=e.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(t=t.replace(i,""))}return t}return e.textContent}}function Ut(e,t){void 0===t&&(t=C);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(e.subscribe(Ne.ERROR_COLLECTED,(function(){n.errorCount+=1,t(n)}))),r.push(e.subscribe(Ne.AUTO_ACTION_COMPLETED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Ne.CUSTOM_ACTION_COLLECTED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Ne.PERFORMANCE_ENTRY_COLLECTED,(function(e){"longtask"===e.entryType&&(n.longTaskCount+=1,t(n))}))),r.push(e.subscribe(Ne.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,t(n)}))),{stop:function(){r.forEach((function(e){return e.unsubscribe()}))},eventCounts:n}}var kt,Bt=100,Pt=100,Ht=1e4;function jt(e,t){var n=function(e){var t,n=new ge,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(Ne.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(Ne.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(Ne.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestId),i+=1,o()}))),r.push(e.subscribe(Ne.REQUEST_COMPLETED,(function(e){void 0===t||e.requestId<t||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(e){return e.unsubscribe()}))}}}(e),r=n.observable,i=n.stop,o=function(e,t,n){var r,i=!1,o=setTimeout(J((function(){return s(!1,0)})),Bt),u=setTimeout(J((function(){return s(!0,performance.now())})),Ht);function a(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(u),t()}function s(e,t){i||(a(),n(e,t))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();t||(r=setTimeout(J((function(){return s(!0,n)})),Pt))})),{stop:a}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Ft(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new zt(e,r,i);t=o,n=jt(e,(function(e,n){e?o.complete(n):o.discard(),t=void 0}))}},discardCurrent:function(){t&&(n.stop(),t.discard(),t=void 0)}}}(e);function n(e){if(e.target instanceof Element){var n=Ot(e.target);n&&t.create(kt.CLICK,n)}}return e.subscribe(Ne.VIEW_CREATED,(function(){t.discardCurrent()})),addEventListener(u.CLICK,n,{capture:!0}),{stop:function(){t.discardCurrent(),removeEventListener(u.CLICK,n,{capture:!0})}}}!function(e){e.CLICK="click",e.CUSTOM="custom"}(kt||(kt={}));var Wt,zt=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=T(),this.startTime=performance.now(),this.eventCountsSubscription=Ut(e),this.lifeCycle.notify(Ne.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Ne.AUTO_ACTION_COMPLETED,{duration:e-this.startTime,id:this.id,measures:{errorCount:t.errorCount,longTaskCount:t.longTaskCount,resourceCount:t.resourceCount},name:this.name,startTime:this.startTime,type:this.type}),this.eventCountsSubscription.stop()},e.prototype.discard=function(){this.lifeCycle.notify(Ne.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(Wt||(Wt={}));var qt,Gt,Vt=3e3,Kt=5*c;function $t(e,t){var n,i=Yt(t,e,Wt.INITIAL_LOAD,0),o=i,a=function(e,t){var n;return{stop:e.subscribe(Ne.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("navigation"===e.entryType){var i=e;n=r(r({},n),{domComplete:i.domComplete,domContentLoaded:i.domContentLoadedEventEnd,domInteractive:i.domInteractive,loadEventEnd:i.loadEventEnd}),t(n)}else if("paint"===e.entryType&&"first-contentful-paint"===e.name){var o=e;n=r(r({},n),{firstContentfulPaint:o.startTime}),t(n)}})).unsubscribe}}(t,(function(e){i.updateTimings(e),i.scheduleUpdate()})).stop;function s(){o.isDifferentView(e)?(o.triggerUpdate(),o.end(),o=Yt(t,e,Wt.ROUTE_CHANGE)):(o.updateLocation(e),o.triggerUpdate())}!function(e){var t=history.pushState;history.pushState=J((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=J((function(){n.apply(this,arguments),e()})),window.addEventListener(u.POP_STATE,J(e))}(s),n=s,window.addEventListener("hashchange",J(n)),t.subscribe(Ne.SESSION_RENEWED,(function(){o.end(),o=Yt(t,e,Wt.ROUTE_CHANGE)})),t.subscribe(Ne.BEFORE_UNLOAD,(function(){o.triggerUpdate(),o.end()}));var c=window.setInterval(J((function(){o.triggerUpdate()})),Kt);return{stop:function(){a(),o.end(),clearInterval(c)}}}function Yt(e,t,n,i){void 0===i&&(i=performance.now());var o,u,a,s=T(),c={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},f=0,l=r({},t);e.notify(Ne.VIEW_CREATED,{id:s,startTime:i,location:l});var p=d(J(C),Vt,{leading:!1}),m=p.throttled,v=p.cancel,E=Ut(e,(function(e){c=e,m()})).stop,h=function(e,t){var n=e===Wt.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&t(Math.max.apply(Math,i))}return{setLoadEventEnd:function(e){n&&(n=!1,i.push(e),o())},setActivityLoadingTime:function(e){r&&(r=!1,void 0!==e&&i.push(e),o())}}}(n,(function(e){u=e,m()})),g=h.setActivityLoadingTime,b=h.setLoadEventEnd,y=function(e,t){var n=performance.now();return{stop:jt(e,(function(e,r){t(e?r-n:void 0)})).stop}}(e,g).stop;function C(){f+=1,e.notify(Ne.VIEW_UPDATED,{documentVersion:f,id:s,loadingTime:u,loadingType:n,location:l,startTime:i,duration:(void 0===a?performance.now():a)-i,measures:r(r({},o),c)})}return(C(),{scheduleUpdate:m,end:function(){a=performance.now(),E(),y()},isDifferentView:function(e){return l.pathname!==e.pathname||(t=e.hash,n=t.substr(1),!document.getElementById(n)&&e.hash!==l.hash);var t,n},triggerUpdate:function(){v(),C()},updateTimings:function(e){o=e,void 0!==e.loadEventEnd&&b(e.loadEventEnd)},updateLocation:function(e){l=r({},e)}})}function Xt(e,t,n,i,o,u){var c={},f=function(e,t){var n,r,i,o=[],u=[];e.subscribe(Ne.VIEW_CREATED,(function(e){n&&o.unshift({context:c(),endTime:e.startTime,startTime:n.startTime}),n=e,i=t.getId()})),e.subscribe(Ne.VIEW_UPDATED,(function(e){n.id===e.id&&(n=e)})),e.subscribe(Ne.AUTO_ACTION_CREATED,(function(e){r=e})),e.subscribe(Ne.AUTO_ACTION_COMPLETED,(function(e){r&&u.unshift({context:f(),endTime:r.startTime+e.duration,startTime:r.startTime}),r=void 0})),e.subscribe(Ne.AUTO_ACTION_DISCARDED,(function(){r=void 0})),e.subscribe(Ne.SESSION_RENEWED,(function(){o=[],u=[],n=void 0,r=void 0}));var a=window.setInterval(J((function(){s(o,bt),s(u,yt)})),Ct);function s(e,t){for(var n=performance.now()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function c(){return{sessionId:i,view:{id:n.id,url:n.location.href}}}function f(){return{userAction:{id:r.id}}}function d(e,t,n,r){if(void 0===r)return n?e():void 0;if(n&&r>=n.startTime)return e();for(var i=0,o=t;i<o.length;i++){var u=o[i];if(r>u.endTime)break;if(r>=u.startTime)return u.context}}return{findAction:function(e){return d(f,u,r,e)},findView:function(e){return d(c,o,n,e)},stop:function(){window.clearInterval(a)}}}(n,o);u.setExternalContextProvider((function(){return v({application_id:e},f.findView(),c)}));var d=function(e,t){var n,r=o(e.rumEndpoint),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(n){return new q(new W(n,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return t.notify(Ne.BEFORE_UNLOAD)}))}function u(e){return v(e,{application_id:i.applicationId})}var a=!1;return{add:function(e){a||(r.add(e),n&&n.add(u(e)))},stop:function(){a=!0},upsert:function(e,t){a||(r.upsert(e,t),n&&n.upsert(u(e),t))}}}(i,n),l=function(e,t,n,r){return function(i,o){return function(u,a,s){var c=e.findView(u);if(t.isTracked()&&c&&c.sessionId){var f=e.findAction(u),d=i(a,{action:f,view:c,rum:n()}),l=v(r(),s,y(d));o(l,d)}}}}(f,o,(function(){return{applicationId:e,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?Gt.USER:Gt.SYNTHETICS},view:{referrer:document.referrer}}}),(function(){return c}));return function(e,t,n,i,o){var u=function(e,t){var n=t.view;return E(t.rum,n,e)},c=function(e,t){var n=t.view,r=t.action;return E(t.rum,n,r,e)};(function(e,t){e.subscribe(Ne.VIEW_UPDATED,(function(e){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:qt.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:b(e.loadingTime),loadingType:e.loadingType,measures:r({domComplete:b(e.measures.domComplete),domContentLoaded:b(e.measures.domContentLoaded),domInteractive:b(e.measures.domInteractive),firstContentfulPaint:b(e.measures.firstContentfulPaint),loadEventEnd:b(e.measures.loadEventEnd)},e.measures)}})}))})(t,i(u,(function(e,t){return o.upsert(e,t.view.id)}))),function(e,t){e.subscribe(Ne.ERROR_COLLECTED,(function(e){var n=e.message,i=e.startTime,o=e.context;t(i,r({message:n,date:A(i),evt:{category:qt.ERROR}},o))}))}(t,i(c,o.add)),function(e,t,n,r){t.subscribe(Ne.REQUEST_COMPLETED,(function(i){if(n.isTrackedWithResource()&&Ve(i.url,e)){var o=nt(i),u=i.type===s.XHR?a.XHR:a.FETCH,c=o?o.startTime:i.startTime;r(c,{date:A(c),duration:o?We(o):b(i.duration),evt:{category:qt.RESOURCE},http:{method:i.method,performance:o?ze(o):void 0,statusCode:i.status,url:i.url},network:{bytesWritten:o?Ge(o):void 0},resource:{kind:u},traceId:i.traceId}),t.notify(Ne.RESOURCE_ADDED_TO_BATCH)}}))}(e,t,n,i(c,o.add)),function(e,t,n){t.subscribe(Ne.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(e,t,n,r){if(!Ve(t.name,e))return;var i=je(t);if(_([a.XHR,a.FETCH],i))return;n(t.startTime,{date:A(t.startTime),duration:We(t),evt:{category:qt.RESOURCE},http:{performance:ze(t),url:t.name},network:{bytesWritten:Ge(t)},resource:{kind:i}}),r.notify(Ne.RESOURCE_ADDED_TO_BATCH)}(e,r,n,t);break;case"longtask":!function(e,t){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:qt.LONG_TASK}})}(r,n)}}))}(e,t,i(c,o.add)),function(e,t){e.subscribe(Ne.CUSTOM_ACTION_COLLECTED,(function(e){t(performance.now(),{evt:{category:qt.USER_ACTION,name:e.name},userAction:{type:e.type}},e.context)}))}(t,i(u,o.add)),function(e,t){e.subscribe(Ne.AUTO_ACTION_COMPLETED,(function(e){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:qt.USER_ACTION,name:e.name},userAction:{id:e.id,measures:e.measures,type:e.type}})}))}(t,i(u,o.add))}(i,n,o,l,d),$t(t,n),{globalApi:{addRumGlobalContext:J((function(e,t){c[e]=t})),addUserAction:J((function(e,t){n.notify(Ne.CUSTOM_ACTION_COLLECTED,{context:t,name:e,type:kt.CUSTOM})})),getInternalContext:J((function(t){return y(v({applicationId:e},f.findView(t),f.findAction(t)))})),setRumGlobalContext:J((function(e){c=e}))},stop:function(){d.stop()}}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(qt||(qt={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(Gt||(Gt={}));var Jt,Qt="rum";function Zt(e,t){var n=pt(Qt,(function(t){return function(e,t){var n;n=function(e){return e===Jt.NOT_TRACKED||e===Jt.TRACKED_WITH_RESOURCES||e===Jt.TRACKED_WITHOUT_RESOURCES}(t)?t:g(e.sampleRate)?g(e.resourceSampleRate)?Jt.TRACKED_WITH_RESOURCES:Jt.TRACKED_WITHOUT_RESOURCES:Jt.NOT_TRACKED;return{trackingType:n,isTracked:en(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(Ne.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&en(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Jt.TRACKED_WITH_RESOURCES}}}function en(e){return e===Jt.TRACKED_WITH_RESOURCES||e===Jt.TRACKED_WITHOUT_RESOURCES}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(Jt||(Jt={}));var tn=nn({init:function(e){Ae("core.init")},addRumGlobalContext:function(e,t){Ae("addRumGlobalContext")},setRumGlobalContext:function(e){Ae("setRumGlobalContext")},addUserAction:function(e,t){Ae("addUserAction")},getInternalContext:function(e){Ae("getInternalContext")}});function nn(e){var t=function(e){var t=r({},e);return Object.defineProperty(t,"_setDebug",{get:function(){return te},enumerable:!1}),t}(e),n=!1;return t.init=J((function(e){if(xe()&&Me()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_RUM is already initialized."),!1;if(!e||!e.clientToken&&!e.publicApiKey)return console.error("Client Token is not configured, we will not send any data."),!1;if(!e.applicationId)return console.error("Application ID is not configured, no RUM data will be collected."),!1;if(void 0!==e.sampleRate&&!w(e.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==e.resourceSampleRate&&!w(e.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey);var i=r(r({},e),{isCollectingError:!0}),o=new ke,u=Le(i,Ue),a=u.errorObservable,s=u.configuration,c=u.internalMonitoring,f=Zt(s,o),d=Xt(i.applicationId,location,o,s,f,c).globalApi,l=Ze(),p=l[0],m=l[1];Ye(o,f),Be(o),s.trackInteractions&&Ft(o),a.subscribe((function(e){return o.notify(Ne.ERROR_COLLECTED,e)})),p.subscribe((function(e){return o.notify(Ne.REQUEST_STARTED,e)})),m.subscribe((function(e){return o.notify(Ne.REQUEST_COMPLETED,e)})),h(t,d),n=!0}})),t}(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}()).DD_RUM=tn}]);

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

datacenter: 'us',
sdkVersion: '1.15.1',
sdkVersion: '1.15.2',
};
//# sourceMappingURL=buildEnv.js.map

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

lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.VIEW_UPDATED, function (currentContext) {
currentView = currentContext;
// A view can be updated after its end. We have to ensure that the view being updated is the
// most recently created.
if (currentView.id === currentContext.id) {
currentView = currentContext;
}
});

@@ -74,3 +78,3 @@ lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.AUTO_ACTION_CREATED, function (currentContext) {

function findContext(buildContext, previousContexts, currentContext, startTime) {
if (!startTime) {
if (startTime === undefined) {
return currentContext ? buildContext() : undefined;

@@ -77,0 +81,0 @@ }

@@ -152,5 +152,5 @@ "use strict";

view: {
loadingTime: view.loadingTime ? browser_core_1.msToNs(view.loadingTime) : undefined,
loadingTime: browser_core_1.msToNs(view.loadingTime),
loadingType: view.loadingType,
measures: view.measures,
measures: tslib_1.__assign({ domComplete: browser_core_1.msToNs(view.measures.domComplete), domContentLoaded: browser_core_1.msToNs(view.measures.domContentLoaded), domInteractive: browser_core_1.msToNs(view.measures.domInteractive), firstContentfulPaint: browser_core_1.msToNs(view.measures.firstContentfulPaint), loadEventEnd: browser_core_1.msToNs(view.measures.loadEventEnd) }, view.measures),
},

@@ -157,0 +157,0 @@ });

import { LifeCycle } from './lifeCycle';
import { EventCounts } from './trackEventCounts';
export interface View {

@@ -12,3 +13,3 @@ id: string;

}
export interface ViewMeasures {
interface Timings {
firstContentfulPaint?: number;

@@ -19,7 +20,4 @@ domInteractive?: number;

loadEventEnd?: number;
errorCount: number;
resourceCount: number;
longTaskCount: number;
userActionCount: number;
}
export declare type ViewMeasures = Timings & EventCounts;
export declare enum ViewLoadingType {

@@ -34,1 +32,2 @@ INITIAL_LOAD = "initial_load",

};
export {};

@@ -17,5 +17,13 @@ "use strict";

var startOrigin = 0;
var currentView = newView(lifeCycle, location, ViewLoadingType.INITIAL_LOAD, startOrigin);
function renewViewOnChange() {
var initialView = newView(lifeCycle, location, ViewLoadingType.INITIAL_LOAD, startOrigin);
var currentView = initialView;
var stopTimingsTracking = trackTimings(lifeCycle, function (timings) {
initialView.updateTimings(timings);
initialView.scheduleUpdate();
}).stop;
trackHistory(onLocationChange);
trackHash(onLocationChange);
function onLocationChange() {
if (currentView.isDifferentView(location)) {
// Renew view on location changes
currentView.triggerUpdate();

@@ -30,6 +38,2 @@ currentView.end();

}
// Renew view on history changes
trackHistory(renewViewOnChange);
// Renew view on hash changes
trackHash(renewViewOnChange);
// Renew view on session renewal

@@ -52,2 +56,3 @@ lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.SESSION_RENEWED, function () {

stop: function () {
stopTimingsTracking();
currentView.end();

@@ -63,3 +68,3 @@ clearInterval(keepAliveInterval);

var id = browser_core_1.generateUUID();
var measures = {
var eventCounts = {
errorCount: 0,

@@ -70,24 +75,24 @@ longTaskCount: 0,

};
var timings;
var documentVersion = 0;
var loadingTime;
var endTime;
var location = tslib_1.__assign({}, initialLocation);
lifeCycle.notify(lifeCycle_1.LifeCycleEventType.VIEW_CREATED, { id: id, startTime: startTime, location: location });
// Update the view every time the measures are changing
var _a = browser_core_1.throttle(browser_core_1.monitor(updateView), exports.THROTTLE_VIEW_UPDATE_PERIOD, {
var _a = browser_core_1.throttle(browser_core_1.monitor(triggerViewUpdate), exports.THROTTLE_VIEW_UPDATE_PERIOD, {
leading: false,
}), scheduleViewUpdate = _a.throttled, stopScheduleViewUpdate = _a.stop;
function updateMeasures(newMeasures) {
measures = tslib_1.__assign(tslib_1.__assign({}, measures), newMeasures);
}), scheduleViewUpdate = _a.throttled, cancelScheduleViewUpdate = _a.cancel;
var stopEventCountsTracking = trackEventCounts_1.trackEventCounts(lifeCycle, function (newEventCounts) {
eventCounts = newEventCounts;
scheduleViewUpdate();
}
var stopTimingsTracking = trackTimings(lifeCycle, updateMeasures).stop;
var stopEventCountsTracking = trackEventCounts_1.trackEventCounts(lifeCycle, updateMeasures).stop;
function updateLoadingTime(loadingTimeValue) {
loadingTime = loadingTimeValue;
}).stop;
var _b = trackLoadingTime(loadingType, function (newLoadingTime) {
loadingTime = newLoadingTime;
scheduleViewUpdate();
}
var stopLoadingTimeTracking = trackLoadingTime(lifeCycle, loadingType, updateLoadingTime).stop;
}), setActivityLoadingTime = _b.setActivityLoadingTime, setLoadEventEnd = _b.setLoadEventEnd;
var stopActivityLoadingTimeTracking = trackActivityLoadingTime(lifeCycle, setActivityLoadingTime).stop;
// Initial view update
updateView();
function updateView() {
triggerViewUpdate();
function triggerViewUpdate() {
documentVersion += 1;

@@ -100,14 +105,13 @@ lifeCycle.notify(lifeCycle_1.LifeCycleEventType.VIEW_UPDATED, {

location: location,
measures: measures,
startTime: startTime,
duration: performance.now() - startTime,
duration: (endTime === undefined ? performance.now() : endTime) - startTime,
measures: tslib_1.__assign(tslib_1.__assign({}, timings), eventCounts),
});
}
return {
scheduleUpdate: scheduleViewUpdate,
end: function () {
stopTimingsTracking();
endTime = performance.now();
stopEventCountsTracking();
stopLoadingTimeTracking();
// prevent pending view updates execution
stopScheduleViewUpdate();
stopActivityLoadingTimeTracking();
},

@@ -119,4 +123,12 @@ isDifferentView: function (otherLocation) {

triggerUpdate: function () {
updateView();
// cancel any pending view updates execution
cancelScheduleViewUpdate();
triggerViewUpdate();
},
updateTimings: function (newTimings) {
timings = newTimings;
if (newTimings.loadEventEnd !== undefined) {
setLoadEventEnd(newTimings.loadEventEnd);
}
},
updateLocation: function (newLocation) {

@@ -148,7 +160,7 @@ location = tslib_1.__assign({}, newLocation);

function trackTimings(lifeCycle, callback) {
var timings = {};
var timings;
var stopPerformanceTracking = lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType === 'navigation') {
var navigationEntry = entry;
timings = tslib_1.__assign(tslib_1.__assign({}, timings), { domComplete: browser_core_1.msToNs(navigationEntry.domComplete), domContentLoaded: browser_core_1.msToNs(navigationEntry.domContentLoadedEventEnd), domInteractive: browser_core_1.msToNs(navigationEntry.domInteractive), loadEventEnd: browser_core_1.msToNs(navigationEntry.loadEventEnd) });
timings = tslib_1.__assign(tslib_1.__assign({}, timings), { domComplete: navigationEntry.domComplete, domContentLoaded: navigationEntry.domContentLoadedEventEnd, domInteractive: navigationEntry.domInteractive, loadEventEnd: navigationEntry.loadEventEnd });
callback(timings);

@@ -158,3 +170,3 @@ }

var paintEntry = entry;
timings = tslib_1.__assign(tslib_1.__assign({}, timings), { firstContentfulPaint: browser_core_1.msToNs(paintEntry.startTime) });
timings = tslib_1.__assign(tslib_1.__assign({}, timings), { firstContentfulPaint: paintEntry.startTime });
callback(timings);

@@ -165,36 +177,30 @@ }

}
function trackLoadingTime(lifeCycle, loadingType, callback) {
var expectedTiming = 1;
var receivedTimings = [];
var stopLoadEventLoadingTime = browser_core_1.noop;
if (loadingType === ViewLoadingType.INITIAL_LOAD) {
expectedTiming += 1;
(stopLoadEventLoadingTime = trackLoadEventLoadingTime(lifeCycle, onTimingValue).stop);
}
var stopActivityLoadingTimeTracking = trackActivityLoadingTime(lifeCycle, onTimingValue).stop;
function onTimingValue(timingValue) {
expectedTiming -= 1;
if (timingValue) {
receivedTimings.push(timingValue);
function trackLoadingTime(loadType, callback) {
var isWaitingForLoadEventEnd = loadType === ViewLoadingType.INITIAL_LOAD;
var isWaitingForActivityLoadingTime = true;
var loadingTimeCandidates = [];
function invokeCallbackIfAllCandidatesAreReceived() {
if (!isWaitingForActivityLoadingTime && !isWaitingForLoadEventEnd && loadingTimeCandidates.length > 0) {
callback(Math.max.apply(Math, loadingTimeCandidates));
}
if (expectedTiming === 0 && receivedTimings.length) {
callback(Math.max.apply(Math, receivedTimings));
}
}
return {
stop: function () {
stopActivityLoadingTimeTracking();
stopLoadEventLoadingTime();
setLoadEventEnd: function (loadEventEnd) {
if (isWaitingForLoadEventEnd) {
isWaitingForLoadEventEnd = false;
loadingTimeCandidates.push(loadEventEnd);
invokeCallbackIfAllCandidatesAreReceived();
}
},
setActivityLoadingTime: function (activityLoadingTime) {
if (isWaitingForActivityLoadingTime) {
isWaitingForActivityLoadingTime = false;
if (activityLoadingTime !== undefined) {
loadingTimeCandidates.push(activityLoadingTime);
}
invokeCallbackIfAllCandidatesAreReceived();
}
},
};
}
function trackLoadEventLoadingTime(lifeCycle, callback) {
var stopPerformanceTracking = lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType === 'navigation') {
var navigationEntry = entry;
callback(navigationEntry.loadEventEnd);
}
}).unsubscribe;
return { stop: stopPerformanceTracking };
}
function trackActivityLoadingTime(lifeCycle, callback) {

@@ -201,0 +207,0 @@ var startTime = performance.now();

export var buildEnv = {
buildMode: 'release',
datacenter: 'us',
sdkVersion: '1.15.1',
sdkVersion: '1.15.2',
};
//# sourceMappingURL=buildEnv.js.map

@@ -24,3 +24,7 @@ import { monitor, ONE_MINUTE, SESSION_TIME_OUT_DELAY } from '@datadog/browser-core';

lifeCycle.subscribe(LifeCycleEventType.VIEW_UPDATED, function (currentContext) {
currentView = currentContext;
// A view can be updated after its end. We have to ensure that the view being updated is the
// most recently created.
if (currentView.id === currentContext.id) {
currentView = currentContext;
}
});

@@ -72,3 +76,3 @@ lifeCycle.subscribe(LifeCycleEventType.AUTO_ACTION_CREATED, function (currentContext) {

function findContext(buildContext, previousContexts, currentContext, startTime) {
if (!startTime) {
if (startTime === undefined) {
return currentContext ? buildContext() : undefined;

@@ -75,0 +79,0 @@ }

@@ -149,5 +149,5 @@ import { __assign } from "tslib";

view: {
loadingTime: view.loadingTime ? msToNs(view.loadingTime) : undefined,
loadingTime: msToNs(view.loadingTime),
loadingType: view.loadingType,
measures: view.measures,
measures: __assign({ domComplete: msToNs(view.measures.domComplete), domContentLoaded: msToNs(view.measures.domContentLoaded), domInteractive: msToNs(view.measures.domInteractive), firstContentfulPaint: msToNs(view.measures.firstContentfulPaint), loadEventEnd: msToNs(view.measures.loadEventEnd) }, view.measures),
},

@@ -154,0 +154,0 @@ });

import { LifeCycle } from './lifeCycle';
import { EventCounts } from './trackEventCounts';
export interface View {

@@ -12,3 +13,3 @@ id: string;

}
export interface ViewMeasures {
interface Timings {
firstContentfulPaint?: number;

@@ -19,7 +20,4 @@ domInteractive?: number;

loadEventEnd?: number;
errorCount: number;
resourceCount: number;
longTaskCount: number;
userActionCount: number;
}
export declare type ViewMeasures = Timings & EventCounts;
export declare enum ViewLoadingType {

@@ -34,1 +32,2 @@ INITIAL_LOAD = "initial_load",

};
export {};
import { __assign } from "tslib";
import { DOM_EVENT, generateUUID, monitor, msToNs, noop, ONE_MINUTE, throttle } from '@datadog/browser-core';
import { DOM_EVENT, generateUUID, monitor, ONE_MINUTE, throttle } from '@datadog/browser-core';
import { LifeCycleEventType } from './lifeCycle';

@@ -15,5 +15,13 @@ import { trackEventCounts } from './trackEventCounts';

var startOrigin = 0;
var currentView = newView(lifeCycle, location, ViewLoadingType.INITIAL_LOAD, startOrigin);
function renewViewOnChange() {
var initialView = newView(lifeCycle, location, ViewLoadingType.INITIAL_LOAD, startOrigin);
var currentView = initialView;
var stopTimingsTracking = trackTimings(lifeCycle, function (timings) {
initialView.updateTimings(timings);
initialView.scheduleUpdate();
}).stop;
trackHistory(onLocationChange);
trackHash(onLocationChange);
function onLocationChange() {
if (currentView.isDifferentView(location)) {
// Renew view on location changes
currentView.triggerUpdate();

@@ -28,6 +36,2 @@ currentView.end();

}
// Renew view on history changes
trackHistory(renewViewOnChange);
// Renew view on hash changes
trackHash(renewViewOnChange);
// Renew view on session renewal

@@ -50,2 +54,3 @@ lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, function () {

stop: function () {
stopTimingsTracking();
currentView.end();

@@ -60,3 +65,3 @@ clearInterval(keepAliveInterval);

var id = generateUUID();
var measures = {
var eventCounts = {
errorCount: 0,

@@ -67,24 +72,24 @@ longTaskCount: 0,

};
var timings;
var documentVersion = 0;
var loadingTime;
var endTime;
var location = __assign({}, initialLocation);
lifeCycle.notify(LifeCycleEventType.VIEW_CREATED, { id: id, startTime: startTime, location: location });
// Update the view every time the measures are changing
var _a = throttle(monitor(updateView), THROTTLE_VIEW_UPDATE_PERIOD, {
var _a = throttle(monitor(triggerViewUpdate), THROTTLE_VIEW_UPDATE_PERIOD, {
leading: false,
}), scheduleViewUpdate = _a.throttled, stopScheduleViewUpdate = _a.stop;
function updateMeasures(newMeasures) {
measures = __assign(__assign({}, measures), newMeasures);
}), scheduleViewUpdate = _a.throttled, cancelScheduleViewUpdate = _a.cancel;
var stopEventCountsTracking = trackEventCounts(lifeCycle, function (newEventCounts) {
eventCounts = newEventCounts;
scheduleViewUpdate();
}
var stopTimingsTracking = trackTimings(lifeCycle, updateMeasures).stop;
var stopEventCountsTracking = trackEventCounts(lifeCycle, updateMeasures).stop;
function updateLoadingTime(loadingTimeValue) {
loadingTime = loadingTimeValue;
}).stop;
var _b = trackLoadingTime(loadingType, function (newLoadingTime) {
loadingTime = newLoadingTime;
scheduleViewUpdate();
}
var stopLoadingTimeTracking = trackLoadingTime(lifeCycle, loadingType, updateLoadingTime).stop;
}), setActivityLoadingTime = _b.setActivityLoadingTime, setLoadEventEnd = _b.setLoadEventEnd;
var stopActivityLoadingTimeTracking = trackActivityLoadingTime(lifeCycle, setActivityLoadingTime).stop;
// Initial view update
updateView();
function updateView() {
triggerViewUpdate();
function triggerViewUpdate() {
documentVersion += 1;

@@ -97,14 +102,13 @@ lifeCycle.notify(LifeCycleEventType.VIEW_UPDATED, {

location: location,
measures: measures,
startTime: startTime,
duration: performance.now() - startTime,
duration: (endTime === undefined ? performance.now() : endTime) - startTime,
measures: __assign(__assign({}, timings), eventCounts),
});
}
return {
scheduleUpdate: scheduleViewUpdate,
end: function () {
stopTimingsTracking();
endTime = performance.now();
stopEventCountsTracking();
stopLoadingTimeTracking();
// prevent pending view updates execution
stopScheduleViewUpdate();
stopActivityLoadingTimeTracking();
},

@@ -116,4 +120,12 @@ isDifferentView: function (otherLocation) {

triggerUpdate: function () {
updateView();
// cancel any pending view updates execution
cancelScheduleViewUpdate();
triggerViewUpdate();
},
updateTimings: function (newTimings) {
timings = newTimings;
if (newTimings.loadEventEnd !== undefined) {
setLoadEventEnd(newTimings.loadEventEnd);
}
},
updateLocation: function (newLocation) {

@@ -145,7 +157,7 @@ location = __assign({}, newLocation);

function trackTimings(lifeCycle, callback) {
var timings = {};
var timings;
var stopPerformanceTracking = lifeCycle.subscribe(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType === 'navigation') {
var navigationEntry = entry;
timings = __assign(__assign({}, timings), { domComplete: msToNs(navigationEntry.domComplete), domContentLoaded: msToNs(navigationEntry.domContentLoadedEventEnd), domInteractive: msToNs(navigationEntry.domInteractive), loadEventEnd: msToNs(navigationEntry.loadEventEnd) });
timings = __assign(__assign({}, timings), { domComplete: navigationEntry.domComplete, domContentLoaded: navigationEntry.domContentLoadedEventEnd, domInteractive: navigationEntry.domInteractive, loadEventEnd: navigationEntry.loadEventEnd });
callback(timings);

@@ -155,3 +167,3 @@ }

var paintEntry = entry;
timings = __assign(__assign({}, timings), { firstContentfulPaint: msToNs(paintEntry.startTime) });
timings = __assign(__assign({}, timings), { firstContentfulPaint: paintEntry.startTime });
callback(timings);

@@ -162,36 +174,30 @@ }

}
function trackLoadingTime(lifeCycle, loadingType, callback) {
var expectedTiming = 1;
var receivedTimings = [];
var stopLoadEventLoadingTime = noop;
if (loadingType === ViewLoadingType.INITIAL_LOAD) {
expectedTiming += 1;
(stopLoadEventLoadingTime = trackLoadEventLoadingTime(lifeCycle, onTimingValue).stop);
}
var stopActivityLoadingTimeTracking = trackActivityLoadingTime(lifeCycle, onTimingValue).stop;
function onTimingValue(timingValue) {
expectedTiming -= 1;
if (timingValue) {
receivedTimings.push(timingValue);
function trackLoadingTime(loadType, callback) {
var isWaitingForLoadEventEnd = loadType === ViewLoadingType.INITIAL_LOAD;
var isWaitingForActivityLoadingTime = true;
var loadingTimeCandidates = [];
function invokeCallbackIfAllCandidatesAreReceived() {
if (!isWaitingForActivityLoadingTime && !isWaitingForLoadEventEnd && loadingTimeCandidates.length > 0) {
callback(Math.max.apply(Math, loadingTimeCandidates));
}
if (expectedTiming === 0 && receivedTimings.length) {
callback(Math.max.apply(Math, receivedTimings));
}
}
return {
stop: function () {
stopActivityLoadingTimeTracking();
stopLoadEventLoadingTime();
setLoadEventEnd: function (loadEventEnd) {
if (isWaitingForLoadEventEnd) {
isWaitingForLoadEventEnd = false;
loadingTimeCandidates.push(loadEventEnd);
invokeCallbackIfAllCandidatesAreReceived();
}
},
setActivityLoadingTime: function (activityLoadingTime) {
if (isWaitingForActivityLoadingTime) {
isWaitingForActivityLoadingTime = false;
if (activityLoadingTime !== undefined) {
loadingTimeCandidates.push(activityLoadingTime);
}
invokeCallbackIfAllCandidatesAreReceived();
}
},
};
}
function trackLoadEventLoadingTime(lifeCycle, callback) {
var stopPerformanceTracking = lifeCycle.subscribe(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType === 'navigation') {
var navigationEntry = entry;
callback(navigationEntry.loadEventEnd);
}
}).unsubscribe;
return { stop: stopPerformanceTracking };
}
function trackActivityLoadingTime(lifeCycle, callback) {

@@ -198,0 +204,0 @@ var startTime = performance.now();

{
"name": "@datadog/browser-rum",
"version": "1.15.1",
"version": "1.15.2",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.15.1",
"@datadog/browser-core": "1.15.2",
"tslib": "1.10.0"

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

},
"gitHead": "7d7cef5e04a1cffeb5773501b77b3b63e7709691"
"gitHead": "a8ab56be3315d82fc4814b418aa452aa40b6cb46"
}

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc