(window.core_bundle_jsonpfunction=window.core_bundle_jsonpfunction||[]).push([[2],Array(108).concat([function(e,t,n){"use strict";t.__esModule=!0,t.HTTP_REQUEST_TIMEOUT=t.SESSION_TIMEOUT=t.OUTCOME_UNKNOWN=t.OUTCOME_FAILURE=t.OUTCOME_SUCCESS=t.LAYOUT_SHIFT=t.FIRST_INPUT=t.TRUNCATED_TYPE=t.ERROR_LOGGING=t.PERFORMANCE_MONITORING=t.APM_SERVER=t.TRANSACTION_SERVICE=t.LOGGING_SERVICE=t.CONFIG_SERVICE=t.TRANSACTIONS=t.ERRORS=t.TRANSACTION_TYPE_ORDER=t.USER_INTERACTION=t.TEMPORARY_TYPE=t.KEYWORD_LIMIT=t.LARGEST_CONTENTFUL_PAINT=t.FIRST_CONTENTFUL_PAINT=t.RESOURCE=t.NAVIGATION=t.MEASURE=t.PAINT=t.LONG_TASK=t.HTTP_REQUEST_TYPE=t.LOCAL_CONFIG_KEY=t.AFTER_EVENT=t.BEFORE_EVENT=t.ERROR=t.CLICK=t.EVENT_TARGET=t.HISTORY=t.FETCH=t.XMLHTTPREQUEST=t.QUEUE_ADD_TRANSACTION=t.QUEUE_FLUSH=t.CONFIG_CHANGE=t.TRANSACTION_END=t.TRANSACTION_START=t.USER_TIMING_THRESHOLD=t.TYPE_CUSTOM=t.NAME_UNKNOWN=t.ROUTE_CHANGE=t.PAGE_LOAD=t.PAGE_LOAD_DELAY=t.MAX_SPAN_DURATION=t.REUSABILITY_THRESHOLD=t.RESOURCE_INITIATOR_TYPES=t.REMOVE_EVENT_LISTENER_STR=t.ADD_EVENT_LISTENER_STR=t.INVOKE=t.SCHEDULE=void 0,t.SCHEDULE="schedule",t.INVOKE="invoke",t.ADD_EVENT_LISTENER_STR="addEventListener",t.REMOVE_EVENT_LISTENER_STR="removeEventListener",t.RESOURCE_INITIATOR_TYPES=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],t.REUSABILITY_THRESHOLD=5e3,t.MAX_SPAN_DURATION=3e5,t.PAGE_LOAD_DELAY=1e3;var r="page-load";t.PAGE_LOAD=r;var i="route-change";t.ROUTE_CHANGE=i;var a="custom";t.TYPE_CUSTOM=a;var o="user-interaction";t.USER_INTERACTION=o;var s="http-request";t.HTTP_REQUEST_TYPE=s;var c="temporary";t.TEMPORARY_TYPE=c,t.NAME_UNKNOWN="Unknown";var u=[r,i,o,s,a,c];t.TRANSACTION_TYPE_ORDER=u,t.OUTCOME_SUCCESS="success",t.OUTCOME_FAILURE="failure",t.OUTCOME_UNKNOWN="unknown",t.USER_TIMING_THRESHOLD=60,t.TRANSACTION_START="transaction:start",t.TRANSACTION_END="transaction:end",t.CONFIG_CHANGE="config:change",t.QUEUE_FLUSH="queue:flush",t.QUEUE_ADD_TRANSACTION="queue:add_transaction",t.XMLHTTPREQUEST="xmlhttprequest",t.FETCH="fetch",t.HISTORY="history",t.EVENT_TARGET="eventtarget",t.CLICK="click",t.ERROR="error",t.BEFORE_EVENT=":before",t.AFTER_EVENT=":after",t.LOCAL_CONFIG_KEY="elastic_apm_config",t.LONG_TASK="longtask",t.PAINT="paint",t.MEASURE="measure",t.NAVIGATION="navigation",t.RESOURCE="resource",t.FIRST_CONTENTFUL_PAINT="first-contentful-paint",t.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",t.FIRST_INPUT="first-input",t.LAYOUT_SHIFT="layout-shift",t.ERRORS="errors",t.TRANSACTIONS="transactions",t.CONFIG_SERVICE="ConfigService",t.LOGGING_SERVICE="LoggingService",t.TRANSACTION_SERVICE="TransactionService",t.APM_SERVER="ApmServer",t.PERFORMANCE_MONITORING="PerformanceMonitoring",t.ERROR_LOGGING="ErrorLogging",t.TRUNCATED_TYPE=".truncated",t.KEYWORD_LIMIT=1024,t.SESSION_TIMEOUT=18e5,t.HTTP_REQUEST_TIMEOUT=1e4},function(e,t,n){"use strict";t.__esModule=!0,t.extend=function(e){return h(e,i.call(arguments,1),!1)},t.merge=function(e){return h(e,i.call(arguments,1),!0)},t.isUndefined=g,t.noop=function(){},t.baseExtend=h,t.bytesToHex=d,t.isCORSSupported=s,t.isObject=p,t.isFunction=v,t.isPlatformSupported=function(){return a&&"function"==typeof Set&&"function"==typeof JSON.stringify&&o&&"function"==typeof o.now&&s()},t.isDtHeaderValid=function(e){return/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(e)&&"00000000000000000000000000000000"!==e.slice(3,35)&&"0000000000000000"!==e.slice(36,52)},t.parseDtHeaderValue=function(e){var t=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(e);if(t){var n="00"!==t[4];return{traceId:t[2],id:t[3],sampled:n}}},t.getServerTimingInfo=function(e){void 0===e&&(e=[]);for(var t=[],n=0;n256))return"es=s:"+t},t.getCurrentScript=function(){if("undefined"!=typeof document)return document.currentScript||_()},t.getElasticScript=_,t.getTimeOrigin=function(){return o.timing.fetchStart},t.generateRandomId=function(e){return d(l()).substr(0,e)},t.getEarliestSpan=function(e){for(var t=e[0],n=1;nr._start&&(t=r)}return t},t.getLatestNonXHRSpan=function(e){return E(e,(function(e){return-1===String(e).indexOf("external")}))},t.getLatestXHRSpan=function(e){return E(e,(function(e){return-1!==String(e).indexOf("external")}))},t.getDuration=function(e,t){return g(t)||g(e)?null:parseInt(t-e)},t.getTime=function(e){return"number"==typeof e&&e>=0?e:T()},t.now=T,t.rng=l,t.checkSameOrigin=function e(t,n){var r=!1;return"string"==typeof n?r=t===n:n&&"function"==typeof n.test?r=n.test(t):Array.isArray(n)&&n.forEach((function(n){r||(r=e(t,n))})),r},t.scheduleMacroTask=function(e){setTimeout(e,0)},t.scheduleMicroTask=function(e){r.Promise.resolve().then(e)},t.setLabel=function(e,t,n){if(n&&e){var r=m(e),i=typeof t;return null!=t&&"boolean"!==i&&"number"!==i&&(t=String(t)),n[r]=t,n}},t.setRequestHeader=function(e,t,n){"function"==typeof e.setRequestHeader?e.setRequestHeader(t,n):e.headers&&"function"==typeof e.headers.append?e.headers.append(t,n):e[t]=n},t.stripQueryStringFromUrl=function(e){return e&&e.split("?")[0]},t.find=function(e,t,n){if(null==e)throw new TypeError("array is null or not defined");var r=Object(e),i=r.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var a=0;a=0},t.isBeaconInspectionEnabled=function(){var e="_elastic_inspect_beacon_";if(null!=sessionStorage.getItem(e))return!0;if(!window.URL||!window.URLSearchParams)return!1;try{var t=new URL(window.location.href).searchParams.has(e);return t&&sessionStorage.setItem(e,!0),t}catch(e){}return!1},t.isRedirectInfoAvailable=function(e){return e.redirectStart>0},t.isBrowser=t.PERF=void 0;var r=n(118),i=[].slice,a="undefined"!=typeof window;t.isBrowser=a;var o=a&&"undefined"!=typeof performance?performance:{};function s(){return"withCredentials"in new window.XMLHttpRequest}t.PERF=o;for(var c=[],u=0;u<256;++u)c[u]=(u+256).toString(16).substr(1);function d(e){for(var t=[],n=0;n0)return r}}function g(e){return void 0===e}function m(e){return e.replace(/[.*"]/g,"_")}function E(e,t){for(var n=null,r=0;r=0||(i[n]=e[n]);return i}(n,o)),s=v(),c={};if(e.type===i.PAGE_LOAD&&(0,a.isPerfTimelineSupported)()){var u=a.PERF.getEntriesByType(i.NAVIGATION);u&&u.length>0&&(c={response:l(u[0])})}e.addContext(s,c,r)};var r=n(134),i=n(108),a=n(109),o=["tags"],s=91,c=93,u="external",d="resource",f="hard-navigation";function l(e){var t=e.transferSize,n=e.encodedBodySize,r=e.decodedBodySize,i=e.serverTiming,o={transfer_size:t,encoded_body_size:n,decoded_body_size:r},s=(0,a.getServerTimingInfo)(i);return s&&(o.headers={"server-timing":s}),o}function p(e){var t=e.port,n=e.protocol,r=e.hostname,i=function(e,t){return""===e&&(e="http:"===t?"80":"https:"===t?"443":""),e}(t,n),a=r.charCodeAt(0)===s&&r.charCodeAt(r.length-1)===c,o=r;return a&&(o=r.slice(1,-1)),{service:{resource:r+":"+i,name:"",type:""},address:o,port:Number(i)}}function v(){return{page:{referer:document.referrer,url:location.href}}}},function(e,t,n){"use strict";t.__esModule=!0,t.slugifyUrl=function(e,t){void 0===t&&(t=2);for(var n=new o(e),r=n.query,i=n.path.substring(1).split("/"),a=":id",s=/\W|_/g,c=/[0-9]/g,u=/[a-z]/g,d=/[A-Z]/g,f=[],l=!1,p=0;pt-1){v&&f.push("*");break}if((v.match(s)||[]).length>=2)f.push(a),l=!0;else{var h=(v.match(c)||[]).length;if(h>3||v.length>3&&h/v.length>=.3)f.push(a),l=!0;else{var _=(v.match(d)||[]).length,g=(v.match(u)||[]).length/v.length,m=_/v.length;v.length>5&&(m>.3&&m<.6||g>.3&&g<.6)?(f.push(a),l=!0):v&&f.push(v)}}}return"/"+(f.length>=2?f.join("/"):f.join(""))+(r?"?{query}":"")},t.Url=void 0;var r=n(109),i=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,o=function(){function e(e){var t,n=this.extractProtocol(e||""),r=n.protocol,a=n.address,o=n.slashes,s=!r&&!o,c=this.getLocation(),u=i.slice();a=a.replace("\\","/"),o||(u[2]=[NaN,"path"]);for(var d=0;d=a&&t>e&&e-a>=n&&t-a<=i&&t-e=a&&o>=n&&s>=o){var c={};return i.forEach((function(i){var a=e[i];a&&a>=n&&((0,r.isRedirectInfoAvailable)(e)?c[i]=parseInt(a-t):c[i]=parseInt(a-n))})),c}return null}(e);return null==t?null:{navigationTiming:t,agent:{timeToFirstByte:t.responseStart,domInteractive:t.domInteractive,domComplete:t.domComplete}}},t.COMPRESSED_NAV_TIMING_MARKS=t.NAVIGATION_TIMING_MARKS=void 0;var r=n(109),i=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"];t.NAVIGATION_TIMING_MARKS=i,t.COMPRESSED_NAV_TIMING_MARKS=["fs","ls","le","cs","ce","qs","rs","re","dl","di","ds","de","dc","es","ee"]},function(e,t,n){"use strict";t.__esModule=!0,t.shouldUseFetchWithKeepAlive=function(e,t){if(!s())return!1;if(!("keepalive"in new Request("")))return!1;var n=function(e){return e?e instanceof Blob?e.size:new Blob([e]).size:0}(t);return"POST"===e&&n399&&e<600)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(108),i=function(){function e(){this.observers={}}var t=e.prototype;return t.observe=function(e,t){var n=this;if("function"==typeof t)return this.observers[e]||(this.observers[e]=[]),this.observers[e].push(t),function(){var r=n.observers[e].indexOf(t);r>-1&&n.observers[e].splice(r,1)}},t.sendOnly=function(e,t){var n=this.observers[e];n&&n.forEach((function(e){try{e.apply(void 0,t)}catch(e){console.log(e,e.stack)}}))},t.send=function(e,t){this.sendOnly(e+r.BEFORE_EVENT,t),this.sendOnly(e,t),this.sendOnly(e+r.AFTER_EVENT,t)},e}();t.default=i},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(121)),i=c(n(158)),a=n(109),o=n(108),s=n(249);function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}var d=function(e){var t,n;function i(t,n,r){var i;return(i=e.call(this,t,n,r)||this).traceId=(0,a.generateRandomId)(),i.marks=void 0,i.spans=[],i._activeSpans={},i._activeTasks=new Set,i.blocked=!1,i.captureTimings=!1,i.breakdownTimings=[],i.sampleRate=i.options.transactionSampleRate,i.sampled=Math.random()<=i.sampleRate,i}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,u(t,n);var c=i.prototype;return c.addMarks=function(e){this.marks=(0,a.merge)(this.marks||{},e)},c.mark=function(e){var t=(0,a.removeInvalidChars)(e),n=(0,a.now)()-this._start,r={};r[t]=n,this.addMarks({custom:r})},c.canReuse=function(){var e=this.options.reuseThreshold||o.REUSABILITY_THRESHOLD;return!!this.options.canReuse&&!this.ended&&(0,a.now)()-this._start=0)){var i=e[r];if(null!=i&&"function"!=typeof i){if("object"==typeof i){if("function"!=typeof i.toISOString)return;i=i.toISOString()}n[r]=i,t=!0}}})),t)return n}(p);g&&(_.custom=g)}h||v&&v.indexOf(":")>-1&&(h=v.split(":")[0]);var m=this._transactionService.getCurrentTransaction(),E=m?m.context:{},T=this._configService.get("context"),S=(T.tags,function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(T,u)),R=(0,o.getPageContext)(),y=(0,a.merge)({},R,E,S,_),O={id:(0,a.generateRandomId)(),culprit:r,exception:{message:v,stacktrace:n,type:h},context:y};return m&&(O=(0,a.extend)(O,{trace_id:m.traceId,parent_id:m.id,transaction_id:m.id,transaction:{type:m.type,sampled:m.sampled}})),(0,s.truncateModel)(s.ERROR_MODEL,O)},t.logErrorEvent=function(e){if(void 0!==e){var t=this.createErrorDataModel(e);void 0!==t.exception.message&&this._apmServer.addError(t)}},t.registerListeners=function(){var e=this;window.addEventListener("error",(function(t){return e.logErrorEvent(t)})),window.addEventListener("unhandledrejection",(function(t){return e.logPromiseEvent(t)}))},t.logPromiseEvent=function(e){var t,n="Unhandled promise rejection: ",r=e.reason;null==r&&(r=""),t="string"==typeof r.message?{error:r,message:n+(r.name?r.name+": ":"")+r.message}:{message:n+(r="object"==typeof r?"":"function"==typeof r?"":r)},this.logErrorEvent(t)},t.logError=function(e){var t={};return"string"==typeof e?t.message=e:t.error=e,this.logErrorEvent(t)},e}();t.default=f},function(e,t,n){"use strict";t.__esModule=!0,t.createStackTraces=function(e,t){var n,r=t.error,i=t.filename,a=t.lineno,o=t.colno,s=[];if(r)try{s=e.parse(r)}catch(e){}return function(e){return 0!==e.length&&(1!==e.length||"lineNumber"in e[0])}(s)||(s=[{fileName:i,lineNumber:a,columnNumber:o}]),(n=s,n.map((function(e){return e.functionName&&(e.functionName=(n=(t=e.functionName).split("/"),t=(t=(t=n.length>1?["Object",n[n.length-1]].join("."):n[0]).replace(/.<$/gi,".")).replace(/^Anonymous function$/,""),t=(n=t.split(".")).length>1?n[n.length-1]:n[0])),e;var t,n}))).map((function(e){var t=e.fileName,n=e.lineNumber,r=e.columnNumber,i=e.functionName,a=void 0===i?"":i;if(!t&&!n)return{};if(!r&&!n)return{};var o,s,c=function(e){return void 0===e&&(e=""),""===e&&(e=""),e}(t),u=(o=c,s=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),o.indexOf(s)>-1&&(o=o.replace(s+"/","")),o);return function(e){return!!e&&0===window.location.href.indexOf(e)}(c)&&(u="(inline script)"),{abs_path:t,filename:u,function:a,lineno:n,colno:r}}))},t.filterInvalidFrames=function(e){return e.filter((function(e){var t=e.filename,n=e.lineno;return void 0!==t&&void 0!==n}))}},function(e,t,n){"use strict";(function(t){var n=setTimeout;function r(e){return Boolean(e&&void 0!==e.length)}function i(){}function a(e){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void c(t.promise,e)}s(t.promise,r)}else(1===e._state?s:c)(t.promise,e._value)}))):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof a)return e._state=3,e._value=t,void u(e);if("function"==typeof n)return void f((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){c(e,t)}var r,i}function c(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&a._immediateFn((function(){e._handled||a._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(231),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(152))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,c=1,u={},d=!1,f=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){v(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&v(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){v(e.data)},r=function(e){a.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(v,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),r=this.extractLocation(n.pop()),i=n.join(" ")||void 0,a=function(e,t){if("function"==typeof Array.prototype.indexOf)return e.indexOf(t);for(var n=0;n"],r[0])>-1?void 0:r[0];return new e(i,void 0,a,r[1],r[2],t)}),this)},parseFFOrSafari:function(t){return i(a(t.stack.split("\n"),(function(e){return!e.match(r)}),this),(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e(t);var n=t.split("@"),r=this.extractLocation(n.pop()),i=n.join("@")||void 0;return new e(i,void 0,r[0],r[1],r[2],t)}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],a=2,o=r.length;a/,"$2").replace(/\([^\)]*\)/g,"")||void 0;a.match(/\(([^\)]*)\)/)&&(n=a.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e(o,s,i[0],i[1],i[2],t)}),this)}}})?r.apply(t,i):r)||(e.exports=a)}()},function(e,t,n){var r,i,a;!function(n,o){"use strict";i=[],void 0===(a="function"==typeof(r=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e,t,n,r,i,a){void 0!==e&&this.setFunctionName(e),void 0!==t&&this.setArgs(t),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==i&&this.setColumnNumber(i),void 0!==a&&this.setSource(a)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(e){this.source=String(e)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?r.apply(t,i):r)||(e.exports=a)}()},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=v(n(236)),i=v(n(237)),a=v(n(238)),o=n(135),s=n(108),c=n(109),u=n(118),d=n(239),f=n(116),l=n(154),p=n(240);function v(e){return e&&e.__esModule?e:{default:e}}var h=function(){function e(e,t){this._configService=e,this._loggingService=t,this.queue=void 0,this.throttleEvents=c.noop}var t=e.prototype;return t.init=function(){var e=this,t=this._configService.get("queueLimit"),n=this._configService.get("flushInterval"),a=this._configService.get("eventsLimit");this.queue=new r.default((function(t){var n=e.sendEvents(t);n&&n.catch((function(t){e._loggingService.warn("Failed sending events!",e._constructError(t))}))}),{queueLimit:t,flushInterval:n}),this.throttleEvents=(0,i.default)(this.queue.add.bind(this.queue),(function(){return e._loggingService.warn("Dropped events due to throttling!")}),{limit:a,interval:6e4}),this._configService.observeEvent(s.QUEUE_FLUSH,(function(){e.queue.flush()}))},t._postJson=function(e,t){var n=this,r={payload:t,headers:{"Content-Type":"application/x-ndjson"},beforeSend:this._configService.get("apmRequest")};return(0,d.compressPayload)(r).catch((function(e){return f.__DEV__&&n._loggingService.debug("Compressing the payload using CompressionStream API failed",e.message),r})).then((function(t){return n._makeHttpRequest("POST",e,t)})).then((function(e){return e.responseText}))},t._constructError=function(e){var t=e.url,n=e.status,r=e.responseText;if(void 0===n)return e;var i=t+" HTTP status: "+n;if(f.__DEV__&&r)try{var a=[],o=JSON.parse(r);o.errors&&o.errors.length>0&&(o.errors.forEach((function(e){return a.push(e.message)})),i+=" "+a.join(","))}catch(e){this._loggingService.debug("Error parsing response from APM server",e)}return new Error(i)},t._makeHttpRequest=function(e,t,n){var r=void 0===n?{}:n,i=r.timeout,a=void 0===i?s.HTTP_REQUEST_TIMEOUT:i,o=r.payload,c=r.headers,u=r.beforeSend,d=this._configService.get("sendCredentials");return!u&&(0,l.shouldUseFetchWithKeepAlive)(e,o)?(0,l.sendFetchRequest)(e,t,{keepalive:!0,timeout:a,payload:o,headers:c,sendCredentials:d}).catch((function(n){if(n instanceof TypeError)return(0,p.sendXHR)(e,t,{timeout:a,payload:o,headers:c,beforeSend:u,sendCredentials:d});throw n})):(0,p.sendXHR)(e,t,{timeout:a,payload:o,headers:c,beforeSend:u,sendCredentials:d})},t.fetchConfig=function(e,t){var n=this,r=this.getEndpoints().configEndpoint;if(!e)return u.Promise.reject("serviceName is required for fetching central config.");r+="?service.name="+e,t&&(r+="&service.environment="+t);var i=this._configService.getLocalConfig();i&&(r+="&ifnonematch="+i.etag);var a=this._configService.get("apmRequest");return this._makeHttpRequest("GET",r,{timeout:5e3,beforeSend:a}).then((function(e){var t=e.status,r=e.responseText;if(304===t)return i;var a=JSON.parse(r),o=e.getResponseHeader("etag");return o&&(a.etag=o.replace(/["]/g,""),n._configService.setLocalConfig(a,!0)),a})).catch((function(e){var t=n._constructError(e);return u.Promise.reject(t)}))},t.createMetaData=function(){var e=this._configService,t={service:{name:e.get("serviceName"),version:e.get("serviceVersion"),agent:{name:"rum-js",version:e.version},language:{name:"javascript"},environment:e.get("environment")},labels:e.get("context.tags")};return(0,o.truncateModel)(o.METADATA_MODEL,t)},t.addError=function(e){var t;this.throttleEvents(((t={})[s.ERRORS]=e,t))},t.addTransaction=function(e){var t;this.throttleEvents(((t={})[s.TRANSACTIONS]=e,t))},t.ndjsonErrors=function(e,t){var n=t?"e":"error";return e.map((function(e){var r;return a.default.stringify(((r={})[n]=t?(0,d.compressError)(e):e,r))}))},t.ndjsonMetricsets=function(e){return e.map((function(e){return a.default.stringify({metricset:e})})).join("")},t.ndjsonTransactions=function(e,t){var n=this,r=t?"x":"transaction";return e.map((function(e){var i,o="",s="";return t||(e.spans&&(o=e.spans.map((function(e){return a.default.stringify({span:e})})).join(""),delete e.spans),e.breakdown&&(s=n.ndjsonMetricsets(e.breakdown),delete e.breakdown)),a.default.stringify(((i={})[r]=t?(0,d.compressTransaction)(e):e,i))+o+s}))},t.sendEvents=function(e){var t,n;if(0!==e.length){for(var r=[],i=[],o=0;o2,v=[],h=this.createMetaData(),_=p?"m":"metadata";v.push(a.default.stringify(((n={})[_]=p?(0,d.compressMetadata)(h):h,n)));var g=(v=v.concat(this.ndjsonErrors(l[s.ERRORS],p),this.ndjsonTransactions(l[s.TRANSACTIONS],p))).join(""),m=this.getEndpoints().intakeEndpoint;return this._postJson(m,g)}this._loggingService.warn("Dropped payload due to filtering!")}}},t.getEndpoints=function(){var e=this._configService.get("serverUrl"),t=this._configService.get("apiVersion");return{intakeEndpoint:e+(this._configService.get("serverUrlPrefix")||"/intake/v"+t+"/rum/events"),configEndpoint:e+"/config/v1/rum/agents"}},e}();t.default=h},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(){function e(e,t){void 0===t&&(t={}),this.onFlush=e,this.items=[],this.queueLimit=t.queueLimit||-1,this.flushInterval=t.flushInterval||0,this.timeoutId=void 0}var t=e.prototype;return t._setTimer=function(){var e=this;this.timeoutId=setTimeout((function(){return e.flush()}),this.flushInterval)},t._clear=function(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},t.flush=function(){this.onFlush(this.items),this._clear()},t.add=function(e){this.items.push(e),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},e}();t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t,n){var r,i=this,a=n.limit,o=n.interval,s=0;return function(){return s++,void 0===r&&(r=setTimeout((function(){s=0,r=void 0}),o)),s>a&&"function"==typeof t?t.apply(i,arguments):e.apply(i,arguments)}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(){function e(){}return e.stringify=function(e){return JSON.stringify(e)+"\n"},e}();t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.compressMetadata=function(e){var t=e.service,n=e.labels,r=t.agent,i=t.language;return{se:{n:t.name,ve:t.version,a:{n:r.name,ve:r.version},la:{n:i.name},en:t.environment},l:n}},t.compressTransaction=function(e){var t=e.spans.map((function(t){var n={id:t.id,n:t.name,t:t.type,s:t.start,d:t.duration,c:s(t.context),o:t.outcome,sr:t.sample_rate};return t.parent_id!==e.id&&(n.pid=t.parent_id),!0===t.sync&&(n.sy=!0),t.subtype&&(n.su=t.subtype),t.action&&(n.ac=t.action),n})),n={id:e.id,tid:e.trace_id,n:e.name,t:e.type,d:e.duration,c:s(e.context),k:c(e.marks),me:d(e.breakdown),y:t,yc:{sd:t.length},sm:e.sampled,sr:e.sample_rate,o:e.outcome};if(e.experience){var r=e.experience,i=r.cls,a=r.fid,o=r.tbt,u=r.longtask;n.exp={cls:i,fid:a,tbt:o,lt:u}}if(e.session){var f=e.session,l=f.id,p=f.sequence;n.ses={id:l,seq:p}}return n},t.compressError=function(e){var t,n=e.exception,r={id:e.id,cl:e.culprit,ex:{mg:n.message,st:(t=n.stacktrace,t.map((function(e){return{ap:e.abs_path,f:e.filename,fn:e.function,li:e.lineno,co:e.colno}}))),t:e.type},c:s(e.context)},i=e.transaction;return i&&(r.tid=e.trace_id,r.pid=e.parent_id,r.xid=e.transaction_id,r.x={t:i.type,sm:i.sampled}),r},t.compressMetricsets=d,t.compressPayload=function(e,t){void 0===t&&(t="gzip");var n="function"==typeof CompressionStream;return new r.Promise((function(r){if(!n)return r(e);if((0,a.isBeaconInspectionEnabled)())return r(e);var i=e.payload,o=e.headers,s=e.beforeSend,c=new Blob([i]).stream().pipeThrough(new CompressionStream(t));return new Response(c).blob().then((function(e){return o["Content-Encoding"]=t,r({payload:e,headers:o,beforeSend:s})}))}))};var r=n(118),i=n(153),a=n(109);function o(e){return{ts:e.transfer_size,ebs:e.encoded_body_size,dbs:e.decoded_body_size}}function s(e){if(!e)return null;var t={},n=e.page,r=e.http,i=e.response,a=e.destination,s=e.user,c=e.custom;if(n&&(t.p={rf:n.referer,url:n.url}),r&&(t.h=function(e){var t={},n=e.method,r=e.status_code,i=e.url,a=e.response;return t.url=i,n&&(t.mt=n),r&&(t.sc=r),a&&(t.r=o(a)),t}(r)),i&&(t.r=o(i)),a){var u=a.service;t.dt={se:{n:u.name,t:u.type,rc:u.resource},ad:a.address,po:a.port}}return s&&(t.u={id:s.id,un:s.username,em:s.email}),c&&(t.cu=c),t}function c(e){if(!e)return null;var t=function(e){if(!e)return null;var t={};return i.COMPRESSED_NAV_TIMING_MARKS.forEach((function(n,r){var a=i.NAVIGATION_TIMING_MARKS[r];t[n]=e[a]})),t}(e.navigationTiming);return{nt:t,a:u(t,e.agent)}}function u(e,t){var n={};if(e&&(n={fb:e.rs,di:e.di,dc:e.dc}),t){var r=t.firstContentfulPaint,i=t.largestContentfulPaint;r&&(n.fp=r),i&&(n.lp=i)}return 0===Object.keys(n).length?null:n}function d(e){return e.map((function(e){var t=e.span,n=e.samples;return{y:{t:t.type},sa:{ysc:{v:n["span.self_time.count"].value},yss:{v:n["span.self_time.sum.us"].value}}}}))}},function(e,t,n){"use strict";t.__esModule=!0,t.sendXHR=function(e,t,n){var o=n.timeout,s=void 0===o?HTTP_REQUEST_TIMEOUT:o,c=n.payload,u=n.headers,d=n.beforeSend,f=n.sendCredentials;return new a.Promise((function(n,a){var o=new window.XMLHttpRequest;if(o[r.XHR_IGNORE]=!0,o.open(e,t,!0),o.timeout=s,o.withCredentials=f,u)for(var l in u)u.hasOwnProperty(l)&&o.setRequestHeader(l,u[l]);o.onreadystatechange=function(){if(4===o.readyState){var e=o.status,r=o.responseText;(0,i.isResponseSuccessful)(e)?n(o):a({url:t,status:e,responseText:r})}},o.onerror=function(){var e=o.status,n=o.responseText;a({url:t,status:e,responseText:n})};var p=!0;"function"==typeof d&&(p=d({url:t,method:e,headers:u,payload:c,xhr:o})),p?o.send(c):a({url:t,status:0,responseText:"Request rejected by user configuration."})}))};var r=n(126),i=n(155),a=n(118)},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=n(109),a=(r=n(156))&&r.__esModule?r:{default:r},o=n(108);function s(){return s=Object.assign||function(e){for(var t=1;t0?e.charAt(0).toUpperCase()+e.substring(1):e})).join("")]=a.value||a.nodeValue)}return t}((0,i.getCurrentScript)());this.setConfig(e)},t.setVersion=function(e){this.version=e},t.addFilter=function(e){if("function"!=typeof e)throw new Error("Argument to must be function");this.filters.push(e)},t.applyFilters=function(e){for(var t=0;t0&&(n=1e-4),e.transactionSampleRate=Math.round(1e4*n)/1e4),(0,i.merge)(this.config,e),this.events.send(o.CONFIG_CHANGE,[this.config])},t.validate=function(e){void 0===e&&(e={});var t=["serviceName","serverUrl"],n=Object.keys(this.config),r={missing:[],invalid:[],unknown:[]};Object.keys(e).forEach((function(i){-1===t.indexOf(i)||e[i]||r.missing.push(i),-1===n.indexOf(i)&&r.unknown.push(i)})),e.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(e.serviceName)&&r.invalid.push({key:"serviceName",value:e.serviceName,allowed:"a-z, A-Z, 0-9, _, -, "});var i=e.transactionSampleRate;return void 0!==i&&("number"!=typeof i||isNaN(i)||i<0||i>1)&&r.invalid.push({key:"transactionSampleRate",value:i,allowed:"Number between 0 and 1"}),r},t.getLocalConfig=function(){var e=sessionStorage;this.config.session&&(e=localStorage);var t=e.getItem(o.LOCAL_CONFIG_KEY);if(t)return JSON.parse(t)},t.setLocalConfig=function(e,t){if(e){t&&(e=s({},this.getLocalConfig(),e));var n=sessionStorage;this.config.session&&(n=localStorage),n.setItem(o.LOCAL_CONFIG_KEY,JSON.stringify(e))}},t.dispatchEvent=function(e,t){this.events.send(e,t)},t.observeEvent=function(e,t){return this.events.observe(e,t)},e}(),u=c;t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(109),i=function(){function e(e){void 0===e&&(e={}),this.levels=["trace","debug","info","warn","error"],this.level=e.level||"warn",this.prefix=e.prefix||"",this.resetLogMethods()}var t=e.prototype;return t.shouldLog=function(e){return this.levels.indexOf(e)>=this.levels.indexOf(this.level)},t.setLevel=function(e){e!==this.level&&(this.level=e,this.resetLogMethods())},t.resetLogMethods=function(){var e=this;this.levels.forEach((function(t){e[t]=e.shouldLog(t)?function(){var e=t;"trace"!==t&&"debug"!==t||(e="info");var n=arguments;if(n[0]=this.prefix+n[0],console){var r=console[e]||console.log;"function"==typeof r&&r.apply(console,n)}}:r.noop}))},e}(),a=i;t.default=a},function(e,t,n){"use strict";t.__esModule=!0,t.registerServices=function(){o.serviceCreators[a.TRANSACTION_SERVICE]=function(e){var t=e.getService([a.LOGGING_SERVICE,a.CONFIG_SERVICE]),n=t[0],r=t[1];return new i.default(n,r)},o.serviceCreators[a.PERFORMANCE_MONITORING]=function(e){var t=e.getService([a.APM_SERVER,a.CONFIG_SERVICE,a.LOGGING_SERVICE,a.TRANSACTION_SERVICE]),n=t[0],i=t[1],o=t[2],s=t[3];return new r.default(n,i,o,s)}};var r=s(n(244)),i=s(n(248)),a=n(108),o=n(136);function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";t.__esModule=!0,t.groupSmallContinuouslySimilarSpans=f,t.adjustTransaction=l,t.default=void 0;var r=n(109),i=n(134),a=n(137),o=n(126),s=n(108),c=n(135),u=n(116),d=.05;function f(e,t,n){e.sort((function(e,t){return e._start-t._start}));var r=[],i=1;return e.forEach((function(a,o){if(0===r.length)r.push(a);else{var s=r[r.length-1],c=s.type===a.type&&s.subtype===a.subtype&&s.action===a.action&&s.name===a.name&&a.duration()/t1&&(!c||u)&&(s.name=i+"x "+s.name,i=1),c||r.push(a)}})),r}function l(e){if(e.sampled){var t=e.spans.filter((function(t){return t.duration()>0&&t._start>=e._start&&t._end<=e._end}));if(e.isManaged()){var n=f(t,e.duration(),d);e.spans=n}else e.spans=t}else e.resetFields();return e}var p=function(){function e(e,t,n,r){this._apmServer=e,this._configService=t,this._logginService=n,this._transactionService=r}var t=e.prototype;return t.init=function(e){var t=this;void 0===e&&(e={}),this._configService.events.observe(s.TRANSACTION_END+s.AFTER_EVENT,(function(e){var n=t.createTransactionPayload(e);n&&(t._apmServer.addTransaction(n),t._configService.dispatchEvent(s.QUEUE_ADD_TRANSACTION))})),e[s.HISTORY]&&a.patchEventHandler.observe(s.HISTORY,this.getHistorySub()),e[s.XMLHTTPREQUEST]&&a.patchEventHandler.observe(s.XMLHTTPREQUEST,this.getXHRSub()),e[s.FETCH]&&a.patchEventHandler.observe(s.FETCH,this.getFetchSub())},t.getHistorySub=function(){var e=this._transactionService;return function(t,n){n.source===s.HISTORY&&t===s.INVOKE&&e.startTransaction(n.data.title,"route-change",{managed:!0,canReuse:!0})}},t.getXHRSub=function(){var e=this;return function(t,n){n.source!==s.XMLHTTPREQUEST||o.globalState.fetchInProgress||e.processAPICalls(t,n)}},t.getFetchSub=function(){var e=this;return function(t,n){n.source===s.FETCH&&e.processAPICalls(t,n)}},t.processAPICalls=function(e,t){var n=this._configService,a=this._transactionService;if(t.data&&t.data.url){var o=this._apmServer.getEndpoints();if(Object.keys(o).some((function(e){return-1!==t.data.url.indexOf(o[e])})))return}if(e===s.SCHEDULE&&t.data){var c=t.data,d=new i.Url(c.url),f=c.method+" "+(d.relative?d.path:(0,r.stripQueryStringFromUrl)(d.href));a.getCurrentTransaction()||a.startTransaction(f,s.HTTP_REQUEST_TYPE,{managed:!0});var l=a.startSpan(f,"external.http",{blocking:!0});if(!l)return;var p=n.get("distributedTracing"),v=n.get("distributedTracingOrigins"),h=new i.Url(window.location.href),_=(0,r.checkSameOrigin)(d.origin,h.origin)||(0,r.checkSameOrigin)(d.origin,v),g=c.target;p&&_&&g?(this.injectDtHeader(l,g),n.get("propagateTracestate")&&this.injectTSHeader(l,g)):u.__DEV__&&this._logginService.debug("Could not inject distributed tracing header to the request origin ('"+d.origin+"') from the current origin ('"+h.origin+"')"),c.sync&&(l.sync=c.sync),c.span=l}else if(e===s.INVOKE){var m=t.data;if(m&&m.span){var E,T,S=m.span,R=m.response,y=m.target;E=R?R.status:y.status,T="abort"==m.status||m.aborted?s.OUTCOME_UNKNOWN:E>=400||0==E?s.OUTCOME_FAILURE:s.OUTCOME_SUCCESS,S.outcome=T;var O=a.getCurrentTransaction();O&&O.type===s.HTTP_REQUEST_TYPE&&(O.outcome=T),a.endSpan(S,m)}}},t.injectDtHeader=function(e,t){var n=this._configService.get("distributedTracingHeaderName"),i=(0,r.getDtHeaderValue)(e);(0,r.isDtHeaderValid)(i)&&i&&n&&(0,r.setRequestHeader)(t,n,i)},t.injectTSHeader=function(e,t){var n=(0,r.getTSHeaderValue)(e);n&&(0,r.setRequestHeader)(t,"tracestate",n)},t.extractDtHeader=function(e){var t=this._configService.get("distributedTracingHeaderName");if(e)return(0,r.parseDtHeaderValue)(e[t])},t.filterTransaction=function(e){var t=e.duration();if(!t){if(u.__DEV__){var n="transaction("+e.id+", "+e.name+") was discarded! ";n+=0===t?"Transaction duration is 0":"Transaction wasn't ended",this._logginService.debug(n)}return!1}if(e.isManaged()){if(t>6e4)return u.__DEV__&&this._logginService.debug("transaction("+e.id+", "+e.name+") was discarded! Transaction duration ("+t+") is greater than managed transaction threshold (60000)"),!1;if(e.sampled&&0===e.spans.length)return u.__DEV__&&this._logginService.debug("transaction("+e.id+", "+e.name+") was discarded! Transaction does not have any spans"),!1}return!0},t.createTransactionDataModel=function(e){var t=e._start,n=e.spans.map((function(n){var r={id:n.id,transaction_id:e.id,parent_id:n.parentId||e.id,trace_id:e.traceId,name:n.name,type:n.type,subtype:n.subtype,action:n.action,sync:n.sync,start:parseInt(n._start-t),duration:n.duration(),context:n.context,outcome:n.outcome,sample_rate:n.sampleRate};return(0,c.truncateModel)(c.SPAN_MODEL,r)})),r={id:e.id,trace_id:e.traceId,session:e.session,name:e.name,type:e.type,duration:e.duration(),spans:n,context:e.context,marks:e.marks,breakdown:e.breakdownTimings,span_count:{started:n.length},sampled:e.sampled,sample_rate:e.sampleRate,experience:e.experience,outcome:e.outcome};return(0,c.truncateModel)(c.TRANSACTION_MODEL,r)},t.createTransactionPayload=function(e){var t=l(e);if(this.filterTransaction(t))return this.createTransactionDataModel(e)},e}();t.default=p},function(e,t,n){"use strict";t.__esModule=!0,t.patchXMLHttpRequest=function(e){var t=XMLHttpRequest.prototype;if(t&&t[i.ADD_EVENT_LISTENER_STR])var n="readystatechange",a="load",o="error",s=(0,r.patchMethod)(t,"open",(function(){return function(e,t){return e[r.XHR_IGNORE]||(e[r.XHR_METHOD]=t[0],e[r.XHR_URL]=t[1],e[r.XHR_SYNC]=!1===t[2]),s.apply(e,t)}})),c=(0,r.patchMethod)(t,"send",(function(){return function(t,s){if(t[r.XHR_IGNORE])return c.apply(t,s);var d={source:i.XMLHTTPREQUEST,state:"",type:"macroTask",data:{target:t,method:t[r.XHR_METHOD],sync:t[r.XHR_SYNC],url:t[r.XHR_URL],status:""}};try{return function(t){if(t.state!==i.SCHEDULE){t.state=i.SCHEDULE,e(i.SCHEDULE,t);var r=t.data.target;s(n),s(a),s("timeout"),s(o),s("abort")}function s(e){r[i.ADD_EVENT_LISTENER_STR](e,(function(e){var i=e.type;i===n?4===r.readyState&&0!==r.status&&u(t,"success"):u(t,i===a?"success":i)}))}}(d),c.apply(t,s)}catch(e){throw u(d,o),e}}}));function u(t,n){t.state!==i.INVOKE&&(t.state=i.INVOKE,t.data.status=n,e(i.INVOKE,t))}};var r=n(126),i=n(108)},function(e,t,n){"use strict";t.__esModule=!0,t.patchFetch=function(e){if((0,s.isFetchSupported)()){var t=window.fetch;window.fetch=function(s,u){var d,f,l=this,p=arguments,v=s instanceof URL;if("string"==typeof s||v)d=new Request(s,u),f=v?d.url:s;else{if(!s)return t.apply(l,p);f=(d=s).url}var h={source:a.FETCH,state:"",type:"macroTask",data:{target:d,method:d.method,url:f,aborted:!1}};return new r.Promise((function(r,s){var u;i.globalState.fetchInProgress=!0,function(t){t.state=a.SCHEDULE,e(a.SCHEDULE,t)}(h);try{u=t.apply(l,[d])}catch(e){return s(e),h.data.error=e,n(h),void(i.globalState.fetchInProgress=!1)}u.then((function(e){var t=e.clone?e.clone():{};r(e),(0,o.scheduleMicroTask)((function(){h.data.response=e;var r=t.body;r?function(e,t){var r=e.getReader();!function e(){r.read().then((function(r){r.done?n(t):e()}),(function(e){c(t,e)}))}()}(r,h):n(h)}))}),(function(e){s(e),(0,o.scheduleMicroTask)((function(){c(h,e)}))})),i.globalState.fetchInProgress=!1}))}}function n(t){t.state=a.INVOKE,e(a.INVOKE,t)}function c(e,t){e.data.aborted=function(e){return e&&"AbortError"===e.name}(t),e.data.error=t,n(e)}};var r=n(118),i=n(126),a=n(108),o=n(109),s=n(154)},function(e,t,n){"use strict";t.__esModule=!0,t.patchHistory=function(e){if(window.history){var t=history.pushState;"function"==typeof t&&(history.pushState=function(n,i,a){var o={source:r.HISTORY,data:{state:n,title:i,url:a}};e(r.INVOKE,o),t.apply(this,arguments)})}};var r=n(108)},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=n(118),a=(r=n(157))&&r.__esModule?r:{default:r},o=n(250),s=n(109),c=n(251),u=n(108),d=n(133),f=n(116),l=n(134),p=function(){function e(e,t){var n=this;this._config=t,this._logger=e,this.currentTransaction=void 0,this.respIntervalId=void 0,this.recorder=new o.PerfEntryRecorder((function(e){var t=n.getCurrentTransaction();if(t&&t.captureTimings){var r,i=t.type===u.PAGE_LOAD,a=(0,o.captureObserverEntries)(e,{isHardNavigation:i,trStart:i?0:t._start}),s=a.spans,c=a.marks;(r=t.spans).push.apply(r,s),t.addMarks({agent:c})}}))}var t=e.prototype;return t.createCurrentTransaction=function(e,t,n){var r=new a.default(e,t,n);return this.currentTransaction=r,r},t.getCurrentTransaction=function(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},t.createOptions=function(e){var t=this._config.config,n={transactionSampleRate:t.transactionSampleRate},r=(0,s.extend)(n,e);return r.managed&&(r=(0,s.extend)({pageLoadTraceId:t.pageLoadTraceId,pageLoadSampled:t.pageLoadSampled,pageLoadSpanId:t.pageLoadSpanId,pageLoadTransactionName:t.pageLoadTransactionName},r)),r},t.startManagedTransaction=function(e,t,n){var r=this.getCurrentTransaction(),i=!1;if(r)if(r.canReuse()&&n.canReuse){var a=r.type,o=u.TRANSACTION_TYPE_ORDER.indexOf(r.type),s=u.TRANSACTION_TYPE_ORDER.indexOf(t);o>=0&&s=e._start)f.__DEV__&&t._logger.debug("transaction("+e.id+", "+r+", "+i+") was discarded! The page was hidden during the transaction!");else if(t.shouldIgnoreTransaction(r)||i===u.TEMPORARY_TYPE)f.__DEV__&&t._logger.debug("transaction("+e.id+", "+r+", "+i+") is ignored");else{if(i===u.PAGE_LOAD){var a=t._config.get("pageLoadTransactionName");if(r===u.NAME_UNKNOWN&&a&&(e.name=a),e.captureTimings){var p=o.metrics.cls,v=o.metrics.fid,h=o.metrics.tbt,_=o.metrics.longtask;h.duration>0&&e.spans.push((0,o.createTotalBlockingTimeSpan)(h)),e.experience={},(0,s.isPerfTypeSupported)(u.LONG_TASK)&&(e.experience.tbt=h.duration),(0,s.isPerfTypeSupported)(u.LAYOUT_SHIFT)&&(e.experience.cls=p.score),v>0&&(e.experience.fid=v),_.count>0&&(e.experience.longtask={count:_.count,sum:_.duration,max:_.max})}t.setSession(e)}e.name===u.NAME_UNKNOWN&&(e.name=(0,l.slugifyUrl)(n)),(0,c.captureNavigation)(e),t.adjustTransactionTime(e),t._config.get("breakdownMetrics")&&e.captureBreakdown();var g=t._config.get("context");(0,d.addTransactionContext)(e,g),t._config.events.send(u.TRANSACTION_END,[e]),f.__DEV__&&t._logger.debug("end transaction("+e.id+", "+e.name+", "+e.type+")",e)}}),(function(n){f.__DEV__&&t._logger.debug("error ending transaction("+e.id+", "+e.name+")",n)}))},t.setSession=function(e){var t=this._config.get("session");if(t){"boolean"==typeof t||t.timestamp&&Date.now()-t.timestamp>u.SESSION_TIMEOUT?e.session={id:(0,s.generateRandomId)(16),sequence:1}:e.session={id:t.id,sequence:t.sequence?t.sequence+1:1};var n={session:{id:e.session.id,sequence:e.session.sequence,timestamp:Date.now()}};this._config.setConfig(n),this._config.setLocalConfig(n,!0)}},t.adjustTransactionTime=function(e){var t=e.spans,n=(0,s.getEarliestSpan)(t);n&&n._starte._end&&(e._end=r);this.truncateSpans(t,e._end)},t.truncateSpans=function(e,t){for(var n=0;nt&&(r._end=t,r.type+=u.TRUNCATED_TYPE),r._start>t&&(r._start=t)}},t.shouldIgnoreTransaction=function(e){var t=this._config.get("ignoreTransactions");if(t&&t.length)for(var n=0;ns?(c+=o-s,s=a):a>s&&(s=a);return s=r})),c={spans:u(o,s.longtask),marks:{}};if(!n)return c;var p=e.getEntriesByType(i.LARGEST_CONTENTFUL_PAINT),v=p[p.length-1];if(v){var h=parseInt(v.startTime);s.lcp=h,c.marks.largestContentfulPaint=h}var _=a.PERF.timing,g=_.fetchStart-_.navigationStart;(0,a.isRedirectInfoAvailable)(_)&&(g=0);var m=e.getEntriesByName(i.FIRST_CONTENTFUL_PAINT)[0];if(m){var E=parseInt(g>=0?m.startTime-g:m.startTime);s.fcp=E,c.marks.firstContentfulPaint=E}var T=d(e.getEntriesByType(i.FIRST_INPUT));return T&&(s.fid=T.duration(),c.spans.push(T)),f(o),l(e.getEntriesByType(i.LAYOUT_SHIFT)),c},t.PerfEntryRecorder=t.metrics=void 0;var r,i=n(108),a=n(109),o=(r=n(121))&&r.__esModule?r:{default:r},s={fid:0,fcp:0,tbt:{start:1/0,duration:0},cls:{score:0,firstEntryTime:Number.NEGATIVE_INFINITY,prevEntryTime:Number.NEGATIVE_INFINITY,currentSessionScore:0},longtask:{count:0,duration:0,max:0}};t.metrics=s;var c=50;function u(e,t){for(var n=[],r=0;r0){var p=d[0],v=p.name,h=p.containerType,_=p.containerName,g=p.containerId,m={attribution:v,type:h};_&&(m.name=_),g&&(m.id=g),l.addContext({custom:m})}l.end(f),n.push(l)}return n}function d(e){var t=e[0];if(t){var n=t.startTime,r=t.processingStart,a=new o.default("First Input Delay",i.FIRST_INPUT,{startTime:n});return a.end(r),a}}function f(e){e.forEach((function(e){var t=e.name,n=e.startTime,r=e.duration;if(!(n0&&(s.tbt.duration+=i)}}))}function l(e){e.forEach((function(e){!e.hadRecentInput&&e.value&&((e.startTime-s.cls.firstEntryTime>5e3||e.startTime-s.cls.prevEntryTime>1e3)&&(s.cls.firstEntryTime=e.startTime,s.cls.currentSessionScore=0),s.cls.prevEntryTime=e.startTime,s.cls.currentSessionScore+=e.value,s.cls.score=Math.max(s.cls.score,s.cls.currentSessionScore))}))}var p=function(){function e(e){this.po={observe:a.noop,disconnect:a.noop},window.PerformanceObserver&&(this.po=new PerformanceObserver(e))}var t=e.prototype;return t.start=function(e){try{if(!(0,a.isPerfTypeSupported)(e))return;this.po.observe({type:e,buffered:!0})}catch(e){}},t.stop=function(){this.po.disconnect()},e}();t.PerfEntryRecorder=p},function(e,t,n){"use strict";t.__esModule=!0,t.captureNavigation=function(e){if(e.captureTimings){var t=e._end;if(e.type===i.PAGE_LOAD){if(e.marks&&e.marks.custom){var n=e.marks.custom;Object.keys(n).forEach((function(t){n[t]+=e._start}))}e._start=0;var d=r.PERF.timing,f=(0,r.isRedirectInfoAvailable)(d)?d.redirectStart:d.fetchStart;(0,o.createNavigationTimingSpans)(d,f,0,t).forEach((function(t){t.traceId=e.traceId,t.sampled=e.sampled,t.pageResponse&&e.options.pageLoadSpanId&&(t.id=e.options.pageLoadSpanId),e.spans.push(t)})),e.addMarks((0,u.getPageLoadMarks)(d))}if((0,r.isPerfTimelineSupported)()){var l=e._start,p=r.PERF.getEntriesByType(i.RESOURCE);(0,c.createResourceTimingSpans)(p,a.state.bootstrapTime,l,t).forEach((function(t){return e.spans.push(t)}));var v=r.PERF.getEntriesByType(i.MEASURE);(0,s.createUserTimingSpans)(v,l,t).forEach((function(t){return e.spans.push(t)}))}}};var r=n(109),i=n(108),a=n(116),o=n(252);t.createNavigationTimingSpans=o.createNavigationTimingSpans;var s=n(253);t.createUserTimingSpans=s.createUserTimingSpans;var c=n(254);t.createResourceTimingSpans=c.createResourceTimingSpans;var u=n(153);t.getPageLoadMarks=u.getPageLoadMarks},function(e,t,n){"use strict";t.__esModule=!0,t.createNavigationTimingSpans=function(e,t,n,r){for(var s=[],c=0;ct}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(256);t.observePageVisibility=r.observePageVisibility;var i=n(257);t.observePageClicks=i.observePageClicks},function(e,t,n){"use strict";t.__esModule=!0,t.observePageVisibility=function(e,t){"hidden"===document.visibilityState&&(i.state.lastHiddenStart=0);var n=function(){"hidden"===document.visibilityState&&o(e,t)},r=function(){return o(e,t)},a=!0;return window.addEventListener("visibilitychange",n,a),window.addEventListener("pagehide",r,a),function(){window.removeEventListener("visibilitychange",n,a),window.removeEventListener("pagehide",r,a)}};var r=n(108),i=n(116),a=n(109);function o(e,t){var n=t.getCurrentTransaction();if(n){var o=e.observeEvent(r.QUEUE_ADD_TRANSACTION,(function(){e.dispatchEvent(r.QUEUE_FLUSH),i.state.lastHiddenStart=(0,a.now)(),o()}));n.end()}else e.dispatchEvent(r.QUEUE_FLUSH),i.state.lastHiddenStart=(0,a.now)()}},function(e,t,n){"use strict";t.__esModule=!0,t.observePageClicks=function(e){var t=function(t){t.target instanceof Element&&function(e,t){var n=function(e){var t={transactionName:null,context:null};t.transactionName=function(e){var t=function(e){if(e.closest){var t=e.closest(i);return t?t.dataset.transactionName:null}return e.dataset.transactionName}(e);if(t)return t;var n=e.tagName.toLowerCase(),r=e.getAttribute("name");return r?n+'["'+r+'"]':n}(e);var n=e.getAttribute("class");return n&&(t.context={custom:{classes:n}}),t}(t),a=n.transactionName,o=n.context,s=e.startTransaction("Click - "+a,r.USER_INTERACTION,{managed:!0,canReuse:!0,reuseThreshold:300});s&&o&&s.addContext(o)}(e,t.target)},n="click";return window.addEventListener(n,t,!0),function(){window.removeEventListener(n,t,!0)}};var r=n(108),i="a[data-transaction-name], button[data-transaction-name]"},function(e,t,n){"use strict";t.__esModule=!0,t.getInstrumentationFlags=function(e,t){var n,i=((n={})[r.XMLHTTPREQUEST]=!1,n[r.FETCH]=!1,n[r.HISTORY]=!1,n[r.PAGE_LOAD]=!1,n[r.ERROR]=!1,n[r.EVENT_TARGET]=!1,n[r.CLICK]=!1,n);return e?(Object.keys(i).forEach((function(e){-1===t.indexOf(e)&&(i[e]=!0)})),i):i};var r=n(108)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t=function(){clearTimeout(n),cancelAnimationFrame(i),setTimeout(e)},n=setTimeout(t,r),i=requestAnimationFrame(t)};var r=100},function(e,t,n){"use strict";t.__esModule=!0,t.bootstrap=function(){return(0,r.isPlatformSupported)()?((0,i.patchAll)(),a.state.bootstrapTime=(0,r.now)(),o=!0):r.isBrowser&&console.log("[Elastic APM] platform is not supported!"),o};var r=n(109),i=n(137),a=n(116),o=!1},function(e,t,n){"use strict";t.__esModule=!0,t.createTracer=function(e){var t=e.getService(a.PERFORMANCE_MONITORING),n=e.getService(a.TRANSACTION_SERVICE),i=e.getService(a.ERROR_LOGGING),o=e.getService(a.LOGGING_SERVICE);return new r.default(t,n,o,i)};var r=o(n(262));t.Tracer=r.default;var i=o(n(162));t.Span=i.default;var a=n(108);function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=n(159),a=n(160),o=n(119),s=n(109),c=n(116),u=(r=n(162))&&r.__esModule?r:{default:r};function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}var f=function(e){var t,n;function r(t,n,r,i){var a;return(a=e.call(this)||this).performanceMonitoring=t,a.transactionService=n,a.loggingService=r,a.errorLogging=i,a}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,d(t,n);var i=r.prototype;return i._startSpan=function(e,t){var n,r={managed:!0};if(t)if(r.timestamp=t.startTime,t.childOf)r.parentId=t.childOf.id;else if(t.references&&t.references.length>0){t.references.length>1&&c.__DEV__&&this.loggingService.debug("Elastic APM OpenTracing: Unsupported number of references, only the first childOf reference will be recorded.");var i=(0,s.find)(t.references,(function(e){return e.type()===a.REFERENCE_CHILD_OF}));i&&(r.parentId=i.referencedContext().id)}if(!(n=this.transactionService.getCurrentTransaction()?this.transactionService.startSpan(e,void 0,r):this.transactionService.startTransaction(e,void 0,r)))return new o.Span;r.timestamp&&(n._start=r.timestamp-(0,s.getTimeOrigin)());var d=new u.default(this,n);return t&&t.tags&&d.addTags(t.tags),d},i._inject=function(e,t,n){switch(t){case a.FORMAT_TEXT_MAP:case a.FORMAT_HTTP_HEADERS:this.performanceMonitoring.injectDtHeader(e,n);break;case a.FORMAT_BINARY:c.__DEV__&&this.loggingService.debug("Elastic APM OpenTracing: binary carrier format is not supported.")}},i._extract=function(e,t){var n;switch(e){case a.FORMAT_TEXT_MAP:case a.FORMAT_HTTP_HEADERS:n=this.performanceMonitoring.extractDtHeader(t);break;case a.FORMAT_BINARY:c.__DEV__&&this.loggingService.debug("Elastic APM OpenTracing: binary carrier format is not supported.")}return n||(n=null),n},r}(i.Tracer);t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(160),i=n(264),a=n(119);t.childOf=function(e){return e instanceof a.default&&(e=e.context()),new i.default(r.REFERENCE_CHILD_OF,e)},t.followsFrom=function(e){return e instanceof a.default&&(e=e.context()),new i.default(r.REFERENCE_FOLLOWS_FROM,e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(119),i=function(){function e(e,t){this._type=e,this._referencedContext=t instanceof r.default?t.context():t}return e.prototype.type=function(){return this._type},e.prototype.referencedContext=function(){return this._referencedContext},e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.toTraceId=function(){return""},e.prototype.toSpanId=function(){return""},e}();t.SpanContext=r,t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(151),i=function(){function e(e,t){this._disable=t,this.serviceFactory=e,this._initialized=!1}var t=e.prototype;return t.isEnabled=function(){return!this._disable},t.isActive=function(){var e=this.serviceFactory.getService(r.CONFIG_SERVICE);return this.isEnabled()&&this._initialized&&e.get("active")},t.init=function(e){var t=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var n=this.serviceFactory.getService([r.CONFIG_SERVICE,r.LOGGING_SERVICE,r.TRANSACTION_SERVICE]),i=n[0],a=n[1],o=n[2];i.setVersion("5.14.0"),this.config(e);var s=i.get("logLevel");if(a.setLevel(s),i.get("active")){this.serviceFactory.init();var c=(0,r.getInstrumentationFlags)(i.get("instrument"),i.get("disableInstrumentations"));if(this.serviceFactory.getService(r.PERFORMANCE_MONITORING).init(c),c[r.ERROR]&&this.serviceFactory.getService(r.ERROR_LOGGING).registerListeners(),i.get("session")){var u=i.getLocalConfig();u&&u.session&&i.setConfig({session:u.session})}var d=function(){return c[r.PAGE_LOAD]&&t._sendPageLoadMetrics()};i.get("centralConfig")?this.fetchCentralConfig().then(d):d(),(0,r.observePageVisibility)(i,o),c[r.EVENT_TARGET]&&c[r.CLICK]&&(0,r.observePageClicks)(o)}else this._disable=!0,a.warn("RUM agent is inactive")}return this},t.fetchCentralConfig=function(){var e=this.serviceFactory.getService([r.APM_SERVER,r.LOGGING_SERVICE,r.CONFIG_SERVICE]),t=e[0],n=e[1],i=e[2];return t.fetchConfig(i.get("serviceName"),i.get("environment")).then((function(e){var t=e.transaction_sample_rate;if(t){var r={transactionSampleRate:t=Number(t)},a=i.validate(r).invalid;if(0===a.length)i.setConfig(r);else{var o=a[0],s=o.key,c=o.value,u=o.allowed;n.warn('invalid value "'+c+'" for '+s+". Allowed: "+u+".")}}return e})).catch((function(e){n.warn("failed fetching config:",e)}))},t._sendPageLoadMetrics=function(){var e=this.startTransaction(void 0,r.PAGE_LOAD,{managed:!0,canReuse:!0});if(e){e.addTask(r.PAGE_LOAD);var t=function(){setTimeout((function(){return e.removeTask(r.PAGE_LOAD)}),r.PAGE_LOAD_DELAY)};"complete"===document.readyState?t():window.addEventListener("load",t)}},t.observe=function(e,t){this.serviceFactory.getService(r.CONFIG_SERVICE).events.observe(e,t)},t.config=function(e){var t=this.serviceFactory.getService([r.CONFIG_SERVICE,r.LOGGING_SERVICE]),n=t[0],i=t[1],a=n.validate(e),o=a.missing,s=a.invalid,c=a.unknown;if(c.length>0){var u="Unknown config options are specified for RUM agent: "+c.join(", ");i.warn(u)}if(0===o.length&&0===s.length)n.setConfig(e);else{var d=", ",f="RUM agent isn't correctly configured. ";o.length>0&&(f+=o.join(d)+" is missing",s.length>0&&(f+=d)),s.forEach((function(e,t){var n=e.key,r=e.value,i=e.allowed;f+=n+' "'+r+'" contains invalid characters! (allowed: '+i+")"+(t!==s.length-1?d:"")})),i.error(f),n.setConfig({active:!1})}},t.setUserContext=function(e){this.serviceFactory.getService(r.CONFIG_SERVICE).setUserContext(e)},t.setCustomContext=function(e){this.serviceFactory.getService(r.CONFIG_SERVICE).setCustomContext(e)},t.addLabels=function(e){this.serviceFactory.getService(r.CONFIG_SERVICE).addLabels(e)},t.setInitialPageLoadName=function(e){this.serviceFactory.getService(r.CONFIG_SERVICE).setConfig({pageLoadTransactionName:e})},t.startTransaction=function(e,t,n){if(this.isEnabled())return this.serviceFactory.getService(r.TRANSACTION_SERVICE).startTransaction(e,t,n)},t.startSpan=function(e,t,n){if(this.isEnabled())return this.serviceFactory.getService(r.TRANSACTION_SERVICE).startSpan(e,t,n)},t.getCurrentTransaction=function(){if(this.isEnabled())return this.serviceFactory.getService(r.TRANSACTION_SERVICE).getCurrentTransaction()},t.captureError=function(e){if(this.isEnabled())return this.serviceFactory.getService(r.ERROR_LOGGING).logError(e)},t.addFilter=function(e){this.serviceFactory.getService(r.CONFIG_SERVICE).addFilter(e)},e}();t.default=i},,function(e,t,n){"use strict";t.__esModule=!0,t.apm=t.apmBase=t.init=t.default=void 0;var r,i=n(151),a=(r=n(266))&&r.__esModule?r:{default:r};t.ApmBase=a.default;var o=function(){if(i.isBrowser&&window.elasticApm)return window.elasticApm;var e=(0,i.bootstrap)(),t=(0,i.createServiceFactory)(),n=new a.default(t,!e);return i.isBrowser&&(window.elasticApm=n),n}();t.apm=t.apmBase=o;var s=o.init.bind(o);t.init=s;var c=s;t.default=c}])]);