@arms/rum-miniapp 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function t(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.RumSDK=n():e.RumSDK=n()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return 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 o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./dist/",n(n.s=17)}([function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function t(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Shell=e.Reporter=e.Context=e.Client=void 0;var i=n(8);e.Client=i.default;var a=n(10);e.Context=a.default;var u=n(21);e.Reporter=u.default;var c=n(23);e.Shell=c.default,o(n(24),e),o(n(9),e),o(n(25),e),o(n(26),e),o(n(27),e),o(n(7),e),o(n(28),e),o(n(29),e),o(n(13),e),o(n(14),e),o(n(2),e),o(n(30),e),o(n(15),e),o(n(31),e),o(n(11),e),o(n(12),e)},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o;Object.defineProperty(e,"__esModule",{value:!0}),e.HEADER_KEY=e.getPerformance=e.setStorageSync=e.getStorageSync=e.appName=e.sdk=e.ksName=e.jdName=e.swanName=e.alipayName=e.dingtalkName=e.wechatName=e.bytedanceName=e.qqName=e.VERSION=void 0,e.VERSION="cdn-0.1.1";var i="object";function a(t){return"function"==typeof t}function u(){var t,n="unknown";if(("undefined"==typeof ks?"undefined":r(ks))===i)t=ks,n=e.ksName;else if(("undefined"==typeof swan?"undefined":r(swan))===i)t=swan,n=e.swanName;else if(("undefined"==typeof qq?"undefined":r(qq))===i)t=qq,n=e.qqName;else if(("undefined"==typeof tt?"undefined":r(tt))===i)t=tt,n=e.bytedanceName;else if(("undefined"==typeof dd?"undefined":r(dd))===i)t=dd,n=e.dingtalkName;else if(("undefined"==typeof my?"undefined":r(my))===i)t=my,n=e.alipayName;else if(("undefined"==typeof jd?"undefined":r(jd))===i)t=jd,n=e.jdName;else{if(("undefined"==typeof wx?"undefined":r(wx))!==i)throw new Error("Current platform is not supported.");t=wx,n=e.wechatName}return{sdk:t,appName:n}}function c(t){return a(e.sdk.getStorageSync)?e.appName===e.alipayName||e.appName===e.dingtalkName?e.sdk.getStorageSync({key:t}).data:e.sdk.getStorageSync(t):void 0}function s(t,n){return a(e.sdk.getStorageSync)?e.appName===e.alipayName||e.appName===e.dingtalkName?e.sdk.setStorageSync({key:t,data:n}):e.sdk.setStorageSync(t,n):void 0}function f(){return a(e.sdk.getPerformance)?e.sdk.getPerformance():"performance"in e.sdk?e.sdk.performance:void 0}e.qqName="qq",e.bytedanceName="bytedance",e.wechatName="wechat",e.dingtalkName="dingtalk",e.alipayName="alipay",e.swanName="swan",e.jdName="jd",e.ksName="ks",o=u(),e.sdk=o.sdk,e.appName=o.appName,e.getStorageSync=c,e.setStorageSync=s,e.getPerformance=f,e.HEADER_KEY=function(){switch(e.appName){case"alipay":return"headers";default:return"header"}}(),e.default=e.sdk},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return r(t)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.isZero=e.isObject=e.isNull=e.isNumber=e.isBoolean=e.isRegExp=e.isArray=e.isToString=e.isString=e.isFunction=e.isTypeof=void 0,e.isTypeof=o;var i=function t(e){return"function"==typeof e};function a(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")}function u(){for(var t=0;t<arguments.length;t++)if(0!==(t<0||arguments.length<=t?void 0:arguments[t]))return!1;return!0}e.isFunction=i,e.isString=function(t){return o(t,"string")},e.isToString=a,e.isArray=function(t){return a(t,"Array")},e.isRegExp=function(t){return a(t,"RegExp")},e.isBoolean=function(t){return o(t,"boolean")},e.isNumber=function(t){return o(t,"number")&&!isNaN(t)||o(t,"bigint")},e.isNull=function(t){return null===t},e.isObject=function(t){return!(0,e.isNull)(t)&&o(t,"object")},e.isZero=u},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),u=new y(r||[]);return w(a,"_invoke",{value:f(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function s(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function f(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}o=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=u.prototype=i.prototype=Object.create(x);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new s(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function f(t,e,n){return e=y(e),l(t,h()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function l(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var m=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.checkEnable=void 0;var g=n(0),b=n(1),w="arms_rum2_local_config";function E(t){var e,n,r,o,i={};i.enable=null===(e=t.enable)||void 0===e||e;var a=t.session;if(a){var u={};u.sampleRate=(null!==(n=a.sampling)&&void 0!==n?n:100)/100,u.storage=null!==(r=a.storage)&&void 0!==r?r:"auto",i.sessionConfig=u}var c=t.report;if(c){var s={};s.flushTime=c.flush_interval,s.maxEventCount=c.max_batch_count,i.reportConfig=s}var f=t.tracing;if(f){var l={enable:null===(o=f.enable)||void 0===o||o},p=[];(f.rules||[]).forEach((function(t){var e={enable:t.enable,tracestate:t.tracestate,baggage:t.baggage,propagatorTypes:t.protocols,sampling:t.sampling};return"{location.origin}"===t.match?void(l=Object.assign(Object.assign({},l),e)):(e.match=(0,g.parseRule2Match)(t),void p.push(e))})),l.allowedUrls=p,i.tracing=l}var h=t.collectors;if(h&&0<Object.keys(h).length){var y={};h.forEach((function(t){var e=t.name;if(e){var n=Object.assign({},t),r=t.filters;0<(null==r?void 0:r.length)&&(n.filters=n.filters.map((function(t){return(0,g.parseRule2Match)(t)}))),y[e]=n}})),i.collectors=Object.assign(Object.assign({},i.collectors),y)}return i}var O=function(t){function e(){var t;return i(this,e),(t=f(this,e,arguments)).version="v2",t}return v(e,t),u(e,[{key:"fetchRemoteCfg",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){var e;return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:if(e=this.getRemoteConfigUrl()){n.next=3;break}return n.abrupt("return");case 3:if(!e.includes(".rum.aliyuncs.com")){n.next=6;break}return this.version="v1",n.abrupt("return",this.getV1Config(e));case 6:return n.abrupt("return",this.getV2Config(e));case 7:case"end":return n.stop()}}),t,this)})))}},{key:"getV1Config",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(t,n){var r;(b.default.request||b.default.httpRequest)({url:e,method:"GET",success:function e(n){t(n)},fail:function t(e){n(e)}})})));case 1:case"end":return n.stop()}}),t)})))}},{key:"getV2Config",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){var n,r;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return n=(0,g.getUrlParams)(e),r={instanceId:"",agentType:"rum_web_sdk",attributes:n,instanceConfigs:[{configType:"rum_web_config",version:1}],capabilities:2},o.abrupt("return",new Promise((function(t,n){var o;(b.default.request||b.default.httpRequest)({url:e,method:"POST",data:JSON.stringify(r),header:{"Content-Type":"application/json","x-log-apiversion":"0.6.0"},success:function e(n){t(n)},fail:function t(e){n(e)}})})));case 3:case"end":return o.stop()}}),t)})))}},{key:"getCacheConfig",value:function t(){var e=(0,b.getStorageSync)(w);if(e){var n,r=this.currentConfig;try{if("pid"in(n=JSON.parse(e))&&n.pid===r.pid||"endpoint"in n&&n.endpoint)return n}catch(t){}return n}}},{key:"setCacheConfig",value:function t(e){var n=this.currentConfig,r=Object.assign(Object.assign({},e),{pid:n.pid,endpoint:n.endpoint});(0,b.setStorageSync)(w,JSON.stringify(r))}},{key:"getRemoteConfigUrl",value:function t(){var e=this.currentConfig,n=e.pid,r,o=e.remoteConfig||{},i=o.url,a=o.region;if(i)return i;if(n){var u=n.split("@");return!u||2>u.length?void 0:"https://".concat(u[0],"-sdk.rum.aliyuncs.com/config/").concat(a||"cn-hangzhou","/").concat(u[1],"?t=").concat(Date.now())}}},{key:"parseConfig",value:function t(e){try{return"v2"===this.version?E(JSON.parse(e.instanceConfigs[0].config)):e}catch(t){return e}}}])}(g.ConfigManager);function S(t,e){var n,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=t.getConfig();if(!1===o.enable)return!1;var i=null===(n=o.collectors)||void 0===n?void 0:n[e];return(0,g.isBoolean)(i)?i:(0,g.isObject)(i)&&"enable"in i?i.enable:r}e.default=O,e.checkEnable=S},function(t,e,n){"use strict";function r(){if("function"==typeof getCurrentPages)try{var t=getCurrentPages()||[];return t[t.length-1]}catch(t){console.warn("[arms] error in getCurView",t)}}function o(t){if(t){var e=t.getViews();if(e&&e.length)return e[e.length-1]}}function i(t,n){return t?t[e.PAGE_ID]?t[e.PAGE_ID]:n?t[e.PAGE_ID]=n.getViewId():void 0:void 0}function a(t,e){return t&&e?e.getViews().find((function(e){return e.id===t})):void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.getViewById=e.getRumViewId=e.getCurView=e.getCurPage=e.PAGE_ID=void 0,e.PAGE_ID="__rum_view_id",e.getCurPage=r,e.getCurView=o,e.getRumViewId=i,e.getViewById=a},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removePageListener=e.addPageListener=e.originalPage=void 0;var s=n(0),f=n(1),l=n(16),p={onLoad:[],onShow:[],onHide:[],onUnload:[],"*":[]},h=["onLoad","onShow","onReady","onHide","onUnload","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"];function y(t){Object.keys(t).forEach((function(e){var n=t[e];!(0,s.isFunction)(n)||h.includes(e)||e in p||(p[e]=[])})),Object.keys(p).forEach((function(e){"swan"===f.appName&&Object.defineProperty(t,e,{writable:!0}),"*"===e||(0,s.interceptFunction)(t,e,(function(){for(var t=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(p[e]),r(p["*"]));a.forEach((function(e){e.apply(t,o)}))}),!0)}))}function v(t,e){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];n||(0,l.addComponentListener)(t,e),t in p||(p[t]=[]),p[t].push(e)}function d(t,e){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];if(n||(0,l.removeComponentListener)(t,e),t in p){var r=p[t],o=r.indexOf(e);r.splice(o,1)}}e.originalPage=Page,Page=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{y.apply(this,n)}catch(t){}return e.originalPage.apply(this,n)},Object.keys(e.originalPage).forEach((function(t){Page[t]=e.originalPage[t]})),e.addPageListener=v,e.removePageListener=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCurrentTime=e.formatNumber=void 0;var r=n(1);function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3;if(!t)return t;var n=t.toString(),r=n.indexOf(".");return n=-1===r?n.substring(0):n.substring(0,e+r+1),parseFloat(n)}function i(t){var e=(0,r.getPerformance)(),n=0;return e&&e.timeOrigin&&e.now&&(n=Math.round(e.timeOrigin+(t||e.now()))),1e12>n&&(n=(new Date).getTime()),n}e.formatNumber=o,e.getCurrentTime=i},function(t,e,n){"use strict";var r,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e.AppType=e.ResourceStatus=e.RumEventType=void 0,function(t){t.VIEW="view",t.RESOURCE="resource",t.EXCEPTION="exception",t.LONG_TASK="longTask",t.ACTION="action",t.CUSTOM="custom",t.APPLICATION="application"}(r=e.RumEventType||(e.RumEventType={})),function(t){t[t.Unknown=-1]="Unknown",t[t.Failed=0]="Failed",t[t.Success=1]="Success"}(o=e.ResourceStatus||(e.ResourceStatus={})),function(t){t.browser="browser",t.miniapp="miniapp",t.minigame="minigame",t.uniapp="uniapp",t.reactnative="reactnative"}(i=e.AppType||(e.AppType={}))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function t(){};return{s:o,n:function e(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function e(){n=n.call(t)},n:function t(){var e=n.next();return u=e.done,e},e:function t(e){c=!0,a=e},f:function t(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,f(r.key),r)}}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==r(e)?e:e+""}function l(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=n(9),h=n(20),y=n(10),v=n(2),d=function(){function t(){var e=this;u(this,t),this.emitter=new h.EventEmitter,this.sendEvent=function(t){e.emitter.emit(p.EventType.collect,t)}}return s(t,[{key:"init",value:function t(e,n,r){var i=this;this.ctx=new y.default(e,n,r);var a=this.ctx,u=this.collectors,c=this.processors,s=this.reporter;c.forEach((function(t){(0,v.isFunction)(t.setup)&&t.setup(a)})),this.emitter.on(p.EventType.collect,(function(t){a.setRumEvent(t);var e=o(c),n;try{for(e.s();!(n=e.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(a)){var i=r.process(a);i&&a.setRumEvent(i)}}}catch(t){e.e(t)}finally{e.f()}s.report(a)})),u.forEach((function(t){t.setup(a,i.sendEvent)}))}},{key:"setContext",value:function t(e){this.ctx=e}},{key:"getContext",value:function t(){return this.ctx}},{key:"useCollectors",value:function t(e){this.collectors=e}},{key:"getCollectors",value:function t(){return this.collectors}},{key:"useProcessors",value:function t(e){this.processors=e}},{key:"useReporter",value:function t(e){this.reporter=e}}])}();e.default=d},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EventType=void 0,function(t){t.collect="collect"}(r=e.EventType||(e.EventType={}))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(e,n,r){o(this,t),this.config=e,this.views=[],n&&(this.session=n,this.session.init(this)),r&&(this.configManager=r)}return a(t,[{key:"getConfig",value:function t(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function t(e){this.configManager?this.configManager.setConfig(e):this.config=e}},{key:"getViews",value:function t(){return this.views}},{key:"addView",value:function t(e){var n=this.views.findIndex((function(t){return t.id===e.id}));n>=0&&this.views.splice(n,1),this.views.push(e)}},{key:"removeView",value:function t(e){this.views=this.views.filter((function(t){return t.id!==e}))}},{key:"getRumEvent",value:function t(){return this.rumEvent}},{key:"setRumEvent",value:function t(e){this.rumEvent=e}}])}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.verifyProperties=void 0;var r=n(2);function o(t){if((0,r.isObject)(t)){var e=Object.assign({},t);Object.keys(e).forEach((function(t){var n=e[t];if(t.length>50){var o=t.substring(0,50);e[o]=n,delete e[t],t=o}(0,r.isString)(n)||(0,r.isNumber)(n)?(0,r.isString)(n)&&n.length>2e3&&(e[t]=n.substring(0,2e3)):delete e[t]}));var n=Object.keys(e);if(n.length)return n.length>20&&n.forEach((function(t,n){n>19&&delete e[t]})),e}}e.verifyProperties=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUrlParams=void 0;var r=function t(e){if(0===e.length)return"";try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function t(e){if(0===e.length)return"";var n=e.indexOf("#"),r=n>=0?e.slice(0,n):e,o=r.indexOf("?");return-1===o?"":r.slice(o+1)};function i(t){if("string"!=typeof t||!t.trim())return{};var e={},n=o(t);if(!n)return e;for(var i=n.split("&"),a=0;a<i.length;a++){var u=i[a];if(u){var c=u.indexOf("=");if(!(c<=0)){var s=r(u.slice(0,c)),f=c<u.length-1?r(u.slice(c+1)):"",l=e[s];void 0!==l?Array.isArray(l)?l.push(f):e[s]=[l,f]:e[s]=f}}}return e}e.getUrlParams=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseRegExpString=e.transStrToReg=e.getType=e.delay=e.debounce=e.generateEventId=e.generateSpanId=e.generateTraceId=e.generateGUID=e.restoreFunction=e.interceptFunction=void 0;var r=n(2),o=/^\[object ([a-z]*)\]$/;function i(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t[e],a=function e(){for(var a=o?this:t,u=arguments.length,c=new Array(u),s=0;s<u;s++)c[s]=arguments[s];if(n.apply(a,c),(0,r.isFunction)(i))return i.apply(a,c)};a._rum_intercepted=i,t[e]=a}function a(t,e){var n=t[e];if(!(0,r.isFunction)(n)){var o=n._rum_intercepted;(0,r.isFunction)(o)||(t[e]=o)}}function u(){var t="";try{if(crypto&&crypto.randomUUID)t=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,t=e.reduce((function(t,e){return t+e.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(e){t=""}return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0,n;return("x"==t?e:3&e|8).toString(16)}))),t}function c(){var t=u().replace(/-/g,"");return"0"===t[0]&&(t="1"+t.substring(1)),"0"===t[16]&&(t=t.substring(0,16)+"1"+t.substring(17)),t}function s(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n="",r=0;r<t;r++)n+=Math.floor(Math.random()*e).toString(e);return n}function f(t){var e=s();return"00-".concat(t,"-").concat(e)}function l(t,e){var n;if((0,r.isFunction)(t))return function(){var r=this,o=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(r,o)}),e)}}function p(t,e){if((0,r.isFunction)(t)){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return setTimeout.apply(void 0,[t,+e||0].concat(o))}}function h(t){var e=Object.prototype.toString.call(t),n=(e=e.toLowerCase()||"").match(o);return null==n?void 0:n[1]}function y(t){return"string"!==h(t)?t:t.length>2&&"/"===t[0]&&"/"===t[t.length-1]?new RegExp(t.substr(1,t.length-2)):t}function v(t){if("string"!=typeof t)throw new TypeError("input must be a string");if(t.length>2&&"/"===t[0]){var e=t.lastIndexOf("/");if(e>0){var n=t.substring(1,e),r=t.substring(e+1);return new RegExp(n,r)}return new RegExp(t.substring(1,t.length-1))}return new RegExp(t)}e.interceptFunction=i,e.restoreFunction=a,e.generateGUID=u,e.generateTraceId=c,e.generateSpanId=s,e.generateEventId=f,e.debounce=l,e.delay=p,e.getType=h,e.transStrToReg=y,e.parseRegExpString=v},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<t.length;n+=1){var r=t[n];if(e(r,n))return r}}function o(t,e){return t.slice(0,e.length)===e}function i(t,e){return t.slice(-e.length)===e}function a(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})),t}Object.defineProperty(e,"__esModule",{value:!0}),e.assign=e.endsWith=e.startsWith=e.find=void 0,e.find=r,e.startsWith=o,e.endsWith=i,e.assign=a},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.parseRule2Match=e.urlMatch=e.matchList=e.isMatchOption=void 0;var s=n(2),f=n(14),l=n(13);function p(t){return(0,s.isString)(t)||(0,s.isFunction)(t)||(0,s.isRegExp)(t)}function h(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;return t.some((function(t){try{if("function"==typeof t)return t(e,r);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?(0,f.startsWith)(e,t):t===e}catch(t){}return!1}))}function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{(0,s.isArray)(e)||(e=[e]);var n=[/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/,/^(https?:)?\/\/.*\.mmstat\.com/,/^(https?:)?\/\/.*hm\.baidu\.com/,/^(https?:)?\/\/.*google-analytics\.com/,/data:(.+?)(;base64)?,(.+)$/].concat(r(e));return h(n,t)}catch(t){return!1}}function v(t){if(p(t))return t;var e;switch(t.match_exp){case"equals":e=function e(n){return n===t.match};break;case"not_equals":e=function e(n){return n!==t.match};break;case"regex":e=(0,l.parseRegExpString)(t.match);break;case"includes":e=function e(n){return n.includes(t.match)};break;case"starts_with":default:e=function e(n){return(0,f.startsWith)(n,t.match)}}return e}e.isMatchOption=p,e.matchList=h,e.urlMatch=y,e.parseRule2Match=v},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removeComponentListener=e.addComponentListener=e.originalComponent=void 0;var s=n(0),f=n(1),l=new Map;["methods","lifetimes"].forEach((function(t){l.set(t,{})}));var p=["created","attached","ready","moved","detached","error"],h=["onShow","onHide","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"].concat(p);function y(t,e){var n=l.get(e);Object.keys(t).forEach((function(e){var r=t[e];!(0,s.isFunction)(r)||h.includes(e)||e in n||(n[e]=[])})),Object.keys(n).forEach((function(o){var i=t;"swan"===f.appName&&Object.defineProperty(i,o,{writable:!0}),"*"===o||("lifetimes"===e&&!(0,s.isFunction)(i[o])&&(!i.lifetimes&&(i.lifetimes={}),i=i.lifetimes),(0,s.interceptFunction)(i,o,(function(){for(var t=this,e=arguments.length,i=Array(e),a=0;a<e;a++)i[a]=arguments[a];var u=[].concat(r(n[o]),r(n["*"]||[]));u.forEach((function(e){e.apply(t,i)}))}),!0))}))}function v(t,e){var n;t in(n=p.includes(t)?l.get("lifetimes"):l.get("methods"))||(n[t]=[]),n[t].push(e)}function d(t,e){var n;if(t in(n=p.includes(t)?l.get("lifetimes"):l.get("methods"))){var r=n[t],o=r.indexOf(e);r.splice(o,1)}}e.originalComponent=Component,Component=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{var o=n[0]||{};o.methods||(o.methods={}),o.lifetimes||(o.lifetimes={}),y.call(this,o.methods,"methods"),y.call(this,o,"lifetimes")}catch(t){}return e.originalComponent.apply(this,n)},Object.keys(e.originalComponent).forEach((function(t){Component[t]=e.originalComponent[t]})),e.addComponentListener=v,e.removeComponentListener=d},function(t,e,n){t.exports=n(18)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var r=n(19);Object.defineProperty(e,"ArmsRum",{enumerable:!0,get:function(){return r.ArmsRum}}),e.default=r.default},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new y(r||[]);return w(a,"_invoke",{value:f(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function s(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function f(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}i=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=u.prototype=o.prototype=Object.create(x);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new s(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}function c(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=f(t,"string");return"symbol"==r(e)?e:e+""}function f(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t,e,n){return e=v(e),p(t,y()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function p(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function m(t,e){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var g=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var b=n(0),w=n(32),E=n(33),O=n(35),S=n(37),j=n(40),_=n(41),x=n(42),P=n(43),k=n(44),T=n(45),C=n(46),L=n(1),N=n(47),I=n(3),R=[w.default,E.default,O.default,S.default,j.default,_.default,x.default],A=function(t){function e(){var t;return a(this,e),(t=l(this,e,arguments)).version=L.VERSION,t.updateNetType=function(e){var n=t.getConfig().net||{};t.setConfig("net",Object.assign(Object.assign({},n),{type:e}))},t}return d(e,t),c(e,[{key:"init",value:function t(e){return g(this,void 0,void 0,i().mark((function t(){var n;return i().wrap((function t(r){for(;;)switch(r.prev=r.next){case 0:return this.configManager=new I.default,r.next=3,this.configManager.init(e);case 3:if(!1!==(n=this.configManager.getConfig()).enable){r.next=6;break}return r.abrupt("return");case 6:return this.client.useCollectors(R.map((function(t){return new t}))),this.client.useProcessors([new P.default,new k.default]),this.client.useReporter(new T.default),this.client.init(n,new N.RumSession,this.configManager),(0,C.getNetType)(this.updateNetType),r.abrupt("return",this);case 12:case"end":return r.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){var e;return null===(e=this.configManager)||void 0===e?void 0:e.getConfig()}},{key:"setConfig",value:function t(){var e=this.configManager;if(e)if(2===arguments.length){var n=e.getConfig();e.setConfig(Object.assign(Object.assign({},n),o({},0>=arguments.length?void 0:arguments[0],1>=arguments.length?void 0:arguments[1])))}else e.setConfig(0>=arguments.length?void 0:arguments[0])}},{key:"getCollector",value:function t(e){return this.client.getCollectors().find((function(t){return t.name===e}))}}])}(b.Shell);e.ArmsRum=A,e.default=new A},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var s=function(){function t(){o(this,t),this.events={}}return a(t,[{key:"on",value:function t(e,n){this.events[e]||(this.events[e]=[]),this.events[e].push(n)}},{key:"emit",value:function t(e){var n=this.events[e];if(n){for(var r=n.slice(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];for(var u=0;u<r.length;u++)try{r[u].apply(r,i)}catch(t){console.error('Error in handler for "'.concat(e,'":'),t)}}}},{key:"off",value:function t(e,n){var r=this.events[e];if(r)if(n){for(var o=r.length;o--;)r[o]===n&&r.splice(o,1);0===r.length&&delete this.events[e]}else delete this.events[e]}},{key:"once",value:function t(e,n){var r=this,o=function t(){r.off(e,o),n.apply(void 0,arguments)};this.on(e,o)}}])}();e.EventEmitter=s},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,n,r){return e[n]=r}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:k(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(I([])));j&&j!==n&&i.call(j,c)&&(O=j);var _=E.prototype=b.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(r,i){function a(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},x(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(n){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!n)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function o(e,o){return c.type="throw",c.arg=n,r.next=e,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function t(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),g},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var i=o.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(n,r,o){return this.delegate={iterator:I(n),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var l=n(7),p=n(22),h=n(2),y=n(11),v=n(12),d=3e3,m=20,g=["app","user","device","os","geo","isp","net","properties"],b=function(){function t(){i(this,t),this.name="reporter",this.eventQueue=[],this._init=!1}return u(t,[{key:"getReportCfg",value:function t(){var e=this.ctx.getConfig().reportConfig;return(0,h.isObject)(e)||(e={}),(!e.flushTime||e.flushTime<0||e.flushTime>1e4)&&(e.flushTime=3e3),(!e.maxEventCount||e.maxEventCount<1||e.maxEventCount>100)&&(e.maxEventCount=20),e}},{key:"report",value:function t(e){var n=this;this.ctx=e,this._init||(this.init(e),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function t(){var e=this.ctx,n=this.eventQueue,r=e.getRumEvent();if(r.event_type===l.RumEventType.EXCEPTION){var o=r.message,i=r.stack,a=(0,p.getErrorID)({message:o,stack:i}),u=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.EXCEPTION){var e=t.message,n=t.stack;return(0,p.getErrorID)({message:e,stack:n})===a}}));if(u)return void u.times++}if(r.event_type===l.RumEventType.ACTION){var c=r.target_name,s=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.ACTION)return c===t.target_name}));if(s)return void s.times++}n.push(r)}},{key:"flushEventQueue",value:function t(){var e=this.ctx,n=this.eventQueue;if(n.length){var r=e.getViews(),o=r[r.length-1];r.forEach((function(t){var e;t.id===o.id&&n.filter((function(e){var n;return(null===(n=e.view)||void 0===n?void 0:n.id)===t.id})).forEach((function(t){delete t.view}))}));var i=e.session,a;(!i||i.getSampled())&&this.mergeEvent(e,n,o),this.eventQueue=[]}}},{key:"mergeEvent",value:function t(e,n,r){for(var o=e.getConfig(),i=e.session,a=i.getSessionId(),u=0;u<n.length;u++){var c=n[u];c.session_id===a?delete c.session_id:(n.splice(u,1),u--)}if(0!==n.length){var s=(0,v.getUrlParams)(o.endpoint),f=Object.assign({app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:a},net:{},view:r,events:n},s);g.forEach((function(t){var e=o[t];(0,h.isObject)(e)&&Object.keys(e).forEach((function(n){var r=e[n];"user"===t&&"id"===n||("properties"===t?f[t]=(0,y.verifyProperties)(e):((0,h.isString)(r)||(0,h.isNumber)(r))&&(t in f||(f[t]={}),f[t][n]=r))}))})),("function"!=typeof o.beforeReport||(f=o.beforeReport(f)))&&this.tryRequest(f)}}},{key:"tryRequest",value:function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r,i,a;return f(this,void 0,void 0,o().mark((function t(){var u=this,c,s,f;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return c=null===(r=this.ctx.getConfig())||void 0===r?void 0:r.reportConfig,s=null!==(i=null==c?void 0:c.maxRetryCount)&&void 0!==i?i:0,f=null!==(a=null==c?void 0:c.retryDelay)&&void 0!==a?a:3e3,o.prev=3,e._retry=n,o.next=7,this.request(this.ctx,e);case 7:o.next=12;break;case 9:o.prev=9,o.t0=o.catch(3),n<s-1&&setTimeout((function(){return u.tryRequest(e,n+1)}),f);case 12:case"end":return o.stop()}}),t,this,[[3,9]])})))}},{key:"init",value:function t(e){}}])}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorID=void 0;var r=function t(e){var n=e.message,r=void 0===n?"":n,o=e.stack,i;return r+(void 0===o?"":o)};e.getErrorID=r},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),f=n(8),l=n(2),p=function(){function t(e){o(this,t),this.client=new f.default,e&&this.init&&this.init(e)}return a(t,[{key:"sendEvent",value:function t(e){this.client&&this.client.sendEvent(e)}},{key:"getConfig",value:function t(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function t(e){if(e.name&&e.type){var n=Object.assign(Object.assign({},e),{event_type:s.RumEventType.CUSTOM});this.sendEvent(n)}}},{key:"sendView",value:function t(e){if((0,l.isObject)(e)){if(e.type||(e.type="custom"),"custom"===e.type){var n=0;if(["t1","t2","t3"].forEach((function(t){(0,l.isNumber)(e[t])||delete e[t],t in e&&n++})),0===n)return}var r=Object.assign(Object.assign({},e),{event_type:s.RumEventType.VIEW});this.sendEvent(r)}}},{key:"sendException",value:function t(e){if(e.name&&e.message){var n=e.name,r=e.message,o=e.stack,i=Object.assign(Object.assign({times:1,name:n,message:r,stack:o},e),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function t(e){if(e.name&&e.type&&(0,l.isNumber)(e.duration)){var n=Object.assign(Object.assign({times:1},e),{event_type:s.RumEventType.RESOURCE});this.sendEvent(n)}}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,n,r){return e[n]=r}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:k(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(I([])));j&&j!==n&&i.call(j,c)&&(O=j);var _=E.prototype=b.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(r,i){function a(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},x(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(n){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!n)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function o(e,o){return c.type="throw",c.arg=n,r.next=e,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function t(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),g},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var i=o.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(n,r,o){return this.delegate={iterator:I(n),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};function l(t){var e=t.remoteConfig||{};return{enable:!1!==e.enable&&!(!e.url&&!e.region),url:e.url||"",mode:e.mode||"launch-first",cacheTimeout:e.cacheTimeout||36e5}}Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigManager=void 0;var p=function(){function t(){i(this,t),this.currentConfig=null,this.initialized=!1}return u(t,[{key:"init",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){var n=this,r,i,a;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(!this.initialized){o.next=2;break}return o.abrupt("return");case 2:if(this.currentConfig=Object.assign({},e),this.initialized=!0,r=l(e),this.currentConfig.remoteConfig=r,r.enable){o.next=8;break}return o.abrupt("return");case 8:return o.next=10,this.getCacheConfig();case 10:if((i=o.sent)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,r.cacheTimeout)){o.next=14;break}return o.abrupt("return");case 14:if(a=this.fetchRemoteCfg(this.currentConfig).then((function(t){if(t){var e=n.parseConfig(t);n.currentConfig=n.mergeRemoteCfg(e),n.setCacheConfig({timestamp:Date.now(),content:t})}})),"remote-first"!==r.mode){o.next=18;break}return o.next=18,a;case 18:case"end":return o.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:if(this.currentConfig){n.next=2;break}return n.abrupt("return");case 2:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),e);case 3:case"end":return n.stop()}}),t,this)})))}},{key:"isCacheValid",value:function t(e,n){if(!e||!e.timestamp)return!1;var r=n||36e5;return Date.now()-e.timestamp<r}},{key:"mergeRemoteCfg",value:function t(e){var n=this.currentConfig,r=n.pid,o=n.app,i=n.endpoint,a=n.remoteConfig,u=n.beforeReport,c=n.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),e),{pid:r,app:o,endpoint:i,remoteConfig:a,beforeReport:u,properties:c})}},{key:"destroy",value:function t(){this.currentConfig=null,this.initialized=!1}}])}();e.ConfigManager=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){return 0!==t&&100*Math.random()<=t}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return t;var r=t.toString(),o=r.indexOf(".");r=-1!==o?r.substring(0,e+o+1):r.substring(0);var i=parseFloat(r);return i>=n?i:void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.performDraw=e.ONE_DAY=e.ONE_HOUR=e.ONE_MINUTE=e.ONE_SECOND=void 0,e.ONE_SECOND=1e3,e.ONE_MINUTE=60*e.ONE_SECOND,e.ONE_HOUR=60*e.ONE_MINUTE,e.ONE_DAY=24*e.ONE_HOUR,e.performDraw=r,e.formatNumber=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTracingOptions=e.makeTracingHeaders=e.isTraceOption=void 0;var r=n(15),o=n(2);function i(t){return t&&(0,r.isMatchOption)(t.match)&&(0,o.isArray)(t.propagatorTypes)}function a(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={},u=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),(0,o.isArray)(r)||(r=[r]),r.forEach((function(n){switch(n){case"jaeger":a["uber-trace-id"]="".concat(t,":").concat(e,":0:").concat(u);break;case"b3":a.b3="".concat(t,"-").concat(e,"-").concat(u);break;case"b3multi":a["X-B3-TraceId"]=t,a["X-B3-SpanId"]=e,a["X-B3-Sampled"]=u;break;case"sw8":if((0,o.isFunction)(btoa)){var r=btoa(t),c=btoa(e),s=btoa(i.appId),f=btoa(i.appVersion),l=btoa(i.viewName),p=btoa(i.host);a.sw8="".concat(u,"-").concat(r,"-").concat(c,"-",0,"-").concat(s,"-").concat(f,"-").concat(l,"-").concat(p)}break;case"tracecontext":default:a.traceparent="00-".concat(t,"-").concat(e,"-0").concat(u),i.tracestate&&(a.tracestate=i.tracestate)}})),i.baggage&&(a.baggage=i.baggage),a}function u(t){var e=["tracecontext"];if((0,o.isBoolean)(t)||!t)return{enable:!!t,sample:100,propagatorTypes:e,allowedUrls:[],tracestate:!0,baggage:!1};var n=t.enable,a=void 0===n||n,u=t.sample,c=void 0===u?100:u,s=t.propagatorTypes,f=void 0===s?e:s,l=t.allowedUrls,p=void 0===l?[]:l,h=t.tracestate,y=void 0===h||h,v=t.baggage,d=void 0!==v&&v,m=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(t){(0,r.isMatchOption)(t)?m.push({match:t,propagatorTypes:f}):i(t)&&m.push(t)})),{enable:!(0,o.isBoolean)(a)||a,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:m,tracestate:y,baggage:d}}e.isTraceOption=i,e.makeTracingHeaders=a,e.parseTracingOptions=u},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(4),l=n(5),p=function(){function t(){var e=this;o(this,t),this.name="pv-collector",this.onUnload=function(){var t=(0,f.getCurView)(e.ctx);e.ctx.removeView(t.id)},this.sendPv=function(){var t=(0,f.getCurPage)();if(t){var n=t.route,r=t.options,o=(0,f.getRumViewId)(t);if(!e.prevPage||o!==e.prevPage.viewId){var i=o?"route_back":"initial_load";o=(0,f.getRumViewId)(t,e.ctx.session),e.prevPage={route:n,viewId:o};var a=e.getViewName(n);e.ctx.addView({id:o,name:a});var u={};r&&Object.keys(r).forEach((function(t){u[t]=decodeURIComponent(r[t])})),e.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:n,name:a,loading_type:i,snapshots:JSON.stringify(u).substring(0,5e3)})}}}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.sendPv(),(0,l.addPageListener)("onLoad",this.sendPv),(0,l.addPageListener)("onUnload",this.onUnload)}},{key:"getViewName",value:function(t){var e,n=this.ctx.getConfig().parseViewName,r=t;return(0,s.isFunction)(n)&&(r=n(t)),r}},{key:"destroy",value:function(){(0,l.removePageListener)("onLoad",this.sendPv),(0,l.removePageListener)("onUnload",this.onUnload)}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(4),p=n(5),h=n(6),y=n(34),v=n(3),d=(0,f.getPerformance)(),m=function(){function t(){var e=this;o(this,t),this.name="perf-collector",this.currentViewId="",this.pageIdToViewId={},this.delayHandler=function(t){var n=(0,s.isArray)(t)?t:t.getEntries();Array.isArray(n)&&0!==n.length&&setTimeout((function(){n.forEach((function(t){if(t.pageId){var n=e.pageIdToViewId["pageId:".concat(t.pageId)];if(n&&e.perfCache[n])return void e.perfCache[n].entries.push(t)}if(e.currentViewId){var r=e.perfCache[e.currentViewId];if(r){var o=t.path;o||"navigation"!==t.entryType||(o=t.name),r.path!==o||r.entries.push(t)}}}))}),y.COMMON_DELAY)},this.onLoad=function(){var t=(0,l.getCurPage)(),n=(0,l.getCurView)(e.ctx),r=(0,l.getRumViewId)(t,e.ctx.session),o=(0,s.isFunction)(t.getPageId)?t.getPageId():null;r in e.perfCache||(e.currentViewId=r,o&&(e.pageIdToViewId[o.toString()]=r),e.perfCache[r]={view:n,path:t.is||t.route,pageId:o,entries:[],timer:setTimeout((function(){e.flushByViewId(r)}),s.ONE_MINUTE),loadTime:(0,h.getCurrentTime)()})},this.onReady=function(){var t=e.currentViewId;if(t){var n=e.perfCache[t];n&&(n.dom_complete=(0,h.getCurrentTime)()-n.loadTime)}},this.flushByViewId=function(t){var n=e.perfCache[t];n&&(e.perfCache[t]=!1,clearTimeout(n.timer),n.entries.length&&e.parsePerf(n))}}return a(t,[{key:"setup",value:function(t,e){if((0,v.checkEnable)(t,"perf")){var n=this;if(this.ctx=t,this.sendEvent=e,d&&d.getEntries){this.perfCache={};var r,o=f.appName===f.wechatName||f.appName===f.alipayName;if(o)r=["navigation","render"];else if(f.appName===f.bytedanceName)r=["launch","paint","navigation"];else{if(f.appName!==f.ksName)return;r=["paint","navigation"]}this.delayHandler(d.getEntries().filter((function(t){return r.includes(t.entryType)}))),this.perfObserver=d.createObserver(this.delayHandler),this.perfObserver.observe({entryTypes:r}),this.onUnload=function(){if(!o){var e=(0,l.getRumViewId)(this,t.session);e&&n.flushByViewId(e)}},(0,p.addPageListener)("onLoad",this.onLoad),(0,p.addPageListener)("onReady",this.onReady),(0,p.addPageListener)("onHide",this.onUnload),(0,p.addPageListener)("onUnload",this.onUnload)}}}},{key:"parsePerf",value:function(t){var e,n,r,o,i,a=t.entries,u=t.view,c=t.dom_complete;a.forEach((function(t){if(t.startTime)switch(t.name){case"firstRender":case"first-render":n=t;break;case"firstPaint":case"first-paint":r=t;break;case"firstContentfulPaint":case"first-contentful-paint":o=t;break;case"largestContentfulPaint":case"largest-contentful-paint":if(i&&i.startTime>t.startTime)break;i=t;break;default:"navigation"===t.entryType&&(e=t)}}));var s={};e&&(n&&(s.first_render=n.duration?n.duration:n.startTime-e.startTime),r&&(s.first_paint=r.startTime-e.startTime),o&&(s.first_contentful_paint=o.startTime-e.startTime),i&&(s.largest_contentful_paint=i.startTime-e.startTime),c&&(s.dom_complete=c),this.sendPerf(s,{view:u,timestamp:e.startTime,timing_data:JSON.stringify(e)}))}},{key:"sendPerf",value:function(t,e){for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r],i=t[o];(0>=i||isNaN(i)||6e5<i)&&delete t[o]}if(Object.keys(t)){var a=this.ctx.session.getBaseEvent();this.sendEvent(Object.assign(Object.assign(Object.assign(Object.assign({},a),{event_type:s.RumEventType.VIEW,type:"perf"}),e),t))}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect(),(0,p.removePageListener)("onLoad",this.onLoad),(0,p.removePageListener)("onReady",this.onReady),(0,p.removePageListener)("onHide",this.onUnload),(0,p.removePageListener)("onUnload",this.onUnload)}}])}();e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.COMMON_DELAY=void 0,e.COMMON_DELAY=200},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(36),l=n(1),p=n(3),h=function(){function t(){var e=this;o(this,t),this.name="exception-collector",this.origin={consoleError:console.error},this.events={onError:null,onUnhandledRejection:null,onPageNotFound:null,onLazyLoadError:null},this.onError=function(t,n){var r=t;(0,s.isString)(r)&&(0,s.isString)(n)&&(r=n),e.errorHandle(r,"onError")},this.errorHandle=function(t){var n,r,o,i,a,u,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(t instanceof Object)n=t.name,r=t.message,o=t.filename||t.fileName,i=t.stack,a=t.lineno||t.lineNumber,u=t.colno||t.columnNumber;else if("string"==typeof t){i=t;var f=e.getErrorByStack(t);f&&(n=f.name,r=f.message)}if(n&&r&&!e.errorFilter(t)){var l=e.ctx.session.getBaseEvent();e.sendEvent(Object.assign(Object.assign({},l),{event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:a,column:u}))}}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.hackOrigin()}},{key:"hackOrigin",value:function(){var t=this,e=this;(0,p.checkEnable)(this.ctx,"jsError")&&((0,s.isFunction)(l.sdk.onError)&&"undefined"==typeof uni?l.sdk.onError(this.onError):Object.keys(this.events).forEach((function(n){t.events[n]=function(t){t.reason&&t.reason instanceof Error&&(t=t.reason),e.errorHandle(t,n)},(0,f.addAppListener)(n,t.events[n])}))),(0,p.checkEnable)(this.ctx,"consoleError")&&("swan"===l.appName&&Object.defineProperty(console,"error",{writable:!0}),(0,s.interceptFunction)(console,"error",(function(t){e.errorHandle(t,"console.error")})))}},{key:"getErrorByStack",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=t.split("\n");if(!(2>e.length))for(var n=1;n<e.length;n++)if(e[n].trim().startsWith("at ")){var r=e[n-1],o=r.indexOf(": ");return{name:r.substring(0,o),message:r.substring(o+2)}}}},{key:"errorFilter",value:function(t){var e,n=(this.ctx.getConfig().filters||{}).exception;return!!n&&((0,s.isArray)(n)||(n=[n]),(0,s.matchList)(n,t.name,!0,t)||(0,s.matchList)(n,t.message,!0,t)||(0,s.matchList)(n,t.stack,!0,t))}},{key:"destroy",value:function(){var t=this,e=this.origin;e.consoleError&&(console.error=e.consoleError),(0,s.isFunction)(l.sdk.offError)&&l.sdk.offError(this.onError),Object.keys(this.events).forEach((function(e){(0,s.isFunction)(t.events[e])&&(0,f.removeAppListener)(e,t.events[e])}))}}])}();e.default=h},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removeAppListener=e.addAppListener=e.originalApp=void 0;var s=n(0),f=n(1),l={onLaunch:[],"*":[]};function p(t){Object.keys(l).forEach((function(e){"swan"===f.appName&&Object.defineProperty(t,e,{writable:!0}),"*"===e||(0,s.interceptFunction)(t,e,(function(){for(var t=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(l[e]),r(l["*"]));a.forEach((function(e){e.apply(t,o)}))}),!0)}))}function h(t,e){t in l||(l[t]=[]),l[t].push(e)}function y(t,e){if(t in l){var n=l[t],r=n.indexOf(e);n.splice(r,1)}}e.originalApp=App,App=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{p.apply(this,n)}catch(t){}return e.originalApp.apply(this,n)},Object.keys(e.originalApp).forEach((function(t){App[t]=e.originalApp[t]})),e.addAppListener=h,e.removeAppListener=y},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return c(t)||u(t)||a(t)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return s(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function c(t){if(Array.isArray(t))return s(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new y(r||[]);return w(a,"_invoke",{value:s(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function u(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function c(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function s(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}f=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=a.prototype=o.prototype=Object.create(x);return i.prototype=a,w(T,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:i,configurable:!0}),i.displayName=t(a,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},u(c.prototype),t(c.prototype,S,(function(){return this})),m.AsyncIterator=c,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new c(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},u(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}function h(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){var e=v(t,"string");return"symbol"==r(e)?e:e+""}function v(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var d=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var m=n(0),g=n(1),b=n(38),w=n(6),E=n(4),O=n(39),S=n(3),j=function(){function t(){var e=this;l(this,t),this.name="api-collector",this.origin={request:g.default.request,httpRequest:g.default.httpRequest},this.sendApi=function(t,n,r){return d(e,void 0,void 0,f().mark((function e(){var o,i,a,u,c,s,l,p,h,y,v,d,g,b;return f().wrap((function e(f){for(;;)switch(f.prev=f.next){case 0:if(o=this.ctx.getConfig(),i=o.evaluateApi,a=n.statusCode,u=n.status,c=n.errMsg,s=n.errorMessage,l=n.message,(p=n.profile)&&(h=this.parseProfile(p),y=JSON.stringify(p)),!(0,m.isFunction)(i)){f.next=14;break}return f.prev=4,0===t.success&&(v=new Error("request error")),f.next=8,i(r,n,v);case 8:d=f.sent,t=Object.assign(Object.assign({},t),(0,O.reviseApiAttr)(d)),f.next=14;break;case 12:f.prev=12,f.t0=f.catch(4);case 14:if(g=this.ctx.session.getBaseEvent(),!((b=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{event_type:m.RumEventType.RESOURCE,type:"api",status_code:u||a,message:s||c||l,duration:(0,w.getCurrentTime)()-t.timestamp}),t),h),{timing_data:y})).duration>m.ONE_HOUR)){f.next=18;break}return f.abrupt("return");case 18:this.sendEvent(b);case 19:case"end":return f.stop()}}),e,this,[[4,12]])})))}}return h(t,[{key:"setup",value:function t(e,n){var r=this;(0,S.checkEnable)(e,"api")&&(this.ctx=e,this.sendEvent=n,Object.keys(this.origin).forEach((function(t){return r.hackRequest(t)})))}},{key:"injectTracing",value:function t(e,n){var r,o=this.ctx.session,i=this.ctx.getConfig(),a=i.tracing,u=i.pid,c=i.version,s=void 0===c?"1.0.0":c,f=(0,m.parseTracingOptions)(a),l=f.enable,p=f.sample,h=f.propagatorTypes,y=f.allowedUrls,v=f.tracestate,d=!(void 0!==v)||v,b=f.baggage,w=void 0!==b&&b;if(l){var E=(0,m.find)(y,(function(t){return(0,m.matchList)([t.match],e.url)}));if(E){var O=E.propagatorTypes;0===O.length&&(O=h);var S=!1;O.includes("sw8")&&(O=["sw8"],S=!0);var j=S?(0,m.generateGUID)():(0,m.generateTraceId)(),_=S?(0,m.generateGUID)():(0,m.generateSpanId)(),x=(0,m.performDraw)(p),P=o.getUserId(),k=o.getSessionId(),T=d?"rum=v2&miniapp&".concat(u,"&").concat(k,"&").concat(P):void 0,C=w?"rum=v2,appType=miniapp,pid=".concat(u,",sid=").concat(k,",uid=").concat(P):void 0,L=(0,m.makeTracingHeaders)(j,_,x,O,{tracestate:T,baggage:C,appId:u,appVersion:s,viewName:null===(r=e.view)||void 0===r?void 0:r.name,host:"miniapp_".concat(g.appName)});x&&(e.trace_id=j,e.trace_data=JSON.stringify({spanId:_,sample:p,sampled:x,headers:L})),n(L)}}}},{key:"hackRequest",value:function t(e){var n=this;(0,m.isFunction)(g.default[e])&&Object.defineProperty(g.default,e,{configurable:!0,enumerable:!0,writable:!0,value:function t(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return o[0]=n.rebuildRequestOptions(o[0]),n.origin[e].apply(this,o)}})}},{key:"rebuildRequestOptions",value:function t(e){var n=this,r=e.url,o=e.success,i=e.fail,a=(0,w.getCurrentTime)();if((0,b.isEndpoint)(this.ctx,r)||n.filter(r))return e;var u=Object.assign({},e),c={view:(0,E.getCurView)(this.ctx),timestamp:a,url:r,name:this.getResourceName(r),method:e.method||"GET"};return this.injectTracing(c,(function(t){var e=[];["headers","header"].forEach((function(n){n in u&&(0,m.isObject)(u[n])&&(u[n]=Object.assign(Object.assign({},u[n]),t),e.push(n))})),0===e.length&&(u[g.HEADER_KEY]=Object.assign(Object.assign({},u[g.HEADER_KEY]),t))})),u.success=function(){c.success=1;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];n.sendApi(c,e[0],u),o&&o.apply(this,e)},u.fail=function(){c.success=0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];n.sendApi(c,e[0],u),i&&i.apply(this,e)},u}},{key:"getResourceName",value:function t(e){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,m.isFunction)(o)?o(e):(0,b.getPathByURL)(e)}},{key:"parseProfile",value:function t(e){function n(t,n){t in e&&0<e[t]&&(o[n]=e[t])}function r(t,n,r){if(t in e&&t in e){var i=e[n]-e[t];0<i&&(o[r]=i)}}var o={};return n("domainLookup","dns_duration"),n("connect","connect_duration"),n("SSLconnection","ssl_duration"),n("Waiting","first_byte_duration"),n("totalTime","duration"),n("receivedBytedCount","size"),r("connectStart","connectEnd","connect_duration"),r("SSLconnectionStart","SSLconnectionEnd","ssl_duration"),r("domainLookUpStart","domainLookUpEnd","dns_duration"),r("redirectStart","redirectEnd","redirect_duration"),r("responseStart","requestStart","first_byte_duration"),r("responseStart","requestEnd","download_duration"),r("redirectStart","responseEnd","duration"),Object.keys(o).forEach((function(t){o[t]>m.ONE_HOUR&&delete o[t]})),o}},{key:"filter",value:function t(e){var n,r,i=this.ctx.getConfig(),a=(null===(n=null==i?void 0:i.filters)||void 0===n?void 0:n.resource)||[];(0,m.isArray)(a)||(a=[a]);var u=null===(r=null==i?void 0:i.collectors)||void 0===r?void 0:r.api;return(0,m.isObject)(u)&&(0,m.isArray)(u.filters)&&(a=[].concat(o(a),o(u.filters))),(0,m.urlMatch)(e,a)}}])}();e.default=j},function(t,e,n){"use strict";function r(t){var e=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var n=a(t);return e?n.hash:n.pathname}catch(t){return""}}function o(t,e){var n,r=t.getConfig().endpoint;try{return a(e).hostname===a(r).hostname}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.getURL=e.isEndpoint=e.getPathByURL=void 0,e.getPathByURL=r,e.isEndpoint=o;var i=/^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i;function a(t){var e=decodeURIComponent(t).match(i),n,r=(e[3]||"").split(":").length?(e[2]||"").replace(/(.*\@)/,""):e[2];return{uri:e[0],protocol:e[1],host:r,hostname:e[4],port:e[5],pathname:e[6],search:e[7],hash:e[8]}}e.getURL=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reviseApiAttr=void 0;var r=n(0);function o(t){if((0,r.isObject)(t)){var e={};(0,r.isString)(t.name)&&(e.name=t.name.substring(0,1e3)),(0,r.isString)(t.message)&&(e.message=t.message.substring(0,1e3)),"success"in t&&(e.success=t.success?1:0),(0,r.isNumber)(t.duration)&&0<=t.duration&&(e.duration=t.duration),(0,r.isString)(t.status_code)&&(e.status_code=t.status_code.substring(0,100)),(0,r.isNumber)(t.status_code)&&(e.status_code=t.status_code),(0,r.isString)(t.snapshots)&&(e.snapshots=t.snapshots.substring(0,5e3));var n=(0,r.verifyProperties)(t.properties);return n&&(e.properties=n),e}}e.reviseApiAttr=o},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(5),l=n(3),p=function(){function t(){var e=this;o(this,t),this.name="action-collector",this.DELAY_TIME=300,this.events=["tap"],this.onEvent=function(t){if(t&&e.events.includes(t.type)&&t.target){var n=t.target,r=t.currentTarget,o=t.type,i=r.dataset,a=r.id;if(a||r===n||(a=n.id,i=n.dataset),!a)return;var u=e.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.ACTION,type:o,name:a,snapshots:JSON.stringify({dataset:i}).substring(0,1e3)});clearTimeout(e.timer),e.lastEvent?e.lastEvent.name===c.name?e.lastEvent.times+=1:e.sendAction():e.lastEvent=c,e.timer=setTimeout(e.sendAction,e.DELAY_TIME)}},this.sendAction=function(){e.sendEvent(e.lastEvent),e.lastEvent=null}}return a(t,[{key:"setup",value:function(t,e){(0,l.checkEnable)(t,"action")&&(this.ctx=t,this.sendEvent=e,(0,f.addPageListener)("*",this.onEvent))}},{key:"destroy",value:function(){(0,f.removePageListener)("*",this.onEvent)}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(3),p=function(){function t(){var e=this;o(this,t),this.name="application-collector",this.observerHandler=function(t){var n,r,o=(0,s.isArray)(t)?t:t.getEntries();if((0,s.isFunction)(f.default.getLaunchOptionsSync)&&(r=null===(n=f.default.getLaunchOptionsSync())||void 0===n?void 0:n.scene),Array.isArray(o)&&0<o.length)for(var i,a=0;a<o.length;a++)if("number"==typeof(i=o[a]).duration&&0<i.duration){var u=e.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.APPLICATION,state:"",duration:0,snapshots:JSON.stringify(i),scene:r});switch(i.name){case"appLaunch":case"app-click":c.state="cold_lunch",c.duration=i.duration;break;case"downloadPackage":case"miniprogram-package":case"download":c.state="download_package",c.duration=i.duration;break;case"evaluateScript":case"app-service":var l;"__APP__"===(i.moduleName||i.packageName)&&(c.state="evaluate_script",c.duration=i.duration)}c.state&&0<c.duration&&6e5>c.duration&&e.sendEvent(c)}}}return a(t,[{key:"setup",value:function(t,e){if((0,l.checkEnable)(t,"application")){this.ctx=t,this.sendEvent=e;var n=(0,f.getPerformance)();if(n&&(0,s.isFunction)(n.createObserver)){var r=[];if(f.appName===f.wechatName||f.appName===f.alipayName)r=["navigation","script","loadPackage"];else if(f.appName===f.bytedanceName)r=["launch","evaluate","resource"];else{if(f.appName!==f.ksName)return;r=["navigation","resource"]}this.observerHandler(n.getEntries().filter((function(t){return r.includes(t.entryType)}))),this.perfObserver=n.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:r})}}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect()}}])}();e.default=p},function(t,e,n){"use strict";function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==a(e)?e:e+""}function l(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=n(0),h=n(5),y=n(16),v=n(4),d=n(6),m=n(3),g=5,b=50,w=function(){function t(){var e=this;u(this,t),this.name="render-block-collector",this.renderBlockReportLimitMap=new Map,this.onLoad=function(){var t=(0,v.getCurPage)(),n=(0,v.getRumViewId)(t,e.ctx.session);e.renderBlockReportLimitMap.set(n,{count:0,name:(0,v.getViewById)(n,e.ctx).name})},this.onSetData=function(t){return t&&(0,p.isFunction)(t.setUpdatePerformanceListener)?void t.setUpdatePerformanceListener({withDataPaths:!0},(function(n){var r=n||{},o=r.updateEndTimestamp,i=r.pendingStartTimestamp,a=r.dataPaths,u=void 0===a?[]:a,c=o-i;if((0,p.isNumber)(c)&&!(c<e.renderThreshold)){var s=(0,v.getCurPage)(),f=(0,v.getRumViewId)(s,e.ctx.session);if(e.renderBlockReportLimitMap.has(f)){var l=e.renderBlockReportLimitMap.get(f),h=l.count,y=l.name;if(!(h>e.maxEventCount)){e.renderBlockReportLimitMap.set(f,{count:h+1,name:y});var m=e.ctx.session.getBaseEvent(),g=t.data,b=O(u,g);e.sendEvent(Object.assign(Object.assign({},m),{event_type:p.RumEventType.LONG_TASK,type:"render",duration:c,message:t.is||t.route||"",snapshots:JSON.stringify(Object.assign(Object.assign({},S(n)),b?{data:b}:{})),timestamp:i||(0,d.getCurrentTime)(),source:"setData",view:{id:f,name:y}}))}}}})):void e.destroy()},this.onUnload=function(){var t=(0,v.getCurPage)(),n=(0,v.getRumViewId)(t,e.ctx.session);e.renderBlockReportLimitMap.delete(n)}}return s(t,[{key:"setup",value:function(t,e){var n,r=t.getConfig().longTaskConfig,o=void 0===r?{}:r;if((0,m.checkEnable)(t,"longTask")){var i=this;this.ctx=t,this.sendEvent=e;var a=E(o),u=a.maxEventCount,c=a.renderThreshold;this.maxEventCount=u,this.renderThreshold=c,this._onSetData=function(){i.onSetData(this)},(0,h.addPageListener)("onLoad",this.onLoad),(0,h.addPageListener)("onReady",this._onSetData,!0),(0,h.addPageListener)("onUnload",this.onUnload),(0,y.addComponentListener)("attached",this._onSetData)}}},{key:"destroy",value:function(){(0,h.removePageListener)("onLoad",this.onLoad),(0,h.removePageListener)("onReady",this._onSetData,!0),(0,h.removePageListener)("onUnload",this.onUnload),(0,y.removeComponentListener)("attached",this._onSetData)}}])}();e.default=w;var E=function(t){var e=t||{},n=e.maxEventCount,r=e.renderThreshold;return(!n||!(0,p.isNumber)(n)||1>n||n>b)&&(t.maxEventCount=g),r&&(0,p.isNumber)(r)&&!(r<b)||(t.renderThreshold=b),t},O=function(t,e){try{return t.map((function(t){var n,o="",i=e,a=r(t);try{for(a.s();!(n=a.n()).done;){var u=n.value;o+=o?".".concat(u):u,i=null==i?void 0:i[u]}}catch(t){a.e(t)}finally{a.f()}return{dataKey:o,dataLength:JSON.stringify(i).length}}))}catch(t){return""}},S=function(t){if(!t)return t;var e=t.updateStartTimestamp,n=t.updateEndTimestamp,r=t.pendingStartTimestamp;return t.updateEndTimestamp=n-r,t.updateStartTimestamp=e-r,t.pendingStartTimestamp=0,t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(6),f=n(4),l=function(){function t(){o(this,t),this.name="default-processor"}return a(t,[{key:"process",value:function(t){var e=t.getRumEvent(),n=(0,f.getCurView)(t),r;return Object.assign({timestamp:(0,s.getCurrentTime)(),session_id:t.session.getSessionId(),event_id:t.session.getEventId(),view:n},e)}}])}();e.default=l},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(5),l=function(){function t(){var e=this;o(this,t),this.name="session-processor",this.update=function(t){t&&!t.isTrusted||e.ctx.session.updateSession()}}return a(t,[{key:"setup",value:function(t){var e=this;this.ctx=t,this.update=(0,s.debounce)(this.update,s.ONE_SECOND),(0,f.addPageListener)("*",(function(t){t&&t.type&&t.target&&e.update()}))}},{key:"process",value:function(t){return this.update(),t.getRumEvent()}}])}();e.default=l},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function s(t,e,n){return e=h(e),f(t,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function f(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function v(t,e){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0});var d=n(0),m=n(1),g=function(t){function e(){var t;return o(this,e),(t=s(this,e,arguments)).name="miniapp-reporter",t}return y(e,t),a(e,[{key:"init",value:function(){var t=this;(0,d.isFunction)(m.default.onAppHide)&&m.default.onAppHide((function(){t.flushEventQueue()}))}},{key:"request",value:function(t,e){var n=t.getConfig();try{var r;e.app.type=d.AppType.miniapp,e._v=m.VERSION,(m.default.request||m.default.httpRequest)({url:n.endpoint,method:"POST",dataType:"text",data:JSON.stringify(e)})}catch(t){console.warn("[arms] sendRequest fail",t)}}}])}(d.Reporter);e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNetType=void 0;var r=n(1);function o(t){r.default.getNetworkType&&r.default.getNetworkType({success:function(e){var n=e.networkType||e.subtype;t(n?n.toLowerCase():void 0)}}),r.default.onNetworkStatusChange&&r.default.onNetworkStatusChange((function(e){var n=e.networkType||e.subtype;t(n?n.toLowerCase():void 0)}))}e.getNetType=o},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return s(t)||c(t,e)||a(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(c){s=!0,o=c}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}function s(t){if(Array.isArray(t))return t}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}function p(t,e,n){return e&&l(t.prototype,e),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var e=y(t,"string");return"symbol"==r(e)?e:e+""}function y(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.RumSession=void 0;var v=n(0),d=n(6),m=n(4),g=n(1),b="_arms_uid",w="_arms_session",E=function(){function t(){f(this,t)}return p(t,[{key:"init",value:function(t){var e;this.ctx=t,this.sessionConfig=this.fixSessionConfig(null===(e=t.config)||void 0===e?void 0:e.sessionConfig)}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(t){var e=this.sessionConfig,n=e.overtime,r=e.maxDuration,o=(0,d.getCurrentTime)();return!(t.startTime+r<o||t.lastTime+n<o)}},{key:"updateSession",value:function(){var t=this.getSessionInfo();if(!t.isNew){var e=t.startTime,n=(0,d.getCurrentTime)(),r=t.sampled?1:0;(0,g.setStorageSync)(w,"".concat(t.sessionId,"-").concat(r,"-").concat(e,"-").concat(n))}}},{key:"getSessionInfo",value:function(){var t,e=o(((0,g.getStorageSync)(w)||"").split("-"),4),n=e[0],r=e[1],i=e[2],a=e[3],u={sessionId:n,sampled:"0"!==r,startTime:parseInt(i||"")||0,lastTime:parseInt(a||"")||0};return this.checkSession(u)||(u=this.resetSession()),u}},{key:"getEventId",value:function(){return(0,v.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var t=(0,g.getStorageSync)(b);return t&&0===t.indexOf("user_")&&(t=""),t||(t="uid_".concat((0,v.generateSpanId)(16,36)),(0,g.setStorageSync)(b,t)),t}},{key:"resetSession",value:function(){var t=this.sessionConfig.sampleRate,e=this.getUUID(),n=(0,d.getCurrentTime)(),r=(0,v.performDraw)(100*t),o="".concat(e,"-").concat(r?1:0,"-").concat(n,"-").concat(n);return(0,g.setStorageSync)(w,o),{sessionId:e,sampled:r,startTime:n,lastTime:n,isNew:!0}}},{key:"getUUID",value:function(){return(0,v.generateGUID)().replace(/-/g,"")}},{key:"fixSessionConfig",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.sampleRate,n=t.maxDuration,r=t.overtime;return(!(0,v.isNumber)(e)||0>e||1<e)&&(e=1),(!(0,v.isNumber)(n)||n<4*v.ONE_HOUR||n>v.ONE_DAY)&&(n=v.ONE_DAY),(!(0,v.isNumber)(r)||r>v.ONE_HOUR||r<10*v.ONE_MINUTE)&&(r=30*v.ONE_MINUTE),{sampleRate:e,maxDuration:n,overtime:r}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,d.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,m.getCurView)(this.ctx):void 0,times:1}}}])}();e.RumSession=E}])}));
1
+ !function t(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.RumSDK=n():e.RumSDK=n()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return 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 o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./dist/",n(n.s=17)}([function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function t(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Shell=e.Reporter=e.Context=e.Client=void 0;var i=n(8);e.Client=i.default;var a=n(10);e.Context=a.default;var u=n(21);e.Reporter=u.default;var c=n(23);e.Shell=c.default,o(n(24),e),o(n(9),e),o(n(25),e),o(n(26),e),o(n(27),e),o(n(7),e),o(n(28),e),o(n(29),e),o(n(13),e),o(n(14),e),o(n(2),e),o(n(30),e),o(n(15),e),o(n(31),e),o(n(11),e),o(n(12),e)},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o;Object.defineProperty(e,"__esModule",{value:!0}),e.HEADER_KEY=e.getPerformance=e.setStorageSync=e.getStorageSync=e.appName=e.sdk=e.ksName=e.jdName=e.swanName=e.alipayName=e.dingtalkName=e.wechatName=e.bytedanceName=e.qqName=e.VERSION=void 0,e.VERSION="cdn-0.1.2";var i="object";function a(t){return"function"==typeof t}function u(){var t,n="unknown";if(("undefined"==typeof ks?"undefined":r(ks))===i)t=ks,n=e.ksName;else if(("undefined"==typeof swan?"undefined":r(swan))===i)t=swan,n=e.swanName;else if(("undefined"==typeof qq?"undefined":r(qq))===i)t=qq,n=e.qqName;else if(("undefined"==typeof tt?"undefined":r(tt))===i)t=tt,n=e.bytedanceName;else if(("undefined"==typeof dd?"undefined":r(dd))===i)t=dd,n=e.dingtalkName;else if(("undefined"==typeof my?"undefined":r(my))===i)t=my,n=e.alipayName;else if(("undefined"==typeof jd?"undefined":r(jd))===i)t=jd,n=e.jdName;else{if(("undefined"==typeof wx?"undefined":r(wx))!==i)throw new Error("Current platform is not supported.");t=wx,n=e.wechatName}return{sdk:t,appName:n}}function c(t){return a(e.sdk.getStorageSync)?e.appName===e.alipayName||e.appName===e.dingtalkName?e.sdk.getStorageSync({key:t}).data:e.sdk.getStorageSync(t):void 0}function s(t,n){return a(e.sdk.getStorageSync)?e.appName===e.alipayName||e.appName===e.dingtalkName?e.sdk.setStorageSync({key:t,data:n}):e.sdk.setStorageSync(t,n):void 0}function f(){return a(e.sdk.getPerformance)?e.sdk.getPerformance():"performance"in e.sdk?e.sdk.performance:void 0}e.qqName="qq",e.bytedanceName="bytedance",e.wechatName="wechat",e.dingtalkName="dingtalk",e.alipayName="alipay",e.swanName="swan",e.jdName="jd",e.ksName="ks",o=u(),e.sdk=o.sdk,e.appName=o.appName,e.getStorageSync=c,e.setStorageSync=s,e.getPerformance=f,e.HEADER_KEY=function(){switch(e.appName){case"alipay":return"headers";default:return"header"}}(),e.default=e.sdk},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return r(t)===e}Object.defineProperty(e,"__esModule",{value:!0}),e.isZero=e.isObject=e.isNull=e.isNumber=e.isBoolean=e.isRegExp=e.isArray=e.isToString=e.isString=e.isFunction=e.isTypeof=void 0,e.isTypeof=o;var i=function t(e){return"function"==typeof e};function a(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")}function u(){for(var t=0;t<arguments.length;t++)if(0!==(t<0||arguments.length<=t?void 0:arguments[t]))return!1;return!0}e.isFunction=i,e.isString=function(t){return o(t,"string")},e.isToString=a,e.isArray=function(t){return a(t,"Array")},e.isRegExp=function(t){return a(t,"RegExp")},e.isBoolean=function(t){return o(t,"boolean")},e.isNumber=function(t){return o(t,"number")&&!isNaN(t)||o(t,"bigint")},e.isNull=function(t){return null===t},e.isObject=function(t){return!(0,e.isNull)(t)&&o(t,"object")},e.isZero=u},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),u=new y(r||[]);return w(a,"_invoke",{value:f(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function s(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function f(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}o=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=u.prototype=i.prototype=Object.create(x);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new s(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function f(t,e,n){return e=y(e),l(t,h()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function l(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function d(t,e){return(d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var m=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.checkEnable=void 0;var g=n(0),b=n(1),w="arms_rum2_local_config";function E(t){var e,n,r,o,i={};i.enable=null===(e=t.enable)||void 0===e||e;var a=t.session;if(a){var u={};u.sampleRate=(null!==(n=a.sampling)&&void 0!==n?n:100)/100,u.storage=null!==(r=a.storage)&&void 0!==r?r:"auto",i.sessionConfig=u}var c=t.report;if(c){var s={};s.flushTime=c.flush_interval,s.maxEventCount=c.max_batch_count,i.reportConfig=s}var f=t.tracing;if(f){var l={enable:null===(o=f.enable)||void 0===o||o},p=[];(f.rules||[]).forEach((function(t){var e={enable:t.enable,tracestate:t.tracestate,baggage:t.baggage,propagatorTypes:t.protocols,sampling:t.sampling};return"{location.origin}"===t.match?void(l=Object.assign(Object.assign({},l),e)):(e.match=(0,g.parseRule2Match)(t),void p.push(e))})),l.allowedUrls=p,i.tracing=l}var h=t.collectors;if(h&&0<Object.keys(h).length){var y={};h.forEach((function(t){var e=t.name;if(e){var n=Object.assign({},t),r=t.filters;0<(null==r?void 0:r.length)&&(n.filters=n.filters.map((function(t){return(0,g.parseRule2Match)(t)}))),y[e]=n}})),i.collectors=Object.assign(Object.assign({},i.collectors),y)}return i}var O=function(t){function e(){var t;return i(this,e),(t=f(this,e,arguments)).version="v2",t}return v(e,t),u(e,[{key:"fetchRemoteCfg",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){var e;return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:if(e=this.getRemoteConfigUrl()){n.next=3;break}return n.abrupt("return");case 3:if(!e.includes(".rum.aliyuncs.com")){n.next=6;break}return this.version="v1",n.abrupt("return",this.getV1Config(e));case 6:return n.abrupt("return",this.getV2Config(e));case 7:case"end":return n.stop()}}),t,this)})))}},{key:"getV1Config",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(t,n){var r;(b.default.request||b.default.httpRequest)({url:e,method:"GET",success:function e(n){t(n)},fail:function t(e){n(e)}})})));case 1:case"end":return n.stop()}}),t)})))}},{key:"getV2Config",value:function t(e){return m(this,void 0,void 0,o().mark((function t(){var n,r;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return n=(0,g.getUrlParams)(e),r={instanceId:"",agentType:"rum_web_sdk",attributes:n,instanceConfigs:[{configType:"rum_web_config",version:1}],capabilities:2},o.abrupt("return",new Promise((function(t,n){var o;(b.default.request||b.default.httpRequest)({url:e,method:"POST",data:JSON.stringify(r),header:{"Content-Type":"application/json","x-log-apiversion":"0.6.0"},success:function e(n){t(n)},fail:function t(e){n(e)}})})));case 3:case"end":return o.stop()}}),t)})))}},{key:"getCacheConfig",value:function t(){var e=(0,b.getStorageSync)(w);if(e){var n,r=this.currentConfig;try{if("pid"in(n=JSON.parse(e))&&n.pid===r.pid||"endpoint"in n&&n.endpoint)return n}catch(t){}return n}}},{key:"setCacheConfig",value:function t(e){var n=this.currentConfig,r=Object.assign(Object.assign({},e),{pid:n.pid,endpoint:n.endpoint});(0,b.setStorageSync)(w,JSON.stringify(r))}},{key:"getRemoteConfigUrl",value:function t(){var e=this.currentConfig,n=e.pid,r,o=e.remoteConfig||{},i=o.url,a=o.region;if(i)return i;if(n){var u=n.split("@");return!u||2>u.length?void 0:"https://".concat(u[0],"-sdk.rum.aliyuncs.com/config/").concat(a||"cn-hangzhou","/").concat(u[1],"?t=").concat(Date.now())}}},{key:"parseConfig",value:function t(e){try{return"v2"===this.version?E(JSON.parse(e.instanceConfigs[0].config)):e}catch(t){return e}}}])}(g.ConfigManager);function S(t,e){var n,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],o=t.getConfig();if(!1===o.enable)return!1;var i=null===(n=o.collectors)||void 0===n?void 0:n[e];return(0,g.isBoolean)(i)?i:(0,g.isObject)(i)&&"enable"in i?i.enable:r}e.default=O,e.checkEnable=S},function(t,e,n){"use strict";function r(){if("function"==typeof getCurrentPages)try{var t=getCurrentPages()||[];return t[t.length-1]}catch(t){console.warn("[arms] error in getCurView",t)}}function o(t){if(t){var e=t.getViews();if(e&&e.length)return e[e.length-1]}}function i(t,n){return t?t[e.PAGE_ID]?t[e.PAGE_ID]:n?t[e.PAGE_ID]=n.getViewId():void 0:void 0}function a(t,e){return t&&e?e.getViews().find((function(e){return e.id===t})):void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.getViewById=e.getRumViewId=e.getCurView=e.getCurPage=e.PAGE_ID=void 0,e.PAGE_ID="__rum_view_id",e.getCurPage=r,e.getCurView=o,e.getRumViewId=i,e.getViewById=a},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removePageListener=e.addPageListener=e.originalPage=void 0;var s=n(0),f=n(1),l=n(16),p={onLoad:[],onShow:[],onHide:[],onUnload:[],"*":[]},h=["onLoad","onShow","onReady","onHide","onUnload","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"];function y(t){Object.keys(t).forEach((function(e){var n=t[e];!(0,s.isFunction)(n)||h.includes(e)||e in p||(p[e]=[])})),Object.keys(p).forEach((function(e){"swan"===f.appName&&Object.defineProperty(t,e,{writable:!0}),"*"===e||(0,s.interceptFunction)(t,e,(function(){for(var t=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(p[e]),r(p["*"]));a.forEach((function(e){e.apply(t,o)}))}),!0)}))}function v(t,e){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];n||(0,l.addComponentListener)(t,e),t in p||(p[t]=[]),p[t].push(e)}function d(t,e){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];if(n||(0,l.removeComponentListener)(t,e),t in p){var r=p[t],o=r.indexOf(e);r.splice(o,1)}}e.originalPage=Page,Page=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{y.apply(this,n)}catch(t){}return e.originalPage.apply(this,n)},Object.keys(e.originalPage).forEach((function(t){Page[t]=e.originalPage[t]})),e.addPageListener=v,e.removePageListener=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCurrentTime=e.formatNumber=void 0;var r=n(1);function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:3;if(!t)return t;var n=t.toString(),r=n.indexOf(".");return n=-1===r?n.substring(0):n.substring(0,e+r+1),parseFloat(n)}function i(t){var e=(0,r.getPerformance)(),n=0;return e&&e.timeOrigin&&e.now&&(n=Math.round(e.timeOrigin+(t||e.now()))),1e12>n&&(n=(new Date).getTime()),n}e.formatNumber=o,e.getCurrentTime=i},function(t,e,n){"use strict";var r,o,i;Object.defineProperty(e,"__esModule",{value:!0}),e.AppType=e.ResourceStatus=e.RumEventType=void 0,function(t){t.VIEW="view",t.RESOURCE="resource",t.EXCEPTION="exception",t.LONG_TASK="longTask",t.ACTION="action",t.CUSTOM="custom",t.APPLICATION="application"}(r=e.RumEventType||(e.RumEventType={})),function(t){t[t.Unknown=-1]="Unknown",t[t.Failed=0]="Failed",t[t.Success=1]="Success"}(o=e.ResourceStatus||(e.ResourceStatus={})),function(t){t.browser="browser",t.miniapp="miniapp",t.minigame="minigame",t.uniapp="uniapp",t.reactnative="reactnative"}(i=e.AppType||(e.AppType={}))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function t(){};return{s:o,n:function e(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function t(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function e(){n=n.call(t)},n:function t(){var e=n.next();return u=e.done,e},e:function t(e){c=!0,a=e},f:function t(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,f(r.key),r)}}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==r(e)?e:e+""}function l(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=n(9),h=n(20),y=n(10),v=n(2),d=function(){function t(){var e=this;u(this,t),this.emitter=new h.EventEmitter,this.sendEvent=function(t){e.emitter.emit(p.EventType.collect,t)}}return s(t,[{key:"init",value:function t(e,n,r){var i=this;this.ctx=new y.default(e,n,r);var a=this.ctx,u=this.collectors,c=this.processors,s=this.reporter;c.forEach((function(t){(0,v.isFunction)(t.setup)&&t.setup(a)})),this.emitter.on(p.EventType.collect,(function(t){a.setRumEvent(t);var e=o(c),n;try{for(e.s();!(n=e.n()).done;){var r=n.value;if(r.match||(r.match=function(){return!0}),r.match(a)){var i=r.process(a);i&&a.setRumEvent(i)}}}catch(t){e.e(t)}finally{e.f()}s.report(a)})),u.forEach((function(t){t.setup(a,i.sendEvent)}))}},{key:"setContext",value:function t(e){this.ctx=e}},{key:"getContext",value:function t(){return this.ctx}},{key:"useCollectors",value:function t(e){this.collectors=e}},{key:"getCollectors",value:function t(){return this.collectors}},{key:"useProcessors",value:function t(e){this.processors=e}},{key:"useReporter",value:function t(e){this.reporter=e}}])}();e.default=d},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.EventType=void 0,function(t){t.collect="collect"}(r=e.EventType||(e.EventType={}))},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(e,n,r){o(this,t),this.config=e,this.views=[],n&&(this.session=n,this.session.init(this)),r&&(this.configManager=r)}return a(t,[{key:"getConfig",value:function t(){return this.configManager?this.configManager.getConfig():this.config}},{key:"setConfig",value:function t(e){this.configManager?this.configManager.setConfig(e):this.config=e}},{key:"getViews",value:function t(){return this.views}},{key:"addView",value:function t(e){var n=this.views.findIndex((function(t){return t.id===e.id}));n>=0&&this.views.splice(n,1),this.views.push(e)}},{key:"removeView",value:function t(e){this.views=this.views.filter((function(t){return t.id!==e}))}},{key:"getRumEvent",value:function t(){return this.rumEvent}},{key:"setRumEvent",value:function t(e){this.rumEvent=e}}])}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.verifyProperties=void 0;var r=n(2);function o(t){if((0,r.isObject)(t)){var e=Object.assign({},t);Object.keys(e).forEach((function(t){var n=e[t];if(t.length>50){var o=t.substring(0,50);e[o]=n,delete e[t],t=o}(0,r.isString)(n)||(0,r.isNumber)(n)?(0,r.isString)(n)&&n.length>2e3&&(e[t]=n.substring(0,2e3)):delete e[t]}));var n=Object.keys(e);if(n.length)return n.length>20&&n.forEach((function(t,n){n>19&&delete e[t]})),e}}e.verifyProperties=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUrlParams=void 0;var r=function t(e){if(0===e.length)return"";try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e.replace(/\+/g," ").replace(/%20/g," ").replace(/%2F/g,"/").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/%3F/g,"?")}},o=function t(e){if(0===e.length)return"";var n=e.indexOf("#"),r=n>=0?e.slice(0,n):e,o=r.indexOf("?");return-1===o?"":r.slice(o+1)};function i(t){if("string"!=typeof t||!t.trim())return{};var e={},n=o(t);if(!n)return e;for(var i=n.split("&"),a=0;a<i.length;a++){var u=i[a];if(u){var c=u.indexOf("=");if(!(c<=0)){var s=r(u.slice(0,c)),f=c<u.length-1?r(u.slice(c+1)):"",l=e[s];void 0!==l?Array.isArray(l)?l.push(f):e[s]=[l,f]:e[s]=f}}}return e}e.getUrlParams=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseRegExpString=e.transStrToReg=e.getType=e.delay=e.debounce=e.generateEventId=e.generateSpanId=e.generateTraceId=e.generateGUID=e.restoreFunction=e.interceptFunction=void 0;var r=n(2),o=/^\[object ([a-z]*)\]$/;function i(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t[e],a=function e(){for(var a=o?this:t,u=arguments.length,c=new Array(u),s=0;s<u;s++)c[s]=arguments[s];if(n.apply(a,c),(0,r.isFunction)(i))return i.apply(a,c)};a._rum_intercepted=i,t[e]=a}function a(t,e){var n=t[e];if(!(0,r.isFunction)(n)){var o=n._rum_intercepted;(0,r.isFunction)(o)||(t[e]=o)}}function u(){var t="";try{if(crypto&&crypto.randomUUID)t=crypto.randomUUID();else if(crypto&&crypto.getRandomValues){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,t=e.reduce((function(t,e){return t+e.toString(16).padStart(2,"0")}),"").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/,"$1-$2-$3-$4-$5")}}catch(e){t=""}return t||(t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0,n;return("x"==t?e:3&e|8).toString(16)}))),t}function c(){var t=u().replace(/-/g,"");return"0"===t[0]&&(t="1"+t.substring(1)),"0"===t[16]&&(t=t.substring(0,16)+"1"+t.substring(17)),t}function s(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n="",r=0;r<t;r++)n+=Math.floor(Math.random()*e).toString(e);return n}function f(t){var e=s();return"00-".concat(t,"-").concat(e)}function l(t,e){var n;if((0,r.isFunction)(t))return function(){var r=this,o=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(r,o)}),e)}}function p(t,e){if((0,r.isFunction)(t)){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return setTimeout.apply(void 0,[t,+e||0].concat(o))}}function h(t){var e=Object.prototype.toString.call(t),n=(e=e.toLowerCase()||"").match(o);return null==n?void 0:n[1]}function y(t){return"string"!==h(t)?t:t.length>2&&"/"===t[0]&&"/"===t[t.length-1]?new RegExp(t.substr(1,t.length-2)):t}function v(t){if("string"!=typeof t)throw new TypeError("input must be a string");if(t.length>2&&"/"===t[0]){var e=t.lastIndexOf("/");if(e>0){var n=t.substring(1,e),r=t.substring(e+1);return new RegExp(n,r)}return new RegExp(t.substring(1,t.length-1))}return new RegExp(t)}e.interceptFunction=i,e.restoreFunction=a,e.generateGUID=u,e.generateTraceId=c,e.generateSpanId=s,e.generateEventId=f,e.debounce=l,e.delay=p,e.getType=h,e.transStrToReg=y,e.parseRegExpString=v},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<t.length;n+=1){var r=t[n];if(e(r,n))return r}}function o(t,e){return t.slice(0,e.length)===e}function i(t,e){return t.slice(-e.length)===e}function a(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})),t}Object.defineProperty(e,"__esModule",{value:!0}),e.assign=e.endsWith=e.startsWith=e.find=void 0,e.find=r,e.startsWith=o,e.endsWith=i,e.assign=a},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.parseRule2Match=e.urlMatch=e.matchList=e.isMatchOption=void 0;var s=n(2),f=n(14),l=n(13);function p(t){return(0,s.isString)(t)||(0,s.isFunction)(t)||(0,s.isRegExp)(t)}function h(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;return t.some((function(t){try{if("function"==typeof t)return t(e,r);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?(0,f.startsWith)(e,t):t===e}catch(t){}return!1}))}function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{(0,s.isArray)(e)||(e=[e]);var n=[/^(https?:)?\/\/.*rum|retcode|log-global|log\.aliyuncs\.com/,/^(https?:)?\/\/.*\.mmstat\.com/,/^(https?:)?\/\/.*hm\.baidu\.com/,/^(https?:)?\/\/.*google-analytics\.com/,/data:(.+?)(;base64)?,(.+)$/].concat(r(e));return h(n,t)}catch(t){return!1}}function v(t){if(p(t))return t;var e;switch(t.match_exp){case"equals":e=function e(n){return n===t.match};break;case"not_equals":e=function e(n){return n!==t.match};break;case"regex":e=(0,l.parseRegExpString)(t.match);break;case"includes":e=function e(n){return n.includes(t.match)};break;case"starts_with":default:e=function e(n){return(0,f.startsWith)(n,t.match)}}return e}e.isMatchOption=p,e.matchList=h,e.urlMatch=y,e.parseRule2Match=v},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removeComponentListener=e.addComponentListener=e.originalComponent=void 0;var s=n(0),f=n(1),l=new Map;["methods","lifetimes"].forEach((function(t){l.set(t,{})}));var p=["created","attached","ready","moved","detached","error"],h=["onShow","onHide","onPullDownRefresh","onReachBottom","onShareAppMessage","onShareTimeline","onAddToFavorites","onPageScroll","onResize","onTabItemTap","onSaveExitState"].concat(p);function y(t,e){var n=l.get(e);Object.keys(t).forEach((function(e){var r=t[e];!(0,s.isFunction)(r)||h.includes(e)||e in n||(n[e]=[])})),Object.keys(n).forEach((function(o){var i=t;"swan"===f.appName&&Object.defineProperty(i,o,{writable:!0}),"*"===o||("lifetimes"===e&&!(0,s.isFunction)(i[o])&&(!i.lifetimes&&(i.lifetimes={}),i=i.lifetimes),(0,s.interceptFunction)(i,o,(function(){for(var t=this,e=arguments.length,i=Array(e),a=0;a<e;a++)i[a]=arguments[a];var u=[].concat(r(n[o]),r(n["*"]||[]));u.forEach((function(e){e.apply(t,i)}))}),!0))}))}function v(t,e){var n;t in(n=p.includes(t)?l.get("lifetimes"):l.get("methods"))||(n[t]=[]),n[t].push(e)}function d(t,e){var n;if(t in(n=p.includes(t)?l.get("lifetimes"):l.get("methods"))){var r=n[t],o=r.indexOf(e);r.splice(o,1)}}e.originalComponent=Component,Component=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{var o=n[0]||{};o.methods||(o.methods={}),o.lifetimes||(o.lifetimes={}),y.call(this,o.methods,"methods"),y.call(this,o,"lifetimes")}catch(t){}return e.originalComponent.apply(this,n)},Object.keys(e.originalComponent).forEach((function(t){Component[t]=e.originalComponent[t]})),e.addComponentListener=v,e.removeComponentListener=d},function(t,e,n){t.exports=n(18)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var r=n(19);Object.defineProperty(e,"ArmsRum",{enumerable:!0,get:function(){return r.ArmsRum}}),e.default=r.default},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n){return(e=s(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new y(r||[]);return w(a,"_invoke",{value:f(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function a(){}function u(){}function c(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function s(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function f(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}i=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=u.prototype=o.prototype=Object.create(x);return a.prototype=u,w(T,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:a,configurable:!0}),a.displayName=t(u,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},c(s.prototype),t(s.prototype,S,(function(){return this})),m.AsyncIterator=s,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new s(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},c(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}function c(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t){var e=f(t,"string");return"symbol"==r(e)?e:e+""}function f(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function l(t,e,n){return e=v(e),p(t,y()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function p(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function m(t,e){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var g=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ArmsRum=void 0;var b=n(0),w=n(32),E=n(33),O=n(35),S=n(37),j=n(40),_=n(41),x=n(42),P=n(43),k=n(44),T=n(45),C=n(46),L=n(1),N=n(47),I=n(3),R=[w.default,E.default,O.default,S.default,j.default,_.default,x.default],A=function(t){function e(){var t;return a(this,e),(t=l(this,e,arguments)).version=L.VERSION,t.updateNetType=function(e){var n=t.getConfig().net||{};t.setConfig("net",Object.assign(Object.assign({},n),{type:e}))},t}return d(e,t),c(e,[{key:"init",value:function t(e){return g(this,void 0,void 0,i().mark((function t(){var n;return i().wrap((function t(r){for(;;)switch(r.prev=r.next){case 0:return this.configManager=new I.default,r.next=3,this.configManager.init(e);case 3:if(!1!==(n=this.configManager.getConfig()).enable){r.next=6;break}return r.abrupt("return");case 6:return this.client.useCollectors(R.map((function(t){return new t}))),this.client.useProcessors([new P.default,new k.default]),this.client.useReporter(new T.default),this.client.init(n,new N.RumSession,this.configManager),(0,C.getNetType)(this.updateNetType),r.abrupt("return",this);case 12:case"end":return r.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){var e;return null===(e=this.configManager)||void 0===e?void 0:e.getConfig()}},{key:"setConfig",value:function t(){var e=this.configManager;if(e)if(2===arguments.length){var n=e.getConfig();e.setConfig(Object.assign(Object.assign({},n),o({},0>=arguments.length?void 0:arguments[0],1>=arguments.length?void 0:arguments[1])))}else e.setConfig(0>=arguments.length?void 0:arguments[0])}},{key:"getCollector",value:function t(e){return this.client.getCollectors().find((function(t){return t.name===e}))}}])}(b.Shell);e.ArmsRum=A,e.default=new A},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var s=function(){function t(){o(this,t),this.events={}}return a(t,[{key:"on",value:function t(e,n){this.events[e]||(this.events[e]=[]),this.events[e].push(n)}},{key:"emit",value:function t(e){var n=this.events[e];if(n){for(var r=n.slice(),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];for(var u=0;u<r.length;u++)try{r[u].apply(r,i)}catch(t){console.error('Error in handler for "'.concat(e,'":'),t)}}}},{key:"off",value:function t(e,n){var r=this.events[e];if(r)if(n){for(var o=r.length;o--;)r[o]===n&&r.splice(o,1);0===r.length&&delete this.events[e]}else delete this.events[e]}},{key:"once",value:function t(e,n){var r=this,o=function t(){r.off(e,o),n.apply(void 0,arguments)};this.on(e,o)}}])}();e.EventEmitter=s},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,n,r){return e[n]=r}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:k(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(I([])));j&&j!==n&&i.call(j,c)&&(O=j);var _=E.prototype=b.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(r,i){function a(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},x(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(n){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!n)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function o(e,o){return c.type="throw",c.arg=n,r.next=e,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function t(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),g},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var i=o.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(n,r,o){return this.delegate={iterator:I(n),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var l=n(7),p=n(22),h=n(2),y=n(11),v=n(12),d=3e3,m=20,g=["app","user","device","os","geo","isp","net","properties"],b=function(){function t(){i(this,t),this.name="reporter",this.eventQueue=[],this._init=!1}return u(t,[{key:"getReportCfg",value:function t(){var e=this.ctx.getConfig().reportConfig;return(0,h.isObject)(e)||(e={}),(!e.flushTime||e.flushTime<0||e.flushTime>1e4)&&(e.flushTime=3e3),(!e.maxEventCount||e.maxEventCount<1||e.maxEventCount>100)&&(e.maxEventCount=20),e}},{key:"report",value:function t(e){var n=this;this.ctx=e,this._init||(this.init(e),this._init=!0),clearTimeout(this.timer),this.pushToQueue();var r=this.getReportCfg();this.eventQueue.length>=r.maxEventCount?this.flushEventQueue():this.timer=setTimeout((function(){n.flushEventQueue()}),r.flushTime)}},{key:"pushToQueue",value:function t(){var e=this.ctx,n=this.eventQueue,r=e.getRumEvent();if(r.event_type===l.RumEventType.EXCEPTION){var o=r.message,i=r.stack,a=(0,p.getErrorID)({message:o,stack:i}),u=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.EXCEPTION){var e=t.message,n=t.stack;return(0,p.getErrorID)({message:e,stack:n})===a}}));if(u)return void u.times++}if(r.event_type===l.RumEventType.ACTION){var c=r.target_name,s=this.eventQueue.find((function(t){if(t.event_type===l.RumEventType.ACTION)return c===t.target_name}));if(s)return void s.times++}n.push(r)}},{key:"flushEventQueue",value:function t(){var e=this.ctx,n=this.eventQueue;if(n.length){var r=e.getViews(),o=r[r.length-1];r.forEach((function(t){var e;t.id===o.id&&n.filter((function(e){var n;return(null===(n=e.view)||void 0===n?void 0:n.id)===t.id})).forEach((function(t){delete t.view}))}));var i=e.session,a;(!i||i.getSampled())&&this.mergeEvent(e,n,o),this.eventQueue=[]}}},{key:"mergeEvent",value:function t(e,n,r){for(var o=e.getConfig(),i=e.session,a=i.getSessionId(),u=0;u<n.length;u++){var c=n[u];c.session_id===a?delete c.session_id:(n.splice(u,1),u--)}if(0!==n.length){var s=(0,v.getUrlParams)(o.endpoint),f=Object.assign({app:{id:o.pid,env:o.env||"prod",version:o.version,type:""},user:{id:i.getUserId()},session:{id:a},net:{},view:r,events:n},s);g.forEach((function(t){var e=o[t];(0,h.isObject)(e)&&Object.keys(e).forEach((function(n){var r=e[n];"user"===t&&"id"===n||("properties"===t?f[t]=(0,y.verifyProperties)(e):((0,h.isString)(r)||(0,h.isNumber)(r))&&(t in f||(f[t]={}),f[t][n]=r))}))})),("function"!=typeof o.beforeReport||(f=o.beforeReport(f)))&&this.tryRequest(f)}}},{key:"tryRequest",value:function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r,i,a;return f(this,void 0,void 0,o().mark((function t(){var u=this,c,s,f;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:return c=null===(r=this.ctx.getConfig())||void 0===r?void 0:r.reportConfig,s=null!==(i=null==c?void 0:c.maxRetryCount)&&void 0!==i?i:0,f=null!==(a=null==c?void 0:c.retryDelay)&&void 0!==a?a:3e3,o.prev=3,e._retry=n,o.next=7,this.request(this.ctx,e);case 7:o.next=12;break;case 9:o.prev=9,o.t0=o.catch(3),n<s-1&&setTimeout((function(){return u.tryRequest(e,n+1)}),f);case 12:case"end":return o.stop()}}),t,this,[[3,9]])})))}},{key:"init",value:function t(e){}}])}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorID=void 0;var r=function t(e){var n=e.message,r=void 0===n?"":n,o=e.stack,i;return r+(void 0===o?"":o)};e.getErrorID=r},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(7),f=n(8),l=n(2),p=function(){function t(e){o(this,t),this.client=new f.default,e&&this.init&&this.init(e)}return a(t,[{key:"sendEvent",value:function t(e){this.client&&this.client.sendEvent(e)}},{key:"getConfig",value:function t(){if(this.client)return this.client.getContext().getConfig()}},{key:"sendCustom",value:function t(e){if(e.name&&e.type){var n=Object.assign(Object.assign({},e),{event_type:s.RumEventType.CUSTOM});this.sendEvent(n)}}},{key:"sendView",value:function t(e){if((0,l.isObject)(e)){if(e.type||(e.type="custom"),"custom"===e.type){var n=0;if(["t1","t2","t3"].forEach((function(t){(0,l.isNumber)(e[t])||delete e[t],t in e&&n++})),0===n)return}var r=Object.assign(Object.assign({},e),{event_type:s.RumEventType.VIEW});this.sendEvent(r)}}},{key:"sendException",value:function t(e){if(e.name&&e.message){var n=e.name,r=e.message,o=e.stack,i=Object.assign(Object.assign({times:1,name:n,message:r,stack:o},e),{event_type:s.RumEventType.EXCEPTION,type:"custom",source:"custom"});this.sendEvent(i)}}},{key:"sendResource",value:function t(e){if(e.name&&e.type&&(0,l.isNumber)(e.duration)){var n=Object.assign(Object.assign({times:1},e),{event_type:s.RumEventType.RESOURCE});this.sendEvent(n)}}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function t(){return e};var t,e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function t(e,n,r){return e[n]=r}}function p(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new N(r||[]);return a(i,"_invoke",{value:k(t,n,u)}),i}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,c,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(I([])));j&&j!==n&&i.call(j,c)&&(O=j);var _=E.prototype=b.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,a,u,c){var s=h(t[o],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function t(r,i){function a(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(a,a):a()}})}function k(e,n,r){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=T(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function T(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(_,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},x(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(_),l(_,f,"Generator"),l(_,c,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function e(n){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!n)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var r=this;function o(e,o){return c.type="throw",c.arg=n,r.next=e,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],c=u.completion;if("root"===u.tryLoc)return o("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return o(u.finallyLoc)}}}},abrupt:function t(e,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function t(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),g},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),g}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var i=o.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function e(n,r,o){return this.delegate={iterator:I(n),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function u(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=s(t,"string");return"symbol"==r(e)?e:e+""}function s(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var f=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};function l(t){var e=t.remoteConfig||{};return{enable:!1!==e.enable&&!(!e.url&&!e.region),url:e.url||"",mode:e.mode||"launch-first",cacheTimeout:e.cacheTimeout||36e5,region:e.region}}Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigManager=void 0;var p=function(){function t(){i(this,t),this.currentConfig=null,this.initialized=!1}return u(t,[{key:"init",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){var n=this,r,i,a;return o().wrap((function t(o){for(;;)switch(o.prev=o.next){case 0:if(!this.initialized){o.next=2;break}return o.abrupt("return");case 2:if(this.currentConfig=Object.assign({},e),this.initialized=!0,r=l(e),this.currentConfig.remoteConfig=r,r.enable){o.next=8;break}return o.abrupt("return");case 8:return o.next=10,this.getCacheConfig();case 10:if((i=o.sent)&&i.content&&(this.currentConfig=this.mergeRemoteCfg(i.content)),!this.isCacheValid(i,r.cacheTimeout)){o.next=14;break}return o.abrupt("return");case 14:if(a=this.fetchRemoteCfg(this.currentConfig).then((function(t){if(t){var e=n.parseConfig(t);n.currentConfig=n.mergeRemoteCfg(e),n.setCacheConfig({timestamp:Date.now(),content:t})}})),"remote-first"!==r.mode){o.next=18;break}return o.next=18,a;case 18:case"end":return o.stop()}}),t,this)})))}},{key:"getConfig",value:function t(){if(!this.currentConfig)throw new Error("Config not initialized");return this.currentConfig}},{key:"setConfig",value:function t(e){return f(this,void 0,void 0,o().mark((function t(){return o().wrap((function t(n){for(;;)switch(n.prev=n.next){case 0:if(this.currentConfig){n.next=2;break}return n.abrupt("return");case 2:this.currentConfig=Object.assign(Object.assign({},this.currentConfig),e);case 3:case"end":return n.stop()}}),t,this)})))}},{key:"isCacheValid",value:function t(e,n){if(!e||!e.timestamp)return!1;var r=n||36e5;return Date.now()-e.timestamp<r}},{key:"mergeRemoteCfg",value:function t(e){var n=this.currentConfig,r=n.pid,o=n.app,i=n.endpoint,a=n.remoteConfig,u=n.beforeReport,c=n.properties;return Object.assign(Object.assign(Object.assign({},this.currentConfig),e),{pid:r,app:o,endpoint:i,remoteConfig:a,beforeReport:u,properties:c})}},{key:"destroy",value:function t(){this.currentConfig=null,this.initialized=!1}}])}();e.ConfigManager=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function r(t){return 0!==t&&100*Math.random()<=t}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return t;var r=t.toString(),o=r.indexOf(".");r=-1!==o?r.substring(0,e+o+1):r.substring(0);var i=parseFloat(r);return i>=n?i:void 0}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.performDraw=e.ONE_DAY=e.ONE_HOUR=e.ONE_MINUTE=e.ONE_SECOND=void 0,e.ONE_SECOND=1e3,e.ONE_MINUTE=60*e.ONE_SECOND,e.ONE_HOUR=60*e.ONE_MINUTE,e.ONE_DAY=24*e.ONE_HOUR,e.performDraw=r,e.formatNumber=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTracingOptions=e.makeTracingHeaders=e.isTraceOption=void 0;var r=n(15),o=n(2);function i(t){return t&&(0,r.isMatchOption)(t.match)&&(0,o.isArray)(t.propagatorTypes)}function a(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a={},u=n?"1":"0";return r.includes("sw8")&&(r=["sw8"]),(0,o.isArray)(r)||(r=[r]),r.forEach((function(n){switch(n){case"jaeger":a["uber-trace-id"]="".concat(t,":").concat(e,":0:").concat(u);break;case"b3":a.b3="".concat(t,"-").concat(e,"-").concat(u);break;case"b3multi":a["X-B3-TraceId"]=t,a["X-B3-SpanId"]=e,a["X-B3-Sampled"]=u;break;case"sw8":if((0,o.isFunction)(btoa)){var r=btoa(t),c=btoa(e),s=btoa(i.appId),f=btoa(i.appVersion),l=btoa(i.viewName),p=btoa(i.host);a.sw8="".concat(u,"-").concat(r,"-").concat(c,"-",0,"-").concat(s,"-").concat(f,"-").concat(l,"-").concat(p)}break;case"tracecontext":default:a.traceparent="00-".concat(t,"-").concat(e,"-0").concat(u),i.tracestate&&(a.tracestate=i.tracestate)}})),i.baggage&&(a.baggage=i.baggage),a}function u(t){var e=["tracecontext"];if((0,o.isBoolean)(t)||!t)return{enable:!!t,sample:100,propagatorTypes:e,allowedUrls:[],tracestate:!0,baggage:!1};var n=t.enable,a=void 0===n||n,u=t.sample,c=void 0===u?100:u,s=t.propagatorTypes,f=void 0===s?e:s,l=t.allowedUrls,p=void 0===l?[]:l,h=t.tracestate,y=void 0===h||h,v=t.baggage,d=void 0!==v&&v,m=[];return(0,o.isArray)(p)&&p.length&&p.forEach((function(t){(0,r.isMatchOption)(t)?m.push({match:t,propagatorTypes:f}):i(t)&&m.push(t)})),{enable:!(0,o.isBoolean)(a)||a,sample:(0,o.isNumber)(c)?c:100,propagatorTypes:f,allowedUrls:m,tracestate:y,baggage:d}}e.isTraceOption=i,e.makeTracingHeaders=a,e.parseTracingOptions=u},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(4),l=n(5),p=function(){function t(){var e=this;o(this,t),this.name="pv-collector",this.onUnload=function(){var t=(0,f.getCurView)(e.ctx);e.ctx.removeView(t.id)},this.sendPv=function(){var t=(0,f.getCurPage)();if(t){var n=t.route,r=t.options,o=(0,f.getRumViewId)(t);if(!e.prevPage||o!==e.prevPage.viewId){var i=o?"route_back":"initial_load";o=(0,f.getRumViewId)(t,e.ctx.session),e.prevPage={route:n,viewId:o};var a=e.getViewName(n);e.ctx.addView({id:o,name:a});var u={};r&&Object.keys(r).forEach((function(t){u[t]=decodeURIComponent(r[t])})),e.sendEvent({event_type:s.RumEventType.VIEW,type:"pv",url:n,name:a,loading_type:i,snapshots:JSON.stringify(u).substring(0,5e3)})}}}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.sendPv(),(0,l.addPageListener)("onLoad",this.sendPv),(0,l.addPageListener)("onUnload",this.onUnload)}},{key:"getViewName",value:function(t){var e,n=this.ctx.getConfig().parseViewName,r=t;return(0,s.isFunction)(n)&&(r=n(t)),r}},{key:"destroy",value:function(){(0,l.removePageListener)("onLoad",this.sendPv),(0,l.removePageListener)("onUnload",this.onUnload)}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(4),p=n(5),h=n(6),y=n(34),v=n(3),d=(0,f.getPerformance)(),m=function(){function t(){var e=this;o(this,t),this.name="perf-collector",this.currentViewId="",this.pageIdToViewId={},this.delayHandler=function(t){var n=(0,s.isArray)(t)?t:t.getEntries();Array.isArray(n)&&0!==n.length&&setTimeout((function(){n.forEach((function(t){if(t.pageId){var n=e.pageIdToViewId["pageId:".concat(t.pageId)];if(n&&e.perfCache[n])return void e.perfCache[n].entries.push(t)}if(e.currentViewId){var r=e.perfCache[e.currentViewId];if(r){var o=t.path;o||"navigation"!==t.entryType||(o=t.name),r.path!==o||r.entries.push(t)}}}))}),y.COMMON_DELAY)},this.onLoad=function(){var t=(0,l.getCurPage)(),n=(0,l.getCurView)(e.ctx),r=(0,l.getRumViewId)(t,e.ctx.session),o=(0,s.isFunction)(t.getPageId)?t.getPageId():null;r in e.perfCache||(e.currentViewId=r,o&&(e.pageIdToViewId[o.toString()]=r),e.perfCache[r]={view:n,path:t.is||t.route,pageId:o,entries:[],timer:setTimeout((function(){e.flushByViewId(r)}),s.ONE_MINUTE),loadTime:(0,h.getCurrentTime)()})},this.onReady=function(){var t=e.currentViewId;if(t){var n=e.perfCache[t];n&&(n.dom_complete=(0,h.getCurrentTime)()-n.loadTime)}},this.flushByViewId=function(t){var n=e.perfCache[t];n&&(e.perfCache[t]=!1,clearTimeout(n.timer),n.entries.length&&e.parsePerf(n))}}return a(t,[{key:"setup",value:function(t,e){if((0,v.checkEnable)(t,"perf")){var n=this;if(this.ctx=t,this.sendEvent=e,d&&d.getEntries){this.perfCache={};var r,o=f.appName===f.wechatName||f.appName===f.alipayName;if(o)r=["navigation","render"];else if(f.appName===f.bytedanceName)r=["launch","paint","navigation"];else{if(f.appName!==f.ksName)return;r=["paint","navigation"]}this.delayHandler(d.getEntries().filter((function(t){return r.includes(t.entryType)}))),this.perfObserver=d.createObserver(this.delayHandler),this.perfObserver.observe({entryTypes:r}),this.onUnload=function(){if(!o){var e=(0,l.getRumViewId)(this,t.session);e&&n.flushByViewId(e)}},(0,p.addPageListener)("onLoad",this.onLoad),(0,p.addPageListener)("onReady",this.onReady),(0,p.addPageListener)("onHide",this.onUnload),(0,p.addPageListener)("onUnload",this.onUnload)}}}},{key:"parsePerf",value:function(t){var e,n,r,o,i,a=t.entries,u=t.view,c=t.dom_complete;a.forEach((function(t){if(t.startTime)switch(t.name){case"firstRender":case"first-render":n=t;break;case"firstPaint":case"first-paint":r=t;break;case"firstContentfulPaint":case"first-contentful-paint":o=t;break;case"largestContentfulPaint":case"largest-contentful-paint":if(i&&i.startTime>t.startTime)break;i=t;break;default:"navigation"===t.entryType&&(e=t)}}));var s={};e&&(n&&(s.first_render=n.duration?n.duration:n.startTime-e.startTime),r&&(s.first_paint=r.startTime-e.startTime),o&&(s.first_contentful_paint=o.startTime-e.startTime),i&&(s.largest_contentful_paint=i.startTime-e.startTime),c&&(s.dom_complete=c),this.sendPerf(s,{view:u,timestamp:e.startTime,timing_data:JSON.stringify(e)}))}},{key:"sendPerf",value:function(t,e){for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r],i=t[o];(0>=i||isNaN(i)||6e5<i)&&delete t[o]}if(Object.keys(t)){var a=this.ctx.session.getBaseEvent();this.sendEvent(Object.assign(Object.assign(Object.assign(Object.assign({},a),{event_type:s.RumEventType.VIEW,type:"perf"}),e),t))}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect(),(0,p.removePageListener)("onLoad",this.onLoad),(0,p.removePageListener)("onReady",this.onReady),(0,p.removePageListener)("onHide",this.onUnload),(0,p.removePageListener)("onUnload",this.onUnload)}}])}();e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.COMMON_DELAY=void 0,e.COMMON_DELAY=200},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(36),l=n(1),p=n(3),h=function(){function t(){var e=this;o(this,t),this.name="exception-collector",this.origin={consoleError:console.error},this.events={onError:null,onUnhandledRejection:null,onPageNotFound:null,onLazyLoadError:null},this.onError=function(t,n){var r=t;(0,s.isString)(r)&&(0,s.isString)(n)&&(r=n),e.errorHandle(r,"onError")},this.errorHandle=function(t){var n,r,o,i,a,u,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(t instanceof Object)n=t.name,r=t.message,o=t.filename||t.fileName,i=t.stack,a=t.lineno||t.lineNumber,u=t.colno||t.columnNumber;else if("string"==typeof t){i=t;var f=e.getErrorByStack(t);f&&(n=f.name,r=f.message)}if(n&&r&&!e.errorFilter(t)){var l=e.ctx.session.getBaseEvent();e.sendEvent(Object.assign(Object.assign({},l),{event_type:s.RumEventType.EXCEPTION,source:c,type:"error",name:n,message:r,file:o,stack:i,line:a,column:u}))}}}return a(t,[{key:"setup",value:function(t,e){this.ctx=t,this.sendEvent=e,this.hackOrigin()}},{key:"hackOrigin",value:function(){var t=this,e=this;(0,p.checkEnable)(this.ctx,"jsError")&&((0,s.isFunction)(l.sdk.onError)&&"undefined"==typeof uni?l.sdk.onError(this.onError):Object.keys(this.events).forEach((function(n){t.events[n]=function(t){t.reason&&t.reason instanceof Error&&(t=t.reason),e.errorHandle(t,n)},(0,f.addAppListener)(n,t.events[n])}))),(0,p.checkEnable)(this.ctx,"consoleError")&&("swan"===l.appName&&Object.defineProperty(console,"error",{writable:!0}),(0,s.interceptFunction)(console,"error",(function(t){e.errorHandle(t,"console.error")})))}},{key:"getErrorByStack",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=t.split("\n");if(!(2>e.length))for(var n=1;n<e.length;n++)if(e[n].trim().startsWith("at ")){var r=e[n-1],o=r.indexOf(": ");return{name:r.substring(0,o),message:r.substring(o+2)}}}},{key:"errorFilter",value:function(t){var e,n=(this.ctx.getConfig().filters||{}).exception;return!!n&&((0,s.isArray)(n)||(n=[n]),(0,s.matchList)(n,t.name,!0,t)||(0,s.matchList)(n,t.message,!0,t)||(0,s.matchList)(n,t.stack,!0,t))}},{key:"destroy",value:function(){var t=this,e=this.origin;e.consoleError&&(console.error=e.consoleError),(0,s.isFunction)(l.sdk.offError)&&l.sdk.offError(this.onError),Object.keys(this.events).forEach((function(e){(0,s.isFunction)(t.events[e])&&(0,f.removeAppListener)(e,t.events[e])}))}}])}();e.default=h},function(t,e,n){"use strict";function r(t){return u(t)||a(t)||i(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function a(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t){if(Array.isArray(t))return c(t)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.removeAppListener=e.addAppListener=e.originalApp=void 0;var s=n(0),f=n(1),l={onLaunch:[],"*":[]};function p(t){Object.keys(l).forEach((function(e){"swan"===f.appName&&Object.defineProperty(t,e,{writable:!0}),"*"===e||(0,s.interceptFunction)(t,e,(function(){for(var t=this,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=[].concat(r(l[e]),r(l["*"]));a.forEach((function(e){e.apply(t,o)}))}),!0)}))}function h(t,e){t in l||(l[t]=[]),l[t].push(e)}function y(t,e){if(t in l){var n=l[t],r=n.indexOf(e);n.splice(r,1)}}e.originalApp=App,App=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{p.apply(this,n)}catch(t){}return e.originalApp.apply(this,n)},Object.keys(e.originalApp).forEach((function(t){App[t]=e.originalApp[t]})),e.addAppListener=h,e.removeAppListener=y},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t){return c(t)||u(t)||a(t)||i()}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return s(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function c(t){if(Array.isArray(t))return s(t)}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function t(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}function e(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new y(r||[]);return w(a,"_invoke",{value:s(t,n,u)}),a}function n(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function u(e){["next","throw","return"].forEach((function(n){t(e,n,(function(t){return this._invoke(n,t)}))}))}function c(t,e){function o(i,a,u,c){var s=n(t[i],t,a);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==r(l)&&b.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,u,c)}),(function(t){o("throw",t,u,c)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return o("throw",t,u,c)}))}c(s.arg)}var i;w(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function s(t,e,r){var o="suspendedStart";return function(i,a){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===i)throw a;return{value:d,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=l(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===o)throw o="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o="executing";var s=n(t,e,r);if("normal"===s.type){if(o=r.done?"completed":"suspendedYield",s.arg===_)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o="completed",r.method="throw",r.arg=s.arg)}}}function l(t,e){var r=e.method,o=t.iterator[r];if(o===d)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=d,l(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var i=n(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,_;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,_):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,_)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function h(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function y(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function v(t){if(t||""===t){var e=t[O];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=d,e.done=!0,e};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}f=function(){return m};var d,m={},g=Object.prototype,b=g.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E="function"==typeof Symbol?Symbol:{},O=E.iterator||"@@iterator",S=E.asyncIterator||"@@asyncIterator",j=E.toStringTag||"@@toStringTag";try{t({},"")}catch(S){t=function(t,e,n){return t[e]=n}}m.wrap=e;var _={},x={};t(x,O,(function(){return this}));var P=Object.getPrototypeOf,k=P&&P(P(v([])));k&&k!==g&&b.call(k,O)&&(x=k);var T=a.prototype=o.prototype=Object.create(x);return i.prototype=a,w(T,"constructor",{value:a,configurable:!0}),w(a,"constructor",{value:i,configurable:!0}),i.displayName=t(a,j,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},m.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,t(e,j,"GeneratorFunction")),e.prototype=Object.create(T),e},m.awrap=function(t){return{__await:t}},u(c.prototype),t(c.prototype,S,(function(){return this})),m.AsyncIterator=c,m.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new c(e(t,n,r,o),i);return m.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},u(T),t(T,j,"Generator"),t(T,O,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),m.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},m.values=v,y.prototype={constructor:y,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(h),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=d),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),u=b.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n,r=this.tryEntries.length-1;0<=r;--r)if((n=this.tryEntries[r]).tryLoc<=this.prev&&b.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).finallyLoc===t)return this.complete(e.completion,e.afterLoc),h(e),_},catch:function(t){for(var e,n=this.tryEntries.length-1;0<=n;--n)if((e=this.tryEntries[n]).tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;h(e)}return o}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=d),_}},m}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}function h(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){var e=v(t,"string");return"symbol"==r(e)?e:e+""}function v(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var d=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});var m=n(0),g=n(1),b=n(38),w=n(6),E=n(4),O=n(39),S=n(3),j=function(){function t(){var e=this;l(this,t),this.name="api-collector",this.origin={request:g.default.request,httpRequest:g.default.httpRequest},this.sendApi=function(t,n,r){return d(e,void 0,void 0,f().mark((function e(){var o,i,a,u,c,s,l,p,h,y,v,d,g,b;return f().wrap((function e(f){for(;;)switch(f.prev=f.next){case 0:if(o=this.ctx.getConfig(),i=o.evaluateApi,a=n.statusCode,u=n.status,c=n.errMsg,s=n.errorMessage,l=n.message,(p=n.profile)&&(h=this.parseProfile(p),y=JSON.stringify(p)),!(0,m.isFunction)(i)){f.next=14;break}return f.prev=4,0===t.success&&(v=new Error("request error")),f.next=8,i(r,n,v);case 8:d=f.sent,t=Object.assign(Object.assign({},t),(0,O.reviseApiAttr)(d)),f.next=14;break;case 12:f.prev=12,f.t0=f.catch(4);case 14:if(g=this.ctx.session.getBaseEvent(),!((b=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{event_type:m.RumEventType.RESOURCE,type:"api",status_code:u||a,message:s||c||l,duration:(0,w.getCurrentTime)()-t.timestamp}),t),h),{timing_data:y})).duration>m.ONE_HOUR)){f.next=18;break}return f.abrupt("return");case 18:this.sendEvent(b);case 19:case"end":return f.stop()}}),e,this,[[4,12]])})))}}return h(t,[{key:"setup",value:function t(e,n){var r=this;(0,S.checkEnable)(e,"api")&&(this.ctx=e,this.sendEvent=n,Object.keys(this.origin).forEach((function(t){return r.hackRequest(t)})))}},{key:"injectTracing",value:function t(e,n){var r,o=this.ctx.session,i=this.ctx.getConfig(),a=i.tracing,u=i.pid,c=i.version,s=void 0===c?"1.0.0":c,f=(0,m.parseTracingOptions)(a),l=f.enable,p=f.sample,h=f.propagatorTypes,y=f.allowedUrls,v=f.tracestate,d=!(void 0!==v)||v,b=f.baggage,w=void 0!==b&&b;if(l){var E=(0,m.find)(y,(function(t){return(0,m.matchList)([t.match],e.url)}));if(E){var O=E.propagatorTypes;0===O.length&&(O=h);var S=!1;O.includes("sw8")&&(O=["sw8"],S=!0);var j=S?(0,m.generateGUID)():(0,m.generateTraceId)(),_=S?(0,m.generateGUID)():(0,m.generateSpanId)(),x=(0,m.performDraw)(p),P=o.getUserId(),k=o.getSessionId(),T=d?"rum=v2&miniapp&".concat(u,"&").concat(k,"&").concat(P):void 0,C=w?"rum=v2,appType=miniapp,pid=".concat(u,",sid=").concat(k,",uid=").concat(P):void 0,L=(0,m.makeTracingHeaders)(j,_,x,O,{tracestate:T,baggage:C,appId:u,appVersion:s,viewName:null===(r=e.view)||void 0===r?void 0:r.name,host:"miniapp_".concat(g.appName)});x&&(e.trace_id=j,e.trace_data=JSON.stringify({spanId:_,sample:p,sampled:x,headers:L})),n(L)}}}},{key:"hackRequest",value:function t(e){var n=this;(0,m.isFunction)(g.default[e])&&Object.defineProperty(g.default,e,{configurable:!0,enumerable:!0,writable:!0,value:function t(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return o[0]=n.rebuildRequestOptions(o[0]),n.origin[e].apply(this,o)}})}},{key:"rebuildRequestOptions",value:function t(e){var n=this,r=e.url,o=e.success,i=e.fail,a=(0,w.getCurrentTime)();if((0,b.isEndpoint)(this.ctx,r)||n.filter(r))return e;var u=Object.assign({},e),c={view:(0,E.getCurView)(this.ctx),timestamp:a,url:r,name:this.getResourceName(r),method:e.method||"GET"};return this.injectTracing(c,(function(t){var e=[];["headers","header"].forEach((function(n){n in u&&(0,m.isObject)(u[n])&&(u[n]=Object.assign(Object.assign({},u[n]),t),e.push(n))})),0===e.length&&(u[g.HEADER_KEY]=Object.assign(Object.assign({},u[g.HEADER_KEY]),t))})),u.success=function(){c.success=1;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];n.sendApi(c,e[0],u),o&&o.apply(this,e)},u.fail=function(){c.success=0;for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];n.sendApi(c,e[0],u),i&&i.apply(this,e)},u}},{key:"getResourceName",value:function t(e){var n,r,o=this.ctx.getConfig().parseResourceName;return n=(0,m.isFunction)(o)?o(e):(0,b.getPathByURL)(e)}},{key:"parseProfile",value:function t(e){function n(t,n){t in e&&0<e[t]&&(o[n]=e[t])}function r(t,n,r){if(t in e&&t in e){var i=e[n]-e[t];0<i&&(o[r]=i)}}var o={};return n("domainLookup","dns_duration"),n("connect","connect_duration"),n("SSLconnection","ssl_duration"),n("Waiting","first_byte_duration"),n("totalTime","duration"),n("receivedBytedCount","size"),r("connectStart","connectEnd","connect_duration"),r("SSLconnectionStart","SSLconnectionEnd","ssl_duration"),r("domainLookUpStart","domainLookUpEnd","dns_duration"),r("redirectStart","redirectEnd","redirect_duration"),r("responseStart","requestStart","first_byte_duration"),r("responseStart","requestEnd","download_duration"),r("redirectStart","responseEnd","duration"),Object.keys(o).forEach((function(t){o[t]>m.ONE_HOUR&&delete o[t]})),o}},{key:"filter",value:function t(e){var n,r,i=this.ctx.getConfig(),a=(null===(n=null==i?void 0:i.filters)||void 0===n?void 0:n.resource)||[];(0,m.isArray)(a)||(a=[a]);var u=null===(r=null==i?void 0:i.collectors)||void 0===r?void 0:r.api;return(0,m.isObject)(u)&&(0,m.isArray)(u.filters)&&(a=[].concat(o(a),o(u.filters))),(0,m.urlMatch)(e,a)}}])}();e.default=j},function(t,e,n){"use strict";function r(t){var e=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];try{var n=a(t);return e?n.hash:n.pathname}catch(t){return""}}function o(t,e){var n,r=t.getConfig().endpoint;try{return a(e).hostname===a(r).hostname}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.getURL=e.isEndpoint=e.getPathByURL=void 0,e.getPathByURL=r,e.isEndpoint=o;var i=/^(?:([^:\/?#]+):\/\/)?((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?)?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i;function a(t){var e=decodeURIComponent(t).match(i),n,r=(e[3]||"").split(":").length?(e[2]||"").replace(/(.*\@)/,""):e[2];return{uri:e[0],protocol:e[1],host:r,hostname:e[4],port:e[5],pathname:e[6],search:e[7],hash:e[8]}}e.getURL=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reviseApiAttr=void 0;var r=n(0);function o(t){if((0,r.isObject)(t)){var e={};(0,r.isString)(t.name)&&(e.name=t.name.substring(0,1e3)),(0,r.isString)(t.message)&&(e.message=t.message.substring(0,1e3)),"success"in t&&(e.success=t.success?1:0),(0,r.isNumber)(t.duration)&&0<=t.duration&&(e.duration=t.duration),(0,r.isString)(t.status_code)&&(e.status_code=t.status_code.substring(0,100)),(0,r.isNumber)(t.status_code)&&(e.status_code=t.status_code),(0,r.isString)(t.snapshots)&&(e.snapshots=t.snapshots.substring(0,5e3));var n=(0,r.verifyProperties)(t.properties);return n&&(e.properties=n),e}}e.reviseApiAttr=o},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(5),l=n(3),p=function(){function t(){var e=this;o(this,t),this.name="action-collector",this.DELAY_TIME=300,this.events=["tap"],this.onEvent=function(t){if(t&&e.events.includes(t.type)&&t.target){var n=t.target,r=t.currentTarget,o=t.type,i=r.dataset,a=r.id;if(a||r===n||(a=n.id,i=n.dataset),!a)return;var u=e.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.ACTION,type:o,name:a,snapshots:JSON.stringify({dataset:i}).substring(0,1e3)});clearTimeout(e.timer),e.lastEvent?e.lastEvent.name===c.name?e.lastEvent.times+=1:e.sendAction():e.lastEvent=c,e.timer=setTimeout(e.sendAction,e.DELAY_TIME)}},this.sendAction=function(){e.sendEvent(e.lastEvent),e.lastEvent=null}}return a(t,[{key:"setup",value:function(t,e){(0,l.checkEnable)(t,"action")&&(this.ctx=t,this.sendEvent=e,(0,f.addPageListener)("*",this.onEvent))}},{key:"destroy",value:function(){(0,f.removePageListener)("*",this.onEvent)}}])}();e.default=p},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(1),l=n(3),p=function(){function t(){var e=this;o(this,t),this.name="application-collector",this.observerHandler=function(t){var n,r,o=(0,s.isArray)(t)?t:t.getEntries();if((0,s.isFunction)(f.default.getLaunchOptionsSync)&&(r=null===(n=f.default.getLaunchOptionsSync())||void 0===n?void 0:n.scene),Array.isArray(o)&&0<o.length)for(var i,a=0;a<o.length;a++)if("number"==typeof(i=o[a]).duration&&0<i.duration){var u=e.ctx.session.getBaseEvent(),c=Object.assign(Object.assign({},u),{event_type:s.RumEventType.APPLICATION,state:"",duration:0,snapshots:JSON.stringify(i),scene:r});switch(i.name){case"appLaunch":case"app-click":c.state="cold_lunch",c.duration=i.duration;break;case"downloadPackage":case"miniprogram-package":case"download":c.state="download_package",c.duration=i.duration;break;case"evaluateScript":case"app-service":var l;"__APP__"===(i.moduleName||i.packageName)&&(c.state="evaluate_script",c.duration=i.duration)}c.state&&0<c.duration&&6e5>c.duration&&e.sendEvent(c)}}}return a(t,[{key:"setup",value:function(t,e){if((0,l.checkEnable)(t,"application")){this.ctx=t,this.sendEvent=e;var n=(0,f.getPerformance)();if(n&&(0,s.isFunction)(n.createObserver)){var r=[];if(f.appName===f.wechatName||f.appName===f.alipayName)r=["navigation","script","loadPackage"];else if(f.appName===f.bytedanceName)r=["launch","evaluate","resource"];else{if(f.appName!==f.ksName)return;r=["navigation","resource"]}this.observerHandler(n.getEntries().filter((function(t){return r.includes(t.entryType)}))),this.perfObserver=n.createObserver(this.observerHandler),this.perfObserver.observe({entryTypes:r})}}}},{key:"destroy",value:function(){this.perfObserver&&this.perfObserver.disconnect()}}])}();e.default=p},function(t,e,n){"use strict";function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw a}}}}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}function s(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t){var e=l(t,"string");return"symbol"==a(e)?e:e+""}function l(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var p=n(0),h=n(5),y=n(16),v=n(4),d=n(6),m=n(3),g=5,b=50,w=function(){function t(){var e=this;u(this,t),this.name="render-block-collector",this.renderBlockReportLimitMap=new Map,this.onLoad=function(){var t=(0,v.getCurPage)(),n=(0,v.getRumViewId)(t,e.ctx.session);e.renderBlockReportLimitMap.set(n,{count:0,name:(0,v.getViewById)(n,e.ctx).name})},this.onSetData=function(t){return t&&(0,p.isFunction)(t.setUpdatePerformanceListener)?void t.setUpdatePerformanceListener({withDataPaths:!0},(function(n){var r=n||{},o=r.updateEndTimestamp,i=r.pendingStartTimestamp,a=r.dataPaths,u=void 0===a?[]:a,c=o-i;if((0,p.isNumber)(c)&&!(c<e.renderThreshold)){var s=(0,v.getCurPage)(),f=(0,v.getRumViewId)(s,e.ctx.session);if(e.renderBlockReportLimitMap.has(f)){var l=e.renderBlockReportLimitMap.get(f),h=l.count,y=l.name;if(!(h>e.maxEventCount)){e.renderBlockReportLimitMap.set(f,{count:h+1,name:y});var m=e.ctx.session.getBaseEvent(),g=t.data,b=O(u,g);e.sendEvent(Object.assign(Object.assign({},m),{event_type:p.RumEventType.LONG_TASK,type:"render",duration:c,message:t.is||t.route||"",snapshots:JSON.stringify(Object.assign(Object.assign({},S(n)),b?{data:b}:{})),timestamp:i||(0,d.getCurrentTime)(),source:"setData",view:{id:f,name:y}}))}}}})):void e.destroy()},this.onUnload=function(){var t=(0,v.getCurPage)(),n=(0,v.getRumViewId)(t,e.ctx.session);e.renderBlockReportLimitMap.delete(n)}}return s(t,[{key:"setup",value:function(t,e){var n,r=t.getConfig().longTaskConfig,o=void 0===r?{}:r;if((0,m.checkEnable)(t,"longTask")){var i=this;this.ctx=t,this.sendEvent=e;var a=E(o),u=a.maxEventCount,c=a.renderThreshold;this.maxEventCount=u,this.renderThreshold=c,this._onSetData=function(){i.onSetData(this)},(0,h.addPageListener)("onLoad",this.onLoad),(0,h.addPageListener)("onReady",this._onSetData,!0),(0,h.addPageListener)("onUnload",this.onUnload),(0,y.addComponentListener)("attached",this._onSetData)}}},{key:"destroy",value:function(){(0,h.removePageListener)("onLoad",this.onLoad),(0,h.removePageListener)("onReady",this._onSetData,!0),(0,h.removePageListener)("onUnload",this.onUnload),(0,y.removeComponentListener)("attached",this._onSetData)}}])}();e.default=w;var E=function(t){var e=t||{},n=e.maxEventCount,r=e.renderThreshold;return(!n||!(0,p.isNumber)(n)||1>n||n>b)&&(t.maxEventCount=g),r&&(0,p.isNumber)(r)&&!(r<b)||(t.renderThreshold=b),t},O=function(t,e){try{return t.map((function(t){var n,o="",i=e,a=r(t);try{for(a.s();!(n=a.n()).done;){var u=n.value;o+=o?".".concat(u):u,i=null==i?void 0:i[u]}}catch(t){a.e(t)}finally{a.f()}return{dataKey:o,dataLength:JSON.stringify(i).length}}))}catch(t){return""}},S=function(t){if(!t)return t;var e=t.updateStartTimestamp,n=t.updateEndTimestamp,r=t.pendingStartTimestamp;return t.updateEndTimestamp=n-r,t.updateStartTimestamp=e-r,t.pendingStartTimestamp=0,t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(6),f=n(4),l=function(){function t(){o(this,t),this.name="default-processor"}return a(t,[{key:"process",value:function(t){var e=t.getRumEvent(),n=(0,f.getCurView)(t),r;return Object.assign({timestamp:(0,s.getCurrentTime)(),session_id:t.session.getSessionId(),event_id:t.session.getEventId(),view:n},e)}}])}();e.default=l},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),f=n(5),l=function(){function t(){var e=this;o(this,t),this.name="session-processor",this.update=function(t){t&&!t.isTrusted||e.ctx.session.updateSession()}}return a(t,[{key:"setup",value:function(t){var e=this;this.ctx=t,this.update=(0,s.debounce)(this.update,s.ONE_SECOND),(0,f.addPageListener)("*",(function(t){t&&t.type&&t.target&&e.update()}))}},{key:"process",value:function(t){return this.update(),t.getRumEvent()}}])}();e.default=l},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){var e=c(t,"string");return"symbol"==r(e)?e:e+""}function c(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function s(t,e,n){return e=h(e),f(t,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function f(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function v(t,e){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}Object.defineProperty(e,"__esModule",{value:!0});var d=n(0),m=n(1),g=function(t){function e(){var t;return o(this,e),(t=s(this,e,arguments)).name="miniapp-reporter",t}return y(e,t),a(e,[{key:"init",value:function(){var t=this;(0,d.isFunction)(m.default.onAppHide)&&m.default.onAppHide((function(){t.flushEventQueue()}))}},{key:"request",value:function(t,e){var n=t.getConfig();try{var r;e.app.type=d.AppType.miniapp,e._v=m.VERSION,(m.default.request||m.default.httpRequest)({url:n.endpoint,method:"POST",dataType:"text",data:JSON.stringify(e)})}catch(t){console.warn("[arms] sendRequest fail",t)}}}])}(d.Reporter);e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNetType=void 0;var r=n(1);function o(t){r.default.getNetworkType&&r.default.getNetworkType({success:function(e){var n=e.networkType||e.subtype;t(n?n.toLowerCase():void 0)}}),r.default.onNetworkStatusChange&&r.default.onNetworkStatusChange((function(e){var n=e.networkType||e.subtype;t(n?n.toLowerCase():void 0)}))}e.getNetType=o},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return s(t)||c(t,e)||a(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(c){s=!0,o=c}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}function s(t){if(Array.isArray(t))return t}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n,r=0;r<e.length;r++)(n=e[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}function p(t,e,n){return e&&l(t.prototype,e),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var e=y(t,"string");return"symbol"==r(e)?e:e+""}function y(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.RumSession=void 0;var v=n(0),d=n(6),m=n(4),g=n(1),b="_arms_uid",w="_arms_session",E=function(){function t(){f(this,t)}return p(t,[{key:"init",value:function(t){var e;this.ctx=t,this.sessionConfig=this.fixSessionConfig(null===(e=t.config)||void 0===e?void 0:e.sessionConfig)}},{key:"getSessionId",value:function(){return this.getSessionInfo().sessionId}},{key:"getSampled",value:function(){return this.getSessionInfo().sampled}},{key:"checkSession",value:function(t){var e=this.sessionConfig,n=e.overtime,r=e.maxDuration,o=(0,d.getCurrentTime)();return!(t.startTime+r<o||t.lastTime+n<o)}},{key:"updateSession",value:function(){var t=this.getSessionInfo();if(!t.isNew){var e=t.startTime,n=(0,d.getCurrentTime)(),r=t.sampled?1:0;(0,g.setStorageSync)(w,"".concat(t.sessionId,"-").concat(r,"-").concat(e,"-").concat(n))}}},{key:"getSessionInfo",value:function(){var t,e=o(((0,g.getStorageSync)(w)||"").split("-"),4),n=e[0],r=e[1],i=e[2],a=e[3],u={sessionId:n,sampled:"0"!==r,startTime:parseInt(i||"")||0,lastTime:parseInt(a||"")||0};return this.checkSession(u)||(u=this.resetSession()),u}},{key:"getEventId",value:function(){return(0,v.generateEventId)(this.getSessionId())}},{key:"getViewId",value:function(){return this.getUUID()}},{key:"getUserId",value:function(){var t=(0,g.getStorageSync)(b);return t&&0===t.indexOf("user_")&&(t=""),t||(t="uid_".concat((0,v.generateSpanId)(16,36)),(0,g.setStorageSync)(b,t)),t}},{key:"resetSession",value:function(){var t=this.sessionConfig.sampleRate,e=this.getUUID(),n=(0,d.getCurrentTime)(),r=(0,v.performDraw)(100*t),o="".concat(e,"-").concat(r?1:0,"-").concat(n,"-").concat(n);return(0,g.setStorageSync)(w,o),{sessionId:e,sampled:r,startTime:n,lastTime:n,isNew:!0}}},{key:"getUUID",value:function(){return(0,v.generateGUID)().replace(/-/g,"")}},{key:"fixSessionConfig",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.sampleRate,n=t.maxDuration,r=t.overtime;return(!(0,v.isNumber)(e)||0>e||1<e)&&(e=1),(!(0,v.isNumber)(n)||n<4*v.ONE_HOUR||n>v.ONE_DAY)&&(n=v.ONE_DAY),(!(0,v.isNumber)(r)||r>v.ONE_HOUR||r<10*v.ONE_MINUTE)&&(r=30*v.ONE_MINUTE),{sampleRate:e,maxDuration:n,overtime:r}}},{key:"getBaseEvent",value:function(){return{timestamp:(0,d.getCurrentTime)(),session_id:this.getSessionId(),event_id:this.getEventId(),view:this.ctx?(0,m.getCurView)(this.ctx):void 0,times:1}}}])}();e.RumSession=E}])}));
@@ -1,4 +1,4 @@
1
- "use strict";exports.__esModule=!0,exports.dingtalkName=exports["default"]=exports.bytedanceName=exports.appName=exports.alipayName=exports.VERSION=exports.HEADER_KEY=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=exports.qqName=exports.ksName=exports.jdName=void 0,exports.setStorageSync=setStorageSync,exports.wechatName=exports.swanName=void 0;var VERSION=exports.VERSION='npm-0.1.1',OBJ="object",qqName=exports.qqName="qq",bytedanceName=exports.bytedanceName="bytedance",wechatName=exports.wechatName="wechat",dingtalkName=exports.dingtalkName="dingtalk",alipayName=exports.alipayName="alipay",swanName=exports.swanName="swan",jdName=exports.jdName="jd",ksName=exports.ksName="ks";function isFunc(a){return"function"==typeof a}/**
1
+ "use strict";exports.__esModule=!0,exports.dingtalkName=exports["default"]=exports.bytedanceName=exports.appName=exports.alipayName=exports.VERSION=exports.HEADER_KEY=void 0,exports.getPerformance=getPerformance,exports.getStorageSync=getStorageSync,exports.sdk=exports.qqName=exports.ksName=exports.jdName=void 0,exports.setStorageSync=setStorageSync,exports.wechatName=exports.swanName=void 0;var VERSION=exports.VERSION='npm-0.1.2',OBJ="object",qqName=exports.qqName="qq",bytedanceName=exports.bytedanceName="bytedance",wechatName=exports.wechatName="wechat",dingtalkName=exports.dingtalkName="dingtalk",alipayName=exports.alipayName="alipay",swanName=exports.swanName="swan",jdName=exports.jdName="jd",ksName=exports.ksName="ks";function isFunc(a){return"function"==typeof a}/**
2
2
  * 获取跨平台的 SDK
3
3
  */function getSDK(){var a,b="unknown";if(typeof ks===OBJ)a=ks,b=ksName;else if(typeof swan===OBJ)a=swan,b=swanName;else if(typeof qq===OBJ)// qq的全局也有wx命名空间,和qq等效,这会导致判断AppName失效
4
4
  a=qq,b=qqName;else if(typeof tt===OBJ)// 字节的全局也有wx命名空间,和tt等效,这会导致判断AppName失效
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arms/rum-miniapp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "arms rum javascript sdk for miniapp",
5
5
  "author": "guangli.fj <guangli.fj@alibaba-inc.com>",
6
6
  "license": "ISC",
@@ -23,7 +23,7 @@
23
23
  "test": "node ./__tests__/@arms/miniapp.test.js"
24
24
  },
25
25
  "dependencies": {
26
- "@arms/rum-core": "0.1.1"
26
+ "@arms/rum-core": "0.1.2"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@babel/runtime": "^7.24.5"
@@ -1,46 +0,0 @@
1
- // import { isObject, isString } from "@arms/rum-core";
2
- // import { getStorageSync, setStorageSync } from "./platform";
3
- //
4
- // const LOCAL_STORE_CONFIG_KEY = 'arms_rum2_local_config';
5
- //
6
- // function storeConfigToLocal(config: any, pid: string): boolean {
7
- // if(!config || !isObject(config)) return false;
8
- // const storeObj = {
9
- // timestamp: (new Date()).getTime(),
10
- // pid,
11
- // content: config
12
- // };
13
- // // 这里要try,防止浏览器的本地存储被占满而报错
14
- // try{
15
- // const storeContent = JSON.stringify(storeObj);
16
- // setStorageSync(LOCAL_STORE_CONFIG_KEY, storeContent);
17
- // return true;
18
- // }catch(e){
19
- // return false;
20
- // }
21
- // }
22
- //
23
- // /**
24
- // *
25
- // * @param duration 有效时间,先暂定为不过期
26
- // * @returns
27
- // */
28
- // function getConfigFromLocal(duration: number=0, pid: string): any {
29
- // const storeContent = getStorageSync(LOCAL_STORE_CONFIG_KEY);
30
- // if(!storeContent) return null;
31
- // try{
32
- // const storeObj = JSON.parse(storeContent);
33
- // if(pid && storeObj.pid && storeObj.pid !== pid) {
34
- // return null;
35
- // }
36
- // return storeObj.content;
37
- // }catch(e){
38
- // return null;
39
- // }
40
- // }
41
- //
42
- // export {
43
- // storeConfigToLocal,
44
- // getConfigFromLocal
45
- // }
46
- "use strict";
@@ -1,34 +0,0 @@
1
- // import sdk from '../utils/platform';
2
- //
3
- // function request(url: string) {
4
- // const _request = sdk.request || sdk.httpRequest;
5
- // if(!url || typeof Promise !== 'function') {
6
- // // throw new Error('Promise is not supported');
7
- // return null;
8
- // }
9
- //
10
- // return new Promise((resolve, reject) => {
11
- // // 小程序需要地址前面携带协议
12
- // if(url.indexOf('https:') !== 0 || url.indexOf('http:') !== 0) {
13
- // url = `https:${url}`;
14
- // }
15
- // _request({
16
- // url: url,
17
- // success: (res: any={}) => {
18
- // const data = res.data;
19
- // const status = res.statusCode || res.status;
20
- // if(!data || status != 200 || typeof data !== 'object') {
21
- // resolve({"errorStatus": status });
22
- // } else {
23
- // resolve(data);
24
- // }
25
- // },
26
- // fail: (err: any={}) => {
27
- // resolve({"errorStatus": err.statusCode || err.status || '400'});
28
- // }
29
- // })
30
- // });
31
- // }
32
- //
33
- // export default request;
34
- "use strict";