Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
Maintainers
1
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-rum - npm Package Compare versions

Comparing version 1.14.0 to 1.14.1

cjs/requestCollection.d.ts

2

bundle/datadog-rum-us.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 Vt}));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=6e4,c=60*s;function f(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={}));var d,l=function(e){return Array.isArray(e)},p=function(e){return!Array.isArray(e)&&"object"==typeof e};function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return l(e)&&l(t)?o(Array(Math.max(e.length,t.length))).map((function(n,r){return m(e[r],t[r])})):p(e)&&p(t)?Object.keys(t).reduce((function(n,i){var o;return r(r({},n),((o={})[i]=m(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 m.apply(void 0,o([e],t))}function v(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 h(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,h)}function T(e){return 0!==e&&100*Math.random()<=e}function g(e){return+(1e6*e).toFixed(0)}function b(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 b(t);return t}(e[n])})),t}function y(){}function C(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];O(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,u=[!1,void 0];"object"==typeof e&&O(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 O(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function R(e,t){return-1!==e.indexOf(t)}function w(e){return _(e)&&e>=0&&e<=100}function _(e){return"number"==typeof e}function S(e){return Math.floor(A()+e)}function A(){return void 0===d&&(d=performance.timing.navigationStart),d}function I(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var D={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 L(e,t,n){var r=t.datacenter===de.US?"com":"eu",i=t.sdkEnv===le.PRODUCTION?"datadoghq."+r:"datad0g."+r,o="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),u=e+"-http-intake.logs."+i,a=t.proxyHost?t.proxyHost:u,s=t.proxyHost?"ddhost="+u+"&":"",c=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+s+"ddsource="+(n||"browser")+"&ddtags="+o;return"https://"+a+"/v1/input/"+t.clientToken+"?"+c}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 x(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}var U="?",k=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=function(){var e,t,n,r,i,o,u=[];function a(e,t,n){var r;for(var i in u)if(B(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)H.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(u)a(H(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(k);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(H(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=H(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=q(s),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=q(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}(),H=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]||U,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]||U,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]||U,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=U),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!==H&&f!==P&&(o={args:[],column:void 0,func:U,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=U),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)B(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=U),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 H(e,t+1)}},i}();var j=/[^\u0000-\u007F]/,F=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 W,z=function(){function e(e,t,n,r,i,o){void 0===o&&(o=y),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 j.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=C(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,q(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,q((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,q((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(W||(W={}));var G,V={maxMessagesPerPage:0,sentMessageCount:0};function K(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 z(new F(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return m({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);v(V,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function q(e){return function(){try{return e.apply(this,arguments)}catch(e){Q(e);try{Y(e)}catch(e){Q(e)}}}}function $(e,t){!function(e){V.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),X(r(r({message:e},t),{status:W.info}))}function Y(e){X(r(r({},function(e){if(e instanceof Error){var t=H(e);return{error:{kind:t.name,stack:be(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+C(e)}}(e)),{status:W.error}))}function X(e){V.batch&&V.sentMessageCount<V.maxMessagesPerPage&&(V.sentMessageCount+=1,V.batch.add(e))}function J(e){V.debugMode=e}function Q(e){V.debugMode&&console.warn("[INTERNAL ERROR]",e)}var Z,ee,te=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}();function ne(e){return oe(e,I(window.location)).href}function re(e,t){return ie(e)===ie(t)}function ie(e){return I(oe(e))}function oe(e,t){if(function(){if(void 0!==Z)return Z;try{var e=new URL("http://test/path");return Z="http://test/path"===e.href}catch(e){Z=!1}return Z}())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}!function(e){e.FETCH="fetch",e.XHR="xhr"}(ee||(ee={}));var ue,ae,se,ce,fe,de,le,pe,me=1;function Ee(){var e=me;return me+=1,e}function ve(){return ue||(function(e){var t=e[0],n=e[1],r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=q((function(e,t){return this._datadog_xhr={method:e,url:t},r.apply(this,arguments)}));var i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){var r=this,o=performance.now(),u=Ee();t.notify({requestId:u});var a=!1,s=function(){a||(a=!0,n.notify({requestId:u,startTime:o,duration:performance.now()-o,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:he(),type:ee.XHR,url:ne(r._datadog_xhr.url)}))},c=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&q(s)(),c&&c.apply(this,arguments)},this.addEventListener("loadend",q(s)),i.apply(this,arguments)}}(ue=[new te,new te]),function(e){var t=e[0],n=e[1];if(!window.fetch)return;var r=window.fetch;window.fetch=q((function(e,o){var u=this,a=o&&o.method||"object"==typeof e&&e.method||"GET",s=performance.now(),c=Ee();t.notify({requestId:c});var f=function(t){return r=u,o=void 0,d=function(){var r,o,u,f,d;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-s,o=ne("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(u=H(t),n.notify({duration:r,method:a,requestId:c,startTime:s,url:o,response:be(u),status:0,traceId:he(),type:ee.FETCH}),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];f=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return f=i.sent(),[3,5];case 4:return d=i.sent(),f="Unable to retrieve response: "+d,[3,5];case 5:n.notify({duration:r,method:a,requestId:c,startTime:s,url:o,response:f,responseType:t.type,status:t.status,traceId:he(),type:ee.FETCH}),i.label=6;case 6:return[2]}}))},new((f=void 0)||(f=Promise))((function(e,t){function n(e){try{u(d.next(e))}catch(e){t(e)}}function i(e){try{u(d.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new f((function(e){e(t.value)})).then(n,i)}u((d=d.apply(r,o||[])).next())}));var r,o,f,d},d=r.call(this,e,o);return d.then(q(f),q(f)),d}))}(ue)),ue}function he(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function Te(e){if(!se){var t=new te;if(e.isCollectingError)!function(e,t,n){n.subscribe((function(n){(function(e){return 0===e.status&&"opaque"!==e.responseType}(n)||function(e){return e.status>=500}(n))&&t.notify({context:{error:{origin:ae.NETWORK,stack:ye(n.response,e)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:Ce(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(e,t,ve()[1]),function(e){ce=console.error,console.error=q((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ce.apply(console,o([t],n)),e.notify({context:{error:{origin:ae.CONSOLE}},message:o(["console error:",t],n).map(ge).join(" "),startTime:performance.now()})}))}(t),function(e){fe=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=be(e)):(n="Uncaught "+C(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:ae.SOURCE}},startTime:performance.now()}}(t,r))},P.subscribe(fe)}(t);se=function(e,t){var n=0,r=new te;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:ae.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),s),r}(e,t)}return se}function ge(e){return"string"==typeof e?e:e instanceof Error?be(H(e)):C(e,0,2)}function be(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 ye(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Ce(e){return ee.XHR===e?"XHR":"Fetch"}function Oe(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}function Re(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,datacenter:e.datacenter||t.datacenter,env:e.env,proxyHost:e.proxyHost,sdkEnv:t.sdkEnv,sdkVersion:t.sdkVersion,service:e.service,version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({isEnabled:function(e){return R(i,e)},logsEndpoint:L("browser",n),rumEndpoint:L("rum",n),traceEndpoint:L("public-trace",n)},D);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=L("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===pe.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===pe.STAGING&&void 0!==e.replica){var u=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,sdkEnv:le.PRODUCTION});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:L("browser",u,"browser-agent-internal-monitoring"),logsEndpoint:L("browser",u),rumEndpoint:L("rum",u)}}return o}(e,t),i=K(n);return{configuration:n,errorObservable:Te(n),internalMonitoring:i}}function we(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return M("dd_rum_test","test",1e3),"test"===x("dd_rum_test")}catch(e){return console.error(e),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function _e(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(ae||(ae={})),function(e){e.US="us",e.EU="eu"}(de||(de={})),function(e){e.PRODUCTION="production",e.STAGING="staging"}(le||(le={})),function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(pe||(pe={}));var Se,Ae={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.14.0"};!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"}(Se||(Se={}));var Ie=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 De(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(q((function(){e.notify(Se.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Le="initial_document",Ne=[[a.DOCUMENT,function(e){return Le===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 R(["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 R(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function Me(e){var t=e.name;if(!function(e){try{return!!oe(e)}catch(e){return!1}}(t))return $('Failed to construct URL for "'+e.name+'"'),a.OTHER;for(var n=function(e){var t=oe(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=0,i=Ne;r<i.length;r++){var o=i[r],u=o[0];if((0,o[1])(e.initiatorType,n))return u}return a.OTHER}function xe(){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 Ue(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return g(0===t&&n<r?r-n:t)}function ke(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(xe(t,n,r,i,o,a,s,c,f)){var p=n!==t;if(!p||(d<t&&(d=t),l<t&&(l=n),xe(t,d,l,n))){var m={download:Be(t,c,f),firstByte:Be(t,s,c)};return a!==n&&(m.connect=Be(t,o,a),xe(o,u,a)&&(m.ssl=Be(t,u,a))),i!==n&&(m.dns=Be(t,r,i)),p&&(m.redirect=Be(t,d,l)),m}}}function Be(e,t,n){return{duration:g(n-t),start:g(t-e)}}function Pe(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function He(e,t){return e&&!function(e,t){return re(e,t.logsEndpoint)||re(e,t.rumEndpoint)||re(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&re(e,t.internalMonitoringEndpoint)}(e,t)}function je(){return void 0!==window.performance&&"getEntries"in performance}function Fe(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function We(e,t){if(function(e){var t;if(Fe()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];t=r({},n.toJSON())}else t=r(r({},ze()),{name:window.location.href,decodedBodySize:0,startTime:0});t.entryType="resource",t.initiatorType=Le,t.duration=t.responseEnd,e(t)}((function(n){Ge(t,e,[n])})),je()&&Ge(t,e,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(q((function(n){return Ge(t,e,n.getEntries())}))),i=["resource","navigation","longtask"];"visible"===document.visibilityState&&i.push("paint"),n.observe({entryTypes:i}),je()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Fe()||function(e){function t(){var t=r(r({},ze()),{entryType:"navigation"});e(t)}if("complete"===document.readyState)t();else{var n=q((function(){window.removeEventListener(u.LOAD,n),setTimeout(q(t))}));window.addEventListener(u.LOAD,n)}}((function(n){Ge(t,e,[n])}))}function ze(){var e={},t=performance.timing;for(var n in t)_(t[n])&&(e[n]=0===t[n]?0:t[n]-A());return e}function Ge(e,t,n){function r(e){t.notify(Se.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)}function Ve(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").filter((function(t){return n=t,r=e.startTime,i=Ke(e),n.startTime>=r&&Ke(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&Ke((t=n)[0])<=t[1].startTime?n[1]:void 0}}function Ke(e){return e.startTime+e.duration}var qe="_dd",$e="_dd_r",Ye="_dd_l",Xe="rum",Je="logs";var Qe="_dd_s",Ze=15*s,et=4*c,tt=s;function nt(e,t){var n,r,i,o,a,s=(n=Qe,o=!1,a=function(){o=!0,window.clearTimeout(r),r=window.setTimeout((function(){o=!1}),N)},{get:function(){return o?i:(i=x(n),a(),i)},set:function(e,t){M(n,e,t),i=e,a()}});!function(e){var t=e.get(),n=x(qe),r=x($e),i=x(Ye);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[Je]=i),r&&/^[012]$/.test(r)&&(o[Xe]=r),ut(o,e)}}(s);var c=new te,d=ot(s).id,l=f((function(){var n=ot(s),r=t(n[e]),i=r.trackingType,o=r.isTracked;n[e]=i,o&&!n.id&&(n.id=h(),n.created=String(Date.now())),ut(n,s),o&&d!==n.id&&(d=n.id,c.notify())}),N).throttled;return l(),function(e){var t=q(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),st.push((function(){return document.removeEventListener(e,t,n)}))}))}(l),function(e){var t=q((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,tt);document.addEventListener(u.VISIBILITY_CHANGE,t),st.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){ut(ot(s),s)})),{getId:function(){return ot(s).id},getTrackingType:function(){return ot(s)[e]},renewObservable:c}}var rt=/^([a-z]+)=([a-z0-9-]+)$/,it="&";function ot(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(it)||rt.test(e))})(t)&&t.split(it).forEach((function(e){var t=rt.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)<et)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(at(e),{})}function ut(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Ze);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(it);t.set(r,Ze)}else at(t)}function at(e){e.set("",0)}var st=[];var ct=et,ft=5*s,dt=s;function lt(e){return function(e){var t;if(function(){void 0===vt&&(vt="closest"in HTMLElement.prototype);return vt}())t=e.closest("["+pt+"]");else for(var n=e;n;){if(n.hasAttribute(pt)){t=n;break}n=n.parentElement}if(!t)return;return Ct(yt(t.getAttribute(pt).trim()))}(e)||bt(e,ht)||bt(e,Tt)||""}var pt="data-dd-action-name";var mt,Et,vt,ht=[function(e){if(function(){void 0===Et&&(Et="labels"in HTMLInputElement.prototype);return Et}()){if("labels"in e&&e.labels&&e.labels.length>0)return Ot(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Ot(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 Ot(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(Ot).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 Ot(e.options[0])}],Tt=[function(e){return Ot(e)}],gt=10;function bt(e,t){for(var n=e,r=0;r<=gt&&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 Ct(yt(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function yt(e){return e.replace(/\s+/g," ")}function Ct(e){return e.length>100?e.slice(0,100)+" [...]":e}function Ot(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===mt){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),mt=""===t.innerText,document.body.removeChild(t)}return mt}())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 Rt(e,t){void 0===t&&(t=y);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(e.subscribe(Se.ERROR_COLLECTED,(function(){n.errorCount+=1,t(n)}))),r.push(e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Se.CUSTOM_ACTION_COLLECTED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"longtask"===e.entryType&&(n.longTaskCount+=1,t(n))}))),r.push(e.subscribe(Se.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,t(n)}))),{stop:function(){r.forEach((function(e){return e.unsubscribe()}))},eventCounts:n}}var wt,_t=100,St=100,At=1e4;function It(e,t){var n=function(e){var t,n=new te,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(Se.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(Se.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestId),i+=1,o()}))),r.push(e.subscribe(Se.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(q((function(){return s(!1,0)})),_t),u=setTimeout(q((function(){return s(!0,performance.now())})),At);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(q((function(){return s(!0,n)})),St))})),{stop:a}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Dt(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Nt(e,r,i);t=o,n=It(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=lt(e.target);n&&t.create(wt.CLICK,n)}}return e.subscribe(Se.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"}(wt||(wt={}));var Lt,Nt=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=h(),this.startTime=performance.now(),this.eventCountsSubscription=Rt(e),this.lifeCycle.notify(Se.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Se.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(Se.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(Lt||(Lt={}));var Mt,xt,Ut=3e3,kt=5*s;function Bt(e,t){var n,r=Pt(t,e,Lt.INITIAL_LOAD,0);function i(){r.isDifferentView(e)?(r.triggerUpdate(),r.end(),r=Pt(t,e,Lt.ROUTE_CHANGE)):(r.updateLocation(e),r.triggerUpdate())}!function(e){var t=history.pushState;history.pushState=q((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=q((function(){n.apply(this,arguments),e()})),window.addEventListener(u.POP_STATE,q(e))}(i),n=i,window.addEventListener("hashchange",q(n)),t.subscribe(Se.SESSION_RENEWED,(function(){r.end(),r=Pt(t,e,Lt.ROUTE_CHANGE)})),t.subscribe(Se.BEFORE_UNLOAD,(function(){r.triggerUpdate(),r.end()}));var o=window.setInterval(q((function(){r.triggerUpdate()})),kt);return{stop:function(){r.end(),clearInterval(o)}}}function Pt(e,t,n,i){void 0===i&&(i=performance.now());var o,u=h(),a={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},s=0,c=r({},t);e.notify(Se.VIEW_CREATED,{id:u,startTime:i,location:c});var d=f(q(b),Ut,{leading:!1}),l=d.throttled,p=d.stop;function m(e){a=r(r({},a),e),l()}var E=function(e,t){var n={};return{stop:e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("navigation"===e.entryType){var i=e;n=r(r({},n),{domComplete:g(i.domComplete),domContentLoaded:g(i.domContentLoadedEventEnd),domInteractive:g(i.domInteractive),loadEventEnd:g(i.loadEventEnd)}),t(n)}else if("paint"===e.entryType&&"first-contentful-paint"===e.name){var o=e;n=r(r({},n),{firstContentfulPaint:g(o.startTime)}),t(n)}})).unsubscribe}}(e,m).stop,v=Rt(e,m).stop;var T=function(e,t,n){var r=1,i=[],o=y;t===Lt.INITIAL_LOAD&&(r+=1,o=function(e,t){return{stop:e.subscribe(Se.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:It(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 b(){s+=1,e.notify(Se.VIEW_UPDATED,{documentVersion:s,id:u,loadingTime:o,loadingType:n,location:c,measures:a,startTime:i,duration:performance.now()-i})}return b(),{end:function(){E(),v(),T(),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(){b()},updateLocation:function(e){c=r({},e)}}}function Ht(e,t,n,i,o,u){var s={},c=function(e,t){var n,r,i,o=[],u=[];e.subscribe(Se.VIEW_CREATED,(function(e){n&&o.unshift({context:c(),endTime:e.startTime,startTime:n.startTime}),n=e,i=t.getId()})),e.subscribe(Se.VIEW_UPDATED,(function(e){n=e})),e.subscribe(Se.AUTO_ACTION_CREATED,(function(e){r=e})),e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(e){r&&u.unshift({context:f(),endTime:r.startTime+e.duration,startTime:r.startTime}),r=void 0})),e.subscribe(Se.AUTO_ACTION_DISCARDED,(function(){r=void 0})),e.subscribe(Se.SESSION_RENEWED,(function(){o=[],u=[],n=void 0,r=void 0}));var a=window.setInterval(q((function(){s(o,ct),s(u,ft)})),dt);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 m({application_id:e},c.findView(),s)}));var f=function(e,t){var n,r=o(e.rumEndpoint),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(n){return new z(new F(n,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return t.notify(Se.BEFORE_UNLOAD)}))}function u(e){return m(e,{application_id:i.applicationId})}return{add:function(e){r.add(e),n&&n.add(u(e))},upsert:function(e,t){r.upsert(e,t),n&&n.upsert(u(e),t)}}}(i,n),d=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=m(r(),s,b(d));o(l,d)}}}}(c,o,(function(){return{applicationId:e,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?xt.USER:xt.SYNTHETICS},view:{referrer:document.referrer}}}),(function(){return s}));return function(e,t,n,i,o){var u=function(e,t){var n=t.view;return E(t.rum,n,e)},s=function(e,t){var n=t.view,r=t.action;return E(t.rum,n,r,e)};(function(e,t){e.subscribe(Se.VIEW_UPDATED,(function(e){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:Mt.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:e.loadingTime?g(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(Se.ERROR_COLLECTED,(function(e){var n=e.message,i=e.startTime,o=e.context;t(i,r({message:n,date:S(i),evt:{category:Mt.ERROR}},o))}))}(t,i(s,o.add)),function(e,t,n,r){t.subscribe(Se.REQUEST_COMPLETED,(function(i){if(n.isTrackedWithResource()&&He(i.url,e)){var o=Ve(i),u=i.type===ee.XHR?a.XHR:a.FETCH,s=o?o.startTime:i.startTime;r(s,{date:S(s),duration:o?Ue(o):g(i.duration),evt:{category:Mt.RESOURCE},http:{method:i.method,performance:o?ke(o):void 0,statusCode:i.status,url:i.url},network:{bytesWritten:o?Pe(o):void 0},resource:{kind:u},traceId:i.traceId}),t.notify(Se.RESOURCE_ADDED_TO_BATCH)}}))}(e,t,n,i(s,o.add)),function(e,t,n){t.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(e,t,n,r){if(!He(t.name,e))return;var i=Me(t);if(R([a.XHR,a.FETCH],i))return;n(t.startTime,{date:S(t.startTime),duration:Ue(t),evt:{category:Mt.RESOURCE},http:{performance:ke(t),url:t.name},network:{bytesWritten:Pe(t)},resource:{kind:i}}),r.notify(Se.RESOURCE_ADDED_TO_BATCH)}(e,r,n,t);break;case"longtask":!function(e,t){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:Mt.LONG_TASK}})}(r,n)}}))}(e,t,i(s,o.add)),function(e,t){e.subscribe(Se.CUSTOM_ACTION_COLLECTED,(function(e){t(performance.now(),{evt:{category:Mt.USER_ACTION,name:e.name},userAction:{type:e.type}},e.context)}))}(t,i(u,o.add)),function(e,t){e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(e){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:Mt.USER_ACTION,name:e.name},userAction:{id:e.id,measures:e.measures,type:e.type}})}))}(t,i(u,o.add))}(i,n,o,d,f),Bt(t,n),{addRumGlobalContext:q((function(e,t){s[e]=t})),addUserAction:q((function(e,t){n.notify(Se.CUSTOM_ACTION_COLLECTED,{context:t,name:e,type:wt.CUSTOM})})),getInternalContext:q((function(t){return b(m({applicationId:e},c.findView(t),c.findAction(t)))})),setRumGlobalContext:q((function(e){s=e}))}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(Mt||(Mt={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(xt||(xt={}));var jt,Ft="rum";function Wt(e,t){var n=nt(Ft,(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:T(e.sampleRate)?T(e.resourceSampleRate)?jt.TRACKED_WITH_RESOURCES:jt.TRACKED_WITHOUT_RESOURCES:jt.NOT_TRACKED;return{trackingType:n,isTracked:zt(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(Se.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&zt(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===jt.TRACKED_WITH_RESOURCES}}}function zt(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 Gt,Vt=(Gt=r({},{init:function(e){Oe("core.init")},addRumGlobalContext:function(e,t){Oe("addRumGlobalContext")},setRumGlobalContext:function(e){Oe("setRumGlobalContext")},addUserAction:function(e,t){Oe("addUserAction")},getInternalContext:function(e){Oe("getInternalContext")}}),Object.defineProperty(Gt,"_setDebug",{get:function(){return J},enumerable:!1}),Gt),Kt=!1;Vt.init=q((function(e){if(we()&&_e()&&function(e){if(Kt)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 t=r(r({},e),{isCollectingError:!0}),n=new Ie,i=Re(t,Ae),o=i.errorObservable,u=i.configuration,a=i.internalMonitoring,s=Wt(u,n),c=Ht(t.applicationId,location,n,u,s,a),f=ve(),d=f[0],l=f[1];We(n,s),De(n),u.trackInteractions&&Dt(n),o.subscribe((function(e){return n.notify(Se.ERROR_COLLECTED,e)})),d.subscribe((function(e){return n.notify(Se.REQUEST_STARTED,e)})),l.subscribe((function(e){return n.notify(Se.REQUEST_COMPLETED,e)})),v(Vt,c),Kt=!0}})),(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=Vt}]);
!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 en})),n.d(t,"makeRumGlobal",(function(){return tn}));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 N(e,t,n){var r=t.datacenter===he.US?"com":"eu",i=t.sdkEnv===Te.PRODUCTION?"datadoghq."+r:"datad0g."+r,o="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),u=e+"-http-intake.logs."+i,a=t.proxyHost?t.proxyHost:u,s=t.proxyHost?"ddhost="+u+"&":"",c=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+s+"ddsource="+(n||"browser")+"&ddtags="+o;return"https://"+a+"/v1/input/"+t.clientToken+"?"+c}var x=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,G=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 q,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 G(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!==q?q():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);h(Y,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){q=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:we(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=we(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,be=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}(),ye=[],Ce=[];function Oe(){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=function(e){var t=this;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,Ce.forEach((function(e){return e(t._datadog_xhr)})))};return this.addEventListener("loadend",J(i)),ye.forEach((function(e){return e(t._datadog_xhr)})),le.apply(this,arguments)},fe={beforeSend:function(e){ye.push(e)},onRequestComplete:function(e){Ce.push(e)}}),fe}function Re(e){if(!me){var t=new be;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:Se(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:Ae(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}Oe().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(_e).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=we(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 be;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 _e(e){return"string"==typeof e?e:e instanceof Error?we(j(e)):O(e,0,2)}function we(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 Se(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Ae(e){return s.XHR===e?"XHR":"Fetch"}function Ie(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}function De(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,datacenter:e.datacenter||t.datacenter,env:e.env,proxyHost:e.proxyHost,sdkEnv:t.sdkEnv,sdkVersion:t.sdkVersion,service:e.service,version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({isEnabled:function(e){return _(i,e)},logsEndpoint:N("browser",n),rumEndpoint:N("rum",n),traceEndpoint:N("public-trace",n)},L);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=N("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===ge.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===ge.STAGING&&void 0!==e.replica){var u=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,sdkEnv:Te.PRODUCTION});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:N("browser",u,"browser-agent-internal-monitoring"),logsEndpoint:N("browser",u),rumEndpoint:N("rum",u)}}return o}(e,t),i=X(n);return{configuration:n,errorObservable:Re(n),internalMonitoring:i}}function Le(){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.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(pe||(pe={})),function(e){e.US="us",e.EU="eu"}(he||(he={})),function(e){e.PRODUCTION="production",e.STAGING="staging"}(Te||(Te={})),function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(ge||(ge={}));var xe,Me={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.14.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"}(xe||(xe={}));var Ue=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 ke(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(xe.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Be="initial_document",Pe=[[a.DOCUMENT,function(e){return Be===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 He(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=Pe;r<i.length;r++){var o=i[r],u=o[0];if((0,o[1])(e.initiatorType,n))return u}return a.OTHER}function je(){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 Fe(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return b(0===t&&n<r?r-n:t)}function We(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(je(t,n,r,i,o,a,s,c,f)){var p=n!==t;if(!p||(d<t&&(d=t),l<t&&(l=n),je(t,d,l,n))){var m={download:ze(t,c,f),firstByte:ze(t,s,c)};return a!==n&&(m.connect=ze(t,o,a),je(o,u,a)&&(m.ssl=ze(t,u,a))),i!==n&&(m.dns=ze(t,r,i)),p&&(m.redirect=ze(t,d,l)),m}}}function ze(e,t,n){return{duration:b(n-t),start:b(t-e)}}function Ge(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function qe(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 Ve(){return void 0!==window.performance&&"getEntries"in performance}function Ke(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function $e(e,t){if(function(e){var t;if(Ke()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];t=r({},n.toJSON())}else t=r(r({},Ye()),{name:window.location.href,decodedBodySize:0,startTime:0});t.entryType="resource",t.initiatorType=Be,t.duration=t.responseEnd,e(t)}((function(n){Xe(t,e,[n])})),Ve()&&Xe(t,e,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(J((function(n){return Xe(t,e,n.getEntries())}))),i=["resource","navigation","longtask"];"visible"===document.visibilityState&&i.push("paint"),n.observe({entryTypes:i}),Ve()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Ke()||function(e){function t(){var t=r(r({},Ye()),{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){Xe(t,e,[n])}))}function Ye(){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 Xe(e,t,n){function r(e){t.notify(xe.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 Je=1;function Qe(){var e,t,n,r,i=[new be,new be];return t=(e=i)[0],n=e[1],(r=Oe()).beforeSend((function(e){var n=Ze();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:et(),type:s.XHR,url:e.url})})),function(e){var t=e[0],n=e[1],r=ce();r.beforeSend((function(e){var n=Ze();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:et(),type:s.FETCH,url:e.url})}))}(i),i}function Ze(){var e=Je;return Je+=1,e}function et(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function tt(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").filter((function(t){return n=t,r=e.startTime,i=nt(e),n.startTime>=r&&nt(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&nt((t=n)[0])<=t[1].startTime?n[1]:void 0}}function nt(e){return e.startTime+e.duration}var rt="_dd",it="_dd_r",ot="_dd_l",ut="rum",at="logs";var st="_dd_s",ct=15*c,ft=4*f,dt=c;function lt(e,t){var n,r,i,o,a,s=(n=st,o=!1,a=function(){o=!0,window.clearTimeout(r),r=window.setTimeout((function(){o=!1}),x)},{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(rt),r=U(it),i=U(ot);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[at]=i),r&&/^[012]$/.test(r)&&(o[ut]=r),vt(o,e)}}(s);var c=new be,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())),vt(n,s),o&&f!==n.id&&(f=n.id,c.notify())}),x).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),Tt.push((function(){return document.removeEventListener(e,t,n)}))}))}(l),function(e){var t=J((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,dt);document.addEventListener(u.VISIBILITY_CHANGE,t),Tt.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){vt(Et(s),s)})),{getId:function(){return Et(s).id},getTrackingType:function(){return Et(s)[e]},renewObservable:c}}var pt=/^([a-z]+)=([a-z0-9-]+)$/,mt="&";function Et(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(mt)||pt.test(e))})(t)&&t.split(mt).forEach((function(e){var t=pt.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)<ft)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(ht(e),{})}function vt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ct);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(mt);t.set(r,ct)}else ht(t)}function ht(e){e.set("",0)}var Tt=[];var gt=ft,bt=5*c,yt=c;function Ct(e){return function(e){var t;if(function(){void 0===wt&&(wt="closest"in HTMLElement.prototype);return wt}())t=e.closest("["+Ot+"]");else for(var n=e;n;){if(n.hasAttribute(Ot)){t=n;break}n=n.parentElement}if(!t)return;return Nt(Lt(t.getAttribute(Ot).trim()))}(e)||Dt(e,St)||Dt(e,At)||""}var Ot="data-dd-action-name";var Rt,_t,wt,St=[function(e){if(function(){void 0===_t&&(_t="labels"in HTMLInputElement.prototype);return _t}()){if("labels"in e&&e.labels&&e.labels.length>0)return xt(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&xt(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 xt(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(xt).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 xt(e.options[0])}],At=[function(e){return xt(e)}],It=10;function Dt(e,t){for(var n=e,r=0;r<=It&&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(Lt(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function Lt(e){return e.replace(/\s+/g," ")}function Nt(e){return e.length>100?e.slice(0,100)+" [...]":e}function xt(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===Rt){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),Rt=""===t.innerText,document.body.removeChild(t)}return Rt}())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 Mt(e,t){void 0===t&&(t=C);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(e.subscribe(xe.ERROR_COLLECTED,(function(){n.errorCount+=1,t(n)}))),r.push(e.subscribe(xe.AUTO_ACTION_COMPLETED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(xe.CUSTOM_ACTION_COLLECTED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(xe.PERFORMANCE_ENTRY_COLLECTED,(function(e){"longtask"===e.entryType&&(n.longTaskCount+=1,t(n))}))),r.push(e.subscribe(xe.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,t(n)}))),{stop:function(){r.forEach((function(e){return e.unsubscribe()}))},eventCounts:n}}var Ut,kt=100,Bt=100,Pt=1e4;function Ht(e,t){var n=function(e){var t,n=new be,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(xe.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(xe.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(xe.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestId),i+=1,o()}))),r.push(e.subscribe(xe.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)})),kt),u=setTimeout(J((function(){return s(!0,performance.now())})),Pt);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)})),Bt))})),{stop:a}}(r,i,t).stop;return{stop:function(){o(),i()}}}function jt(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Wt(e,r,i);t=o,n=Ht(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=Ct(e.target);n&&t.create(Ut.CLICK,n)}}return e.subscribe(xe.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"}(Ut||(Ut={}));var Ft,Wt=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=T(),this.startTime=performance.now(),this.eventCountsSubscription=Mt(e),this.lifeCycle.notify(xe.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(xe.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(xe.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(Ft||(Ft={}));var zt,Gt,qt=3e3,Vt=5*c;function Kt(e,t){var n,r=$t(t,e,Ft.INITIAL_LOAD,0);function i(){r.isDifferentView(e)?(r.triggerUpdate(),r.end(),r=$t(t,e,Ft.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(xe.SESSION_RENEWED,(function(){r.end(),r=$t(t,e,Ft.ROUTE_CHANGE)})),t.subscribe(xe.BEFORE_UNLOAD,(function(){r.triggerUpdate(),r.end()}));var o=window.setInterval(J((function(){r.triggerUpdate()})),Vt);return{stop:function(){r.end(),clearInterval(o)}}}function $t(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(xe.VIEW_CREATED,{id:u,startTime:i,location:c});var f=d(J(g),qt,{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(xe.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=Mt(e,m).stop;var h=function(e,t,n){var r=1,i=[],o=C;t===Ft.INITIAL_LOAD&&(r+=1,o=function(e,t){return{stop:e.subscribe(xe.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:Ht(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(xe.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 Yt(e,t,n,i,o,u){var c={},f=function(e,t){var n,r,i,o=[],u=[];e.subscribe(xe.VIEW_CREATED,(function(e){n&&o.unshift({context:c(),endTime:e.startTime,startTime:n.startTime}),n=e,i=t.getId()})),e.subscribe(xe.VIEW_UPDATED,(function(e){n=e})),e.subscribe(xe.AUTO_ACTION_CREATED,(function(e){r=e})),e.subscribe(xe.AUTO_ACTION_COMPLETED,(function(e){r&&u.unshift({context:f(),endTime:r.startTime+e.duration,startTime:r.startTime}),r=void 0})),e.subscribe(xe.AUTO_ACTION_DISCARDED,(function(){r=void 0})),e.subscribe(xe.SESSION_RENEWED,(function(){o=[],u=[],n=void 0,r=void 0}));var a=window.setInterval(J((function(){s(o,gt),s(u,bt)})),yt);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 G(new W(n,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return t.notify(xe.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(xe.VIEW_UPDATED,(function(e){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:zt.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(xe.ERROR_COLLECTED,(function(e){var n=e.message,i=e.startTime,o=e.context;t(i,r({message:n,date:A(i),evt:{category:zt.ERROR}},o))}))}(t,i(c,o.add)),function(e,t,n,r){t.subscribe(xe.REQUEST_COMPLETED,(function(i){if(n.isTrackedWithResource()&&qe(i.url,e)){var o=tt(i),u=i.type===s.XHR?a.XHR:a.FETCH,c=o?o.startTime:i.startTime;r(c,{date:A(c),duration:o?Fe(o):b(i.duration),evt:{category:zt.RESOURCE},http:{method:i.method,performance:o?We(o):void 0,statusCode:i.status,url:i.url},network:{bytesWritten:o?Ge(o):void 0},resource:{kind:u},traceId:i.traceId}),t.notify(xe.RESOURCE_ADDED_TO_BATCH)}}))}(e,t,n,i(c,o.add)),function(e,t,n){t.subscribe(xe.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(e,t,n,r){if(!qe(t.name,e))return;var i=He(t);if(_([a.XHR,a.FETCH],i))return;n(t.startTime,{date:A(t.startTime),duration:Fe(t),evt:{category:zt.RESOURCE},http:{performance:We(t),url:t.name},network:{bytesWritten:Ge(t)},resource:{kind:i}}),r.notify(xe.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:zt.LONG_TASK}})}(r,n)}}))}(e,t,i(c,o.add)),function(e,t){e.subscribe(xe.CUSTOM_ACTION_COLLECTED,(function(e){t(performance.now(),{evt:{category:zt.USER_ACTION,name:e.name},userAction:{type:e.type}},e.context)}))}(t,i(u,o.add)),function(e,t){e.subscribe(xe.AUTO_ACTION_COMPLETED,(function(e){t(e.startTime,{date:A(e.startTime),duration:b(e.duration),evt:{category:zt.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),Kt(t,n),{globalApi:{addRumGlobalContext:J((function(e,t){c[e]=t})),addUserAction:J((function(e,t){n.notify(xe.CUSTOM_ACTION_COLLECTED,{context:t,name:e,type:Ut.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"}(zt||(zt={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(Gt||(Gt={}));var Xt,Jt="rum";function Qt(e,t){var n=lt(Jt,(function(t){return function(e,t){var n;n=function(e){return e===Xt.NOT_TRACKED||e===Xt.TRACKED_WITH_RESOURCES||e===Xt.TRACKED_WITHOUT_RESOURCES}(t)?t:g(e.sampleRate)?g(e.resourceSampleRate)?Xt.TRACKED_WITH_RESOURCES:Xt.TRACKED_WITHOUT_RESOURCES:Xt.NOT_TRACKED;return{trackingType:n,isTracked:Zt(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(xe.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Zt(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Xt.TRACKED_WITH_RESOURCES}}}function Zt(e){return e===Xt.TRACKED_WITH_RESOURCES||e===Xt.TRACKED_WITHOUT_RESOURCES}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(Xt||(Xt={}));var en=tn({init:function(e){Ie("core.init")},addRumGlobalContext:function(e,t){Ie("addRumGlobalContext")},setRumGlobalContext:function(e){Ie("setRumGlobalContext")},addUserAction:function(e,t){Ie("addUserAction")},getInternalContext:function(e){Ie("getInternalContext")}});function tn(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(Le()&&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 Ue,u=De(i,Me),a=u.errorObservable,s=u.configuration,c=u.internalMonitoring,f=Qt(s,o),d=Yt(i.applicationId,location,o,s,f,c).globalApi,l=Qe(),p=l[0],m=l[1];$e(o,f),ke(o),s.trackInteractions&&jt(o),a.subscribe((function(e){return o.notify(xe.ERROR_COLLECTED,e)})),p.subscribe((function(e){return o.notify(xe.REQUEST_STARTED,e)})),m.subscribe((function(e){return o.notify(xe.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=en}]);

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

sdkEnv: 'production',
sdkVersion: '1.14.0',
sdkVersion: '1.14.1',
};
//# sourceMappingURL=buildEnv.js.map

@@ -1,2 +0,3 @@

import { ErrorMessage, RequestCompleteEvent, RequestStartEvent } from '@datadog/browser-core';
import { ErrorMessage } from '@datadog/browser-core';
import { RequestCompleteEvent, RequestStartEvent } from './requestCollection';
import { AutoUserAction, CustomUserAction } from './userActionCollection';

@@ -3,0 +4,0 @@ import { View } from './viewCollection';

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

import { RequestCompleteEvent } from '@datadog/browser-core';
import { RequestCompleteEvent } from './requestCollection';
/**

@@ -3,0 +3,0 @@ * Look for corresponding timing in resource timing buffer

@@ -110,4 +110,7 @@ import { Configuration, ErrorContext, HttpContext, InternalMonitoring, Omit, ResourceKind } from '@datadog/browser-core';

export declare type RumEvent = RumErrorEvent & ActionContext & ViewContext & RumContext | RumResourceEvent & ActionContext & ViewContext & RumContext | RumViewEvent & ViewContext & RumContext | RumLongTaskEvent & ActionContext & ViewContext & RumContext | RumUserActionEvent & ViewContext & RumContext;
export declare function startRum(applicationId: string, location: Location, lifeCycle: LifeCycle, configuration: Configuration, session: RumSession, internalMonitoring: InternalMonitoring): Omit<RumGlobal, 'init'>;
export declare function startRum(applicationId: string, location: Location, lifeCycle: LifeCycle, configuration: Configuration, session: RumSession, internalMonitoring: InternalMonitoring): {
globalApi: Omit<RumGlobal, 'init'>;
stop: () => void;
};
export declare function handleResourceEntry(configuration: Configuration, entry: PerformanceResourceTiming, handler: (startTime: number, event: RumResourceEvent) => void, lifeCycle: LifeCycle): void;
export {};

@@ -31,2 +31,9 @@ import { Context, ContextValue, UserConfiguration } from '@datadog/browser-core';

};
export declare function makeRumGlobal(stub: RumGlobal): {
init(userConfiguration: RumUserConfiguration): void;
addRumGlobalContext(key: string, value: ContextValue): void;
setRumGlobalContext(context: Context): void;
addUserAction(name: string, context: Context): void;
getInternalContext(startTime?: number | undefined): InternalContext | undefined;
};
export {};

@@ -9,2 +9,3 @@ "use strict";

var performanceCollection_1 = require("./performanceCollection");
var requestCollection_1 = require("./requestCollection");
var rum_1 = require("./rum");

@@ -31,54 +32,59 @@ var rumSession_1 = require("./rumSession");

};
exports.datadogRum = browser_core_1.makeGlobal(STUBBED_RUM);
var isAlreadyInitialized = false;
exports.datadogRum.init = browser_core_1.monitor(function (userConfiguration) {
if (!browser_core_1.checkCookiesAuthorized() || !browser_core_1.checkIsNotLocalFile() || !canInitRum(userConfiguration)) {
return;
}
if (userConfiguration.publicApiKey) {
userConfiguration.clientToken = userConfiguration.publicApiKey;
}
var rumUserConfiguration = tslib_1.__assign(tslib_1.__assign({}, userConfiguration), { isCollectingError: true });
var lifeCycle = new lifeCycle_1.LifeCycle();
var _a = browser_core_1.commonInit(rumUserConfiguration, buildEnv_1.buildEnv), errorObservable = _a.errorObservable, configuration = _a.configuration, internalMonitoring = _a.internalMonitoring;
var session = rumSession_1.startRumSession(configuration, lifeCycle);
var globalApi = rum_1.startRum(rumUserConfiguration.applicationId, location, lifeCycle, configuration, session, internalMonitoring);
var _b = browser_core_1.startRequestCollection(), requestStartObservable = _b[0], requestCompleteObservable = _b[1];
performanceCollection_1.startPerformanceCollection(lifeCycle, session);
domMutationCollection_1.startDOMMutationCollection(lifeCycle);
if (configuration.trackInteractions) {
userActionCollection_1.startUserActionCollection(lifeCycle);
}
errorObservable.subscribe(function (errorMessage) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.ERROR_COLLECTED, errorMessage); });
requestStartObservable.subscribe(function (startEvent) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_STARTED, startEvent); });
requestCompleteObservable.subscribe(function (request) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_COMPLETED, request); });
browser_core_1.assign(exports.datadogRum, globalApi);
isAlreadyInitialized = true;
});
function canInitRum(userConfiguration) {
if (isAlreadyInitialized) {
if (!userConfiguration.silentMultipleInit) {
console.error('DD_RUM is already initialized.');
exports.datadogRum = makeRumGlobal(STUBBED_RUM);
browser_core_1.getGlobalObject().DD_RUM = exports.datadogRum;
function makeRumGlobal(stub) {
var global = browser_core_1.makeGlobal(stub);
var isAlreadyInitialized = false;
global.init = browser_core_1.monitor(function (userConfiguration) {
if (!browser_core_1.checkCookiesAuthorized() || !browser_core_1.checkIsNotLocalFile() || !canInitRum(userConfiguration)) {
return;
}
return false;
if (userConfiguration.publicApiKey) {
userConfiguration.clientToken = userConfiguration.publicApiKey;
}
var rumUserConfiguration = tslib_1.__assign(tslib_1.__assign({}, userConfiguration), { isCollectingError: true });
var lifeCycle = new lifeCycle_1.LifeCycle();
var _a = browser_core_1.commonInit(rumUserConfiguration, buildEnv_1.buildEnv), errorObservable = _a.errorObservable, configuration = _a.configuration, internalMonitoring = _a.internalMonitoring;
var session = rumSession_1.startRumSession(configuration, lifeCycle);
var globalApi = rum_1.startRum(rumUserConfiguration.applicationId, location, lifeCycle, configuration, session, internalMonitoring).globalApi;
var _b = requestCollection_1.startRequestCollection(), requestStartObservable = _b[0], requestCompleteObservable = _b[1];
performanceCollection_1.startPerformanceCollection(lifeCycle, session);
domMutationCollection_1.startDOMMutationCollection(lifeCycle);
if (configuration.trackInteractions) {
userActionCollection_1.startUserActionCollection(lifeCycle);
}
errorObservable.subscribe(function (errorMessage) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.ERROR_COLLECTED, errorMessage); });
requestStartObservable.subscribe(function (startEvent) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_STARTED, startEvent); });
requestCompleteObservable.subscribe(function (request) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_COMPLETED, request); });
browser_core_1.assign(global, globalApi);
isAlreadyInitialized = true;
});
function canInitRum(userConfiguration) {
if (isAlreadyInitialized) {
if (!userConfiguration.silentMultipleInit) {
console.error('DD_RUM is already initialized.');
}
return false;
}
if (!userConfiguration || (!userConfiguration.clientToken && !userConfiguration.publicApiKey)) {
console.error('Client Token is not configured, we will not send any data.');
return false;
}
if (!userConfiguration.applicationId) {
console.error('Application ID is not configured, no RUM data will be collected.');
return false;
}
if (userConfiguration.sampleRate !== undefined && !browser_core_1.isPercentage(userConfiguration.sampleRate)) {
console.error('Sample Rate should be a number between 0 and 100');
return false;
}
if (userConfiguration.resourceSampleRate !== undefined && !browser_core_1.isPercentage(userConfiguration.resourceSampleRate)) {
console.error('Resource Sample Rate should be a number between 0 and 100');
return false;
}
return true;
}
if (!userConfiguration || (!userConfiguration.clientToken && !userConfiguration.publicApiKey)) {
console.error('Client Token is not configured, we will not send any data.');
return false;
}
if (!userConfiguration.applicationId) {
console.error('Application ID is not configured, no RUM data will be collected.');
return false;
}
if (userConfiguration.sampleRate !== undefined && !browser_core_1.isPercentage(userConfiguration.sampleRate)) {
console.error('Sample Rate should be a number between 0 and 100');
return false;
}
if (userConfiguration.resourceSampleRate !== undefined && !browser_core_1.isPercentage(userConfiguration.resourceSampleRate)) {
console.error('Resource Sample Rate should be a number between 0 and 100');
return false;
}
return true;
return global;
}
browser_core_1.getGlobalObject().DD_RUM = exports.datadogRum;
exports.makeRumGlobal = makeRumGlobal;
//# sourceMappingURL=rum.entry.js.map

@@ -48,14 +48,21 @@ "use strict";

return {
addRumGlobalContext: browser_core_1.monitor(function (key, value) {
globalContext[key] = value;
}),
addUserAction: browser_core_1.monitor(function (name, context) {
lifeCycle.notify(lifeCycle_1.LifeCycleEventType.CUSTOM_ACTION_COLLECTED, { context: context, name: name, type: userActionCollection_1.UserActionType.CUSTOM });
}),
getInternalContext: browser_core_1.monitor(function (startTime) {
return browser_core_1.withSnakeCaseKeys(browser_core_1.deepMerge({ applicationId: applicationId }, parentContexts.findView(startTime), parentContexts.findAction(startTime)));
}),
setRumGlobalContext: browser_core_1.monitor(function (context) {
globalContext = context;
}),
globalApi: {
addRumGlobalContext: browser_core_1.monitor(function (key, value) {
globalContext[key] = value;
}),
addUserAction: browser_core_1.monitor(function (name, context) {
lifeCycle.notify(lifeCycle_1.LifeCycleEventType.CUSTOM_ACTION_COLLECTED, { context: context, name: name, type: userActionCollection_1.UserActionType.CUSTOM });
}),
getInternalContext: browser_core_1.monitor(function (startTime) {
return browser_core_1.withSnakeCaseKeys(browser_core_1.deepMerge({ applicationId: applicationId }, parentContexts.findView(startTime), parentContexts.findAction(startTime)));
}),
setRumGlobalContext: browser_core_1.monitor(function (context) {
globalContext = context;
}),
},
stop: function () {
// prevent batch from previous tests to keep running and send unwanted requests
// could be replaced by stopping all the component when they will all have a stop method
batch.stop();
},
};

@@ -77,4 +84,8 @@ }

}
var stopped = false;
return {
add: function (message) {
if (stopped) {
return;
}
primaryBatch.add(message);

@@ -85,3 +96,9 @@ if (replicaBatch) {

},
stop: function () {
stopped = true;
},
upsert: function (message, key) {
if (stopped) {
return;
}
primaryBatch.upsert(message, key);

@@ -88,0 +105,0 @@ if (replicaBatch) {

@@ -5,4 +5,4 @@ export var buildEnv = {

sdkEnv: 'production',
sdkVersion: '1.14.0',
sdkVersion: '1.14.1',
};
//# sourceMappingURL=buildEnv.js.map

@@ -1,2 +0,3 @@

import { ErrorMessage, RequestCompleteEvent, RequestStartEvent } from '@datadog/browser-core';
import { ErrorMessage } from '@datadog/browser-core';
import { RequestCompleteEvent, RequestStartEvent } from './requestCollection';
import { AutoUserAction, CustomUserAction } from './userActionCollection';

@@ -3,0 +4,0 @@ import { View } from './viewCollection';

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

import { RequestCompleteEvent } from '@datadog/browser-core';
import { RequestCompleteEvent } from './requestCollection';
/**

@@ -3,0 +3,0 @@ * Look for corresponding timing in resource timing buffer

@@ -110,4 +110,7 @@ import { Configuration, ErrorContext, HttpContext, InternalMonitoring, Omit, ResourceKind } from '@datadog/browser-core';

export declare type RumEvent = RumErrorEvent & ActionContext & ViewContext & RumContext | RumResourceEvent & ActionContext & ViewContext & RumContext | RumViewEvent & ViewContext & RumContext | RumLongTaskEvent & ActionContext & ViewContext & RumContext | RumUserActionEvent & ViewContext & RumContext;
export declare function startRum(applicationId: string, location: Location, lifeCycle: LifeCycle, configuration: Configuration, session: RumSession, internalMonitoring: InternalMonitoring): Omit<RumGlobal, 'init'>;
export declare function startRum(applicationId: string, location: Location, lifeCycle: LifeCycle, configuration: Configuration, session: RumSession, internalMonitoring: InternalMonitoring): {
globalApi: Omit<RumGlobal, 'init'>;
stop: () => void;
};
export declare function handleResourceEntry(configuration: Configuration, entry: PerformanceResourceTiming, handler: (startTime: number, event: RumResourceEvent) => void, lifeCycle: LifeCycle): void;
export {};

@@ -31,2 +31,9 @@ import { Context, ContextValue, UserConfiguration } from '@datadog/browser-core';

};
export declare function makeRumGlobal(stub: RumGlobal): {
init(userConfiguration: RumUserConfiguration): void;
addRumGlobalContext(key: string, value: ContextValue): void;
setRumGlobalContext(context: Context): void;
addUserAction(name: string, context: Context): void;
getInternalContext(startTime?: number | undefined): InternalContext | undefined;
};
export {};
import { __assign } from "tslib";
import { assign, checkCookiesAuthorized, checkIsNotLocalFile, commonInit, getGlobalObject, isPercentage, makeGlobal, makeStub, monitor, startRequestCollection, } from '@datadog/browser-core';
import { assign, checkCookiesAuthorized, checkIsNotLocalFile, commonInit, getGlobalObject, isPercentage, makeGlobal, makeStub, monitor, } from '@datadog/browser-core';
import { buildEnv } from './buildEnv';

@@ -7,2 +7,3 @@ import { startDOMMutationCollection } from './domMutationCollection';

import { startPerformanceCollection } from './performanceCollection';
import { startRequestCollection } from './requestCollection';
import { startRum } from './rum';

@@ -29,54 +30,58 @@ import { startRumSession } from './rumSession';

};
export var datadogRum = makeGlobal(STUBBED_RUM);
var isAlreadyInitialized = false;
datadogRum.init = monitor(function (userConfiguration) {
if (!checkCookiesAuthorized() || !checkIsNotLocalFile() || !canInitRum(userConfiguration)) {
return;
}
if (userConfiguration.publicApiKey) {
userConfiguration.clientToken = userConfiguration.publicApiKey;
}
var rumUserConfiguration = __assign(__assign({}, userConfiguration), { isCollectingError: true });
var lifeCycle = new LifeCycle();
var _a = commonInit(rumUserConfiguration, buildEnv), errorObservable = _a.errorObservable, configuration = _a.configuration, internalMonitoring = _a.internalMonitoring;
var session = startRumSession(configuration, lifeCycle);
var globalApi = startRum(rumUserConfiguration.applicationId, location, lifeCycle, configuration, session, internalMonitoring);
var _b = startRequestCollection(), requestStartObservable = _b[0], requestCompleteObservable = _b[1];
startPerformanceCollection(lifeCycle, session);
startDOMMutationCollection(lifeCycle);
if (configuration.trackInteractions) {
startUserActionCollection(lifeCycle);
}
errorObservable.subscribe(function (errorMessage) { return lifeCycle.notify(LifeCycleEventType.ERROR_COLLECTED, errorMessage); });
requestStartObservable.subscribe(function (startEvent) { return lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, startEvent); });
requestCompleteObservable.subscribe(function (request) { return lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, request); });
assign(datadogRum, globalApi);
isAlreadyInitialized = true;
});
function canInitRum(userConfiguration) {
if (isAlreadyInitialized) {
if (!userConfiguration.silentMultipleInit) {
console.error('DD_RUM is already initialized.');
export var datadogRum = makeRumGlobal(STUBBED_RUM);
getGlobalObject().DD_RUM = datadogRum;
export function makeRumGlobal(stub) {
var global = makeGlobal(stub);
var isAlreadyInitialized = false;
global.init = monitor(function (userConfiguration) {
if (!checkCookiesAuthorized() || !checkIsNotLocalFile() || !canInitRum(userConfiguration)) {
return;
}
return false;
if (userConfiguration.publicApiKey) {
userConfiguration.clientToken = userConfiguration.publicApiKey;
}
var rumUserConfiguration = __assign(__assign({}, userConfiguration), { isCollectingError: true });
var lifeCycle = new LifeCycle();
var _a = commonInit(rumUserConfiguration, buildEnv), errorObservable = _a.errorObservable, configuration = _a.configuration, internalMonitoring = _a.internalMonitoring;
var session = startRumSession(configuration, lifeCycle);
var globalApi = startRum(rumUserConfiguration.applicationId, location, lifeCycle, configuration, session, internalMonitoring).globalApi;
var _b = startRequestCollection(), requestStartObservable = _b[0], requestCompleteObservable = _b[1];
startPerformanceCollection(lifeCycle, session);
startDOMMutationCollection(lifeCycle);
if (configuration.trackInteractions) {
startUserActionCollection(lifeCycle);
}
errorObservable.subscribe(function (errorMessage) { return lifeCycle.notify(LifeCycleEventType.ERROR_COLLECTED, errorMessage); });
requestStartObservable.subscribe(function (startEvent) { return lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, startEvent); });
requestCompleteObservable.subscribe(function (request) { return lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, request); });
assign(global, globalApi);
isAlreadyInitialized = true;
});
function canInitRum(userConfiguration) {
if (isAlreadyInitialized) {
if (!userConfiguration.silentMultipleInit) {
console.error('DD_RUM is already initialized.');
}
return false;
}
if (!userConfiguration || (!userConfiguration.clientToken && !userConfiguration.publicApiKey)) {
console.error('Client Token is not configured, we will not send any data.');
return false;
}
if (!userConfiguration.applicationId) {
console.error('Application ID is not configured, no RUM data will be collected.');
return false;
}
if (userConfiguration.sampleRate !== undefined && !isPercentage(userConfiguration.sampleRate)) {
console.error('Sample Rate should be a number between 0 and 100');
return false;
}
if (userConfiguration.resourceSampleRate !== undefined && !isPercentage(userConfiguration.resourceSampleRate)) {
console.error('Resource Sample Rate should be a number between 0 and 100');
return false;
}
return true;
}
if (!userConfiguration || (!userConfiguration.clientToken && !userConfiguration.publicApiKey)) {
console.error('Client Token is not configured, we will not send any data.');
return false;
}
if (!userConfiguration.applicationId) {
console.error('Application ID is not configured, no RUM data will be collected.');
return false;
}
if (userConfiguration.sampleRate !== undefined && !isPercentage(userConfiguration.sampleRate)) {
console.error('Sample Rate should be a number between 0 and 100');
return false;
}
if (userConfiguration.resourceSampleRate !== undefined && !isPercentage(userConfiguration.resourceSampleRate)) {
console.error('Resource Sample Rate should be a number between 0 and 100');
return false;
}
return true;
return global;
}
getGlobalObject().DD_RUM = datadogRum;
//# sourceMappingURL=rum.entry.js.map

@@ -46,14 +46,21 @@ import { __assign } from "tslib";

return {
addRumGlobalContext: monitor(function (key, value) {
globalContext[key] = value;
}),
addUserAction: monitor(function (name, context) {
lifeCycle.notify(LifeCycleEventType.CUSTOM_ACTION_COLLECTED, { context: context, name: name, type: UserActionType.CUSTOM });
}),
getInternalContext: monitor(function (startTime) {
return withSnakeCaseKeys(deepMerge({ applicationId: applicationId }, parentContexts.findView(startTime), parentContexts.findAction(startTime)));
}),
setRumGlobalContext: monitor(function (context) {
globalContext = context;
}),
globalApi: {
addRumGlobalContext: monitor(function (key, value) {
globalContext[key] = value;
}),
addUserAction: monitor(function (name, context) {
lifeCycle.notify(LifeCycleEventType.CUSTOM_ACTION_COLLECTED, { context: context, name: name, type: UserActionType.CUSTOM });
}),
getInternalContext: monitor(function (startTime) {
return withSnakeCaseKeys(deepMerge({ applicationId: applicationId }, parentContexts.findView(startTime), parentContexts.findAction(startTime)));
}),
setRumGlobalContext: monitor(function (context) {
globalContext = context;
}),
},
stop: function () {
// prevent batch from previous tests to keep running and send unwanted requests
// could be replaced by stopping all the component when they will all have a stop method
batch.stop();
},
};

@@ -74,4 +81,8 @@ }

}
var stopped = false;
return {
add: function (message) {
if (stopped) {
return;
}
primaryBatch.add(message);

@@ -82,3 +93,9 @@ if (replicaBatch) {

},
stop: function () {
stopped = true;
},
upsert: function (message, key) {
if (stopped) {
return;
}
primaryBatch.upsert(message, key);

@@ -85,0 +102,0 @@ if (replicaBatch) {

{
"name": "@datadog/browser-rum",
"version": "1.14.0",
"version": "1.14.1",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.14.0",
"@datadog/browser-core": "1.14.1",
"tslib": "1.10.0"

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

},
"gitHead": "b9e32106eef6dd9e7f5c03ab92a7c518f53f934a"
"gitHead": "1298e13e8204d4ac9149b77bd533126ec70d5dd2"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc