Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
Maintainers
1
Versions
254
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 2.5.2 to 2.5.3

2

bundle/datadog-rum.js

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

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([,function(t,e,n){"use strict";n.r(e),n.d(e,"datadogRum",(function(){return Kn}));var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function o(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}var a=function(t){return Array.isArray(t)},u=function(t){return!Array.isArray(t)&&"object"==typeof t&&null!==t};function s(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];null!=o&&(t=d(t,o,f()))}return t}function c(t){return d(void 0,t,f())}function f(){if("undefined"!=typeof WeakSet){var t=new WeakSet;return{hasAlreadyBeenSeen:function(e){var n=t.has(e);return n||t.add(e),n}}}var e=[];return{hasAlreadyBeenSeen:function(t){var n=e.indexOf(t)>=0;return n||e.push(t),n}}}function d(t,e,n){if(void 0===e)return t;if(!u(e)&&!a(e))return e;if(!n.hasAlreadyBeenSeen(e)){if(u(e)&&(void 0===t||u(t))){var r=t||{};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=d(r[i],e[i],n));return r}if(a(e)&&(void 0===t||a(t))){(r=t||[]).length=Math.max(r.length,e.length);for(var o=0;o<e.length;o+=1)r[o]=d(r[o],e[o],n);return r}return e}}var l={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source"};function p(t,e,n){return t&&(void 0!==t.message||e instanceof Error)?{message:t.message||"Empty message",stack:m(t),type:t.name}:{message:n+" "+q(e),stack:"No stack, consider using an instance of Error",type:t&&t.name}}function m(t){var e=(t.name||"Error")+": "+t.message;return t.stack.forEach((function(t){var n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?"("+t.args.join(", ")+")":"",i=t.line?":"+t.line:"",o=t.line&&t.column?":"+t.column:"";e+="\n at "+n+r+" @ "+t.url+i+o})),e}var v=/[^\u0000-\u007F]/,E=function(){function t(t,e,n){void 0===n&&(n=!1),this.endpointUrl=t,this.bytesLimit=e,this.withBatchTime=n}return t.prototype.send=function(t,e){var n=this.withBatchTime?function(t){return t+(-1===t.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&e<this.bytesLimit&&navigator.sendBeacon(n,t))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(t)},t}();var h=function(){function t(t,e,n,r,i,o){void 0===o&&(o=V),this.request=t,this.maxSize=e,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 t.prototype.add=function(t){this.addOrUpdate(t)},t.prototype.upsert=function(t,e){this.addOrUpdate(t,e)},t.prototype.flush=function(){if(0!==this.bufferMessageCount){var t=o(this.pushOnlyBuffer,(e=this.upsertBuffer,n=[],Object.keys(e).forEach((function(t){n.push(e[t])})),n));this.request.send(t.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var e,n},t.prototype.sizeInBytes=function(t){return v.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length},t.prototype.addOrUpdate=function(t,e){var n=this.process(t),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(e)&&this.remove(e),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(r,i,e),this.isFull()&&this.flush())},t.prototype.process=function(t){var e=q(t);return{processedMessage:e,messageBytesSize:this.sizeInBytes(e)}},t.prototype.push=function(t,e,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=t:this.pushOnlyBuffer.push(t),this.bufferBytesSize+=e,this.bufferMessageCount+=1},t.prototype.remove=function(t){var e=this.upsertBuffer[t];delete this.upsertBuffer[t];var n=this.sizeInBytes(e);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},t.prototype.hasMessageFor=function(t){return void 0!==t&&void 0!==this.upsertBuffer[t]},t.prototype.willReachedBytesLimitWith=function(t){return this.bufferBytesSize+t+1>=this.bytesLimit},t.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},t.prototype.flushPeriodically=function(){var t=this;setTimeout((function(){t.flush(),t.flushPeriodically()}),this.flushTimeout)},t.prototype.flushOnVisibilityHidden=function(){var t=this;navigator.sendBeacon&&(et(window,L.BEFORE_UNLOAD,this.beforeUnloadCallback),et(document,L.VISIBILITY_CHANGE,(function(){"hidden"===document.visibilityState&&t.flush()})),et(window,L.BEFORE_UNLOAD,(function(){return t.flush()})))},t}(),T="?",g=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;var y,b=function(){var t,e,n,r,i,o,a=[];function u(t,e,n){var r;if(a.forEach((function(i){try{i(t,e,n)}catch(t){r=t}})),r)throw r}function s(t,r,i,o,a){if(e)C.augmentStackTraceWithInitialElement(e,r,i),f();else if(a)u(C(a),!0,a);else{var s,c={url:r,column:o,line:i},d=t;if("[object String]"==={}.toString.call(t)){var l=g.exec(d);l&&(s=l[1],d=l[2])}u({name:s,message:"string"==typeof d?d:void 0,stack:[c]},!0,t)}return!!n&&n.apply(this,arguments)}function c(t){var e=t.reason||"Empty reason";u(C(e),!0,e)}function f(){var n=e,r=t;e=void 0,t=void 0,u(n,!1,r)}function d(n){if(e){if(t===n)return;f()}var r=C(n);throw e=r,t=n,setTimeout((function(){t===n&&f()}),r.incomplete?2e3:0),n}return d.subscribe=function(t){!function(){if(r)return;n=window.onerror,window.onerror=S(s),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=S(c),o=!0}(),a.push(t)},d.unsubscribe=function(t){for(var e=a.length-1;e>=0;e-=1)a[e]===t&&a.splice(e,1);0===a.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},d.traceKitWindowOnError=s,d}(),C=function(){var t=!1;function e(t){var e=o(t,"stack");if(e){for(var n,r,i,a,u=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,c=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,f=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,d=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.split("\n"),p=[],m=0,v=l.length;m<v;m+=1){if(u.exec(l[m])){var E=(i=u.exec(l[m]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=d.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),a={args:E?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||T,line:i[3]?+i[3]:void 0,url:E?void 0:i[2]}}else if(c.exec(l[m]))a={args:[],column:(i=c.exec(l[m]))[4]?+i[4]:void 0,func:i[1]||T,line:+i[3],url:i[2]};else{if(!s.exec(l[m]))continue;n=(i=s.exec(l[m]))[3]&&i[3].indexOf(" > eval")>-1,r=f.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==m||i[5]||void 0===t.columnNumber||(p[0].column=t.columnNumber+1),a={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||T,line:i[4]?+i[4]:void 0,url:i[3]}}!a.func&&a.line&&(a.func=T),p.push(a)}if(p.length)return{stack:p,message:o(t,"message"),name:o(t,"name")}}}function n(t,e,n){var r={url:e,line:n?+n:void 0};if(r.url&&r.line){t.incomplete=!1;var i=t.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),t.partial=!0,!0}return t.incomplete=!0,!1}function r(t,e){for(var i,a,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],c={},f=!1,d=r.caller;d&&!f;d=d.caller)d!==C&&d!==b&&(a={args:[],column:void 0,func:T,line:void 0,url:void 0},i=u.exec(d.toString()),d.name?a.func=d.name:i&&(a.func=i[1]),void 0===a.func&&(a.func=i?i.input.substring(0,i.input.indexOf("{")):void 0),c[d.toString()]?f=!0:c[d.toString()]=!0,s.push(a));e&&s.splice(0,e);var l={stack:s,message:o(t,"message"),name:o(t,"name")};return n(l,o(t,"sourceURL")||o(t,"fileName"),o(t,"line")||o(t,"lineNumber")),l}function i(n,i){var a,u=void 0===i?0:+i;try{if(a=function(t){var e=o(t,"stacktrace");if(e){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,a=e.split("\n"),u=[],s=0;s<a.length;s+=2){var c=void 0;r.exec(a[s])?c={args:[],column:void 0,func:(n=r.exec(a[s]))[3],line:+n[1],url:n[2]}:i.exec(a[s])&&(c={args:(n=i.exec(a[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),c&&(!c.func&&c.line&&(c.func=T),c.context=[a[s+1]],u.push(c))}if(u.length)return{stack:u,message:o(t,"message"),name:o(t,"name")}}}(n))return a}catch(e){if(t)throw e}try{if(a=e(n))return a}catch(e){if(t)throw e}try{if(a=function(t){var e=o(t,"message");if(e){var n=e.split("\n");if(!(n.length<4)){var r,i,a,u=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,s=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,c=/^\s*Line (\d+) of function script\s*$/i,f=[],d=window&&window.document&&window.document.getElementsByTagName("script"),l=[];for(var p in d)i=d,a=p,Object.prototype.hasOwnProperty.call(i,a)&&!d[p].src&&l.push(d[p]);for(var m=2;m<n.length;m+=2){var v=void 0;if(u.exec(n[m]))v={args:[],column:void 0,func:(r=u.exec(n[m]))[3],line:+r[1],url:r[2]};else if(s.exec(n[m]))v={args:[],column:void 0,func:(r=s.exec(n[m]))[4],line:+r[1],url:r[3]};else if(c.exec(n[m])){r=c.exec(n[m]),v={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}v&&(v.func||(v.func=T),v.context=[n[m+1]],f.push(v))}if(f.length)return{stack:f,message:n[0],name:o(t,"name")}}}}(n))return a}catch(e){if(t)throw e}try{if(a=r(n,u+1))return a}catch(e){if(t)throw e}return{message:o(n,"message"),name:o(n,"name"),stack:[]}}function o(t,e){if("object"==typeof t&&t&&e in t){var n=t[e];return"string"==typeof n?n:void 0}}return i.augmentStackTraceWithInitialElement=n,i.computeStackTraceFromStackProp=e,i.ofCaller=function(t){var e=1+(void 0===t?0:+t);try{throw new Error}catch(t){return C(t,e+1)}},i}();!function(t){t.info="info",t.error="error"}(y||(y={}));var _,O={maxMessagesPerPage:0,sentMessageCount:0};function R(t){if(t.internalMonitoringEndpoint){var e=function(t){var e,n=r(t.internalMonitoringEndpoint);void 0!==t.replica&&(e=r(t.replica.internalMonitoringEndpoint));function r(e){return new h(new E(e,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout)}return{add:function(t){var r=function(t){return s({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==_?_():{},t)}(t);n.add(r),e&&e.add(r)}}}(t);!function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];e.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))}(O,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){_=t}}}function S(t){return function(){return w(t,this,arguments)}}function w(t,e,n){try{return t.apply(e,n)}catch(t){D(t);try{!function(t){A(r(r({},function(t){if(t instanceof Error){var e=C(t);return{error:{kind:e.name,stack:m(e)},message:e.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+q(t)}}(t)),{status:y.error}))}(t)}catch(t){D(t)}}}function I(t,e){!function(t){O.debugMode&&console.log("[MONITORING MESSAGE]",t)}(t),A(r(r({message:t},e),{status:y.info}))}function A(t){O.batch&&O.sentMessageCount<O.maxMessagesPerPage&&(O.sentMessageCount+=1,O.batch.add(t))}function N(t){O.debugMode=t}function D(t){O.debugMode&&console.warn("[INTERNAL ERROR]",t)}var L,x,U,M,k=1e3,P=60*k,B=60*P;function H(t,e,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,a=!1,u=!1;return{throttled:function(){a?u=!0:(i?t():u=!0,a=!0,r=setTimeout((function(){o&&u&&t(),a=!1,u=!1}),e))},cancel:function(){clearTimeout(r),a=!1,u=!1}}}function W(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,W)}function j(t){return 0!==t&&100*Math.random()<=t}function F(t){return"number"!=typeof t?t:+(1e6*t).toFixed(0)}function V(){}function q(t,e,n){if(null==t)return JSON.stringify(t);var r=[!1,void 0];z(t)&&(r=[!0,t.toJSON],delete t.toJSON);var i,o,a=[!1,void 0];"object"==typeof t&&z(i=Object.getPrototypeOf(t))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(t,e,n)}catch(t){o="<error: unable to serialize object>"}finally{r[0]&&(t.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function z(t){return"object"==typeof t&&null!==t&&t.hasOwnProperty("toJSON")}function G(t,e){return-1!==t.indexOf(e)}function K(t){return Y(t)&&t>=0&&t<=100}function Y(t){return"number"==typeof t}function $(t){return Math.floor(X()+t)}function X(){return void 0===M&&(M=performance.timing.navigationStart),M}function J(t){return Object.keys(t).map((function(e){return[e,t[e]]}))}function Q(t){return 0===Object.keys(t).length}function Z(t){if(t.origin)return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return t.protocol+"//"+e}function tt(t,e){var n=new RegExp("(?:^|;)\\s*"+e+"\\s*=\\s*([^;]+)").exec(t);return n?n[1]:void 0}function et(t,e,n,r){return nt(t,[e],n,r)}function nt(t,e,n,r){var i=void 0===r?{}:r,o=i.once,a=i.capture,u=i.passive,s=S(o?function(t){f(),n(t)}:n),c=u?{capture:a,passive:u}:a;e.forEach((function(e){return t.addEventListener(e,s,c)}));var f=function(){return e.forEach((function(e){return t.removeEventListener(e,s,c)}))};return{stop:f}}!function(t){t.BEFORE_UNLOAD="beforeunload",t.CLICK="click",t.KEY_DOWN="keydown",t.LOAD="load",t.POP_STATE="popstate",t.SCROLL="scroll",t.TOUCH_START="touchstart",t.VISIBILITY_CHANGE="visibilitychange",t.DOM_CONTENT_LOADED="DOMContentLoaded",t.POINTER_DOWN="pointerdown",t.POINTER_UP="pointerup",t.POINTER_CANCEL="pointercancel",t.HASH_CHANGE="hashchange",t.PAGE_HIDE="pagehide",t.MOUSE_DOWN="mousedown",t.FOCUS="focus",t.BLUR="blur"}(L||(L={})),function(t){t.DOCUMENT="document",t.XHR="xhr",t.BEACON="beacon",t.FETCH="fetch",t.CSS="css",t.JS="js",t.IMAGE="image",t.FONT="font",t.MEDIA="media",t.OTHER="other"}(x||(x={})),function(t){t.FETCH="fetch",t.XHR="xhr"}(U||(U={}));var rt,it,ot=k;function at(t,e,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",u=r&&r.domain?";domain="+r.domain:"",s=r&&r.secure?";secure":"";document.cookie=t+"="+e+";"+o+";path=/;samesite="+a+u+s}function ut(t){return tt(document.cookie,t)}var st={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay",trace:"trace"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0,trace:"public-trace"}},ct={EU:"eu",US:"us"},ft=((it={})[ct.EU]="datadoghq.eu",it[ct.US]="datadoghq.com",it),dt=[ft[ct.US],ft[ct.EU]];function lt(t,e){var n={applicationId:t.applicationId,buildMode:e.buildMode,clientToken:t.clientToken,env:t.env,proxyHost:t.proxyHost,sdkVersion:e.sdkVersion,service:t.service,site:t.site||ft[t.datacenter||e.datacenter],version:t.version},i=function(t,e){return!e.useAlternateIntakeDomains&&G(dt,t)?"classic":"alternate"}(n.site,t),o=function(t,e,n){if(e.proxyHost)return["https://"+e.proxyHost+"/v1/input/"];var r=[e.site];e.buildMode===vt.STAGING&&n&&r.push(ft[ct.US]);for(var i=[],o=Object.keys(st[t]),a=0,u=r;a<u.length;a++)for(var s=u[a],c=0,f=o;c<f.length;c++){var d=f[c];i.push("https://"+pt(t,d,s)+"/v1/input/")}return i}(i,n,void 0!==t.replica),a={isIntakeUrl:function(t){return o.some((function(e){return 0===t.indexOf(e)}))},logsEndpoint:mt(i,"logs",n),rumEndpoint:mt(i,"rum",n),sessionReplayEndpoint:mt(i,"sessionReplay",n),traceEndpoint:mt(i,"trace",n)};if(t.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=mt(i,"logs",n,"browser-agent-internal-monitoring")),n.buildMode===vt.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),n.buildMode===vt.STAGING&&void 0!==t.replica){var u=r(r({},n),{applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,site:ft[ct.US]});a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:mt(i,"logs",u,"browser-agent-internal-monitoring"),logsEndpoint:mt(i,"logs",u),rumEndpoint:mt(i,"rum",u)}}return a}function pt(t,e,n){return"classic"===t&&function(t,e){var n=st.classic[t];return n&&n+"-http-intake.logs."+e}(e,n)||function(t,e){var n=st.alternate[t],r=e.split("."),i=r.pop(),o=r.join("-")+"."+i;return n+".browser-intake-"+o}(e,n)}function mt(t,e,n,r){var i="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),o=pt(t,e,n.site),a=n.proxyHost?n.proxyHost:o,u=n.proxyHost?"ddhost="+o+"&":"",s=""+(n.applicationId?"_dd.application_id="+n.applicationId+"&":"")+u+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(i);return"https://"+a+"/v1/input/"+n.clientToken+"?"+s}var vt,Et={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:30*k,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function ht(t){var e={};return e.secure=function(t){return!!t.useSecureSessionCookie||!!t.useCrossSiteSessionCookie}(t),e.crossSite=!!t.useCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===rt){for(var t="dd_site_test_"+W(),e=window.location.hostname.split("."),n=e.pop();e.length&&!ut(t);)n=e.pop()+"."+n,at(t,"test",k,{domain:n});rt=n}return rt}()),e}function Tt(t,e){var n=function(t,e){var n=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],i=r(r({beforeSend:t.beforeSend,cookieOptions:ht(t),isEnabled:function(t){return G(n,t)},service:t.service},lt(t,e)),Et);return"allowedTracingOrigins"in t&&(i.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(i.sampleRate=t.sampleRate),"resourceSampleRate"in t&&(i.resourceSampleRate=t.resourceSampleRate),"trackInteractions"in t&&(i.trackInteractions=!!t.trackInteractions),i}(t,e);return{configuration:n,internalMonitoring:R(n)}}function gt(t){return!!function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{var e="dd_cookie_test_"+W();return at(e,"test",k,t),"test"===ut(e)}catch(t){return console.error(t),!1}}(t)||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function yt(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(t){t.RELEASE="release",t.STAGING="staging",t.E2E_TEST="e2e-test"}(vt||(vt={}));var bt,Ct=1e4,_t=function(){function t(t){void 0===t&&(t=Ct),this.limit=t,this.buffer=[]}return t.prototype.add=function(t){this.buffer.push(t)>this.limit&&this.buffer.splice(0,1)},t.prototype.drain=function(t){this.buffer.forEach((function(e){return t(e)})),this.buffer.length=0},t}();!function(t){t[t.PERFORMANCE_ENTRY_COLLECTED=0]="PERFORMANCE_ENTRY_COLLECTED",t[t.AUTO_ACTION_CREATED=1]="AUTO_ACTION_CREATED",t[t.AUTO_ACTION_COMPLETED=2]="AUTO_ACTION_COMPLETED",t[t.AUTO_ACTION_DISCARDED=3]="AUTO_ACTION_DISCARDED",t[t.VIEW_CREATED=4]="VIEW_CREATED",t[t.VIEW_UPDATED=5]="VIEW_UPDATED",t[t.VIEW_ENDED=6]="VIEW_ENDED",t[t.REQUEST_STARTED=7]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=8]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=9]="SESSION_RENEWED",t[t.DOM_MUTATED=10]="DOM_MUTATED",t[t.BEFORE_UNLOAD=11]="BEFORE_UNLOAD",t[t.RAW_RUM_EVENT_COLLECTED=12]="RAW_RUM_EVENT_COLLECTED",t[t.RUM_EVENT_COLLECTED=13]="RUM_EVENT_COLLECTED"}(bt||(bt={}));var Ot,Rt=function(){function t(){this.callbacks={}}return t.prototype.notify=function(t,e){var n=this.callbacks[t];n&&n.forEach((function(t){return t(e)}))},t.prototype.subscribe=function(t,e){var n=this;return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:function(){n.callbacks[t]=n.callbacks[t].filter((function(t){return e!==t}))}}},t}();function St(t,e){void 0===e&&(e=V);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=t.subscribe(bt.RAW_RUM_EVENT_COLLECTED,(function(t){switch(t.rawRumEvent.type){case Ot.ERROR:n.errorCount+=1,e(n);break;case Ot.ACTION:n.userActionCount+=1,e(n);break;case Ot.LONG_TASK:n.longTaskCount+=1,e(n);break;case Ot.RESOURCE:n.resourceCount+=1,e(n)}}));return{stop:function(){r.unsubscribe()},eventCounts:n}}!function(t){t.ACTION="action",t.ERROR="error",t.LONG_TASK="long_task",t.VIEW="view",t.RESOURCE="resource"}(Ot||(Ot={}));var wt=function(){function t(){this.observers=[]}return t.prototype.subscribe=function(t){this.observers.push(t)},t.prototype.notify=function(t){this.observers.forEach((function(e){return e(t)}))},t}(),It=100,At=100,Nt=1e4;function Dt(t,e){var n=function(t){var e,n=new wt,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(t.subscribe(bt.DOM_MUTATED,(function(){return o()}))),r.push(t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"resource"===t.entryType&&o()}))),r.push(t.subscribe(bt.REQUEST_STARTED,(function(t){void 0===e&&(e=t.requestIndex),i+=1,o()}))),r.push(t.subscribe(bt.REQUEST_COMPLETED,(function(t){void 0===e||t.requestIndex<e||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(t){return t.unsubscribe()}))}}}(t),r=n.observable,i=n.stop,o=function(t,e,n){var r,i=!1,o=setTimeout(S((function(){return s(!1,0)})),It),a=setTimeout(S((function(){return s(!0,performance.now())})),Nt);t.subscribe((function(t){var e=t.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();e||(r=setTimeout(S((function(){return s(!0,n)})),At))}));var u=function(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),e()};function s(t,e){i||(u(),n(t,e))}return{stop:u}}(r,i,e).stop;return{stop:function(){o(),i()}}}function Lt(t){return function(t){var e;if(function(){void 0===kt&&(kt="closest"in HTMLElement.prototype);return kt}())e=t.closest("["+xt+"]");else for(var n=t;n;){if(n.hasAttribute(xt)){e=n;break}n=n.parentElement}if(!e)return;return Vt(Ft(e.getAttribute(xt).trim()))}(t)||jt(t,Bt)||jt(t,Ht)||""}var xt="data-dd-action-name";var Ut,Mt,kt,Pt,Bt=[function(t){if(function(){void 0===Mt&&(Mt="labels"in HTMLInputElement.prototype);return Mt}()){if("labels"in t&&t.labels&&t.labels.length>0)return qt(t.labels[0])}else if(t.id){var e=t.ownerDocument&&t.ownerDocument.querySelector('label[for="'+t.id.replace('"','\\"')+'"]');return e&&qt(e)}},function(t){if("INPUT"===t.nodeName){var e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return e.value}},function(t){if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return qt(t)},function(t){return t.getAttribute("aria-label")},function(t){var e=t.getAttribute("aria-labelledby");if(e)return e.split(/\s+/).map((function(e){return function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e)})).filter((function(t){return Boolean(t)})).map(qt).join(" ")},function(t){return t.getAttribute("alt")},function(t){return t.getAttribute("name")},function(t){return t.getAttribute("title")},function(t){return t.getAttribute("placeholder")},function(t){if("options"in t&&t.options.length>0)return qt(t.options[0])}],Ht=[function(t){return qt(t)}],Wt=10;function jt(t,e){for(var n=t,r=0;r<=Wt&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=e;i<o.length;i++){var a=(0,o[i])(n);if("string"==typeof a){var u=a.trim();if(u)return Vt(Ft(u))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function Ft(t){return t.replace(/\s+/g," ")}function Vt(t){return t.length>100?(n=100,((r=(e=t).charCodeAt(n-1))>=55296&&r<=56319?e.slice(0,n+1):e.slice(0,n))+" [...]"):t;var e,n,r}function qt(t){if(!t.isContentEditable){if("innerText"in t){var e=t.innerText;if(!function(){if(void 0===Ut){var t=document.createElement("style");t.textContent="*";var e=document.createElement("div");e.appendChild(t),document.body.appendChild(e),Ut=""===e.innerText,document.body.removeChild(e)}return Ut}())for(var n=t.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(e=e.replace(i,""))}return e}return t.textContent}}function zt(t){var e=function(t){var e,n;return{create:function(r,i){if(!e){var o=new Kt(t,r,i);e=o,n=Dt(t,(function(t,n){t?o.complete(n):o.discard(),e=void 0}))}},discardCurrent:function(){e&&(n.stop(),e.discard(),e=void 0)}}}(t);t.subscribe(bt.VIEW_CREATED,(function(){e.discardCurrent()}));var n=et(window,L.CLICK,(function(t){if(t.target instanceof Element){var n=Lt(t.target);n&&e.create(Pt.CLICK,n)}}),{capture:!0}).stop;return{stop:function(){e.discardCurrent(),n()}}}!function(t){t.CLICK="click",t.CUSTOM="custom"}(Pt||(Pt={}));var Gt,Kt=function(){function t(t,e,n){this.lifeCycle=t,this.type=e,this.name=n,this.id=W(),this.startTime=performance.now(),this.eventCountsSubscription=St(t),this.lifeCycle.notify(bt.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return t.prototype.complete=function(t){var e=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(bt.AUTO_ACTION_COMPLETED,{counts:{errorCount:e.errorCount,longTaskCount:e.longTaskCount,resourceCount:e.resourceCount},duration:t-this.startTime,id:this.id,name:this.name,startTime:this.startTime,type:this.type}),this.eventCountsSubscription.stop()},t.prototype.discard=function(){this.lifeCycle.notify(bt.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},t}();function Yt(t){var e,n=function(){var t,e=window;if(e.Zone){var n=e.Zone.__symbol__("MutationObserver");t=e[n]}return t||(t=e.MutationObserver),t}();return n&&(e=new n(S((function(){t.notify(bt.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){e&&e.disconnect()}}}function $t(t){return Jt(t,Z(window.location)).href}function Xt(t){return Z(Jt(t))}function Jt(t,e){if(function(){if(void 0!==Gt)return Gt;try{var t=new URL("http://test/path");return Gt="http://test/path"===t.href}catch(t){Gt=!1}return Gt}())return void 0!==e?new URL(t,e):new URL(t);if(void 0===e&&!/:/.test(t))throw new Error("Invalid URL: '"+t+"'");var n=document,r=n.createElement("a");if(void 0!==e){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=e,n.head.appendChild(i),n.body.appendChild(r)}return r.href=t,r}var Qt="initial_document",Zt=[[x.DOCUMENT,function(t){return Qt===t}],[x.XHR,function(t){return"xmlhttprequest"===t}],[x.FETCH,function(t){return"fetch"===t}],[x.BEACON,function(t){return"beacon"===t}],[x.CSS,function(t,e){return/\.css$/i.test(e)}],[x.JS,function(t,e){return/\.js$/i.test(e)}],[x.IMAGE,function(t,e){return G(["image","img","icon"],t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)}],[x.FONT,function(t,e){return null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)}],[x.MEDIA,function(t,e){return G(["audio","video"],t)||null!==/\.(mp3|mp4)$/i.exec(e)}]];function te(t){var e=t.name;if(!function(t){try{return!!Jt(t)}catch(t){return!1}}(e))return I('Failed to construct URL for "'+t.name+'"'),x.OTHER;for(var n=function(t){var e=Jt(t).pathname;return"/"===e[0]?e:"/"+e}(e),r=0,i=Zt;r<i.length;r++){var o=i[r],a=o[0];if((0,o[1])(t.initiatorType,n))return a}return x.OTHER}function ee(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=1;n<t.length;n+=1)if(t[n-1]>t[n])return!1;return!0}function ne(t){var e=re(t);if(e){var n=e.startTime,r=e.fetchStart,i=e.redirectStart,o=e.redirectEnd,a=e.domainLookupStart,u=e.domainLookupEnd,s=e.connectStart,c=e.secureConnectionStart,f=e.connectEnd,d=e.requestStart,l=e.responseStart,p={download:oe(n,l,e.responseEnd),first_byte:oe(n,d,l)};return f!==r&&(p.connect=oe(n,s,f),ee(s,c,f)&&(p.ssl=oe(n,c,f))),u!==r&&(p.dns=oe(n,a,u)),ie(t)&&(p.redirect=oe(n,i,o)),p}}function re(t){if(ee(t.startTime,t.fetchStart,t.domainLookupStart,t.domainLookupEnd,t.connectStart,t.connectEnd,t.requestStart,t.responseStart,t.responseEnd)){if(!ie(t))return t;var e=t.redirectStart,n=t.redirectEnd;if(e<t.startTime&&(e=t.startTime),n<t.startTime&&(n=t.fetchStart),ee(t.startTime,e,n,t.fetchStart))return r(r({},t),{redirectEnd:n,redirectStart:e})}}function ie(t){return t.fetchStart!==t.startTime}function oe(t,e,n){return{duration:F(n-e),start:F(e-t)}}function ae(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function ue(t,e){return e&&!t.isIntakeUrl(e)}var se,ce=2*P;function fe(t){var e=function(t){var e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return de(e&&e.content,n&&n.content)}(t)||function(t){var e=function(t){for(var e=0;e<t.childNodes.length;e+=1){if(n=le(t.childNodes[e]))return n}if(t.body)for(e=t.body.childNodes.length-1;e>=0;e-=1){var n,r=t.body.childNodes[e];if(n=le(r))return n;if(!pe(r))break}}(t);if(!e)return;return de(tt(e,"trace-id"),tt(e,"trace-time"))}(t);if(e&&!(e.traceTime<=Date.now()-ce))return e.traceId}function de(t,e){var n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function le(t){if(t&&function(t){return"#comment"===t.nodeName}(t)){var e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function pe(t){return"#text"===t.nodeName}function me(){return void 0!==window.performance&&"getEntries"in performance}function ve(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}function Ee(t,e){var n;if(n=function(n){ye(t,e,n)},he("interactive",(function(){var t,e={entryType:"resource",initiatorType:Qt,traceId:fe(document)};if(ve("navigation")&&performance.getEntriesByType("navigation").length>0){var i=performance.getEntriesByType("navigation")[0];t=r(r({},i.toJSON()),e)}else{var o=Te();t=r(r(r({},o),{decodedBodySize:0,duration:o.responseEnd,name:window.location.href,startTime:0}),e)}n(t)})),me()&&ge(t,e,performance.getEntries()),window.PerformanceObserver){new PerformanceObserver(S((function(n){return ge(t,e,n.getEntries())}))).observe({entryTypes:["resource","navigation","longtask","paint","largest-contentful-paint","first-input","layout-shift"]}),me()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}ve("navigation")||function(t){function e(){t(r(r({},Te()),{entryType:"navigation"}))}he("complete",(function(){setTimeout(S(e))}))}((function(n){ye(t,e,n)})),ve("first-input")||function(t){var e=Date.now(),n=!1,r=nt(window,[L.CLICK,L.MOUSE_DOWN,L.KEY_DOWN,L.TOUCH_START,L.POINTER_DOWN],(function(t){if(t.cancelable){var e={entryType:"first-input",processingStart:performance.now(),startTime:t.timeStamp};t.type===L.POINTER_DOWN?function(t){nt(window,[L.POINTER_UP,L.POINTER_CANCEL],(function(e){e.type===L.POINTER_UP&&i(t)}),{once:!0})}(e):i(e)}}),{passive:!0,capture:!0}).stop;function i(i){if(!n){n=!0,r();var o=i.processingStart-i.startTime;o>=0&&o<Date.now()-e&&t(i)}}}((function(n){ye(t,e,n)}))}function he(t,e){if(document.readyState===t||"complete"===document.readyState)e();else{var n="complete"===t?L.LOAD:L.DOM_CONTENT_LOADED;et(window,n,e,{once:!0})}}function Te(){var t={},e=performance.timing;for(var n in e)Y(e[n])&&(t[n]=0===e[n]?0:e[n]-X());return t}function ge(t,e,n){n.forEach((function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType&&"largest-contentful-paint"!==n.entryType&&"first-input"!==n.entryType&&"layout-shift"!==n.entryType||ye(t,e,n)}))}function ye(t,e,n){(function(t){return"navigation"===t.entryType&&t.loadEventEnd<=0})(n)||function(t,e){return"resource"===e.entryType&&!ue(t,e.name)}(e,n)||t.notify(bt.PERFORMANCE_ENTRY_COLLECTED,n)}function be(t,e,n){var r=c(t);try{n(r)}catch(e){return console.error(e),t}return e.forEach((function(e){var n=Ce(t,e),i=Ce(r,e);"string"==typeof n&&"string"==typeof i&&function(t,e,n){for(var r=t,i=e.split("."),o=0;o<i.length;o+=1){var a=i[o];if(!_e(r,a))return;o!==i.length-1?r=r[a]:r[a]=n}}(t,e,i)})),t}function Ce(t,e){for(var n=t,r=0,i=e.split(".");r<i.length;r++){var o=i[r];if(!_e(n,o))return;n=n[o]}return n}function _e(t,e){return"object"==typeof t&&null!==t&&e in t}!function(t){t.SYNTHETICS="synthetics",t.USER="user"}(se||(se={}));var Oe=["view.url","view.referrer","action.target.name","error.message","error.stack","error.resource.url","resource.url"];function Re(t,e,n,r,i,o){n.subscribe(bt.RAW_RUM_EVENT_COLLECTED,(function(a){var u,c=a.startTime,f=a.rawRumEvent,d=a.savedCommonContext,l=a.customerContext,p=i.findView(c);if(r.isTracked()&&p&&p.session.id){var m=i.findAction(c),v=d||o(),E={_dd:{format_version:2},application:{id:t},date:(new Date).getTime(),service:e.service,session:{has_replay:v.hasReplay,type:void 0===window._DATADOG_SYNTHETICS_BROWSER?se.USER:se.SYNTHETICS}},h=(u=f,-1!==[Ot.ERROR,Ot.RESOURCE,Ot.LONG_TASK].indexOf(u.type)?s(E,p,m,f):s(E,p,f)),T=s(v.context,l);Q(T)||(h.context=T),Q(v.user)||(h.usr=v.user),e.beforeSend&&be(h,Oe,e.beforeSend),n.notify(bt.RUM_EVENT_COLLECTED,h)}}))}var Se="_dd",we="_dd_r",Ie="_dd_l",Ae="rum",Ne="logs";var De="_dd_s",Le=15*P,xe=4*B,Ue=P;function Me(t,e,n){var r=function(t,e){var n,r,i=!1,o=function(){i=!0,clearTimeout(n),n=setTimeout((function(){i=!1}),ot)};return{get:function(){return i?r:(r=ut(t),o(),r)},set:function(n,i){at(t,n,i,e),r=n,o()}}}(De,t);!function(t){var e=t.get(),n=ut(Se),r=ut(we),i=ut(Ie);if(!e){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[Ne]=i),r&&/^[012]$/.test(r)&&(o[Ae]=r),He(o,t)}}(r);var i=new wt,o=Be(r).id,a=H(S((function(){var t=Be(r),a=n(t[e]),u=a.trackingType,s=a.isTracked;t[e]=u,s&&!t.id&&(t.id=W(),t.created=String(Date.now())),He(t,r),s&&o!==t.id&&(o=t.id,i.notify())})),ot).throttled;return a(),function(t){var e=nt(window,[L.CLICK,L.TOUCH_START,L.KEY_DOWN,L.SCROLL],t,{capture:!0,passive:!0}).stop;je.push(e)}(a),function(t){var e=S((function(){"visible"===document.visibilityState&&t()})),n=et(document,L.VISIBILITY_CHANGE,e).stop;je.push(n);var r=setInterval(e,Ue);je.push((function(){clearInterval(r)}))}((function(){He(Be(r),r)})),{getId:function(){return Be(r).id},getTrackingType:function(){return Be(r)[e]},renewObservable:i}}var ke=/^([a-z]+)=([a-z0-9-]+)$/,Pe="&";function Be(t){var e=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf(Pe)||ke.test(t))})(e)&&e.split(Pe).forEach((function(t){var e=ke.exec(t);if(null!==e){var r=e[1],i=e[2];n[r]=i}}));return n}(t);return function(t){return(void 0===t.created||Date.now()-Number(t.created)<xe)&&(void 0===t.expire||Date.now()<Number(t.expire))}(e)?e:(We(t),{})}function He(t,e){if(Q(t))We(e);else{t.expire=String(Date.now()+Le);var n=J(t).map((function(t){return t[0]+"="+t[1]})).join(Pe);e.set(n,Le)}}function We(t){t.set("",0)}var je=[];var Fe,Ve=xe,qe=5*P,ze=P;var Ge,Ke,Ye,$e,Xe=[],Je=[];function Qe(){return Fe||(Ge=XMLHttpRequest.prototype.open,Ke=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=function(t,e){var n=this;return w((function(){n._datadog_xhr={method:t,startTime:-1,url:$t(e)}})),Ge.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){var t=this;return w((function(){if(t._datadog_xhr){t._datadog_xhr.startTime=performance.now();var e=t.onreadystatechange;t.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&w(r),e&&e.apply(this,arguments)};var n=!1,r=function(){n||(n=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,Je.forEach((function(e){return e(t._datadog_xhr)})))};t.addEventListener("loadend",S(r)),Xe.forEach((function(e){return e(t._datadog_xhr,t)}))}})),Ke.apply(this,arguments)},Fe={beforeSend:function(t){Xe.push(t)},onRequestComplete:function(t){Je.push(t)}}),Fe}var Ze=[],tn=[];function en(){return Ye||(!function(){if(!window.fetch)return;$e=window.fetch,window.fetch=function(t,e){var n,r=w(nn,null,[t,e]);return r?w(rn,null,[n=$e.call(this,r.input,r.init),r]):n=$e.call(this,t,e),n}}(),Ye={beforeSend:function(t){Ze.push(t)},onRequestComplete:function(t){tn.push(t)}}),Ye}function nn(t,e){var n=e&&e.method||"object"==typeof t&&t.method||"GET",r=$t("object"==typeof t&&t.url||t),i={init:e,input:t,method:n,startTime:performance.now(),url:r};return Ze.forEach((function(t){return t(i)})),i}function rn(t,e){var n=this,r=function(t){return r=n,o=void 0,u=function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return e.duration=performance.now()-e.startTime,"stack"in t||t instanceof Error?(e.status=0,e.response=m(C(t)),tn.forEach((function(t){return t(e)})),[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 r=i.sent(),n="Unable to retrieve response: "+r,[3,5];case 5:e.response=n,e.responseType=t.type,e.status=t.status,tn.forEach((function(t){return t(e)})),i.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{s(u.next(t))}catch(t){e(t)}}function i(t){try{s(u.throw(t))}catch(t){e(t)}}function s(e){e.done?t(e.value):new a((function(t){t(e.value)})).then(n,i)}s((u=u.apply(r,o||[])).next())}));var r,o,a,u};t.then(S(r),S(r))}function on(t){0===t.status&&(t.traceId=void 0,t.spanId=void 0)}function an(t,e,n){var r;void 0!==un()&&function(t,e){for(var n=Xt(e),r=0,i=t.allowedTracingOrigins;r<i.length;r++){var o=i[r];if(n===o||o instanceof RegExp&&o.test(n))return!0}return!1}(t,e.url)&&(e.traceId=new pn,e.spanId=new pn,n((r=e.traceId,{"x-datadog-origin":"rum","x-datadog-parent-id":e.spanId.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":r.toDecimalString()})))}function un(){return window.crypto||window.msCrypto}var sn,cn,fn,dn,ln,pn=function(){function t(){this.buffer=new Uint8Array(8),un().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}return t.prototype.toString=function(t){for(var e=this.readInt32(0),n=this.readInt32(4),r="";;){var i=e%t*4294967296+n;if(e=Math.floor(e/t),n=Math.floor(i/t),r=(i%t).toString(t)+r,!e&&!n)break}return r},t.prototype.toDecimalString=function(){return this.toString(10)},t.prototype.readInt32=function(t){return 16777216*this.buffer[t]+(this.buffer[t+1]<<16)+(this.buffer[t+2]<<8)+this.buffer[t+3]},t}(),mn=1;function vn(t,e){var n=function(t){return{clearTracingIfCancelled:on,traceFetch:function(e){return an(t,e,(function(t){var n;if(e.input instanceof Request&&!(null===(n=e.init)||void 0===n?void 0:n.headers))e.input=new Request(e.input),Object.keys(t).forEach((function(n){e.input.headers.append(n,t[n])}));else{e.init=r({},e.init);var i=[];e.init.headers instanceof Headers?e.init.headers.forEach((function(t,e){i.push([e,t])})):Array.isArray(e.init.headers)?e.init.headers.forEach((function(t){i.push(t)})):e.init.headers&&Object.keys(e.init.headers).forEach((function(t){i.push([t,e.init.headers[t]])})),e.init.headers=i.concat(J(t))}}))},traceXhr:function(e,n){return an(t,e,(function(t){Object.keys(t).forEach((function(e){n.setRequestHeader(e,t[e])}))}))}}}(e);!function(t,e,n){var r=Qe();r.beforeSend((function(r,i){ue(e,r.url)&&(n.traceXhr(r,i),r.requestIndex=En(),t.notify(bt.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){ue(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(bt.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,spanId:r.spanId,startTime:r.startTime,status:r.status,traceId:r.traceId,type:U.XHR,url:r.url}))}))}(t,e,n),function(t,e,n){var r=en();r.beforeSend((function(r){ue(e,r.url)&&(n.traceFetch(r),r.requestIndex=En(),t.notify(bt.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){ue(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(bt.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,responseType:r.responseType,spanId:r.spanId,startTime:r.startTime,status:r.status,traceId:r.traceId,type:U.FETCH,url:r.url}))}))}(t,e,n)}function En(){var t=mn;return mn+=1,t}function hn(t,e){return t.subscribe(bt.AUTO_ACTION_COMPLETED,(function(e){return t.notify(bt.RAW_RUM_EVENT_COLLECTED,Tn(e))})),e.trackInteractions&&zt(t),{addAction:function(e,n){t.notify(bt.RAW_RUM_EVENT_COLLECTED,r({savedCommonContext:n},Tn(e)))}}}function Tn(t){var e=gn(t)?{action:{error:{count:t.counts.errorCount},id:t.id,loading_time:F(t.duration),long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}}}:void 0;return{customerContext:gn(t)?void 0:t.context,rawRumEvent:s({action:{target:{name:t.name},type:t.type},date:$(t.startTime),type:Ot.ACTION},e),startTime:t.startTime}}function gn(t){return t.type!==Pt.CUSTOM}function yn(t){if(!sn){var e=new wt;!function(t,e){function n(n,r){t.isIntakeUrl(r.url)||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!function(t){return t.status>=500}(r)||e.notify({message:_n(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:l.NETWORK,stack:Cn(r.response,t)||"Failed to load",startTime:r.startTime})}Qe().onRequestComplete((function(t){return n(U.XHR,t)})),en().onRequestComplete((function(t){return n(U.FETCH,t)}))}(t,e),function(t){cn=console.error,console.error=S((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];cn.apply(console,o([e],n)),t.notify({message:o(["console error:",e],n).map(bn).join(" "),source:l.CONSOLE,startTime:performance.now()})}))}(e),function(t){fn=function(e,n,r){var i=p(e,r,"Uncaught"),o=i.stack,a=i.message,u=i.type;t.notify({message:a,stack:o,type:u,source:l.SOURCE,startTime:performance.now()})},b.subscribe(fn)}(e),sn=function(t,e){var n=0,r=new wt;return e.subscribe((function(e){n<t.maxErrorsByMinute?(n+=1,r.notify(e)):n===t.maxErrorsByMinute&&(n+=1,r.notify({message:"Reached max number of errors by minute: "+t.maxErrorsByMinute,source:l.AGENT,startTime:performance.now()}))})),setInterval((function(){return n=0}),P),r}(t,e)}return sn}function bn(t){return"string"==typeof t?t:t instanceof Error?m(C(t)):q(t,void 0,2)}function Cn(t,e){return t&&t.length>e.requestErrorResponseLengthLimit?t.substring(0,e.requestErrorResponseLengthLimit)+"...":t}function _n(t){return U.XHR===t?"XHR":"Fetch"}function On(t,e){return function(t,e){return e.subscribe((function(e){return t.notify(bt.RAW_RUM_EVENT_COLLECTED,Rn(e))})),{addError:function(e,n){var i=e.error,o=e.startTime,a=e.context,u=function(t,e,n){var i=t instanceof Error?C(t):void 0;return r({startTime:e,source:n},p(i,t,"Provided"))}(i,o,e.source);t.notify(bt.RAW_RUM_EVENT_COLLECTED,r({customerContext:a,savedCommonContext:n},Rn(u)))}}}(t,yn(e))}function Rn(t){return{rawRumEvent:{date:$(t.startTime),error:{message:t.message,resource:t.resource?{method:t.resource.method,status_code:t.resource.statusCode,url:t.resource.url}:void 0,source:t.source,stack:t.stack,type:t.type},type:Ot.ERROR},startTime:t.startTime}}function Sn(t){if(performance&&"getEntriesByName"in performance){var e=performance.getEntriesByName(t.url,"resource");if(e.length&&"toJSON"in e[0]){var n,r=e.map((function(t){return t.toJSON()})).filter(re).filter((function(e){return n=e,r=t.startTime,i=wn(t),n.startTime>=r&&wn(n)<=i;var n,r,i}));return 1===r.length?r[0]:2===r.length&&wn((n=r)[0])<=n[1].startTime?r[1]:void 0}}}function wn(t){return t.startTime+t.duration}function In(t,e){t.subscribe(bt.REQUEST_COMPLETED,(function(n){e.isTrackedWithResource()&&t.notify(bt.RAW_RUM_EVENT_COLLECTED,function(t){var e=t.type===U.XHR?x.XHR:x.FETCH,n=Sn(t),r=n?n.startTime:t.startTime,i=n?An(n):void 0,o=function(t){if(!t.traceId||!t.spanId)return;return{_dd:{span_id:t.spanId.toDecimalString(),trace_id:t.traceId.toDecimalString()},resource:{id:W()}}}(t),a=s({date:$(r),resource:{type:e,duration:F(t.duration),method:t.method,status_code:t.status,url:t.url},type:Ot.RESOURCE},o,i);return{startTime:r,rawRumEvent:a}}(n))})),t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(n){var r;e.isTrackedWithResource()&&"resource"===n.entryType&&("xmlhttprequest"!==(r=n).initiatorType&&"fetch"!==r.initiatorType)&&t.notify(bt.RAW_RUM_EVENT_COLLECTED,function(t){var e=te(t),n=An(t),r=function(t){return t.traceId?{_dd:{trace_id:t.traceId}}:void 0}(t),i=s({date:$(t.startTime),resource:{type:e,url:t.name},type:Ot.RESOURCE},r,n);return{startTime:t.startTime,rawRumEvent:i}}(n))}))}function An(t){return{resource:r({duration:(e=t,n=e.duration,i=e.startTime,o=e.responseEnd,F(0===n&&i<o?o-i:n)),size:ae(t)},ne(t))};var e,n,i,o}function Nn(t){return void 0===t&&(t=window),dn||("hidden"===document.visibilityState?dn={timeStamp:0}:(dn={timeStamp:1/0},et(t,L.PAGE_HIDE,(function(t){var e=t.timeStamp;dn.timeStamp=e}),{capture:!0,once:!0}).stop)),dn}function Dn(t,e){var n;function i(t){n=r(r({},n),t),e(n)}var o=function(t,e){return{stop:t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"navigation"===t.entryType&&e({domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd})})).unsubscribe}}(t,i).stop,a=function(t,e){var n=Nn();return{stop:t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"paint"===t.entryType&&"first-contentful-paint"===t.name&&t.startTime<n.timeStamp&&e(t.startTime)})).unsubscribe}}(t,(function(t){return i({firstContentfulPaint:t})})).stop,u=function(t,e,n){var r=Nn(),i=1/0,o=nt(e,[L.POINTER_DOWN,L.KEY_DOWN],(function(t){i=t.timeStamp}),{capture:!0,once:!0}).stop,a=t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"largest-contentful-paint"===t.entryType&&t.startTime<i&&t.startTime<r.timeStamp&&n(t.startTime)})).unsubscribe;return{stop:function(){o(),a()}}}(t,window,(function(t){i({largestContentfulPaint:t})})).stop,s=function(t,e){var n=Nn();return{stop:t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"first-input"===t.entryType&&t.startTime<n.timeStamp&&e({firstInputDelay:t.processingStart-t.startTime,firstInputTime:t.startTime})})).unsubscribe}}(t,(function(t){i({firstInputDelay:t.firstInputDelay,firstInputTime:t.firstInputTime})})).stop;return{stop:function(){o(),a(),u(),s()}}}!function(t){t.INITIAL_LOAD="initial_load",t.ROUTE_CHANGE="route_change"}(ln||(ln={}));var Ln=3e3,xn=5*P;function Un(t,e){var n,r=Mn(e,t,ln.INITIAL_LOAD,document.referrer,0),i=r,o=Dn(e,(function(t){r.updateTimings(t),r.scheduleUpdate()})).stop;function a(){i.isDifferentView(t)?(i.end(),i.triggerUpdate(),i=Mn(e,t,ln.ROUTE_CHANGE,i.url)):(i.updateLocation(t),i.triggerUpdate())}!function(t){var e=history.pushState;history.pushState=S((function(){e.apply(this,arguments),t()}));var n=history.replaceState;history.replaceState=S((function(){n.apply(this,arguments),t()})),et(window,L.POP_STATE,t)}(a),n=a,et(window,L.HASH_CHANGE,n),e.subscribe(bt.SESSION_RENEWED,(function(){i.end(),i=Mn(e,t,ln.ROUTE_CHANGE,i.url)})),e.subscribe(bt.BEFORE_UNLOAD,(function(){i.end(),i.triggerUpdate()}));var u=window.setInterval(S((function(){i.triggerUpdate()})),xn);return{addTiming:function(t,e){void 0===e&&(e=performance.now()),i.addTiming(t,e),i.triggerUpdate()},stop:function(){o(),i.end(),clearInterval(u)}}}function Mn(t,e,n,i,o){void 0===o&&(o=performance.now());var a,u,s,c=W(),f={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},d={},l={},p=0,m=r({},e);t.notify(bt.VIEW_CREATED,{id:c,startTime:o,location:m,referrer:i});var v,E=H(S(O),Ln,{leading:!1}),h=E.throttled,T=E.cancel,g=St(t,(function(t){f=t,h()})).stop,y=function(t,e){var n=t===ln.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&e(Math.max.apply(Math,i))}return{setLoadEvent:function(t){n&&(n=!1,i.push(t),o())},setActivityLoadingTime:function(t){r&&(r=!1,void 0!==t&&i.push(t),o())}}}(n,(function(t){u=t,h()})),b=y.setActivityLoadingTime,C=y.setLoadEvent,_=function(t,e){var n=performance.now();return{stop:Dt(t,(function(t,r){e(t?r-n:void 0)})).stop}}(t,b).stop;function O(){p+=1,t.notify(bt.VIEW_UPDATED,{cumulativeLayoutShift:a,customTimings:l,documentVersion:p,eventCounts:f,id:c,loadingTime:u,loadingType:n,location:m,referrer:i,startTime:o,timings:d,duration:(void 0===s?performance.now():s)-o,isActive:void 0===s})}return ve("layout-shift")?(a=0,v=function(t,e){return{stop:t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"layout-shift"!==t.entryType||t.hadRecentInput||e(t.value)})).unsubscribe}}(t,(function(t){a+=t,h()})).stop):v=V,O(),{scheduleUpdate:h,end:function(){s=performance.now(),g(),_(),v(),t.notify(bt.VIEW_ENDED)},isDifferentView:function(t){return m.pathname!==t.pathname||(e=t.hash,n=e.substr(1),!document.getElementById(n)&&t.hash!==m.hash);var e,n},triggerUpdate:function(){T(),O()},updateTimings:function(t){d=t,void 0!==t.loadEvent&&C(t.loadEvent)},addTiming:function(t,e){l[function(t){var e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&console.warn("Invalid timing name: "+t+", sanitized to: "+e);return e}(t)]=e-o},updateLocation:function(t){m=r({},t)},get url(){return m.href}}}function kn(t,e){return t.subscribe(bt.VIEW_UPDATED,(function(e){return t.notify(bt.RAW_RUM_EVENT_COLLECTED,function(t){var e={_dd:{document_version:t.documentVersion},date:$(t.startTime),type:Ot.VIEW,view:{action:{count:t.eventCounts.userActionCount},cumulative_layout_shift:t.cumulativeLayoutShift,dom_complete:F(t.timings.domComplete),dom_content_loaded:F(t.timings.domContentLoaded),dom_interactive:F(t.timings.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:F(t.timings.firstContentfulPaint),first_input_delay:F(t.timings.firstInputDelay),first_input_time:F(t.timings.firstInputTime),is_active:t.isActive,largest_contentful_paint:F(t.timings.largestContentfulPaint),load_event:F(t.timings.loadEvent),loading_time:F(t.loadingTime),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:F(t.duration)}};Q(t.customTimings)||(e.view.custom_timings=function(t,e){for(var n={},r=0,i=Object.keys(t);r<i.length;r++){var o=i[r];n[o]=e(t[o])}return n}(t.customTimings,F));return{rawRumEvent:e,startTime:t.startTime}}(e))})),Un(e,t)}var Pn,Bn="rum";function Hn(t,e){var n=Me(t.cookieOptions,Bn,(function(e){return function(t,e){var n;n=function(t){return t===Pn.NOT_TRACKED||t===Pn.TRACKED_WITH_RESOURCES||t===Pn.TRACKED_WITHOUT_RESOURCES}(e)?e:j(t.sampleRate)?j(t.resourceSampleRate)?Pn.TRACKED_WITH_RESOURCES:Pn.TRACKED_WITHOUT_RESOURCES:Pn.NOT_TRACKED;return{trackingType:n,isTracked:Wn(n)}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(bt.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Wn(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Pn.TRACKED_WITH_RESOURCES}}}function Wn(t){return t===Pn.TRACKED_WITH_RESOURCES||t===Pn.TRACKED_WITHOUT_RESOURCES}function jn(t,e){var n=function(t,e){var n,r=o(t.rumEndpoint,(function(){return e.notify(bt.BEFORE_UNLOAD)})),i=t.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(e,n){return new h(new E(e,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,n)}function a(t){return s(t,{application:{id:i.applicationId}})}var u=!1;return{add:function(t){u||(r.add(t),n&&n.add(a(t)))},stop:function(){u=!0},upsert:function(t,e){u||(r.upsert(t,e),n&&n.upsert(a(t),e))}}}(t,e);return e.subscribe(bt.RUM_EVENT_COLLECTED,(function(t){t.type===Ot.VIEW?n.upsert(t,t.view.id):n.add(t)})),{stop:function(){n.stop()}}}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(Pn||(Pn={}));var Fn={buildMode:"release",datacenter:"us",sdkVersion:"2.5.2"};var Vn,qn,zn,Gn,Kn=function(t){var e,n=!1,i=(e={},{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t}}),o={},a=function(){},u=new _t,s=function(t){u.add([t,performance.now()])},f=new _t,d=function(t){f.add([t,v()])},p=new _t,m=function(t){p.add([t,v()])};function v(){return c({context:i.get(),user:o})}var E,h,T=(E={init:S((function(e){var r;gt(ht(e))&&yt()&&function(t){return n?(t.silentMultipleInit||console.error("DD_RUM is already initialized."),!1):t&&(t.clientToken||t.publicApiKey)?t.applicationId?void 0===t.sampleRate||K(t.sampleRate)?void 0===t.resourceSampleRate||K(t.resourceSampleRate)?!Array.isArray(t.allowedTracingOrigins)||0===t.allowedTracingOrigins.length||void 0!==t.service||(console.error("Service need to be configured when tracing is enabled"),!1):(console.error("Resource Sample Rate should be a number between 0 and 100"),!1):(console.error("Sample Rate should be a number between 0 and 100"),!1):(console.error("Application ID is not configured, no RUM data will be collected."),!1):(console.error("Client Token is not configured, we will not send any data."),!1)}(e)&&(e.publicApiKey&&(e.clientToken=e.publicApiKey),r=t(e,(function(){return{user:o,context:i.get()}})),d=r.addAction,m=r.addError,s=r.addTiming,a=r.getInternalContext,f.drain((function(t){var e=t[0],n=t[1];return d(e,n)})),p.drain((function(t){var e=t[0],n=t[1];return m(e,n)})),u.drain((function(t){var e=t[0],n=t[1];return s(e,n)})),n=!0)})),addRumGlobalContext:S(i.add),removeRumGlobalContext:S(i.remove),getRumGlobalContext:S(i.get),setRumGlobalContext:S(i.set),getInternalContext:S((function(t){return a(t)})),addAction:S((function(t,e){d({name:t,context:c(e),startTime:performance.now(),type:Pt.CUSTOM})})),addUserAction:function(t,e){T.addAction(t,e)},addError:S((function(t,e,n){var r;void 0===n&&(n=l.CUSTOM),n===l.CUSTOM||n===l.NETWORK||n===l.SOURCE?r=n:(console.error("DD_RUM.addError: Invalid source '"+n+"'"),r=l.CUSTOM),m({error:t,context:c(e),source:r,startTime:performance.now()})})),addTiming:S((function(t){s(t)})),setUser:S((function(t){var e=function(t){if("object"==typeof t&&t){var e=c(t);return"id"in e&&(e.id=String(e.id)),"name"in e&&(e.name=String(e.name)),"email"in e&&(e.email=String(e.email)),e}}(t);e?o=e:console.error("Unsupported user:",t)}))},h=r(r({},E),{onReady:function(t){t()}}),Object.defineProperty(h,"_setDebug",{get:function(){return N},enumerable:!1}),h);return T}((function(t,e){var n=new Rt,r=Tt(t,Fn),i=r.configuration,o=r.internalMonitoring,a=Hn(i,n);o.setExternalContextProvider((function(){return s({application_id:t.applicationId},c.findView(),e().context)}));var u=function(t,e,n,r,i,o){var a=function(t,e){var n,r,i,o=[],a=[];t.subscribe(bt.VIEW_CREATED,(function(t){n&&o.unshift({context:c(),endTime:t.startTime,startTime:n.startTime}),n=t,i=e.getId()})),t.subscribe(bt.VIEW_UPDATED,(function(t){n.id===t.id&&(n=t)})),t.subscribe(bt.AUTO_ACTION_CREATED,(function(t){r=t})),t.subscribe(bt.AUTO_ACTION_COMPLETED,(function(t){r&&a.unshift({context:f(),endTime:r.startTime+t.duration,startTime:r.startTime}),r=void 0})),t.subscribe(bt.AUTO_ACTION_DISCARDED,(function(){r=void 0})),t.subscribe(bt.SESSION_RENEWED,(function(){o=[],a=[],n=void 0,r=void 0}));var u=setInterval(S((function(){s(o,Ve),s(a,qe)})),ze);function s(t,e){for(var n=performance.now()-e;t.length>0&&t[t.length-1].startTime<n;)t.pop()}function c(){return{session:{id:i},view:{id:n.id,referrer:n.referrer,url:n.location.href}}}function f(){return{action:{id:r.id}}}function d(t,e,n,r){if(void 0===r)return n?t():void 0;if(n&&r>=n.startTime)return t();for(var i=0,o=e;i<o.length;i++){var a=o[i];if(r>a.endTime)break;if(r>=a.startTime)return a.context}}return{findAction:function(t){return d(f,a,r,t)},findView:function(t){return d(c,o,n,t)},stop:function(){clearInterval(u)}}}(n,i),u=jn(r,n);Re(t,r,n,i,a,o),function(t){t.subscribe(bt.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("longtask"===e.entryType){var n={date:$(e.startTime),long_task:{duration:F(e.duration)},type:Ot.LONG_TASK};t.notify(bt.RAW_RUM_EVENT_COLLECTED,{rawRumEvent:n,startTime:e.startTime})}}))}(n),In(n,i);var s=kn(n,e).addTiming,c=On(n,r).addError;return{addAction:hn(n,r).addAction,addError:c,parentContexts:a,addTiming:s,stop:function(){u.stop()}}}(t.applicationId,location,n,i,a,e),c=u.parentContexts,f=u.addError,d=u.addAction,l=u.addTiming;vn(n,i),Ee(n,i),Yt(n);var p=function(t,e,n){return{get:function(r){var i=n.findView(r);if(e.isTracked()&&i&&i.session.id){var o=n.findAction(r);return{application_id:t,session_id:i.session.id,user_action:o?{id:o.action.id}:void 0,view:i.view}}}}}(t.applicationId,a,c);return{addAction:d,addError:f,addTiming:l,configuration:i,lifeCycle:n,parentContexts:c,session:a,getInternalContext:p.get}}));Vn=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}(),zn=Kn,Gn=Vn[qn="DD_RUM"],Vn[qn]=zn,Gn&&Gn.q&&Gn.q.forEach((function(t){return t()}))}]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}({2:function(t,e,n){"use strict";n.r(e),n.d(e,"datadogRum",(function(){return ur}));var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function o(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}var a=function(t){return Array.isArray(t)},u=function(t){return!Array.isArray(t)&&"object"==typeof t&&null!==t};function s(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];null!=o&&(t=d(t,o,f()))}return t}function c(t){return d(void 0,t,f())}function f(){if("undefined"!=typeof WeakSet){var t=new WeakSet;return{hasAlreadyBeenSeen:function(e){var n=t.has(e);return n||t.add(e),n}}}var e=[];return{hasAlreadyBeenSeen:function(t){var n=e.indexOf(t)>=0;return n||e.push(t),n}}}function d(t,e,n){if(void 0===e)return t;if(!u(e)&&!a(e))return e;if(!n.hasAlreadyBeenSeen(e)){if(u(e)&&(void 0===t||u(t))){var r=t||{};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=d(r[i],e[i],n));return r}if(a(e)&&(void 0===t||a(t))){(r=t||[]).length=Math.max(r.length,e.length);for(var o=0;o<e.length;o+=1)r[o]=d(r[o],e[o],n);return r}return e}}var l={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source"};function p(t,e,n){return t&&(void 0!==t.message||e instanceof Error)?{message:t.message||"Empty message",stack:m(t),type:t.name}:{message:n+" "+ot(e),stack:"No stack, consider using an instance of Error",type:t&&t.name}}function m(t){var e=(t.name||"Error")+": "+t.message;return t.stack.forEach((function(t){var n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?"("+t.args.join(", ")+")":"",i=t.line?":"+t.line:"",o=t.line&&t.column?":"+t.column:"";e+="\n at "+n+r+" @ "+t.url+i+o})),e}var v=/[^\u0000-\u007F]/,E=function(){function t(t,e,n){void 0===n&&(n=!1),this.endpointUrl=t,this.bytesLimit=e,this.withBatchTime=n}return t.prototype.send=function(t,e){var n=this.withBatchTime?function(t){return t+(-1===t.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&e<this.bytesLimit&&navigator.sendBeacon(n,t))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(t)},t}();var h=function(){function t(t,e,n,r,i,o){void 0===o&&(o=it),this.request=t,this.maxSize=e,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 t.prototype.add=function(t){this.addOrUpdate(t)},t.prototype.upsert=function(t,e){this.addOrUpdate(t,e)},t.prototype.flush=function(){if(0!==this.bufferMessageCount){var t=o(this.pushOnlyBuffer,(e=this.upsertBuffer,n=[],Object.keys(e).forEach((function(t){n.push(e[t])})),n));this.request.send(t.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var e,n},t.prototype.sizeInBytes=function(t){return v.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length},t.prototype.addOrUpdate=function(t,e){var n=this.process(t),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(e)&&this.remove(e),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(r,i,e),this.isFull()&&this.flush())},t.prototype.process=function(t){var e=ot(t);return{processedMessage:e,messageBytesSize:this.sizeInBytes(e)}},t.prototype.push=function(t,e,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=t:this.pushOnlyBuffer.push(t),this.bufferBytesSize+=e,this.bufferMessageCount+=1},t.prototype.remove=function(t){var e=this.upsertBuffer[t];delete this.upsertBuffer[t];var n=this.sizeInBytes(e);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},t.prototype.hasMessageFor=function(t){return void 0!==t&&void 0!==this.upsertBuffer[t]},t.prototype.willReachedBytesLimitWith=function(t){return this.bufferBytesSize+t+1>=this.bytesLimit},t.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},t.prototype.flushPeriodically=function(){var t=this;setTimeout((function(){t.flush(),t.flushPeriodically()}),this.flushTimeout)},t.prototype.flushOnVisibilityHidden=function(){var t=this;navigator.sendBeacon&&(Et(window,K.BEFORE_UNLOAD,this.beforeUnloadCallback),Et(document,K.VISIBILITY_CHANGE,(function(){"hidden"===document.visibilityState&&t.flush()})),Et(window,K.BEFORE_UNLOAD,(function(){return t.flush()})))},t}(),T=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function g(t){if(b){if(y===t)return;N()}var e=L(t);throw b=e,y=t,setTimeout((function(){y===t&&N()}),e.incomplete?2e3:0),t}var y,b,C,_,O,R=[];function S(t){!function(){if(_)return;C=window.onerror,window.onerror=j(I),_=!0}(),function(){if(O)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=j(A),O=!0}(),R.push(t)}function w(t,e,n){var r;if(R.forEach((function(i){try{i(t,e,n)}catch(t){r=t}})),r)throw r}function I(t,e,n,r,i){if(b)M(b,e,n),N();else if(i)w(L(i),!0,i);else{var o,a={url:e,column:r,line:n},u=t;if("[object String]"==={}.toString.call(t)){var s=T.exec(u);s&&(o=s[1],u=s[2])}w({name:o,message:"string"==typeof u?u:void 0,stack:[a]},!0,t)}return!!C&&C.apply(this,arguments)}function A(t){var e=t.reason||"Empty reason";w(L(e),!0,e)}function N(){var t=b,e=y;b=void 0,y=void 0,w(t,!1,e)}var D="?";function L(t,e){var n,r=void 0===e?0:+e;try{if(n=function(t){var e=P(t,"stacktrace");if(!e)return;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=e.split("\n"),a=[],u=0;u<o.length;u+=2){var s=void 0;r.exec(o[u])?(n=r.exec(o[u]),s={args:[],column:void 0,func:n[3],line:+n[1],url:n[2]}):i.exec(o[u])&&(n=i.exec(o[u]),s={args:n[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=D),s.context=[o[u+1]],a.push(s))}if(!a.length)return;return{stack:a,message:P(t,"message"),name:P(t,"name")}}(t))return n}catch(t){if(U)throw t}try{if(n=function(t){var e=P(t,"stack");if(!e)return;for(var n,r,i,o,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,d=e.split("\n"),l=[],p=0,m=d.length;p<m;p+=1){if(a.exec(d[p])){var v=(i=a.exec(d[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=f.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),o={args:v?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||D,line:i[3]?+i[3]:void 0,url:v?void 0:i[2]}}else if(s.exec(d[p]))i=s.exec(d[p]),o={args:[],column:i[4]?+i[4]:void 0,func:i[1]||D,line:+i[3],url:i[2]};else{if(!u.exec(d[p]))continue;i=u.exec(d[p]),n=i[3]&&i[3].indexOf(" > eval")>-1,r=c.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==p||i[5]||void 0===t.columnNumber||(l[0].column=t.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||D,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=D),l.push(o)}if(!l.length)return;return{stack:l,message:P(t,"message"),name:P(t,"name")}}(t))return n}catch(t){if(U)throw t}try{if(n=function(t){var e=P(t,"message");if(!e)return;var n=e.split("\n");if(n.length<4)return;var r,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,u=[],s=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in s)d=s,l=f,Object.prototype.hasOwnProperty.call(d,l)&&!s[f].src&&c.push(s[f]);var d,l;for(var p=2;p<n.length;p+=2){var m=void 0;if(i.exec(n[p]))r=i.exec(n[p]),m={args:[],column:void 0,func:r[3],line:+r[1],url:r[2]};else if(o.exec(n[p]))r=o.exec(n[p]),m={args:[],column:void 0,func:r[4],line:+r[1],url:r[3]};else if(a.exec(n[p])){r=a.exec(n[p]);var v=window.location.href.replace(/#.*$/,"");m={url:v,args:[],column:void 0,func:"",line:+r[1]}}m&&(m.func||(m.func=D),m.context=[n[p+1]],u.push(m))}if(!u.length)return;return{stack:u,message:n[0],name:P(t,"name")}}(t))return n}catch(t){if(U)throw t}try{if(n=k(t,r+1))return n}catch(t){if(U)throw t}return{message:P(t,"message"),name:P(t,"name"),stack:[]}}var x,U=!1;function M(t,e,n){var r={url:e,line:n?+n:void 0};if(r.url&&r.line){t.incomplete=!1;var i=t.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),t.partial=!0,!0}return t.incomplete=!0,!1}function k(t,e){for(var n,r,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],a={},u=!1,s=k.caller;s&&!u;s=s.caller)s!==L&&s!==g&&(r={args:[],column:void 0,func:D,line:void 0,url:void 0},n=i.exec(s.toString()),s.name?r.func=s.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[s.toString()]?u=!0:a[s.toString()]=!0,o.push(r));e&&o.splice(0,e);var c={stack:o,message:P(t,"message"),name:P(t,"name")};return M(c,P(t,"sourceURL")||P(t,"fileName"),P(t,"line")||P(t,"lineNumber")),c}function P(t,e){if("object"==typeof t&&t&&e in t){var n=t[e];return"string"==typeof n?n:void 0}}!function(t){t.info="info",t.error="error"}(x||(x={}));var B,H={maxMessagesPerPage:0,sentMessageCount:0};function W(t){if(t.internalMonitoringEndpoint){var e=function(t){var e,n=r(t.internalMonitoringEndpoint);void 0!==t.replica&&(e=r(t.replica.internalMonitoringEndpoint));function r(e){return new h(new E(e,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout)}return{add:function(t){var r=function(t){return s({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==B?B():{},t)}(t);n.add(r),e&&e.add(r)}}}(t);!function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];e.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))}(H,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){B=t}}}function j(t){return function(){return V(t,this,arguments)}}function V(t,e,n){try{return t.apply(e,n)}catch(t){G(t);try{!function(t){q(r(r({},function(t){if(t instanceof Error){var e=L(t);return{error:{kind:e.name,stack:m(e)},message:e.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+ot(t)}}(t)),{status:x.error}))}(t)}catch(t){G(t)}}}function F(t,e){!function(t){H.debugMode&&console.log("[MONITORING MESSAGE]",t)}(t),q(r(r({message:t},e),{status:x.info}))}function q(t){H.batch&&H.sentMessageCount<H.maxMessagesPerPage&&(H.sentMessageCount+=1,H.batch.add(t))}function z(t){H.debugMode=t}function G(t){H.debugMode&&console.warn("[INTERNAL ERROR]",t)}var K,Y,$,X,J=1e3,Q=60*J,Z=60*Q;function tt(t,e,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,a=!1,u=!1;return{throttled:function(){a?u=!0:(i?t():u=!0,a=!0,r=setTimeout((function(){o&&u&&t(),a=!1,u=!1}),e))},cancel:function(){clearTimeout(r),a=!1,u=!1}}}function et(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,et)}function nt(t){return 0!==t&&100*Math.random()<=t}function rt(t){return"number"!=typeof t?t:+(1e6*t).toFixed(0)}function it(){}function ot(t,e,n){if(null==t)return JSON.stringify(t);var r=[!1,void 0];at(t)&&(r=[!0,t.toJSON],delete t.toJSON);var i,o,a=[!1,void 0];"object"==typeof t&&at(i=Object.getPrototypeOf(t))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(t,e,n)}catch(t){o="<error: unable to serialize object>"}finally{r[0]&&(t.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function at(t){return"object"==typeof t&&null!==t&&t.hasOwnProperty("toJSON")}function ut(t,e){return-1!==t.indexOf(e)}function st(t){return ct(t)&&t>=0&&t<=100}function ct(t){return"number"==typeof t}function ft(t){return Math.floor(dt()+t)}function dt(){return void 0===X&&(X=performance.timing.navigationStart),X}function lt(t){return Object.keys(t).map((function(e){return[e,t[e]]}))}function pt(t){return 0===Object.keys(t).length}function mt(t){if(t.origin)return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return t.protocol+"//"+e}function vt(t,e){var n=new RegExp("(?:^|;)\\s*"+e+"\\s*=\\s*([^;]+)").exec(t);return n?n[1]:void 0}function Et(t,e,n,r){return ht(t,[e],n,r)}function ht(t,e,n,r){var i=void 0===r?{}:r,o=i.once,a=i.capture,u=i.passive,s=j(o?function(t){f(),n(t)}:n),c=u?{capture:a,passive:u}:a;e.forEach((function(e){return t.addEventListener(e,s,c)}));var f=function(){return e.forEach((function(e){return t.removeEventListener(e,s,c)}))};return{stop:f}}!function(t){t.BEFORE_UNLOAD="beforeunload",t.CLICK="click",t.KEY_DOWN="keydown",t.LOAD="load",t.POP_STATE="popstate",t.SCROLL="scroll",t.TOUCH_START="touchstart",t.VISIBILITY_CHANGE="visibilitychange",t.DOM_CONTENT_LOADED="DOMContentLoaded",t.POINTER_DOWN="pointerdown",t.POINTER_UP="pointerup",t.POINTER_CANCEL="pointercancel",t.HASH_CHANGE="hashchange",t.PAGE_HIDE="pagehide",t.MOUSE_DOWN="mousedown",t.FOCUS="focus",t.BLUR="blur"}(K||(K={})),function(t){t.DOCUMENT="document",t.XHR="xhr",t.BEACON="beacon",t.FETCH="fetch",t.CSS="css",t.JS="js",t.IMAGE="image",t.FONT="font",t.MEDIA="media",t.OTHER="other"}(Y||(Y={})),function(t){t.FETCH="fetch",t.XHR="xhr"}($||($={}));var Tt,gt,yt=J;function bt(t,e,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",u=r&&r.domain?";domain="+r.domain:"",s=r&&r.secure?";secure":"";document.cookie=t+"="+e+";"+o+";path=/;samesite="+a+u+s}function Ct(t){return vt(document.cookie,t)}var _t={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay",trace:"trace"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0,trace:"public-trace"}},Ot={EU:"eu",US:"us"},Rt=((gt={})[Ot.EU]="datadoghq.eu",gt[Ot.US]="datadoghq.com",gt),St=[Rt[Ot.US],Rt[Ot.EU]];function wt(t,e){var n={applicationId:t.applicationId,buildMode:e.buildMode,clientToken:t.clientToken,env:t.env,proxyHost:t.proxyHost,sdkVersion:e.sdkVersion,service:t.service,site:t.site||Rt[t.datacenter||e.datacenter],version:t.version},i=function(t,e){return!e.useAlternateIntakeDomains&&ut(St,t)?"classic":"alternate"}(n.site,t),o=function(t,e,n){if(e.proxyHost)return["https://"+e.proxyHost+"/v1/input/"];var r=[e.site];e.buildMode===Nt.STAGING&&n&&r.push(Rt[Ot.US]);for(var i=[],o=Object.keys(_t[t]),a=0,u=r;a<u.length;a++)for(var s=u[a],c=0,f=o;c<f.length;c++){var d=f[c];i.push("https://"+It(t,d,s)+"/v1/input/")}return i}(i,n,void 0!==t.replica),a={isIntakeUrl:function(t){return o.some((function(e){return 0===t.indexOf(e)}))},logsEndpoint:At(i,"logs",n),rumEndpoint:At(i,"rum",n),sessionReplayEndpoint:At(i,"sessionReplay",n),traceEndpoint:At(i,"trace",n)};if(t.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=At(i,"logs",n,"browser-agent-internal-monitoring")),n.buildMode===Nt.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),n.buildMode===Nt.STAGING&&void 0!==t.replica){var u=r(r({},n),{applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,site:Rt[Ot.US]});a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:At(i,"logs",u,"browser-agent-internal-monitoring"),logsEndpoint:At(i,"logs",u),rumEndpoint:At(i,"rum",u)}}return a}function It(t,e,n){return"classic"===t&&function(t,e){var n=_t.classic[t];return n&&n+"-http-intake.logs."+e}(e,n)||function(t,e){var n=_t.alternate[t],r=e.split("."),i=r.pop(),o=r.join("-")+"."+i;return n+".browser-intake-"+o}(e,n)}function At(t,e,n,r){var i="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),o=It(t,e,n.site),a=n.proxyHost?n.proxyHost:o,u=n.proxyHost?"ddhost="+o+"&":"",s=""+(n.applicationId?"_dd.application_id="+n.applicationId+"&":"")+u+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(i);return"https://"+a+"/v1/input/"+n.clientToken+"?"+s}var Nt,Dt={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:30*J,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Lt(t){var e={};return e.secure=function(t){return!!t.useSecureSessionCookie||!!t.useCrossSiteSessionCookie}(t),e.crossSite=!!t.useCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===Tt){for(var t="dd_site_test_"+et(),e=window.location.hostname.split("."),n=e.pop();e.length&&!Ct(t);)n=e.pop()+"."+n,bt(t,"test",J,{domain:n});Tt=n}return Tt}()),e}function xt(t,e){var n=function(t,e){var n=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],i=r(r({beforeSend:t.beforeSend,cookieOptions:Lt(t),isEnabled:function(t){return ut(n,t)},service:t.service},wt(t,e)),Dt);return"allowedTracingOrigins"in t&&(i.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(i.sampleRate=t.sampleRate),"resourceSampleRate"in t&&(i.resourceSampleRate=t.resourceSampleRate),"trackInteractions"in t&&(i.trackInteractions=!!t.trackInteractions),i}(t,e);return{configuration:n,internalMonitoring:W(n)}}function Ut(t){return!!function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{var e="dd_cookie_test_"+et();return bt(e,"test",J,t),"test"===Ct(e)}catch(t){return console.error(t),!1}}(t)||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function Mt(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(t){t.RELEASE="release",t.STAGING="staging",t.E2E_TEST="e2e-test"}(Nt||(Nt={}));var kt,Pt,Bt,Ht,Wt=1e4,jt=function(){function t(t){void 0===t&&(t=Wt),this.limit=t,this.buffer=[]}return t.prototype.add=function(t){this.buffer.push(t)>this.limit&&this.buffer.splice(0,1)},t.prototype.drain=function(t){this.buffer.forEach((function(e){return t(e)})),this.buffer.length=0},t}();!function(t){t.ACTION="action",t.ERROR="error",t.LONG_TASK="long_task",t.VIEW="view",t.RESOURCE="resource"}(kt||(kt={})),function(t){t.INITIAL_LOAD="initial_load",t.ROUTE_CHANGE="route_change"}(Pt||(Pt={})),function(t){t.CLICK="click",t.CUSTOM="custom"}(Bt||(Bt={})),function(t){t[t.PERFORMANCE_ENTRY_COLLECTED=0]="PERFORMANCE_ENTRY_COLLECTED",t[t.AUTO_ACTION_CREATED=1]="AUTO_ACTION_CREATED",t[t.AUTO_ACTION_COMPLETED=2]="AUTO_ACTION_COMPLETED",t[t.AUTO_ACTION_DISCARDED=3]="AUTO_ACTION_DISCARDED",t[t.VIEW_CREATED=4]="VIEW_CREATED",t[t.VIEW_UPDATED=5]="VIEW_UPDATED",t[t.VIEW_ENDED=6]="VIEW_ENDED",t[t.REQUEST_STARTED=7]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=8]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=9]="SESSION_RENEWED",t[t.DOM_MUTATED=10]="DOM_MUTATED",t[t.BEFORE_UNLOAD=11]="BEFORE_UNLOAD",t[t.RAW_RUM_EVENT_COLLECTED=12]="RAW_RUM_EVENT_COLLECTED",t[t.RUM_EVENT_COLLECTED=13]="RUM_EVENT_COLLECTED"}(Ht||(Ht={}));var Vt,Ft=function(){function t(){this.callbacks={}}return t.prototype.notify=function(t,e){var n=this.callbacks[t];n&&n.forEach((function(t){return t(e)}))},t.prototype.subscribe=function(t,e){var n=this;return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:function(){n.callbacks[t]=n.callbacks[t].filter((function(t){return e!==t}))}}},t}();function qt(t){var e,n=function(){var t,e=window;if(e.Zone){var n=e.Zone.__symbol__("MutationObserver");t=e[n]}return t||(t=e.MutationObserver),t}();return n&&(e=new n(j((function(){t.notify(Ht.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){e&&e.disconnect()}}}function zt(t){return Kt(t,mt(window.location)).href}function Gt(t){return mt(Kt(t))}function Kt(t,e){if(function(){if(void 0!==Vt)return Vt;try{var t=new URL("http://test/path");return Vt="http://test/path"===t.href}catch(t){Vt=!1}return Vt}())return void 0!==e?new URL(t,e):new URL(t);if(void 0===e&&!/:/.test(t))throw new Error("Invalid URL: '"+t+"'");var n=document,r=n.createElement("a");if(void 0!==e){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=e,n.head.appendChild(i),n.body.appendChild(r)}return r.href=t,r}var Yt="initial_document",$t=[[Y.DOCUMENT,function(t){return Yt===t}],[Y.XHR,function(t){return"xmlhttprequest"===t}],[Y.FETCH,function(t){return"fetch"===t}],[Y.BEACON,function(t){return"beacon"===t}],[Y.CSS,function(t,e){return/\.css$/i.test(e)}],[Y.JS,function(t,e){return/\.js$/i.test(e)}],[Y.IMAGE,function(t,e){return ut(["image","img","icon"],t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)}],[Y.FONT,function(t,e){return null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)}],[Y.MEDIA,function(t,e){return ut(["audio","video"],t)||null!==/\.(mp3|mp4)$/i.exec(e)}]];function Xt(t){var e=t.name;if(!function(t){try{return!!Kt(t)}catch(t){return!1}}(e))return F('Failed to construct URL for "'+t.name+'"'),Y.OTHER;for(var n=function(t){var e=Kt(t).pathname;return"/"===e[0]?e:"/"+e}(e),r=0,i=$t;r<i.length;r++){var o=i[r],a=o[0];if((0,o[1])(t.initiatorType,n))return a}return Y.OTHER}function Jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=1;n<t.length;n+=1)if(t[n-1]>t[n])return!1;return!0}function Qt(t){var e=Zt(t);if(e){var n=e.startTime,r=e.fetchStart,i=e.redirectStart,o=e.redirectEnd,a=e.domainLookupStart,u=e.domainLookupEnd,s=e.connectStart,c=e.secureConnectionStart,f=e.connectEnd,d=e.requestStart,l=e.responseStart,p={download:ee(n,l,e.responseEnd),first_byte:ee(n,d,l)};return f!==r&&(p.connect=ee(n,s,f),Jt(s,c,f)&&(p.ssl=ee(n,c,f))),u!==r&&(p.dns=ee(n,a,u)),te(t)&&(p.redirect=ee(n,i,o)),p}}function Zt(t){if(Jt(t.startTime,t.fetchStart,t.domainLookupStart,t.domainLookupEnd,t.connectStart,t.connectEnd,t.requestStart,t.responseStart,t.responseEnd)){if(!te(t))return t;var e=t.redirectStart,n=t.redirectEnd;if(e<t.startTime&&(e=t.startTime),n<t.startTime&&(n=t.fetchStart),Jt(t.startTime,e,n,t.fetchStart))return r(r({},t),{redirectEnd:n,redirectStart:e})}}function te(t){return t.fetchStart!==t.startTime}function ee(t,e,n){return{duration:rt(n-e),start:rt(e-t)}}function ne(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function re(t,e){return e&&!t.isIntakeUrl(e)}var ie,oe=2*Q;function ae(t){var e=function(t){var e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return ue(e&&e.content,n&&n.content)}(t)||function(t){var e=function(t){for(var e=0;e<t.childNodes.length;e+=1){if(n=se(t.childNodes[e]))return n}if(t.body)for(e=t.body.childNodes.length-1;e>=0;e-=1){var n,r=t.body.childNodes[e];if(n=se(r))return n;if(!ce(r))break}}(t);if(!e)return;return ue(vt(e,"trace-id"),vt(e,"trace-time"))}(t);if(e&&!(e.traceTime<=Date.now()-oe))return e.traceId}function ue(t,e){var n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function se(t){if(t&&function(t){return"#comment"===t.nodeName}(t)){var e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function ce(t){return"#text"===t.nodeName}function fe(){return void 0!==window.performance&&"getEntries"in performance}function de(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}function le(t,e){var n;if(n=function(n){Ee(t,e,n)},pe("interactive",(function(){var t,e={entryType:"resource",initiatorType:Yt,traceId:ae(document)};if(de("navigation")&&performance.getEntriesByType("navigation").length>0){var i=performance.getEntriesByType("navigation")[0];t=r(r({},i.toJSON()),e)}else{var o=me();t=r(r(r({},o),{decodedBodySize:0,duration:o.responseEnd,name:window.location.href,startTime:0}),e)}n(t)})),fe()&&ve(t,e,performance.getEntries()),window.PerformanceObserver){new PerformanceObserver(j((function(n){return ve(t,e,n.getEntries())}))).observe({entryTypes:["resource","navigation","longtask","paint","largest-contentful-paint","first-input","layout-shift"]}),fe()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}de("navigation")||function(t){function e(){t(r(r({},me()),{entryType:"navigation"}))}pe("complete",(function(){setTimeout(j(e))}))}((function(n){Ee(t,e,n)})),de("first-input")||function(t){var e=Date.now(),n=!1,r=ht(window,[K.CLICK,K.MOUSE_DOWN,K.KEY_DOWN,K.TOUCH_START,K.POINTER_DOWN],(function(t){if(t.cancelable){var e={entryType:"first-input",processingStart:performance.now(),startTime:t.timeStamp};t.type===K.POINTER_DOWN?function(t){ht(window,[K.POINTER_UP,K.POINTER_CANCEL],(function(e){e.type===K.POINTER_UP&&i(t)}),{once:!0})}(e):i(e)}}),{passive:!0,capture:!0}).stop;function i(i){if(!n){n=!0,r();var o=i.processingStart-i.startTime;o>=0&&o<Date.now()-e&&t(i)}}}((function(n){Ee(t,e,n)}))}function pe(t,e){if(document.readyState===t||"complete"===document.readyState)e();else{var n="complete"===t?K.LOAD:K.DOM_CONTENT_LOADED;Et(window,n,e,{once:!0})}}function me(){var t={},e=performance.timing;for(var n in e)ct(e[n])&&(t[n]=0===e[n]?0:e[n]-dt());return t}function ve(t,e,n){n.forEach((function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType&&"largest-contentful-paint"!==n.entryType&&"first-input"!==n.entryType&&"layout-shift"!==n.entryType||Ee(t,e,n)}))}function Ee(t,e,n){(function(t){return"navigation"===t.entryType&&t.loadEventEnd<=0})(n)||function(t,e){return"resource"===e.entryType&&!re(t,e.name)}(e,n)||t.notify(Ht.PERFORMANCE_ENTRY_COLLECTED,n)}function he(t,e,n){var r=c(t);try{n(r)}catch(e){return console.error(e),t}return e.forEach((function(e){var n=Te(t,e),i=Te(r,e);"string"==typeof n&&"string"==typeof i&&function(t,e,n){for(var r=t,i=e.split("."),o=0;o<i.length;o+=1){var a=i[o];if(!ge(r,a))return;o!==i.length-1?r=r[a]:r[a]=n}}(t,e,i)})),t}function Te(t,e){for(var n=t,r=0,i=e.split(".");r<i.length;r++){var o=i[r];if(!ge(n,o))return;n=n[o]}return n}function ge(t,e){return"object"==typeof t&&null!==t&&e in t}!function(t){t.SYNTHETICS="synthetics",t.USER="user"}(ie||(ie={}));var ye=["view.url","view.referrer","action.target.name","error.message","error.stack","error.resource.url","resource.url"];function be(t,e,n,r,i,o){n.subscribe(Ht.RAW_RUM_EVENT_COLLECTED,(function(a){var u,c=a.startTime,f=a.rawRumEvent,d=a.savedCommonContext,l=a.customerContext,p=i.findView(c);if(r.isTracked()&&p&&p.session.id){var m=i.findAction(c),v=d||o(),E={_dd:{format_version:2},application:{id:t},date:(new Date).getTime(),service:e.service,session:{has_replay:v.hasReplay,type:void 0===window._DATADOG_SYNTHETICS_BROWSER?ie.USER:ie.SYNTHETICS}},h=(u=f,-1!==[kt.ERROR,kt.RESOURCE,kt.LONG_TASK].indexOf(u.type)?s(E,p,m,f):s(E,p,f)),T=s(v.context,l);pt(T)||(h.context=T),pt(v.user)||(h.usr=v.user),e.beforeSend&&he(h,ye,e.beforeSend),n.notify(Ht.RUM_EVENT_COLLECTED,h)}}))}var Ce=function(){function t(){this.observers=[]}return t.prototype.subscribe=function(t){this.observers.push(t)},t.prototype.notify=function(t){this.observers.forEach((function(e){return e(t)}))},t}(),_e="_dd",Oe="_dd_r",Re="_dd_l",Se="rum",we="logs";var Ie="_dd_s",Ae=15*Q,Ne=4*Z,De=Q;function Le(t,e,n){var r=function(t,e){var n,r,i=!1,o=function(){i=!0,clearTimeout(n),n=setTimeout((function(){i=!1}),yt)};return{get:function(){return i?r:(r=Ct(t),o(),r)},set:function(n,i){bt(t,n,i,e),r=n,o()}}}(Ie,t);!function(t){var e=t.get(),n=Ct(_e),r=Ct(Oe),i=Ct(Re);if(!e){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[we]=i),r&&/^[012]$/.test(r)&&(o[Se]=r),ke(o,t)}}(r);var i=new Ce,o=Me(r).id,a=tt(j((function(){var t=Me(r),a=n(t[e]),u=a.trackingType,s=a.isTracked;t[e]=u,s&&!t.id&&(t.id=et(),t.created=String(Date.now())),ke(t,r),s&&o!==t.id&&(o=t.id,i.notify())})),yt).throttled;return a(),function(t){var e=ht(window,[K.CLICK,K.TOUCH_START,K.KEY_DOWN,K.SCROLL],t,{capture:!0,passive:!0}).stop;Be.push(e)}(a),function(t){var e=j((function(){"visible"===document.visibilityState&&t()})),n=Et(document,K.VISIBILITY_CHANGE,e).stop;Be.push(n);var r=setInterval(e,De);Be.push((function(){clearInterval(r)}))}((function(){ke(Me(r),r)})),{getId:function(){return Me(r).id},getTrackingType:function(){return Me(r)[e]},renewObservable:i}}var xe=/^([a-z]+)=([a-z0-9-]+)$/,Ue="&";function Me(t){var e=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf(Ue)||xe.test(t))})(e)&&e.split(Ue).forEach((function(t){var e=xe.exec(t);if(null!==e){var r=e[1],i=e[2];n[r]=i}}));return n}(t);return function(t){return(void 0===t.created||Date.now()-Number(t.created)<Ne)&&(void 0===t.expire||Date.now()<Number(t.expire))}(e)?e:(Pe(t),{})}function ke(t,e){if(pt(t))Pe(e);else{t.expire=String(Date.now()+Ae);var n=lt(t).map((function(t){return t[0]+"="+t[1]})).join(Ue);e.set(n,Ae)}}function Pe(t){t.set("",0)}var Be=[];var He,We=Ne,je=5*Q,Ve=Q;var Fe,qe,ze,Ge,Ke=[],Ye=[];function $e(){return He||(Fe=XMLHttpRequest.prototype.open,qe=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=function(t,e){var n=this;return V((function(){n._datadog_xhr={method:t,startTime:-1,url:zt(e)}})),Fe.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){var t=this;return V((function(){if(t._datadog_xhr){t._datadog_xhr.startTime=performance.now();var e=t.onreadystatechange;t.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&V(r),e&&e.apply(this,arguments)};var n=!1,r=function(){n||(n=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,Ye.forEach((function(e){return e(t._datadog_xhr)})))};t.addEventListener("loadend",j(r)),Ke.forEach((function(e){return e(t._datadog_xhr,t)}))}})),qe.apply(this,arguments)},He={beforeSend:function(t){Ke.push(t)},onRequestComplete:function(t){Ye.push(t)}}),He}var Xe=[],Je=[];function Qe(){return ze||(!function(){if(!window.fetch)return;Ge=window.fetch,window.fetch=function(t,e){var n,r=V(Ze,null,[t,e]);return r?V(tn,null,[n=Ge.call(this,r.input,r.init),r]):n=Ge.call(this,t,e),n}}(),ze={beforeSend:function(t){Xe.push(t)},onRequestComplete:function(t){Je.push(t)}}),ze}function Ze(t,e){var n=e&&e.method||"object"==typeof t&&t.method||"GET",r=zt("object"==typeof t&&t.url||t),i={init:e,input:t,method:n,startTime:performance.now(),url:r};return Xe.forEach((function(t){return t(i)})),i}function tn(t,e){var n=this,r=function(t){return r=n,o=void 0,u=function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return e.duration=performance.now()-e.startTime,"stack"in t||t instanceof Error?(e.status=0,e.response=m(L(t)),Je.forEach((function(t){return t(e)})),[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 r=i.sent(),n="Unable to retrieve response: "+r,[3,5];case 5:e.response=n,e.responseType=t.type,e.status=t.status,Je.forEach((function(t){return t(e)})),i.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{s(u.next(t))}catch(t){e(t)}}function i(t){try{s(u.throw(t))}catch(t){e(t)}}function s(e){e.done?t(e.value):new a((function(t){t(e.value)})).then(n,i)}s((u=u.apply(r,o||[])).next())}));var r,o,a,u};t.then(j(r),j(r))}function en(t){0===t.status&&(t.traceId=void 0,t.spanId=void 0)}function nn(t,e,n){var r;void 0!==rn()&&function(t,e){for(var n=Gt(e),r=0,i=t.allowedTracingOrigins;r<i.length;r++){var o=i[r];if(n===o||o instanceof RegExp&&o.test(n))return!0}return!1}(t,e.url)&&(e.traceId=new on,e.spanId=new on,n((r=e.traceId,{"x-datadog-origin":"rum","x-datadog-parent-id":e.spanId.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":r.toDecimalString()})))}function rn(){return window.crypto||window.msCrypto}var on=function(){function t(){this.buffer=new Uint8Array(8),rn().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}return t.prototype.toString=function(t){for(var e=this.readInt32(0),n=this.readInt32(4),r="";;){var i=e%t*4294967296+n;if(e=Math.floor(e/t),n=Math.floor(i/t),r=(i%t).toString(t)+r,!e&&!n)break}return r},t.prototype.toDecimalString=function(){return this.toString(10)},t.prototype.readInt32=function(t){return 16777216*this.buffer[t]+(this.buffer[t+1]<<16)+(this.buffer[t+2]<<8)+this.buffer[t+3]},t}(),an=1;function un(t,e){var n=function(t){return{clearTracingIfCancelled:en,traceFetch:function(e){return nn(t,e,(function(t){var n;if(e.input instanceof Request&&!(null===(n=e.init)||void 0===n?void 0:n.headers))e.input=new Request(e.input),Object.keys(t).forEach((function(n){e.input.headers.append(n,t[n])}));else{e.init=r({},e.init);var i=[];e.init.headers instanceof Headers?e.init.headers.forEach((function(t,e){i.push([e,t])})):Array.isArray(e.init.headers)?e.init.headers.forEach((function(t){i.push(t)})):e.init.headers&&Object.keys(e.init.headers).forEach((function(t){i.push([t,e.init.headers[t]])})),e.init.headers=i.concat(lt(t))}}))},traceXhr:function(e,n){return nn(t,e,(function(t){Object.keys(t).forEach((function(e){n.setRequestHeader(e,t[e])}))}))}}}(e);!function(t,e,n){var r=$e();r.beforeSend((function(r,i){re(e,r.url)&&(n.traceXhr(r,i),r.requestIndex=sn(),t.notify(Ht.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){re(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(Ht.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,spanId:r.spanId,startTime:r.startTime,status:r.status,traceId:r.traceId,type:$.XHR,url:r.url}))}))}(t,e,n),function(t,e,n){var r=Qe();r.beforeSend((function(r){re(e,r.url)&&(n.traceFetch(r),r.requestIndex=sn(),t.notify(Ht.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){re(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(Ht.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,responseType:r.responseType,spanId:r.spanId,startTime:r.startTime,status:r.status,traceId:r.traceId,type:$.FETCH,url:r.url}))}))}(t,e,n)}function sn(){var t=an;return an+=1,t}function cn(t,e){void 0===e&&(e=it);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=t.subscribe(Ht.RAW_RUM_EVENT_COLLECTED,(function(t){switch(t.rawRumEvent.type){case kt.ERROR:n.errorCount+=1,e(n);break;case kt.ACTION:n.userActionCount+=1,e(n);break;case kt.LONG_TASK:n.longTaskCount+=1,e(n);break;case kt.RESOURCE:n.resourceCount+=1,e(n)}}));return{stop:function(){r.unsubscribe()},eventCounts:n}}var fn=100,dn=100,ln=1e4;function pn(t,e){var n=function(t){var e,n=new Ce,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(t.subscribe(Ht.DOM_MUTATED,(function(){return o()}))),r.push(t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(t){"resource"===t.entryType&&o()}))),r.push(t.subscribe(Ht.REQUEST_STARTED,(function(t){void 0===e&&(e=t.requestIndex),i+=1,o()}))),r.push(t.subscribe(Ht.REQUEST_COMPLETED,(function(t){void 0===e||t.requestIndex<e||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(t){return t.unsubscribe()}))}}}(t),r=n.observable,i=n.stop,o=function(t,e,n){var r,i=!1,o=setTimeout(j((function(){return s(!1,0)})),fn),a=setTimeout(j((function(){return s(!0,performance.now())})),ln);t.subscribe((function(t){var e=t.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();e||(r=setTimeout(j((function(){return s(!0,n)})),dn))}));var u=function(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),e()};function s(t,e){i||(u(),n(t,e))}return{stop:u}}(r,i,e).stop;return{stop:function(){o(),i()}}}function mn(t){return function(t){var e;if(function(){void 0===Tn&&(Tn="closest"in HTMLElement.prototype);return Tn}())e=t.closest("["+vn+"]");else for(var n=t;n;){if(n.hasAttribute(vn)){e=n;break}n=n.parentElement}if(!e)return;return On(_n(e.getAttribute(vn).trim()))}(t)||Cn(t,gn)||Cn(t,yn)||""}var vn="data-dd-action-name";var En,hn,Tn,gn=[function(t){if(function(){void 0===hn&&(hn="labels"in HTMLInputElement.prototype);return hn}()){if("labels"in t&&t.labels&&t.labels.length>0)return Rn(t.labels[0])}else if(t.id){var e=t.ownerDocument&&t.ownerDocument.querySelector('label[for="'+t.id.replace('"','\\"')+'"]');return e&&Rn(e)}},function(t){if("INPUT"===t.nodeName){var e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return e.value}},function(t){if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Rn(t)},function(t){return t.getAttribute("aria-label")},function(t){var e=t.getAttribute("aria-labelledby");if(e)return e.split(/\s+/).map((function(e){return function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e)})).filter((function(t){return Boolean(t)})).map(Rn).join(" ")},function(t){return t.getAttribute("alt")},function(t){return t.getAttribute("name")},function(t){return t.getAttribute("title")},function(t){return t.getAttribute("placeholder")},function(t){if("options"in t&&t.options.length>0)return Rn(t.options[0])}],yn=[function(t){return Rn(t)}],bn=10;function Cn(t,e){for(var n=t,r=0;r<=bn&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=e;i<o.length;i++){var a=(0,o[i])(n);if("string"==typeof a){var u=a.trim();if(u)return On(_n(u))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function _n(t){return t.replace(/\s+/g," ")}function On(t){return t.length>100?(n=100,((r=(e=t).charCodeAt(n-1))>=55296&&r<=56319?e.slice(0,n+1):e.slice(0,n))+" [...]"):t;var e,n,r}function Rn(t){if(!t.isContentEditable){if("innerText"in t){var e=t.innerText;if(!function(){if(void 0===En){var t=document.createElement("style");t.textContent="*";var e=document.createElement("div");e.appendChild(t),document.body.appendChild(e),En=""===e.innerText,document.body.removeChild(e)}return En}())for(var n=t.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(e=e.replace(i,""))}return e}return t.textContent}}function Sn(t){var e=function(t){var e,n;return{create:function(r,i){if(!e){var o=new Nn(t,r,i);e=o,n=pn(t,(function(t,n){t?o.complete(n):o.discard(),e=void 0}))}},discardCurrent:function(){e&&(n.stop(),e.discard(),e=void 0)}}}(t);t.subscribe(Ht.VIEW_CREATED,(function(){e.discardCurrent()}));var n=Et(window,K.CLICK,(function(t){if(t.target instanceof Element){var n=mn(t.target);n&&e.create(Bt.CLICK,n)}}),{capture:!0}).stop;return{stop:function(){e.discardCurrent(),n()}}}var wn,In,An,Nn=function(){function t(t,e,n){this.lifeCycle=t,this.type=e,this.name=n,this.id=et(),this.startTime=performance.now(),this.eventCountsSubscription=cn(t),this.lifeCycle.notify(Ht.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return t.prototype.complete=function(t){var e=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Ht.AUTO_ACTION_COMPLETED,{counts:{errorCount:e.errorCount,longTaskCount:e.longTaskCount,resourceCount:e.resourceCount},duration:t-this.startTime,id:this.id,name:this.name,startTime:this.startTime,type:this.type}),this.eventCountsSubscription.stop()},t.prototype.discard=function(){this.lifeCycle.notify(Ht.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},t}();function Dn(t,e){return t.subscribe(Ht.AUTO_ACTION_COMPLETED,(function(e){return t.notify(Ht.RAW_RUM_EVENT_COLLECTED,Ln(e))})),e.trackInteractions&&Sn(t),{addAction:function(e,n){t.notify(Ht.RAW_RUM_EVENT_COLLECTED,r({savedCommonContext:n},Ln(e)))}}}function Ln(t){var e=xn(t)?{action:{error:{count:t.counts.errorCount},id:t.id,loading_time:rt(t.duration),long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}}}:void 0;return{customerContext:xn(t)?void 0:t.context,rawRumEvent:s({action:{target:{name:t.name},type:t.type},date:ft(t.startTime),type:kt.ACTION},e),startTime:t.startTime}}function xn(t){return t.type!==Bt.CUSTOM}function Un(t){if(!wn){var e=new Ce;!function(t,e){function n(n,r){t.isIntakeUrl(r.url)||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!function(t){return t.status>=500}(r)||e.notify({message:Pn(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:l.NETWORK,stack:kn(r.response,t)||"Failed to load",startTime:r.startTime})}$e().onRequestComplete((function(t){return n($.XHR,t)})),Qe().onRequestComplete((function(t){return n($.FETCH,t)}))}(t,e),function(t){In=console.error,console.error=j((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];In.apply(console,o([e],n)),t.notify({message:o(["console error:",e],n).map(Mn).join(" "),source:l.CONSOLE,startTime:performance.now()})}))}(e),function(t){S((function(e,n,r){var i=p(e,r,"Uncaught"),o=i.stack,a=i.message,u=i.type;t.notify({message:a,stack:o,type:u,source:l.SOURCE,startTime:performance.now()})}))}(e),wn=function(t,e){var n=0,r=new Ce;return e.subscribe((function(e){n<t.maxErrorsByMinute?(n+=1,r.notify(e)):n===t.maxErrorsByMinute&&(n+=1,r.notify({message:"Reached max number of errors by minute: "+t.maxErrorsByMinute,source:l.AGENT,startTime:performance.now()}))})),setInterval((function(){return n=0}),Q),r}(t,e)}return wn}function Mn(t){return"string"==typeof t?t:t instanceof Error?m(L(t)):ot(t,void 0,2)}function kn(t,e){return t&&t.length>e.requestErrorResponseLengthLimit?t.substring(0,e.requestErrorResponseLengthLimit)+"...":t}function Pn(t){return $.XHR===t?"XHR":"Fetch"}function Bn(t,e){return function(t,e){return e.subscribe((function(e){return t.notify(Ht.RAW_RUM_EVENT_COLLECTED,Hn(e))})),{addError:function(e,n){var i=e.error,o=e.startTime,a=e.context,u=function(t,e,n){var i=t instanceof Error?L(t):void 0;return r({startTime:e,source:n},p(i,t,"Provided"))}(i,o,e.source);t.notify(Ht.RAW_RUM_EVENT_COLLECTED,r({customerContext:a,savedCommonContext:n},Hn(u)))}}}(t,Un(e))}function Hn(t){return{rawRumEvent:{date:ft(t.startTime),error:{message:t.message,resource:t.resource?{method:t.resource.method,status_code:t.resource.statusCode,url:t.resource.url}:void 0,source:t.source,stack:t.stack,type:t.type},type:kt.ERROR},startTime:t.startTime}}function Wn(t){if(performance&&"getEntriesByName"in performance){var e=performance.getEntriesByName(t.url,"resource");if(e.length&&"toJSON"in e[0]){var n,r=e.map((function(t){return t.toJSON()})).filter(Zt).filter((function(e){return n=e,r=t.startTime,i=jn(t),n.startTime>=r&&jn(n)<=i;var n,r,i}));return 1===r.length?r[0]:2===r.length&&jn((n=r)[0])<=n[1].startTime?r[1]:void 0}}}function jn(t){return t.startTime+t.duration}function Vn(t,e){t.subscribe(Ht.REQUEST_COMPLETED,(function(n){e.isTrackedWithResource()&&t.notify(Ht.RAW_RUM_EVENT_COLLECTED,function(t){var e=t.type===$.XHR?Y.XHR:Y.FETCH,n=Wn(t),r=n?n.startTime:t.startTime,i=n?Fn(n):void 0,o=function(t){if(!t.traceId||!t.spanId)return;return{_dd:{span_id:t.spanId.toDecimalString(),trace_id:t.traceId.toDecimalString()},resource:{id:et()}}}(t),a=s({date:ft(r),resource:{type:e,duration:rt(t.duration),method:t.method,status_code:t.status,url:t.url},type:kt.RESOURCE},o,i);return{startTime:r,rawRumEvent:a}}(n))})),t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(n){var r;e.isTrackedWithResource()&&"resource"===n.entryType&&("xmlhttprequest"!==(r=n).initiatorType&&"fetch"!==r.initiatorType)&&t.notify(Ht.RAW_RUM_EVENT_COLLECTED,function(t){var e=Xt(t),n=Fn(t),r=function(t){return t.traceId?{_dd:{trace_id:t.traceId}}:void 0}(t),i=s({date:ft(t.startTime),resource:{type:e,url:t.name},type:kt.RESOURCE},r,n);return{startTime:t.startTime,rawRumEvent:i}}(n))}))}function Fn(t){return{resource:r({duration:(e=t,n=e.duration,i=e.startTime,o=e.responseEnd,rt(0===n&&i<o?o-i:n)),size:ne(t)},Qt(t))};var e,n,i,o}function qn(t){return void 0===t&&(t=window),An||("hidden"===document.visibilityState?An={timeStamp:0}:(An={timeStamp:1/0},Et(t,K.PAGE_HIDE,(function(t){var e=t.timeStamp;An.timeStamp=e}),{capture:!0,once:!0}).stop)),An}function zn(t,e){var n;function i(t){n=r(r({},n),t),e(n)}var o=function(t,e){return{stop:t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(t){"navigation"===t.entryType&&e({domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd})})).unsubscribe}}(t,i).stop,a=function(t,e){var n=qn();return{stop:t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(t){"paint"===t.entryType&&"first-contentful-paint"===t.name&&t.startTime<n.timeStamp&&e(t.startTime)})).unsubscribe}}(t,(function(t){return i({firstContentfulPaint:t})})).stop,u=function(t,e,n){var r=qn(),i=1/0,o=ht(e,[K.POINTER_DOWN,K.KEY_DOWN],(function(t){i=t.timeStamp}),{capture:!0,once:!0}).stop,a=t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(t){"largest-contentful-paint"===t.entryType&&t.startTime<i&&t.startTime<r.timeStamp&&n(t.startTime)})).unsubscribe;return{stop:function(){o(),a()}}}(t,window,(function(t){i({largestContentfulPaint:t})})).stop,s=function(t,e){var n=qn();return{stop:t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(t){"first-input"===t.entryType&&t.startTime<n.timeStamp&&e({firstInputDelay:t.processingStart-t.startTime,firstInputTime:t.startTime})})).unsubscribe}}(t,(function(t){i({firstInputDelay:t.firstInputDelay,firstInputTime:t.firstInputTime})})).stop;return{stop:function(){o(),a(),u(),s()}}}var Gn=3e3,Kn=5*Q;function Yn(t,e){var n,r=$n(e,t,Pt.INITIAL_LOAD,document.referrer,0),i=r,o=zn(e,(function(t){r.updateTimings(t),r.scheduleUpdate()})).stop;function a(){i.isDifferentView(t)?(i.end(),i.triggerUpdate(),i=$n(e,t,Pt.ROUTE_CHANGE,i.url)):(i.updateLocation(t),i.triggerUpdate())}!function(t){var e=history.pushState;history.pushState=j((function(){e.apply(this,arguments),t()}));var n=history.replaceState;history.replaceState=j((function(){n.apply(this,arguments),t()})),Et(window,K.POP_STATE,t)}(a),n=a,Et(window,K.HASH_CHANGE,n),e.subscribe(Ht.SESSION_RENEWED,(function(){i.end(),i=$n(e,t,Pt.ROUTE_CHANGE,i.url)})),e.subscribe(Ht.BEFORE_UNLOAD,(function(){i.end(),i.triggerUpdate()}));var u=window.setInterval(j((function(){i.triggerUpdate()})),Kn);return{addTiming:function(t,e){void 0===e&&(e=performance.now()),i.addTiming(t,e),i.triggerUpdate()},stop:function(){o(),i.end(),clearInterval(u)}}}function $n(t,e,n,i,o){void 0===o&&(o=performance.now());var a,u,s,c=et(),f={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},d={},l={},p=0,m=r({},e);t.notify(Ht.VIEW_CREATED,{id:c,startTime:o,location:m,referrer:i});var v,E=tt(j(O),Gn,{leading:!1}),h=E.throttled,T=E.cancel,g=cn(t,(function(t){f=t,h()})).stop,y=function(t,e){var n=t===Pt.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&e(Math.max.apply(Math,i))}return{setLoadEvent:function(t){n&&(n=!1,i.push(t),o())},setActivityLoadingTime:function(t){r&&(r=!1,void 0!==t&&i.push(t),o())}}}(n,(function(t){u=t,h()})),b=y.setActivityLoadingTime,C=y.setLoadEvent,_=function(t,e){var n=performance.now();return{stop:pn(t,(function(t,r){e(t?r-n:void 0)})).stop}}(t,b).stop;function O(){p+=1,t.notify(Ht.VIEW_UPDATED,{cumulativeLayoutShift:a,customTimings:l,documentVersion:p,eventCounts:f,id:c,loadingTime:u,loadingType:n,location:m,referrer:i,startTime:o,timings:d,duration:(void 0===s?performance.now():s)-o,isActive:void 0===s})}return de("layout-shift")?(a=0,v=function(t,e){return{stop:t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(t){"layout-shift"!==t.entryType||t.hadRecentInput||e(t.value)})).unsubscribe}}(t,(function(t){a+=t,h()})).stop):v=it,O(),{scheduleUpdate:h,end:function(){s=performance.now(),g(),_(),v(),t.notify(Ht.VIEW_ENDED)},isDifferentView:function(t){return m.pathname!==t.pathname||(e=t.hash,n=e.substr(1),!document.getElementById(n)&&t.hash!==m.hash);var e,n},triggerUpdate:function(){T(),O()},updateTimings:function(t){d=t,void 0!==t.loadEvent&&C(t.loadEvent)},addTiming:function(t,e){l[function(t){var e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&console.warn("Invalid timing name: "+t+", sanitized to: "+e);return e}(t)]=e-o},updateLocation:function(t){m=r({},t)},get url(){return m.href}}}function Xn(t,e){return t.subscribe(Ht.VIEW_UPDATED,(function(e){return t.notify(Ht.RAW_RUM_EVENT_COLLECTED,function(t){var e={_dd:{document_version:t.documentVersion},date:ft(t.startTime),type:kt.VIEW,view:{action:{count:t.eventCounts.userActionCount},cumulative_layout_shift:t.cumulativeLayoutShift,dom_complete:rt(t.timings.domComplete),dom_content_loaded:rt(t.timings.domContentLoaded),dom_interactive:rt(t.timings.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:rt(t.timings.firstContentfulPaint),first_input_delay:rt(t.timings.firstInputDelay),first_input_time:rt(t.timings.firstInputTime),is_active:t.isActive,largest_contentful_paint:rt(t.timings.largestContentfulPaint),load_event:rt(t.timings.loadEvent),loading_time:rt(t.loadingTime),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:rt(t.duration)}};pt(t.customTimings)||(e.view.custom_timings=function(t,e){for(var n={},r=0,i=Object.keys(t);r<i.length;r++){var o=i[r];n[o]=e(t[o])}return n}(t.customTimings,rt));return{rawRumEvent:e,startTime:t.startTime}}(e))})),Yn(e,t)}var Jn,Qn="rum";function Zn(t,e){var n=Le(t.cookieOptions,Qn,(function(e){return function(t,e){var n;n=function(t){return t===Jn.NOT_TRACKED||t===Jn.TRACKED_WITH_RESOURCES||t===Jn.TRACKED_WITHOUT_RESOURCES}(e)?e:nt(t.sampleRate)?nt(t.resourceSampleRate)?Jn.TRACKED_WITH_RESOURCES:Jn.TRACKED_WITHOUT_RESOURCES:Jn.NOT_TRACKED;return{trackingType:n,isTracked:tr(n)}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(Ht.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&tr(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Jn.TRACKED_WITH_RESOURCES}}}function tr(t){return t===Jn.TRACKED_WITH_RESOURCES||t===Jn.TRACKED_WITHOUT_RESOURCES}function er(t,e){var n=function(t,e){var n,r=o(t.rumEndpoint,(function(){return e.notify(Ht.BEFORE_UNLOAD)})),i=t.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(e,n){return new h(new E(e,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,n)}function a(t){return s(t,{application:{id:i.applicationId}})}var u=!1;return{add:function(t){u||(r.add(t),n&&n.add(a(t)))},stop:function(){u=!0},upsert:function(t,e){u||(r.upsert(t,e),n&&n.upsert(a(t),e))}}}(t,e);return e.subscribe(Ht.RUM_EVENT_COLLECTED,(function(t){t.type===kt.VIEW?n.upsert(t,t.view.id):n.add(t)})),{stop:function(){n.stop()}}}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(Jn||(Jn={}));var nr={buildMode:"release",datacenter:"us",sdkVersion:"2.5.3"};var rr,ir,or,ar,ur=function(t){var e,n=!1,i=(e={},{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t}}),o={},a=function(){},u=new jt,s=function(t){u.add([t,performance.now()])},f=new jt,d=function(t){f.add([t,v()])},p=new jt,m=function(t){p.add([t,v()])};function v(){return c({context:i.get(),user:o})}var E,h,T=(E={init:j((function(e){var r;Ut(Lt(e))&&Mt()&&function(t){return n?(t.silentMultipleInit||console.error("DD_RUM is already initialized."),!1):t&&(t.clientToken||t.publicApiKey)?t.applicationId?void 0===t.sampleRate||st(t.sampleRate)?void 0===t.resourceSampleRate||st(t.resourceSampleRate)?!Array.isArray(t.allowedTracingOrigins)||0===t.allowedTracingOrigins.length||void 0!==t.service||(console.error("Service need to be configured when tracing is enabled"),!1):(console.error("Resource Sample Rate should be a number between 0 and 100"),!1):(console.error("Sample Rate should be a number between 0 and 100"),!1):(console.error("Application ID is not configured, no RUM data will be collected."),!1):(console.error("Client Token is not configured, we will not send any data."),!1)}(e)&&(e.publicApiKey&&(e.clientToken=e.publicApiKey),r=t(e,(function(){return{user:o,context:i.get()}})),d=r.addAction,m=r.addError,s=r.addTiming,a=r.getInternalContext,f.drain((function(t){var e=t[0],n=t[1];return d(e,n)})),p.drain((function(t){var e=t[0],n=t[1];return m(e,n)})),u.drain((function(t){var e=t[0],n=t[1];return s(e,n)})),n=!0)})),addRumGlobalContext:j(i.add),removeRumGlobalContext:j(i.remove),getRumGlobalContext:j(i.get),setRumGlobalContext:j(i.set),getInternalContext:j((function(t){return a(t)})),addAction:j((function(t,e){d({name:t,context:c(e),startTime:performance.now(),type:Bt.CUSTOM})})),addUserAction:function(t,e){T.addAction(t,e)},addError:j((function(t,e,n){var r;void 0===n&&(n=l.CUSTOM),n===l.CUSTOM||n===l.NETWORK||n===l.SOURCE?r=n:(console.error("DD_RUM.addError: Invalid source '"+n+"'"),r=l.CUSTOM),m({error:t,context:c(e),source:r,startTime:performance.now()})})),addTiming:j((function(t){s(t)})),setUser:j((function(t){var e=function(t){if("object"==typeof t&&t){var e=c(t);return"id"in e&&(e.id=String(e.id)),"name"in e&&(e.name=String(e.name)),"email"in e&&(e.email=String(e.email)),e}}(t);e?o=e:console.error("Unsupported user:",t)}))},h=r(r({},E),{onReady:function(t){t()}}),Object.defineProperty(h,"_setDebug",{get:function(){return z},enumerable:!1}),h);return T}((function(t,e){var n=new Ft,r=xt(t,nr),i=r.configuration,o=r.internalMonitoring,a=Zn(i,n);o.setExternalContextProvider((function(){return s({application_id:t.applicationId},c.findView(),e().context)}));var u=function(t,e,n,r,i,o){var a=function(t,e){var n,r,i,o=[],a=[];t.subscribe(Ht.VIEW_CREATED,(function(t){n&&o.unshift({context:c(),endTime:t.startTime,startTime:n.startTime}),n=t,i=e.getId()})),t.subscribe(Ht.VIEW_UPDATED,(function(t){n.id===t.id&&(n=t)})),t.subscribe(Ht.AUTO_ACTION_CREATED,(function(t){r=t})),t.subscribe(Ht.AUTO_ACTION_COMPLETED,(function(t){r&&a.unshift({context:f(),endTime:r.startTime+t.duration,startTime:r.startTime}),r=void 0})),t.subscribe(Ht.AUTO_ACTION_DISCARDED,(function(){r=void 0})),t.subscribe(Ht.SESSION_RENEWED,(function(){o=[],a=[],n=void 0,r=void 0}));var u=setInterval(j((function(){s(o,We),s(a,je)})),Ve);function s(t,e){for(var n=performance.now()-e;t.length>0&&t[t.length-1].startTime<n;)t.pop()}function c(){return{session:{id:i},view:{id:n.id,referrer:n.referrer,url:n.location.href}}}function f(){return{action:{id:r.id}}}function d(t,e,n,r){if(void 0===r)return n?t():void 0;if(n&&r>=n.startTime)return t();for(var i=0,o=e;i<o.length;i++){var a=o[i];if(r>a.endTime)break;if(r>=a.startTime)return a.context}}return{findAction:function(t){return d(f,a,r,t)},findView:function(t){return d(c,o,n,t)},stop:function(){clearInterval(u)}}}(n,i),u=er(r,n);be(t,r,n,i,a,o),function(t){t.subscribe(Ht.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("longtask"===e.entryType){var n={date:ft(e.startTime),long_task:{duration:rt(e.duration)},type:kt.LONG_TASK};t.notify(Ht.RAW_RUM_EVENT_COLLECTED,{rawRumEvent:n,startTime:e.startTime})}}))}(n),Vn(n,i);var s=Xn(n,e).addTiming,c=Bn(n,r).addError;return{addAction:Dn(n,r).addAction,addError:c,parentContexts:a,addTiming:s,stop:function(){u.stop()}}}(t.applicationId,location,n,i,a,e),c=u.parentContexts,f=u.addError,d=u.addAction,l=u.addTiming;un(n,i),le(n,i),qt(n);var p=function(t,e,n){return{get:function(r){var i=n.findView(r);if(e.isTracked()&&i&&i.session.id){var o=n.findAction(r);return{application_id:t,session_id:i.session.id,user_action:o?{id:o.action.id}:void 0,view:i.view}}}}}(t.applicationId,a,c);return{addAction:d,addError:f,addTiming:l,configuration:i,lifeCycle:n,parentContexts:c,session:a,getInternalContext:p.get}}));rr=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}(),or=ur,ar=rr[ir="DD_RUM"],rr[ir]=or,ar&&ar.q&&ar.q.forEach((function(t){return t()}))}});
{
"name": "@datadog/browser-rum",
"version": "2.5.2",
"version": "2.5.3",
"license": "Apache-2.0",

@@ -15,4 +15,4 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "2.5.2",
"@datadog/browser-rum-core": "2.5.2",
"@datadog/browser-core": "2.5.3",
"@datadog/browser-rum-core": "2.5.3",
"tslib": "^1.10.0"

@@ -25,3 +25,3 @@ },

},
"gitHead": "d178a681b56b5d502d9540cf2ff20d0ebc5aec53"
"gitHead": "b735e1963efd863df83ab1a7dc218006457abda3"
}
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