@apmplus/web
Advanced tools
Comparing version 1.4.2-alpha.1 to 1.4.2
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var c,u,v=function(){return(v=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function j(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),u=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function y(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"object"==typeof document&&("currentScript"in(c=document)||Object.defineProperty(c,"currentScript",{get:function(){try{throw new Error}catch(e){var n=0,t=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e.stack),r=t&&t[1]||!1,o=t&&t[2]||0,i=c.location.href.replace(c.location.hash,""),u="",a=c.getElementsByTagName("script");for(r===i&&(t=c.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(o-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),u=t.replace(o,"$1").trim());n<a.length;n++){if("interactive"===a[n].readyState)return a[n];if(a[n].src===r)return a[n];if(r===i&&a[n].innerHTML&&a[n].innerHTML.trim()===u)return a[n]}return null}}})),"undefined"==typeof Element||Element.prototype.addEventListener||(u=[],mr=function(e,n){for(var t=0;t<u.length;){var r=u[t];if(r.object===this&&r.type===e&&r.listener===n){"DOMContentLoaded"===e?this.detachEvent("onreadystatechange",r.wrapper):this.detachEvent("on"+e,r.wrapper),u.splice(t,1);break}++t}},Element.prototype.addEventListener=Er=function(e,n){function t(e){e.target=e.srcElement,e.currentTarget=i,void 0!==n.handleEvent?n.handleEvent(e):n.call(i,e)}var r,o,i=this;"DOMContentLoaded"===e?(r=function(e){"complete"===document.readyState&&t(e)},document.attachEvent("onreadystatechange",r),u.push({object:this,type:e,listener:n,wrapper:r}),"complete"===document.readyState&&((o=new Event).srcElement=window,r(o))):(this.attachEvent("on"+e,t),u.push({object:this,type:e,listener:n,wrapper:t}))},Element.prototype.removeEventListener=mr,HTMLDocument&&!HTMLDocument.prototype.addEventListener&&(HTMLDocument.prototype.addEventListener=Er,HTMLDocument.prototype.removeEventListener=mr),Window&&!Window.prototype.addEventListener&&(Window.prototype.addEventListener=Er,Window.prototype.removeEventListener=mr));function p(e){return JSON.stringify({ev_type:"batch",list:e})}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],b=function(){return{}};function g(e){return e}function E(e){return"object"==typeof e&&null!==e}var n=Object.prototype;function i(e){if(E(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===n.toString.call(e);e=Object.getPrototypeOf(e);return e===n||null===e}}function a(e){return"[object Array]"===n.toString.call(e)}function _(e){return"function"==typeof e}function f(e){return"number"==typeof e}function h(e){return"string"==typeof e}function o(e){return"undefined"!=typeof Event&&function(e,n){try{return e instanceof n}catch(e){return}}(e,Event)}function d(e,n){var t,r,o=v({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(E(n[t])&&i(n[t])?o[t]=d(E(e[t])?e[t]:{},n[t]):a(n[t])&&a(e[t])?o[t]=function n(e,t){e=a(e)?e:[];t=a(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:E(e)&&i(e)?d({},e):a(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function x(e,n){if(!a(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function S(e,n){if(!a(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function l(e,n,t){for(var r,o=(n=j(n.split(".")))[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=j(i))[0],i=r.slice(1);if(e)return t(e,o)}function m(e){return a(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];h(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function s(e){try{return h(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function D(i,u,a){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return b;var t=i[u],r=a.apply(void 0,y([t],j(e),!1)),o=r;return _(o)&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return _(t)&&t.apply(this,n)}}),i[u]=o,function(e){e||(o===i[u]?i[u]=t:r=t)}}}function T(t,r,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t[r]=o.apply(void 0,y([t[r]],j(e),!1))}}function R(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,y(["[SDK]",Date.now(),(""+r++).padStart(8," ")],j(e),!1))}function L(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){C(e)}return n}}var t=0,C=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,y(["[SDK]",Date.now(),(""+t++).padStart(8," ")],j(e),!1))},r=0,k=function(e){return Math.random()<Number(e)},O=function(e,n){return e<Number(n)};function q(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}var N=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=s(n),o},merge:function(n){return t=v(v({},t),n),Object.keys(n).forEach(function(e){r[e]=s(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return v({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},I=function(a,c,t){function f(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0];if(t){var r=t.split(".")[0];if(r in f)return i=f,u=t,o=[].slice.call(e,1),l(i,u,function(e,n){if(e&&n in e&&_(e[n]))try{return e[n].apply(e,o)}catch(e){return}});var o,i=s[r]||[],u=null!==(u=null==c?void 0:c(a))&&void 0!==u?u:{};i.push(y([u],j(e),!1)),void(s[r]=i)}}var e,s={};for(e in D(a,"provide",function(t){return function(e,n){f[e]=n,t.call(a,e,n)}})(),a)Object.prototype.hasOwnProperty.call(a,e)&&(f[e]=a[e]);return a.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=j(e),e=n[0],n=n.slice(1);null!=t&&t(a,e,n)}),s[e]=null)}),f};function A(){if("object"==typeof window&&E(window))return window}function M(){if("object"==typeof document&&E(document))return document}function B(){return A()&&window.location}function H(){if(A()&&E(window.performance))return window.performance}function P(){if("function"==typeof XMLHttpRequest&&_(XMLHttpRequest))return XMLHttpRequest}function U(){try{return new Headers,new Request(""),new Response,window.fetch}catch(e){}}function W(){if(A()&&_(window.MutationObserver))return window.MutationObserver}function e(){if(A()&&_(window.PerformanceObserver))return window.PerformanceObserver}function G(){var e=H();if(e&&E(e.timing))return e.timing}function F(){var e=function(){if(A()&&"navigator"in window)return window.navigator}();if(e)return e.connection||e.mozConnection||e.webkitConnection}var X=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[]}}),e.__SLARDAR_REGISTRY__.Slardar}(A());t&&(t.errors||(t.errors=[]),t.errors.push(e))},z=function(e,n){var t=e&&new e(n);return[function(e,n){t&&e&&t.observe(e,n)},function(){return t&&t.disconnect()}]},Y=function(t){var e=t&&t.timing||void 0;return[e,function(){return t&&t.now?t.now():(Date.now?Date.now():+new Date)-(e&&e.navigationStart||0)},function(e){var n=(t||{}).getEntriesByType;return _(n)&&n.call(t,e)||[]},function(){var e=(t||{}).clearResourceTimings;_(e)&&e.call(t)},function(e){var n=(t||{}).getEntriesByName;return _(n)&&n.call(t,e)||[]}]},J=function(t,o,n,i){var r=t&&new t(function(e,r){e.getEntries?e.getEntries().forEach(function(e,n,t){return o(e,n,t,r)}):i&&i(),n&&r.disconnect()});return[function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!t||!r)return i&&i();try{n.forEach(function(e){-1<t.supportedEntryTypes.indexOf(e)&&r.observe({type:e,buffered:!1})})}catch(e){try{r.observe({entryTypes:n})}catch(e){return i&&i()}}},function(){return r&&r.disconnect()}]},V=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,y([],j(r),!1));return o&&o(n,t)||[]}catch(e){return X(e),[]}};function $(e){var n=M();if(!n||!e)return"";n=n.createElement("a");return n.href=e,n.href}function K(e){var n=M();if(!n||!e)return{url:e,protocol:"",domain:"",query:"",path:"",hash:""};n=n.createElement("a");n.href=e;e=n.pathname||"/";return"/"!==e[0]&&(e="/"+e),{url:n.href,protocol:n.protocol.slice(0,-1),domain:n.hostname,query:n.search.substring(1),path:e,hash:n.hash}}function Q(){var e=A()&&B();return null==e?void 0:e.href}var Z=function(e){var n={url:Q(),timestamp:Date.now()},t=e.config();return null!=t&&t.pid&&(n.pid=t.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},ee=function(t,r){return function(e){function n(e){return e.overrides=r,e}t.on("report",n),e(),t.off("report",n)}},ne="<unknown>";function te(e){try{for(var n,t=e,r=[],o=0,i=0,u=" > ".length;t&&o++<5&&!("html"===(n=function(e){var n,t,r,o,i=e,u=[];if(!i||!i.tagName)return"";u.push(i.tagName.toLowerCase()),i.id&&u.push("#"+i.id);e=i.className;if(e&&h(e))for(n=e.split(/\s+/),o=0;o<n.length;o++)u.push("."+n[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)t=a[o],(r=i.getAttribute(t))&&u.push("["+t+'="'+r+'"]');return u.join("")}(t))||1<o&&80<=i+r.length*u+n.length);)r.push(n),i+=n.length,t=t.parentNode;return r.reverse().join(" > ")}catch(e){return ne}}function re(o){function i(n,t){var r;return function(e){u=void 0,e&&r!==e&&t({event:r=e,name:n})}}var u;return[i,function(r){return function(e){var n;try{n=e.target}catch(e){return}var t=n&&n.tagName;t&&("INPUT"===t||"TEXTAREA"===t||n.isContentEditable)&&(u||i("input",r)(e),clearTimeout(u),u=window.setTimeout(function(){u=void 0},o))}}]}function oe(n,t){return function(e){if(t)try{n(e)}catch(e){}}}function ie(e){var n=A(),t=M();n&&t&&("complete"!==t.readyState?n.addEventListener("load",function(){setTimeout(function(){e()},0)},!1):e())}function ue(e){var n;"hidden"!==document.visibilityState?(n=function(){"hidden"===document.visibilityState&&(e(),removeEventListener("visibilitychange",n,!0))},addEventListener("visibilitychange",n,!0)):e()}function ae(e,n){return E(e)?v(v({},n),e):!!e&&n}function ce(e,n){return!(!e||!n)&&(le.test(e)||de.test(n))}var fe=function(n){var t=!1;return[function(e){t||(t=!0,n&&n(e))}]},se=function(e){var n=j(fe(e),1)[0];["unload","beforeunload","pagehide"].forEach(function(e){addEventListener(e,n)})},le=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),de=new RegExp("(bearer|session)","i");function pe(e,n,t){var r=e._method,o=e._reqHeaders,i=e._url,u=e._start,a=e._data,t={api:"xhr",request:{url:$(i),method:(r||"").toLowerCase(),headers:o,timestamp:u},response:{status:e.status||0,is_custom_error:!1,timing:t(e.responseURL),timestamp:Date.now()},duration:Date.now()-u};"function"==typeof e.getAllResponseHeaders&&(t.response.headers=h(c=e.getAllResponseHeaders())&&c?c.split("\r\n").reduce(function(e,n){var t;return h(n)&&(n=(t=j(n.split(": "),2))[0],t=t[1],ce(n,t)||(e[n.toLowerCase()]=t)),e},{}):{});var u=t.response.status,c=n.collectBodyOnError,n=n.extraExtractor;try{var f=null==n?void 0:n(e.response,t);f&&(t.extra=f),f&&(t.response.is_custom_error=!0),c&&400<=u&&(t.request.body=a?""+a:void 0,t.response.body=e.response?""+e.response:void 0)}catch(e){}return t}function ve(e,n){return!!(e=m(e||[]))&&e.test(n)}function he(e){var n=j(Y(e),5)[4];return function(e){return n(e).pop()}}function me(o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._reqHeaders=this._reqHeaders||{};var t=j(e,2),r=t[0],t=t[1];return ce(r,t)||(this._reqHeaders[r.toLowerCase()]=t),o&&o.apply(this,e)}}function ge(r,o,a,c){return function(){for(var i,u,t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return u=c,T(i=this,"onreadystatechange",function(t,r,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{4===this.readyState&&!ve(r.ignoreUrls,i._url)&&o&&o({ev_type:"http",payload:pe(i,r,u)})}catch(e){X(e)}return t&&t.apply(this,e)}})(o,o.hookCbAtReq(a)),o.setTraceHeader&&o.setTraceHeader(this._url,function(e,n){return t.setRequestHeader(e,n)}),this._start=Date.now(),this._data=null==e?void 0:e[0],r.apply(this,e)}}function ye(r){return function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e=j(n,2),this._method=e[0],this._url=e[1],r.apply(this,n)}}function we(e,n,t,r){T(e,"open",ye)(),T(e,"setRequestHeader",me)(),T(e,"send",ge)(n,t,r)}function be(){var e=window.crypto||window.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n);e=function(e){for(var n=e.toString(16);n.length<4;)n="0"+n;return n};return e(n[0])+e(n[1])+e(n[2])+e(n[3])+e(n[4])+e(n[5])+e(n[6])+e(n[7])}return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,function(){return(16*Math.random()|0).toString(16)})}var Ee=function(e,n){if(void 0===e&&(e=P()&&A()),void 0===n&&(n=H()),e){var s=he(n);return function(c,f){var e;!c.autoWrap||(e=XMLHttpRequest&&XMLHttpRequest.prototype)&&we(e,c,f,s);return[function(e,n,t){return i=n=void 0===n?c:n,u=t=void 0===t?f:t,a=s,r.prototype=new(o=e),["DONE","HEADERS_RECIEVED","LOADING","OPENED","UNSENT"].forEach(function(e){r[e]=o[e]}),r;function r(){var e=new o;return we(e,i,u,a),e}var o,i,u,a}]}}},_e={sampleRate:1,origins:[]},xe=function(e,r){var o=ae(e,_e);if(o&&k(o.sampleRate))return function(e,n){var t=o.origins;t.length&&Boolean(e.match(new RegExp(t.join("|"))))&&(n("x-rum-traceparent","00-"+be()+"-"+be().substring(16)+"-01"),n("x-rum-tracestate",r))}};function Se(e,n,t){n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return ae(n,t)}var Te=function(n,t){var e=n.config(),r={url:Q(),pid:e.pid,view_id:e.viewId};return function(e){n.report(v(v({},e),{overrides:v(v({},r),t&&t(e)||{})}))}},De="ajax",Re={autoWrap:!0,hookCbAtReq:g,ignoreUrls:[],collectBodyOnError:!1},Le=function(r){return function(n){if(!n)return n;var e=r.config(),t={url:Q(),pid:e.pid,view_id:e.viewId};return function(e){n(v(v({},e),{overrides:v(v({},t),{timestamp:e.payload.request.timestamp})}))}}};var Ce=function(f){if(f=void 0===f?M():f)return function(e,n){var t,r=e.maxBreadcrumbs,o=e.onAddBreadcrumb,i=e.onMaxBreadcrumbs,u=e.dom,a=j(re(100),2),e=a[0],a=a[1],r=j(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=g),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=v(v({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(y(y([],j(o),!1),[e],!1),n):y(y([],j(o),!1),[e],!1))}]}(r,o,i),2),o=r[0],i=r[1],r=(t=i,function(e){var n;try{n=e.event.target?te(e.event.target):te(e.event)}catch(e){n="<unknown>"}0!==n.length&&t({type:"dom",category:"ui."+e.name,message:n})}),c=[];u&&(c.push(e("click",oe(r,"dom"))),c.push(a(oe(r,"dom"))),f.addEventListener("click",c[0]),f.addEventListener("keypress",c[1]));return[o,i,function(){f.removeEventListener("click",c[0]),f.removeEventListener("keypress",c[1])}]}},je="breadcrumb",ke={maxBreadcrumbs:20,dom:!0};function Oe(e,n){return e instanceof n}function qe(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(t,e){return new n(e).forEach(function(e,n){return!ce(n,e)&&(t[n]=e)}),t},{})}function Ne(e,n,t){return Oe(e,t)?e.body:null==n?void 0:n.body}function Ie(e,n,t,r){return{method:function(e,n,t){n=n&&n.method||"get";return(n=Oe(e,t)?e.method||n:n).toLowerCase()}(n,t,r),timestamp:Date.now(),url:$(e)}}function Ae(c,f,s,l,d,p){return function(i,u){void 0===u&&(u={});var e,n,t=(n=!1,t="",t=Oe(e=i,d)?e.url:e,t=!(n=void 0!==n&&n)&&h(t)?t.split("?")[0]:t);if(!function(e){if(h(e)){var n=j(e.split(":"),2),e=n[0];return!n[1]||"http"===e||"https"===e}}(t)||ve(f.ignoreUrls,t))return c(i,u);var r=f.hookCbAtReq(s),o={api:"fetch",request:Ie(i instanceof d?i.url:i,i,u,d),response:{is_custom_error:!1},duration:0};f.setTraceHeader&&f.setTraceHeader(o.request.url,function(e,n){var t,r,o;t=e,r=n,o=u,e=l,Oe(n=i,d)?n.headers.set(t,r):o.headers instanceof e?o.headers.set(t,r):o.headers=v(v({},o.headers),((o={})[t]=r,o))});var t=c(i,u);try{o.request.headers=qe(l,i.headers,u.headers)}catch(e){X(e)}var a=function(){r&&r({ev_type:"http",payload:o})};return t.then(function(e){var n;try{o.response.status=e.status||0,o.response.headers=qe(l,e.headers),o.response.timestamp=Date.now(),o.duration=o.response.timestamp-o.request.timestamp;var t=f.collectBodyOnError,r=f.extraExtractor;try{r&&e.clone().json().then(function(e){e=r(e,o);e&&(o.extra=e,o.response.is_custom_error=!0)})}catch(e){}t&&400<=e.status&&(o.request.body=null===(n=Ne(i,u,d))||void 0===n?void 0:n.toString());setTimeout(function(){o.response.timing=p(e.url),a()},100)}catch(e){X(e)}},function(){var e;try{o.response.status=0,o.response.timestamp=Date.now(),o.duration=o.response.timestamp-o.request.timestamp,f.collectBodyOnError&&(o.request.body=null===(e=Ne(i,u,d))||void 0===e?void 0:e.toString())}catch(e){X(e)}a()}),t}}var Me=function(e,i,u,n){if(void 0===e&&(e=U()&&A()),void 0===i&&(i=window.Headers),void 0===u&&(u=window.Request),void 0===n&&(n=H()),e&&i&&u){var a=he(n);return function(r,o){r.autoWrap&&T(e,"fetch",Ae)(r,o,i,u,a);return[function(e,n,t){return Ae(e,n=void 0===n?r:n,t=void 0===t?o:t,i,u,a)}]}}},Be="fetch",He={autoWrap:!0,hookCbAtReq:g,ignoreUrls:[],collectBodyOnError:!1};function Pe(e){var n,t,r;return!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?(i(e)||o(e)||h(e))&&(n={message:s(e)}):(r=Ye,n=(t=e)&&E(t)?r.reduce(function(e,n){return e[n]=t[n],e},{}):t),n}function Ue(e){return Pe(e.error)}function We(e){var n;try{var t=void 0;if("reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason),t){var r=Pe(t);return v(v({},r),{name:null!==(n=r&&r.name)&&void 0!==n?n:"UnhandledRejection"})}}catch(e){}}function Ge(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)?Ue(e):("[object PromiseRejectionEvent]"===Object.prototype.toString.call(e)?We:Pe)(e)}function Fe(n){function i(e){return _(e)?e._w_||(e._w_=function(){try{return(e.handleEvent||e).apply(this,[].map.call(arguments,i))}catch(e){throw t&&n(Pe(e)),e}}):e}var t=!0;return Ve.forEach(function(e){return window[e]&&T(window,e,function(r){return function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return r&&r.call.apply(r,y([this,i(e)],j(n),!1))}})()}),T(XMLHttpRequest.prototype,"send",function(r){return function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $e.forEach(function(e){return n[e]&&T(n,e,i)()}),r.apply(this,e)}})(),Je.forEach(function(e){e=window[e]&&window[e].prototype;e&&e[Ke]&&(T(e,Ke,function(o){return function(e,n,t){try{var r=n.handleEvent;_(r)&&(n.handleEvent=i(r))}catch(e){}return o&&o.call(this,e,i(n),t)}})(),T(e,"removeEventListener",function(r){return function(e,n,t){return null!=n&&n._w_&&r.call(this,e,n._w_,t),r.call(this,e,n,t)}})())}),function(){return t=!1}}function Xe(e,n){return e&&n&&e===n}function ze(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!Xe(n.message,t.message)&&!Xe(n.stack,t.stack)))return void(r=e)}catch(e){X(e)}var n,t;return r=e}}var Ye=["name","message","stack","filename","lineno","colno"],Je=["EventTarget","Window","Node","ApplicationCache","ChannelMergerNode","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","MessagePort","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Ve=["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"],$e=["onload","onerror","onprogress","onreadystatechange"],Ke="addEventListener",Qe=function(d){if(d=void 0===d?A():d)return function(e,r){var n,t,o=e.ignoreErrors,i=e.onerror,u=e.onunhandledrejection,a=e.dedupe,e=e.captureGlobalAsync,c=m(o),f=[],s=ze(),l=function(e,n,t){e=a?s(e):e;r&&e&&(c&&c.test(e.message)||r({ev_type:"js_error",payload:{error:e,breadcrumbs:[],extra:n,react:t}}))};i&&(d.addEventListener("error",n=function(e){return l(Ue(e))}),f.push(function(){return d.removeEventListener("error",n)})),u&&(d.addEventListener("unhandledrejection",t=function(e){return l(We(e))}),f.push(function(){return d.removeEventListener("unhandledrejection",t)})),e&&f.push(Fe(l));return[function(e,n,t){return l(Ge(e),n,t)},function(){f.forEach(function(e){return e()})}]}},Ze="jsError",en={ignoreErrors:[],onerror:!0,onunhandledrejection:!0,captureGlobalAsync:!1,dedupe:!0};var nn=function(y,w,b){if(void 0===y&&(y=A()),void 0===w&&(w=B()),void 0===b&&(b=A()&&window.history),y&&w)return function(e,t){var r,n,o,i,u,a,c,f,s=e.sendInit,l=e.initPid,d=e.routeMode,p=e.extractPid,e=e.onPidUpdate,v=[],h="manual"===d?function(){return""}:(r=d,function(e){var n;return"hash"===r?(null===(n=K(e).hash)||void 0===n?void 0:n.replace(/^#/,""))||"/":K(e).path}),m=p||function(){},p=j(function(r,e,n,o){var i=n,u=e;o&&o(e);return[function(e,n,t){"user_set"!==e&&n!==i?(i=n,u=null!=t?t:i,o&&o(u),r(e,u)):"user_set"===e&&n!==u&&(u=n,o&&o(u),r(e,u))},function(){e&&r("init",e)}]}(function(e,n){t&&t({ev_type:"pageview",payload:{pid:n,source:e}})},l||(n=w.href,null!==(o=m(n))&&void 0!==o?o:h(n)),h(w.href),e),2),g=p[0],l=p[1],e=g.bind(null,"user_set");"manual"!==d&&(i=j((c=function(e,n){return g(e,h(n),m(n))},f="",[function(e,n){n!==f&&c(e,f=n)}]),1)[0],u=function(){return i("history",w.href)},b&&(p=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(b,e)}finally{u()}}},v.push(D(b,"pushState",p)(),D(b,"replaceState",p)())),"hash"===d?(a=function(){return i("hash",w.href)},y.addEventListener("hashchange",a,!0),v.push(function(){return y.removeEventListener("hashchange",a,!0)})):(y.addEventListener("popstate",u,!0),v.push(function(){return y.removeEventListener("popstate",u,!0)})));return s&&l(),[e,function(){v.forEach(function(e){return e()})}]}},tn="pageview",rn={sendInit:!0,routeMode:"history"};var on="resource",un=["xmlhttprequest","fetch","beacon"],an=function(f,s,l){if(void 0===f&&(f=H()),void 0===s&&(s=e()),void 0===l&&(l=G()),f)return function(e,t){var n=e.ignoreUrls,r=e.slowSessionThreshold,o=e.ignoreTypes,i=m(n),u=[],a=function(e,n){void 0===n&&(n=!1),e=e.filter(function(e){return!(x(null!=o?o:un,e.initiatorType)||null!=i&&i.test(e.name))}),t&&e.length&&e.forEach(function(e){t([{ev_type:"resource",payload:e},n])})},c=j(Y(f),3)[2];ie(function(){var e,n;a(c(on),function(){if(!l)return!1;var e=l.loadEventEnd-l.navigationStart;return r<e}()),e=j(J(s,function(e,n,t){return 0===n&&a(t)}),2),n=e[0],e=e[1],n(on),u.push(e)});return[function(){u.forEach(function(e){return e()})}]}},cn="resource",fn={ignoreUrls:[],slowSessionThreshold:4e3};function sn(e){return e="link"===(n=e).tagName.toLowerCase()?"href":"src",_(n.getAttribute)?n.getAttribute(e)||"":n[e]||"";var n}var ln=function(l,d,p){if(void 0===l&&(l=A()),void 0===d&&(d=H()),void 0===p&&(p=null===location||void 0===location?void 0:location.href),l)return function(e,i){var n=e.ignoreUrls,t=e.includeUrls,u=e.dedupe,a=m(t),c=m(n),f=j(Y(d),5)[4],s=void 0,r=function(e){var n,t,r,o;p&&e.url===p||a&&!a.test(e.url)||c&&c.test(e.url)||(e.url||e.xpath&&e.xpath!==ne)&&(u&&e.url===s||(s=e.url,t=f,r=(n=e).url,o=e.tagName,n=e.xpath,r=$(r),t=t(r)[0],t={type:o.toLowerCase(),url:r,xpath:n,timing:t},i&&i({ev_type:"resource_error",payload:t})))},o=function(e){e=e||l.event;!e||(e=function(e){var n=e.target||e.srcElement;if(n){var t=n.tagName;if(t&&h(t)){e=sn(n);return{url:e,tagName:t,xpath:e?void 0:te(n)}}}}(e))&&r(e)};l.addEventListener("error",o,!0);return[r,function(){l.removeEventListener("error",o,!0)}]}},dn="resourceError",pn={includeUrls:[],ignoreUrls:[],dedupe:!0};function vn(e,n){return v({name:e,value:n},bn)}function hn(e){return{ev_type:"performance",payload:e}}function mn(i,u){return void 0===i&&(i=e()),void 0===u&&(u=H()),function(e,n){var t=vn("fid",0),r=j(fe(n),1)[0];if(!u||!i)return t.isSupport=!1,void r(t);function o(e){var n=e.processingStart,e=e.startTime;t.value=n-e,r(t)}n=(0,j(Y(u),3)[2])(En)[0];n?o(n):(0,j(J(i,o,!0),1)[0])(En)}}function gn(a){return void 0===a&&(a=e()),function(e,n){var e=e.precollect,t=vn("lcp",0),r=j(fe(n),1)[0];if(!a)return t.isSupport=!1,void r(t);(e.entries||[]).forEach(function(e){var n=e.entryType,e=e.startTime;n===_n&&(t.value=e)});var n=j(J(a,function(e){e=e.startTime;t.value=e}),2),e=n[0],o=n[1];e(_n);var i=function(){o(),xn.forEach(function(e){window.removeEventListener(e,u,!0)})},u=function(){r(t),i()};xn.forEach(function(e){window.addEventListener(e,u,!0)});ue(function(){t.isSupport=!1,u()});se(function(){t.isBounced=!0,u()})}}function yn(c,f){return void 0===c&&(c=e()),void 0===f&&(f=H()),function(e,n){var t=e.metricName,r=e.entryName,o=vn(t,0),i=j(fe(n),1)[0];if(!f||!c)return o.isSupport=!1,void i(o);var u,a=function(e){e=e.startTime;o.value=e,i(o)},t=(0,j(Y(f),5)[4])(r)[0];t?a(t):(t=(n=j(J(c,function(e){e.name===r&&(a(e),u())}),2))[0],u=n[1],t("paint"),ue(function(){o.isSupport=!1,i(o),u()}),se(function(){o.isBounced=!0,i(o),u()}))}}function wn(r,a){return void 0===r&&(r=e()),void 0===a&&(a=H()),function(e,n){var t=vn("mpfid",0),o=j(fe(n),1)[0];if(!r)return t.isSupport=!1,o(t),[b];var i=[],n=e.precollect;n&&(n.entries||[]).forEach(function(e){e.entryType===Tn&&i.push(e)});var e=j(J(r,function(e){return i.push(e)}),2),n=e[0],u=e[1];n(Tn);return[function(){u();var e=(0,j(Y(a),5)[4])(Sn)[0],r=e&&e.startTime||0;t.value=i.reduce(function(e,n){var t=n.duration,n=n.startTime;return e<t&&r<n?t:e},0),o(t)}]}}var bn={isSupport:!0,isPolyfill:!1,isBounced:!1,isCustom:!1,type:"perf"},En="first-input",_n="largest-contentful-paint",xn=["keydown","click"],Sn="first-contentful-paint",Tn="longtask",Dn=function(d){return void 0===d&&(d=H()),function(e,r){var n,o,t,i=e.precollect,u=e.fp,a=e.fcp,c=e.lcp,f=e.fid,s=e.mpfid,l=e.timing,e=function(e){r&&r({ev_type:"performance",payload:e})};u&&V(yn,{metricName:"fp",entryName:"first-paint"},e),a&&V(yn,{metricName:"fcp",entryName:Sn},e),c&&V(gn,{precollect:i},e),f&&V(mn,0,e),s&&(n=j(V(wn,{precollect:i},e),1)[0],ie(function(){return setTimeout(n,200)})),l&&(o=j(Y(d),3)[2],t=j(fe(function(e){var n=d&&d.timing||void 0,t=o("navigation")[0];r&&r({ev_type:"performance_timing",payload:{isBounced:e,timing:n,navigation_timing:t}})}),1)[0],ie(function(){t(!1)}),se(function(){t(!0)}))}},Rn="layout-shift",Ln=function(i){return void 0===i&&(i=e()),function(e,n){var t=j(e,1)[0],r=vn("cls",0);if(!i)return r.isSupport=!1,[function(){return n&&n(r)},b];function o(e){var n=e.hadRecentInput,e=e.value;n||(r.value+=e)}(t.entries||[]).forEach(function(e){e.entryType===Rn&&o(e)});e=j(J(i,o),2),t=e[0],e=e[1];return t(Rn),[function(){n&&n(r),r=vn("cls",0)},e]}},Cn="longtask",jn=function(o){return void 0===o&&(o=e()),function(e,n){function t(e){n&&n({longtasks:e,type:"pref"})}var r=(e.precollect||{}).entries,e=(void 0===r?[]:r).filter(function(e){return e.entryType===Cn});if(e.length&&t(e),!o)return[b];r=j(J(o,function(e){return t([e])},!1),2),e=r[0],r=r[1];return e(Cn),[r]}},kn=function(){return function(e,n){var t=0,r=vn("spa_load",0),o=function(e){r.value=e,n&&n(r)},i=function(){o(Date.now()-t),t=0};return se(function(){t&&(r.isBounced=!0,i())}),[function(){t=Date.now()},i]}},On="performance",qn={entries:[],observer:void 0},Nn={fp:!0,fcp:!0,fid:!0,mpfid:!0,lcp:!0,cls:!0,timing:!0,longtask:!0};function In(n){function t(e){e<o||!r||(u(),i=window.setTimeout(r,e-n()),o=e)}var r,o=-1/0,i=void 0,u=function(){return window.clearTimeout(i)};return[function(e,n){r=e,t(n)},function(){u(),r=void 0},t]}function An(e,t){var r=["img","script","iframe","link","audio","video","source"],n=(e=j(z(e,function(e){for(var n=0;n<e.length;n++)("childList"===e[n].type&&function e(n,t){for(var r=0;r<n.length;r++)if(x(t,n[r].nodeName.toLowerCase())||n[r].children&&e(n[r].children,t))return 1}(e[n].addedNodes,r)||"attributes"===e[n].type&&x(r,e[n].target.nodeName.toLowerCase()))&&t(e[n])}),2))[0];return[function(){return n(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]})},e[1]]}function Mn(e){var e=(n=e||{}).domContentLoadedEventEnd,n=n.navigationStart;return e?e-(void 0===n?0:n):null}function Bn(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._method=e[0],t.apply(this,e)}}function Hn(r,o,i){var u=0;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if("GET"!==this._method)return r.apply(this,e);var t=u+=2;return o(t,Date.now()),D(this,"onreadystatechange",function(n){return function(e){n&&n.call(this,e),4===this.readyState&&i(t)}})(),r.apply(this,e)}}function Pn(i,u,a){var c=1;return function(){for(var e,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return"GET"!==((null===(e=o[0])||void 0===e?void 0:e.method)||(null===(e=o[1])||void 0===e?void 0:e.method)||"GET")?i.apply(void 0,y([],j(o),!1)):new Promise(function(n,t){var r=c+=2;u(r,Date.now()),i.apply(void 0,y([],j(o),!1)).then(function(e){a(r),n(e)},function(e){a(r,e),t(e)})})}}function Un(_,x,S,T){return function(e,t,n){var c,f,r,o,i,u,a,s,l=j([c=[],f=[],function(u,a){return function(e){var n=e.startTime,t=e.duration,r=e.fetchStart,o=e.responseEnd,i=e.entryType;"longtask"===i?(e.start=n,e.end=n+t,c.push(e),u&&u(e)):"resource"===i&&(f.push({start:r,end:o}),a&&a(e))}}],3),d=l[0],p=l[1],v=l[2],h=j((r=_,o=x,h=j([i={},function(e,n){return i[e]=n},function(e){return delete i[e]}],3),y=h[0],l=h[1],h=h[2],u=o&&D(o.prototype,"open",Bn)(),a=o&&D(o.prototype,"send",Hn)(l,h),s=r&&D(r,"fetch",Pn)(l,h),[y,function(){u&&u(!0),a&&a(!0),s&&s(!0)}]),2),m=h[0],g=h[1],y=j(T&&An(T,function(){return t(n()+5e3)})||[],2),h=y[0],w=y[1];h&&h();function b(){return function(e,n,t){if(2<e.length)return t();for(var r=[],o=0;o<n.length;o++)r.push([n[o].start,0],[n[o].end,1]);for(o=0;o<e.length;o++)r.push([e[o],0]);r.sort(function(e,n){return e[0]-n[0]});for(var i=e.length,o=r.length-1;0<=o;o--){var u=j(r[o],2),a=u[0];switch(u[1]){case 0:i--;break;case 1:if(2<++i)return a}}return 0}(function(e){for(var n=Object.keys(e),t=[],r=0;r<n.length;r++){var o=e[n[r]];"number"==typeof o&&t.push(o)}return t}(m),p,n)}var y=j(J(S,v(function(e){var n=e.startTime,e=e.duration;return t(n+e+5e3)},function(){return t(b()+5e3)}),!1,function(){return d.notSupport=!0}),2),h=y[0],E=y[1];return h("longtask","resource"),e.forEach(v()),[d,function(){g(),E(),w&&w()},b]}}var Wn=function(_,x,S,T,D){return void 0===_&&(_=P()),void 0===x&&(x=U()&&A()),void 0===S&&(S=e()),void 0===T&&(T=W()),void 0===D&&(D=H()),function(e,n,t,r){var o=vn("tti",0),i=j(fe(function(e){e=hn(e);n&&n(e)}),1)[0];if(!(_&&x&&S&&D))return o.isSupport=!1,i(o),[function(){return 0}];var u=e.precollect,a=e.isAsync,a=void 0===a?0:a,e=e.minValue,c=void 0===e?null:e,e=u||{},u=e.entries,f=void 0===u?[]:u,s=e.observer,u=j(Y(D),5),l=u[0],d=u[1],p=u[4],e=j(In(d),3),u=e[0],v=e[1],h=e[2],a=j(Un(x,_,S,T)(a?[]:f,h,d),3),m=a[0],g=a[1],y=a[2],w=function(){v(),g(),t&&t(),s&&s.disconnect(),f.length=0},b=function(e){var n=p("first-contentful-paint")[0],n=function(e,n,t,r,o){if(r-t<5e3)return null;o=0===o.length?e:o[o.length-1].end;return r-o<5e3?null:Math.max(o,n)}((n?n.startTime:Mn(l))||0,c||Mn(l)||0,y(),d()+(e?0:5e3),m);return e?n?(w(),void e(n)):h(d()+1e3):(w(),n)};if(r&&r(m,h,o),m.notSupport)return o.isSupport=!1,i(o),[function(){return 0}];function E(e){o.value=e,i(o)}r=m[m.length-1];u(function(){return b(E)},Math.max(y()+5e3,r?r.end:0));return[function(){return b()||0}]}},Gn="tti";function Fn(e,t,n,r){if(!e||-1<r.indexOf(e.tagName))return 0;var o=e.children;if((o=[].slice.call(void 0===o?[]:o).reduceRight(function(e,n){return e+Fn(n,t+1,0<e,r)},0))<=0&&!n){if(!_(e.getBoundingClientRect))return 0;n=e.getBoundingClientRect()||{},e=n.top,n=n.height;if(e>window.innerHeight||n<=0)return 0}return o+1+.5*t}var Xn=["SCRIPT","STYLE","META","HEAD"],zn=function(h,m,g,y,w){var e;return void 0===h&&(h=M()),void 0===m&&(m=W()),void 0===g&&(g=null===(e=G())||void 0===e?void 0:e.navigationStart),void 0===y&&(y=function(){if(A()&&"requestAnimationFrame"in window)return window.requestAnimationFrame}()),void 0===w&&(w=function(){if(A()&&"cancelAnimationFrame"in window)return window.cancelAnimationFrame}()),function(e,n){var t=e.renderType,r=vn("fmp",0),o=function(e){e=hn(e);n&&n(e)};if("SSR"===t)return V(yn,{metricName:"fmp",entryName:Sn},o),[b];var i=j(fe(o),1)[0];if(!h||!m||!g)return r.isSupport=!1,i(r),[b];function u(){return d.push({time:Date.now()-l,score:Fn(h&&h.body,1,!1,Xn)})}var a,c,f,s,l=Date.now(),d=[],p=j((a=h,e=w,t=!0,f=!_(o=y)||t&&a&&a.hidden?function(e){return e(0),0}:o,s=_(e)?e:b,[function(e){c&&s(c),c=f(e)},f,s]),1)[0],o=j(z(m,function(){return p(u)}),2),e=o[0],v=o[1],o=l-(g||0);return e(h,{subtree:!0,childList:!0}),[function(e){void 0===e&&(e=0),v();var n,t,n=(n=(t=j(void 0===(n=d)?[]:n))[0],(t=t.slice(1))&&t.reduce(function(e,n){var t=j(e,2),r=t[0],e=t[1],t=n.score-r.score;return[n,n.time>=r.time&&e.rate<t?{time:n.time,rate:t}:e]},[n,{time:null==n?void 0:n.time,rate:0}])[1].time||0);r.value=n?n+e:0,i(r)}.bind(null,o)]}},Yn="fmp",Jn={renderType:"CSR"};function Vn(T,D,R,L,C){if(void 0===T&&(T=A()),void 0===D&&(D=M()),void 0===R&&(R=e()),void 0===L&&(L=W()),void 0===C&&(C=H()),D&&T)return function(e,n){var t,r,o,i,u,a,c=e.threshold,f=e.screenshot,s=e.rootSelector,l=e.autoDetect,d=e.ssUrl,p=tt(T),v=j(Y(C),2)[1],h=0,m=!1,g=function(e){t&&n&&n({ev_type:"blank_screen",payload:{timestamp:t[0],score:t[1],screenshot:e,error:r}})},y=(i=function(){t&&!m&&(m=!0,b(),f?it(g,d,T,D):g())},function(){u||(a=Date.now(),u=T.setTimeout(function(){u=0,a<h||i()},v()>Qn?et:Zn))});se(function(){m||g()});function w(){o&&clearTimeout(o),o=T.setTimeout(function(){p(function(){T.requestAnimationFrame(function(){var e=s?D.querySelector(s):D.body;e&&((e=ot(e,0,0,c))<c?(t=[Date.now(),e],y()):t=void 0)})})},1e3)}var b=function(){clearTimeout(o),x&&x(),S&&S()},E=j(z(L,w),2),_=E[0],x=E[1],e=j(J(R,function(e,n,t){return o&&1<t.length&&w()}),2),E=e[0],S=e[1];return l&&(_(null===(_=M())||void 0===_?void 0:_.body,{subtree:!0,childList:!0}),E("longtask","resource"),w()),[b,function(e){m||(h=Date.now(),r&&h-r.timestamp>nt&&(r=void 0),r=rt(r,e))},w]}}var $n=["SCRIPT","STYLE","META","HEAD"],Kn=["js_error","http","resource_error"],Qn=1e4,Zn=8e3,et=2e3,nt=1e4,tt=function(n){return n.requestIdleCallback||function(e){return n.setTimeout(e,1)}},rt=function(e,n){if(-1===Kn.indexOf(n.ev_type))return e;if("http"===n.ev_type&&n.payload.response.status<400)return e;if(e&&Kn.indexOf(e.type)<Kn.indexOf(n.ev_type))return e;var t="";switch(n.ev_type){case"js_error":t=n.payload.error.message;break;case"http":t=n.payload.request.url;break;case"resource_error":t=n.payload.url}return{type:n.ev_type,message:t,timestamp:Date.now()}},ot=function(t,r,e,o,i){if(void 0===r&&(r=0),void 0===e&&(e=0),void 0===o&&(o=1.5),void 0===i&&(i=$n),!t||-1<i.indexOf(t.tagName)||o<=e||4<r)return e;var n=function(){if(!r)return 0;var e=t.getBoundingClientRect(),n=e.top,e=e.height;return n>innerHeight||e<=0?0:1/Math.pow(2,r-1)}();return[].reduceRight.call(t.children,function(e,n){return ot(n,r+1,e,o,i)},e+n)},it=function(n,e,t,r){if(A()&&"Promise"in window&&Promise&&t&&r){if(t.html2canvas)return i();var o=r.createElement("script");o.src=e,null!==(e=r.head)&&void 0!==e&&e.appendChild(o),o.onload=i}function i(){tt(t)(function(){t.html2canvas&&t.html2canvas(r.body,{scale:360/t.innerWidth}).then(function(e){n(e.toDataURL("image/jpeg",.1))})})}},ut="blankScreen";var at={autoDetect:!0,threshold:1.5,screenshot:!0,ssUrl:"https://apm.volccdn.com/mars-web/apmplus/web/html2canvas.min.js"};function ct(e){var o,i,u;i=at,(o=e).on("init",function(){var e,n,t,r=Se(o,ut,i)||ae(u,i);r&&(r=j(V(Vn,r,o.report.bind(o)),3),e=r[0],n=r[1],r=r[2],o.on("report",t=function(e){return n(e),e}),o.on("beforeDestroy",function(){e(),o.off("report",t)}),o.provide("detectBlankScreen",r))})}var ft="custom",st=function(e){if(e&&E(e)&&e.name&&h(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&E(e.metrics)){var t=e.metrics,r={};for(o in t)f(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&E(e.categories)){var o,i=e.categories,u={};for(o in i)u[o]=s(i[o]);n.categories=u}return n}},lt=function(e){if(e&&E(e)&&e.content&&h(e.content)){var n={content:s(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&E(e.extra)){var t,r=e.extra,o={},i={};for(t in r)f(r[t])?o[t]=r[t]:i[t]=s(r[t]);n.metrics=o,n.categories=i}return n}};function dt(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}function pt(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function vt(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function ht(e,n,t,r){if(void 0===(e=l(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":f(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return x(n,e);case"neq":return!x(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function mt(n,e){try{return"rule"===e.type?ht(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return mt(n,e)}):e.children.some(function(e){return mt(n,e)})}catch(e){return X(e),!1}}function gt(){var t=A();return t&&t.navigator.sendBeacon?{get:function(){},post:function(e,n){t.navigator.sendBeacon(e,n)}}:{get:b,post:b}}function yt(e,n,t){var r=n.url,o=n.data,i=n.success,u=void 0===i?b:i,a=void 0===(i=n.fail)?b:i,c=void 0===(i=n.getResponseText)?b:i,n=void 0!==(n=n.withCredentials)&&n;(t=new t).withCredentials=n,t.open(e,r,!0),t.setRequestHeader("Content-Type","application/json"),t.onload=function(){null!=c&&c(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),u(e)):u({})}catch(e){a(e)}},t.onerror=function(){a(new Error("Network request failed"))},t.onabort=function(){a(new Error("Network request aborted"))},t.send(o)}var wt=function(e){var n=F(),t=dt(n);n&&(n.onchange=function(){t=dt(n)}),e.on("report",function(e){return v(v({},e),{extra:v(v({},e.extra||{}),{network_type:t})})})},bt=function(e,n,t,r){if(!n)return g;var o=n.sample_rate,i=n.include_users,u=n.sample_granularity,a=n.rules,n=n.r,n=void 0===n?Math.random():n;if(x(i,e))return function(e){return pt(e,1)};var c,f,s,l,d,p,v,u="session"===u,h=vt(u,o,t,n,r),m=(c=a,f=u,s=o,l=t,d=n,p=r,v={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(v[e]={enable:t,sample_rate:r,effectiveSampleRate:r*s,hit:vt(f,r,l,d,p)},n&&(v[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:vt(f,n,l,d,p),effectiveSampleRate:n*s,filter:e}}))):v[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),v);return function(e){if(!h())return!1;if(!(e.ev_type in m))return pt(e,o);if(!m[e.ev_type].enable)return!1;if(null!==(n=e.common)&&void 0!==n&&n.sample_rate)return e;var n=m[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(mt(e,t[r].filter))return!!t[r].hit()&&pt(e,t[r].effectiveSampleRate);return!!n.hit()&&pt(e,n.effectiveSampleRate)}};function Et(e){var n,t,r,o,i,u,a,c,f=(t=(n=e).transport,r=e.endpoint,o=e.size,i=void 0===o?10:o,u=void 0===(n=e.wait)?1e3:n,a=[],c=0,{getSize:function(){return i},getWait:function(){return u},setSize:function(e){i=e},setWait:function(e){u=e},getEndpoint:function(){return r},setEndpoint:function(e){r=e},send:function(e){a.push(e),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?p(a):""},clear:function(){clearTimeout(c),a=[]}});function s(){a.length&&(t.post({url:r,data:this.getBatchData()}),a=[])}function l(e){d.post(f.getEndpoint(),p([e]))}var d=gt();return se(function(){var e=f.getBatchData();e&&(d.post(f.getEndpoint(),e),f.clear()),f.send=l}),f}var _t={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:v(v({},e.extra||{}),e.overrides||{})}}};function xt(e){var n,t=e.plugins||{};for(n in t)t[n]&&!E(t[n])&&(t[n]={});return v(v({},e),{plugins:t})}function St(e){return E(e)&&"aid"in e}function Tt(e){return v({},e)}function Dt(){var e=A(),n=M();if(e&&n)return(null===(n=null===(n=null===(n=n.currentScript)||void 0===n?void 0:n.getAttribute("src"))||void 0===n?void 0:n.match(/globalName=(.+)$/))||void 0===n?void 0:n[1])||jt}function Rt(e){return"APMPLUS"+e}function Lt(e){return function(e){try{var n=localStorage.getItem(e),t=n;return t=n&&"string"==typeof n?JSON.parse(n):t}catch(e){return}}(Rt(e))||{userId:q(),deviceId:q(),r:Math.random()}}function Ct(e){var n=e.aid,t=e.userId,r=e.deviceId,e=e.sample;!function(e,n){try{var t="string"==typeof n?n:JSON.stringify(n);localStorage.setItem(e,t)}catch(e){}}(Rt(n),{userId:t,deviceId:r,r:e.r})}var jt="APM_PLUS_WEB",kt="/settings/get/webpro",Ot="/monitor_web/collect",qt=[Ot,kt,"/monitor_browser/collect"],Nt={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},It=20,At=function(e,n){return void 0===n&&(n=Ot),(e&&0<=e.indexOf("//")?"":"https://")+e+n},Mt=q,Bt=function(n){var o,i,u,a=n,c={},f=b,t=b;return{getConfig:function(){return a},setConfig:function(e){var n,t,r;return c=v(v({},c),e||{}),s(),o||(o=e,a.useLocalConfig?(u={},f()):i?l():(n=a.transport,t=a.domain,e=a.aid,r=function(e){i=e,l()},n.get({withCredentials:!0,url:function(e,n){return void 0===n&&(n=kt),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(t)+"?aid="+e,success:function(e){r(e.data||{})},fail:function(){r()}}))),a},onChange:function(e){t=e},onReady:function(e){f=function(){!function(){n.userId!==a.userId&&(n.sample.r=Math.random(),s());Ct(a)}(),e()},u&&f()}};function s(){var e=v(v(v({},n),u||{}),c);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=d(t,e[r++]);return t}(n.plugins,(null==u?void 0:u.plugins)||{},c.plugins||{}),e.sample=Ht(Ht(n.sample,null==u?void 0:u.sample),c.sample),a=e,t()}function l(){u=function(e){if(!e)return{};var n=e.sample,t=e.timestamp,r=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:r&&4===r?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:t}}(i),s(),f()}};function Ht(r,o){if(!r||!o)return r||o;var e=v(v({},r),o);return e.include_users=y(y([],j(r.include_users||[]),!1),j(o.include_users||[]),!1),e.rules=y(y([],j(Object.keys(r.rules||{})),!1),j(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=v(v({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=y(y([],j(r.rules[n].conditional_sample_rules||[]),!1),j(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}var Pt,Ut,Wt,Gt,Ft,Xt,zt,Yt,Jt,Vt,$t,Kt,Qt,Zt,er,nr,tr,rr,or=function(e){e.on("report",function(e){return n=e,e={url:Q(),timestamp:Date.now()},v(v({},n),{extra:v(v({},e),n.extra||{})});var n})},ir={sri:"reportSri",st:"reportResourceError",err:"captureException"},ur=function(e){return Object.keys(e).reduce(function(e,n){return e[n]=[],e},{})},ar=function(t){return Object.keys(t).reduce(function(e,n){return e[t[n]]=n,e},{})},cr=function(o,i,u){return function(e,n,t,r){void 0===t&&(t=Date.now()),void 0===r&&(r=location.href);r=v(v({},Z(o)),{url:r,timestamp:t});i[e]&&(o[u[e]]?ee(o,r)(function(){o[u[e]](n)}):null!==(t=i[e])&&void 0!==t&&t.push([n,r]))}},fr=function(r,n,o){return function(t){var e;t in o&&(null!==(e=n[o[t]])&&void 0!==e&&e.forEach(function(e){var e=j(e,2),n=e[0],e=e[1];ee(r,e)(function(){r[t](n)})}),n[o[t]]=null)}},sr=function(t){var r,o=!1;t.on("init",function(){r=(new Date).getTime(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-r<700&&n&&(e=n-(e+r)/2,!isNaN(e)&&(0<e||e<-6e5)&&t.set({offset:e})))})})},lr=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,v(v({},n),{extra:v(v({},e),n.extra||{})});var n,t})},dr=function(f){f.on("start",function(){var e,n=f.config(),t=n.deviceId,r=n.sessionId,o=n.release,i=n.env,u=n.offset,n=n.aid,a={did:t,sid:r,release:o,env:i,sname:jt,sversion:"1.4.2-alpha.1",soffset:u||0,biz_id:n},c="";for(e in a)c+="&"+e+"="+a[e];n=f.getSender();n.setEndpoint(n.getEndpoint()+c.replace("&","?"))})},pr=function(e){var n,e=Lt(e.aid);return{aid:0,pid:"",viewId:"__"+Date.now(),userId:e.userId,deviceId:e.deviceId,sessionId:Mt(),domain:"apmplus.volces.com",plugins:{ajax:{ignoreUrls:qt},fetch:{ignoreUrls:qt},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:v(v({},Nt),{r:e.r}),transport:(n=P())?{get:function(e){yt("GET",e,n)},post:function(e){yt("POST",e,n)}}:{get:b,post:b}}},vr=(rr=function(e){var n=void 0===e?{}:e,t=n.createSender,e=n.builder,n=n.createDefaultConfig,r=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,u=e.createConfigManager,a=e.userConfigNormalizer,c=e.initConfigNormalizer,f=e.validateInitConfig,s={};w.forEach(function(e){return s[e]=[]});var l=!1,d=!1,p=!1,v=[],h=[],m={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return v},init:function(e){if(l)R("already inited");else{if(!(e&&E(e)&&f(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=u(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&E(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&E(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(a(e))),null==r?void 0:r.getConfig()},provide:function(e,n){x(h,e)?R("cannot provide "+e+", reserved"):(m[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(d||null!=r&&r.onReady(function(){g("start",d=!0),v.forEach(function(e){return n.build(e)}),v=[]}))},report:function(e){e&&(!(e=L(s.beforeReport)(e))||(e=L(s.report)(e))&&(d?this.build(e):v.push(e)))},build:function(e){!d||(e=L(s.beforeBuild)(e))&&(!(e=n.build(e))||(e=L(s.build)(e))&&this.send(e))},send:function(e){!d||(e=L(s.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){g("beforeDestroy",p=!0)},on:function(e,n){"init"===e&&l||"start"===e&&d||"beforeDestroy"===e&&p?n():s[e]&&s[e].push(n)},off:function(e,n){s[e]&&(s[e]=S(s[e],n))}},h=Object.keys(m);return m;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];s[e].forEach(function(e){try{e.apply(void 0,y([],j(t),!1))}catch(e){}}),n&&(s[e].length=0)}}({validateInitConfig:St,initConfigNormalizer:xt,userConfigNormalizer:Tt,createSender:void 0===t?function(e){return Et({size:It,endpoint:At(e.domain),transport:e.transport})}:t,builder:void 0===e?_t:e,createDefaultConfig:void 0===n?pr:n,createConfigManager:Bt});N(r),sr(r),lr(r),or(r),wt(r),dr(r);var o,n=I(r,Z,function(e,n,t){return ee(e,n)(function(){var e=j(t),n=e[0],e=e.slice(1);r[n].apply(r,y([],j(e),!1))})});return(o=n).on("init",function(){var n=[],e=o.config();e&&e.integrations&&e.integrations.forEach(function(e){x(n,e.name)||(n.push(e.name),e.setup(o),e.tearDown&&o.on("beforeDestroy",e.tearDown))})}),n}(Pt=void 0===Pt?{}:Pt),(Ut=rr).on("start",function(){var e=Ut.config(),n=e.userId,e=e.sample;e&&0===e.sample_rate&&Ut.destroy();e=bt(n,e,k,O);Ut.on("build",e)}),Wt=rr,Ft=ur(Gt=void 0===Gt?ir:Gt),Pt=ar(Gt),Xt=cr(Wt,Ft,Gt),null!==(Gt=Wt.p)&&void 0!==Gt&&Gt.a&&"observe"in Wt.p.a&&Wt.p.a.observe(function(e){var n=j(e,5);n[0];var t=n[1],r=n[2],e=n[3],n=n[4];Xt(t,r,e,n)}),Wt.on("init",function(){var e;null!==(e=Wt.p)&&void 0!==e&&e.a.forEach(function(e){var n=j(e,5);n[0];var t=n[1],r=n[2],e=n[3],n=n[4];Xt(t,r,e,n)}),Wt.p&&Wt.p.a&&(Wt.p.a.length=0)}),Wt.provide("precollect",Xt),Wt.on("provide",fr(Wt,Ft,Pt)),(zt=rr).provide("sendEvent",function(e){e=st(e);e&&zt.report({ev_type:ft,payload:e,extra:{timestamp:Date.now()}})}),zt.provide("sendLog",function(e){e=lt(e);e&&zt.report({ev_type:ft,payload:e,extra:{timestamp:Date.now()}})}),(Yt=rr).on("init",function(){var e,n=Se(Yt,tn,rn);n&&(n=j(V(nn,v(v({},n),{initPid:null===(n=Yt.config())||void 0===n?void 0:n.pid,onPidUpdate:function(e){Yt.set({pid:e,viewId:e+"_"+Date.now(),actionId:void 0})}}),Yt.report.bind(Yt)),2),e=n[0],n=n[1],Yt.on("config",function(){e(Yt.config().pid)}),Yt.on("beforeDestroy",n),Yt.provide("sendPageview",e))}),(Jt=rr).on("init",function(){var n,e=Se(Jt,De,Re);e&&(n=!1,e=j(V(Ee,v(v({},e),{hookCbAtReq:Le(Jt),setTraceHeader:xe(e.trace,"app_id="+(null===(e=Jt.config())||void 0===e?void 0:e.aid)+",origin=web")}),function(e){return!n&&Jt.report(e)}),1)[0],Jt.on("beforeDestroy",function(){n=!0}),Jt.provide("wrapXhr",e))}),(Vt=rr).on("init",function(){var n,e=Se(Vt,Be,He);e&&(n=!1,e=j(V(Me,v(v({},e),{hookCbAtReq:Le(Vt),setTraceHeader:xe(e.trace,"app_id="+(null===(e=Vt.config())||void 0===e?void 0:e.aid)+",origin=web")}),function(e){return!n&&Vt.report(e)}),1)[0],Vt.on("beforeDestroy",function(){n=!0}),Vt.provide("wrapFetch",e))}),($t=rr).on("init",function(){var e,n=Se($t,Gn,{});n&&(e=$t.pp||qn,V(Wn,v(v({},n),{precollect:e}),Te($t)))}),(Kt=rr).on("init",function(){var e,n=Se(Kt,Yn,Jn);n&&(e=j(V(zn,n,Te(Kt)),1)[0],ie(function(){return setTimeout(e,200)}))}),(Qt=rr).on("init",function(){var n,e,t=Se(Qt,je,ke);t&&(t=(e=j(V(Ce,t,b),3))[0],n=e[1],e=e[2],Qt.on("report",function(e){return"http"===e.ev_type&&n({type:"http",category:e.payload.api,message:"",data:{method:e.payload.request.method,url:e.payload.request.url,status_code:String(e.payload.response.status)},timestamp:e.payload.request.timestamp}),e}),Qt.on("beforeDestroy",e),Qt.provide("getBreadcrumbs",t),Qt.provide("addBreadcrumb",n))}),(Zt=rr).on("init",function(){window.removeEventListener("error",Zt.pcErr,!0),window.removeEventListener("unhandledrejection",Zt.pcRej,!0);var e,n=Se(Zt,Ze,en);n&&(n=(e=j(V(Qe,n,function(e){Zt.getBreadcrumbs&&(e.payload.breadcrumbs=Zt.getBreadcrumbs()),Zt.report(e)}),2))[0],e=e[1],Zt.on("beforeDestroy",e),Zt.provide("captureException",n))}),(er=rr).on("init",function(){var e=er.pp||qn;null!==(t=e.observer)&&void 0!==t&&t.disconnect();var n,t,r,o,i,u=Se(er,On,Nn);u&&(V(Dn,v(v({},u),{precollect:e}),Te(er)),t=(r=j(V(kn,0,n=function(e){er.report({ev_type:"performance",payload:e})}),2))[0],r=r[1],er.provide("performanceInit",t),er.provide("performanceSend",r),u.longtask&&(r=j(V(jn,{precollect:e},function(e){er.report({ev_type:"performance_longtask",payload:e})}),1)[0],er.on("beforeDestroy",r)),u.cls&&(o=Q(),u=j(V(Ln,[e],function(e){er.report({ev_type:"performance",payload:e,overrides:{url:o}})}),2),i=u[0],u=u[1],er.on("beforeConfig",function(e){e.viewId&&e.viewId!==(null===(e=er.config())||void 0===e?void 0:e.viewId)&&(i(),o=Q())}),er.on("beforeDestroy",u),se(i)),e.entries.length=0,er.provide("sendCustomPerfMetric",function(e){e=v(v(v({},bn),e),{isCustom:!0});n(e)}))}),(nr=rr).on("init",function(){var e,n=Se(nr,dn,pn);n&&(n=(e=j(V(ln,n,nr.report.bind(nr)),2))[0],e=e[1],nr.on("beforeDestroy",e),nr.provide("reportResourceError",n))}),(tr=rr).on("init",function(){var e=Se(tr,cn,fn);e&&(e=j(V(an,e,function(e){var n=j(e,2),e=n[0],n=n[1];tr.report(n?v(v({},e),{extra:{sample_rate:1}}):e)}),1)[0],tr.on("beforeDestroy",e))}),ct(rr),rr),hr=function(){var e=A(),n=Dt();if(e&&n)return e[n]}();hr&&["p","pp","pcErr","pcRej"].forEach(function(e){vr.provide(e,hr[e])});var mr,gr,yr,wr,br=A(),Er=Dt();br&&Er&&(mr=(null==(mr=br[Er])?void 0:mr.q)||[],br[Er]=vr,mr.forEach(function(e){var n,t;t=e,e=v(v({},Z(n=vr)),{url:t.pop(),timestamp:t.pop()}),ee(n,e)(function(){n.apply(void 0,y([],j(t),!1))})}),mr.length=0,vr.p&&("observe"in vr.p.a&&console.warn("global precollect queue already updated"),vr.p.a=(yr=vr.p.a,wr=[],yr.observe=function(e){wr.push(e)},yr.push=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n.forEach(function(n){wr.forEach(function(e){return e(n)})}),(e=[].push).call.apply(e,y([yr],j(n),!1))},yr),(gr=vr.precollect)&&vr.provide("precollect",function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return vr.p.a.push(y(["precollect"],j(e),!1)),gr.apply(void 0,y([],j(e),!1))})))}(); | ||
!function(){"use strict";var c,u,v=function(){return(v=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function k(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),u=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function y(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"object"==typeof document&&("currentScript"in(c=document)||Object.defineProperty(c,"currentScript",{get:function(){try{throw new Error}catch(e){var n=0,t=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e.stack),r=t&&t[1]||!1,o=t&&t[2]||0,i=c.location.href.replace(c.location.hash,""),u="",a=c.getElementsByTagName("script");for(r===i&&(t=c.documentElement.outerHTML,o=new RegExp("(?:[^\\n]+?\\n){0,"+(o-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),u=t.replace(o,"$1").trim());n<a.length;n++){if("interactive"===a[n].readyState)return a[n];if(a[n].src===r)return a[n];if(r===i&&a[n].innerHTML&&a[n].innerHTML.trim()===u)return a[n]}return null}}})),"undefined"==typeof Element||Element.prototype.addEventListener||(u=[],mr=function(e,n){for(var t=0;t<u.length;){var r=u[t];if(r.object===this&&r.type===e&&r.listener===n){"DOMContentLoaded"===e?this.detachEvent("onreadystatechange",r.wrapper):this.detachEvent("on"+e,r.wrapper),u.splice(t,1);break}++t}},Element.prototype.addEventListener=Er=function(e,n){function t(e){e.target=e.srcElement,e.currentTarget=i,void 0!==n.handleEvent?n.handleEvent(e):n.call(i,e)}var r,o,i=this;"DOMContentLoaded"===e?(r=function(e){"complete"===document.readyState&&t(e)},document.attachEvent("onreadystatechange",r),u.push({object:this,type:e,listener:n,wrapper:r}),"complete"===document.readyState&&((o=new Event).srcElement=window,r(o))):(this.attachEvent("on"+e,t),u.push({object:this,type:e,listener:n,wrapper:t}))},Element.prototype.removeEventListener=mr,HTMLDocument&&!HTMLDocument.prototype.addEventListener&&(HTMLDocument.prototype.addEventListener=Er,HTMLDocument.prototype.removeEventListener=mr),Window&&!Window.prototype.addEventListener&&(Window.prototype.addEventListener=Er,Window.prototype.removeEventListener=mr));function p(e){return JSON.stringify({ev_type:"batch",list:e})}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],b=function(){return{}};function g(e){return e}function E(e){return"object"==typeof e&&null!==e}var n=Object.prototype;function i(e){if(E(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===n.toString.call(e);e=Object.getPrototypeOf(e);return e===n||null===e}}function a(e){return"[object Array]"===n.toString.call(e)}function _(e){return"function"==typeof e}function f(e){return"number"==typeof e}function h(e){return"string"==typeof e}function o(e){return"undefined"!=typeof Event&&function(e,n){try{return e instanceof n}catch(e){return}}(e,Event)}function d(e,n){var t,r,o=v({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(E(n[t])&&i(n[t])?o[t]=d(E(e[t])?e[t]:{},n[t]):a(n[t])&&a(e[t])?o[t]=function n(e,t){e=a(e)?e:[];t=a(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:E(e)&&i(e)?d({},e):a(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function x(e,n){if(!a(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function S(e,n){if(!a(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function l(e,n,t){for(var r,o=(n=k(n.split(".")))[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=k(i))[0],i=r.slice(1);if(e)return t(e,o)}function m(e){return a(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];h(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function s(e){try{return h(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function D(i,u,a){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return b;var t=i[u],r=a.apply(void 0,y([t],k(e),!1)),o=r;return _(o)&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return _(t)&&t.apply(this,n)}}),i[u]=o,function(e){e||(o===i[u]?i[u]=t:r=t)}}}function T(t,r,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t[r]=o.apply(void 0,y([t[r]],k(e),!1))}}function R(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,y(["[SDK]",Date.now(),(""+r++).padStart(8," ")],k(e),!1))}function L(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){C(e)}return n}}var t=0,C=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,y(["[SDK]",Date.now(),(""+t++).padStart(8," ")],k(e),!1))},r=0,j=function(e){return Math.random()<Number(e)},O=function(e,n){return e<Number(n)};function q(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}var N=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=s(n),o},merge:function(n){return t=v(v({},t),n),Object.keys(n).forEach(function(e){r[e]=s(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return v({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})},I=function(a,c,t){function f(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=e[0];if(t){var r=t.split(".")[0];if(r in f)return i=f,u=t,o=[].slice.call(e,1),l(i,u,function(e,n){if(e&&n in e&&_(e[n]))try{return e[n].apply(e,o)}catch(e){return}});var o,i=s[r]||[],u=null!==(u=null==c?void 0:c(a))&&void 0!==u?u:{};i.push(y([u],k(e),!1)),void(s[r]=i)}}var e,s={};for(e in D(a,"provide",function(t){return function(e,n){f[e]=n,t.call(a,e,n)}})(),a)Object.prototype.hasOwnProperty.call(a,e)&&(f[e]=a[e]);return a.on("provide",function(e){s[e]&&(s[e].forEach(function(e){var n=k(e),e=n[0],n=n.slice(1);null!=t&&t(a,e,n)}),s[e]=null)}),f};function A(){if("object"==typeof window&&E(window))return window}function M(){if("object"==typeof document&&E(document))return document}function B(){return A()&&window.location}function H(){if(A()&&E(window.performance))return window.performance}function P(){if("function"==typeof XMLHttpRequest&&_(XMLHttpRequest))return XMLHttpRequest}function U(){try{return new Headers,new Request(""),new Response,window.fetch}catch(e){}}function W(){if(A()&&_(window.MutationObserver))return window.MutationObserver}function e(){if(A()&&_(window.PerformanceObserver))return window.PerformanceObserver}function G(){var e=H();if(e&&E(e.timing))return e.timing}function F(){var e=function(){if(A()&&"navigator"in window)return window.navigator}();if(e)return e.connection||e.mozConnection||e.webkitConnection}var X=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=function(e){if(e)return e.__SLARDAR_REGISTRY__||(e.__SLARDAR_REGISTRY__={Slardar:{plugins:[],errors:[]}}),e.__SLARDAR_REGISTRY__.Slardar}(A());t&&(t.errors||(t.errors=[]),t.errors.push(e))},z=function(e,n){var t=e&&new e(n);return[function(e,n){t&&e&&t.observe(e,n)},function(){return t&&t.disconnect()}]},Y=function(t){var e=t&&t.timing||void 0;return[e,function(){return t&&t.now?t.now():(Date.now?Date.now():+new Date)-(e&&e.navigationStart||0)},function(e){var n=(t||{}).getEntriesByType;return _(n)&&n.call(t,e)||[]},function(){var e=(t||{}).clearResourceTimings;_(e)&&e.call(t)},function(e){var n=(t||{}).getEntriesByName;return _(n)&&n.call(t,e)||[]}]},J=function(t,o,n,i){var r=t&&new t(function(e,r){e.getEntries?e.getEntries().forEach(function(e,n,t){return o(e,n,t,r)}):i&&i(),n&&r.disconnect()});return[function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!t||!r)return i&&i();try{n.forEach(function(e){-1<t.supportedEntryTypes.indexOf(e)&&r.observe({type:e,buffered:!1})})}catch(e){try{r.observe({entryTypes:n})}catch(e){return i&&i()}}},function(){return r&&r.disconnect()}]},V=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,y([],k(r),!1));return o&&o(n,t)||[]}catch(e){return X(e),[]}};function $(e){var n=M();if(!n||!e)return"";n=n.createElement("a");return n.href=e,n.href}function K(e){var n=M();if(!n||!e)return{url:e,protocol:"",domain:"",query:"",path:"",hash:""};n=n.createElement("a");n.href=e;e=n.pathname||"/";return"/"!==e[0]&&(e="/"+e),{url:n.href,protocol:n.protocol.slice(0,-1),domain:n.hostname,query:n.search.substring(1),path:e,hash:n.hash}}function Q(){var e=A()&&B();return null==e?void 0:e.href}var Z=function(e){var n={url:Q(),timestamp:Date.now()},t=e.config();return null!=t&&t.pid&&(n.pid=t.pid),null!=e&&e.context&&(n.context=e.context.toString()),n},ee=function(t,r){return function(e){function n(e){return e.overrides=r,e}t.on("report",n),e(),t.off("report",n)}},ne="<unknown>";function te(e){try{for(var n,t=e,r=[],o=0,i=0,u=" > ".length;t&&o++<5&&!("html"===(n=function(e){var n,t,r,o,i=e,u=[];if(!i||!i.tagName)return"";u.push(i.tagName.toLowerCase()),i.id&&u.push("#"+i.id);e=i.className;if(e&&h(e))for(n=e.split(/\s+/),o=0;o<n.length;o++)u.push("."+n[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)t=a[o],(r=i.getAttribute(t))&&u.push("["+t+'="'+r+'"]');return u.join("")}(t))||1<o&&80<=i+r.length*u+n.length);)r.push(n),i+=n.length,t=t.parentNode;return r.reverse().join(" > ")}catch(e){return ne}}function re(o){function i(n,t){var r;return function(e){u=void 0,e&&r!==e&&t({event:r=e,name:n})}}var u;return[i,function(r){return function(e){var n;try{n=e.target}catch(e){return}var t=n&&n.tagName;t&&("INPUT"===t||"TEXTAREA"===t||n.isContentEditable)&&(u||i("input",r)(e),clearTimeout(u),u=window.setTimeout(function(){u=void 0},o))}}]}function oe(n,t){return function(e){if(t)try{n(e)}catch(e){}}}function ie(e){var n=A(),t=M();n&&t&&("complete"!==t.readyState?n.addEventListener("load",function(){setTimeout(function(){e()},0)},!1):e())}function ue(e,n){var t;void 0===n&&(n=!0),"hidden"!==document.visibilityState?(t=function(){"hidden"===document.visibilityState&&(e(),n&&removeEventListener("visibilitychange",t,!0))},addEventListener("visibilitychange",t,!0)):e()}function ae(e,n){return E(e)?v(v({},n),e):!!e&&n}function ce(e,n){return!(!e||!n)&&(le.test(e)||de.test(n))}var fe=function(n){var t=!1;return[function(e){t||(t=!0,n&&n(e))}]},se=function(e){var n=k(fe(e),1)[0];["unload","beforeunload","pagehide"].forEach(function(e){addEventListener(e,n)})},le=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),de=new RegExp("(bearer|session)","i");function pe(e,n,t){var r=e._method,o=e._reqHeaders,i=e._url,u=e._start,a=e._data,i={api:"xhr",request:{url:i=$(i),method:(r||"").toLowerCase(),headers:o,timestamp:u},response:{status:e.status||0,is_custom_error:!1,timing:t(i),timestamp:Date.now()},duration:Date.now()-u};"function"==typeof e.getAllResponseHeaders&&(i.response.headers=h(c=e.getAllResponseHeaders())&&c?c.split("\r\n").reduce(function(e,n){var t;return h(n)&&(n=(t=k(n.split(": "),2))[0],t=t[1],ce(n,t)||(e[n.toLowerCase()]=t)),e},{}):{});var u=i.response.status,c=n.collectBodyOnError,n=n.extraExtractor;try{var f=null==n?void 0:n(e.response,i);f&&(i.extra=f),f&&(i.response.is_custom_error=!0),c&&400<=u&&(i.request.body=a?""+a:void 0,i.response.body=e.response?""+e.response:void 0)}catch(e){}return i}function ve(e,n){return!!(e=m(e||[]))&&e.test(n)}function he(e){var n=k(Y(e),5)[4];return function(e){return n(e).pop()}}function me(o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._reqHeaders=this._reqHeaders||{};var t=k(e,2),r=t[0],t=t[1];return ce(r,t)||(this._reqHeaders[r.toLowerCase()]=t),o&&o.apply(this,e)}}function ge(r,o,a,c){return function(){for(var i,u,t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return u=c,T(i=this,"onreadystatechange",function(t,r,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{4===this.readyState&&!ve(r.ignoreUrls,i._url)&&o&&o({ev_type:"http",payload:pe(i,r,u)})}catch(e){X(e)}return t&&t.apply(this,e)}})(o,o.hookCbAtReq(a)),o.setTraceHeader&&o.setTraceHeader(this._url,function(e,n){return t.setRequestHeader(e,n)}),this._start=Date.now(),this._data=null==e?void 0:e[0],r.apply(this,e)}}function ye(r){return function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e=k(n,2),this._method=e[0],this._url=e[1],r.apply(this,n)}}function we(e,n,t,r){T(e,"open",ye)(),T(e,"setRequestHeader",me)(),T(e,"send",ge)(n,t,r)}function be(){var e=window.crypto||window.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n);e=function(e){for(var n=e.toString(16);n.length<4;)n="0"+n;return n};return e(n[0])+e(n[1])+e(n[2])+e(n[3])+e(n[4])+e(n[5])+e(n[6])+e(n[7])}return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/[x]/g,function(){return(16*Math.random()|0).toString(16)})}var Ee=function(e,n){if(void 0===e&&(e=P()&&A()),void 0===n&&(n=H()),e){var s=he(n);return function(c,f){var e;!c.autoWrap||(e=XMLHttpRequest&&XMLHttpRequest.prototype)&&we(e,c,f,s);return[function(e,n,t){return i=n=void 0===n?c:n,u=t=void 0===t?f:t,a=s,r.prototype=new(o=e),["DONE","HEADERS_RECIEVED","LOADING","OPENED","UNSENT"].forEach(function(e){r[e]=o[e]}),r;function r(){var e=new o;return we(e,i,u,a),e}var o,i,u,a}]}}},_e={sampleRate:1,origins:[]},xe=function(e,r){var o=ae(e,_e);if(o&&j(o.sampleRate))return function(e,n){var t=o.origins;t.length&&Boolean(e.match(new RegExp(t.join("|"))))&&(n("x-rum-traceparent","00-"+be()+"-"+be().substring(16)+"-01"),n("x-rum-tracestate",r))}};function Se(e,n,t){n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return ae(n,t)}var Te=function(n,t){var e=n.config(),r={url:Q(),pid:e.pid,view_id:e.viewId};return function(e){n.report(v(v({},e),{overrides:v(v({},r),t&&t(e)||{})}))}},De="ajax",Re={autoWrap:!0,hookCbAtReq:g,ignoreUrls:[],collectBodyOnError:!1},Le=function(r){return function(n){if(!n)return n;var e=r.config(),t={url:Q(),pid:e.pid,view_id:e.viewId};return function(e){n(v(v({},e),{overrides:v(v({},t),{timestamp:e.payload.request.timestamp})}))}}};var Ce=function(f){if(f=void 0===f?M():f)return function(e,n){var t,r=e.maxBreadcrumbs,o=e.onAddBreadcrumb,i=e.onMaxBreadcrumbs,u=e.dom,a=k(re(100),2),e=a[0],a=a[1],r=k(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=g),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=v(v({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(y(y([],k(o),!1),[e],!1),n):y(y([],k(o),!1),[e],!1))}]}(r,o,i),2),o=r[0],i=r[1],r=(t=i,function(e){var n;try{n=e.event.target?te(e.event.target):te(e.event)}catch(e){n="<unknown>"}0!==n.length&&t({type:"dom",category:"ui."+e.name,message:n})}),c=[];u&&(c.push(e("click",oe(r,"dom"))),c.push(a(oe(r,"dom"))),f.addEventListener("click",c[0]),f.addEventListener("keypress",c[1]));return[o,i,function(){f.removeEventListener("click",c[0]),f.removeEventListener("keypress",c[1])}]}},ke="breadcrumb",je={maxBreadcrumbs:20,dom:!0};function Oe(e,n){return e instanceof n}function qe(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(t,e){return new n(e).forEach(function(e,n){return!ce(n,e)&&(t[n]=e)}),t},{})}function Ne(e,n,t){return Oe(e,t)?e.body:null==n?void 0:n.body}function Ie(e,n,t,r){return{method:function(e,n,t){n=n&&n.method||"get";return(n=Oe(e,t)?e.method||n:n).toLowerCase()}(n,t,r),timestamp:Date.now(),url:$(e)}}function Ae(c,f,s,l,d,p){return function(i,u){void 0===u&&(u={});var e,n,t=(n=!1,t="",t=Oe(e=i,d)?e.url:e,t=!(n=void 0!==n&&n)&&h(t)?t.split("?")[0]:t);if(!function(e){if(h(e)){var n=k(e.split(":"),2),e=n[0];return!n[1]||"http"===e||"https"===e}}(t)||ve(f.ignoreUrls,t))return c(i,u);var r=f.hookCbAtReq(s),o={api:"fetch",request:Ie(i instanceof d?i.url:i,i,u,d),response:{is_custom_error:!1},duration:0};f.setTraceHeader&&f.setTraceHeader(o.request.url,function(e,n){var t,r,o;t=e,r=n,o=u,e=l,Oe(n=i,d)?n.headers.set(t,r):o.headers instanceof e?o.headers.set(t,r):o.headers=v(v({},o.headers),((o={})[t]=r,o))});var t=c(i,u);try{o.request.headers=qe(l,i.headers,u.headers)}catch(e){X(e)}var a=function(){r&&r({ev_type:"http",payload:o})};return t.then(function(e){var n;try{o.response.status=e.status||0,o.response.headers=qe(l,e.headers),o.response.timestamp=Date.now(),o.duration=o.response.timestamp-o.request.timestamp;var t=f.collectBodyOnError,r=f.extraExtractor;try{r&&e.clone().json().then(function(e){e=r(e,o);e&&(o.extra=e,o.response.is_custom_error=!0)})}catch(e){}t&&400<=e.status&&(o.request.body=null===(n=Ne(i,u,d))||void 0===n?void 0:n.toString());setTimeout(function(){o.response.timing=p(e.url),a()},100)}catch(e){X(e)}},function(){var e;try{o.response.status=0,o.response.timestamp=Date.now(),o.duration=o.response.timestamp-o.request.timestamp,f.collectBodyOnError&&(o.request.body=null===(e=Ne(i,u,d))||void 0===e?void 0:e.toString())}catch(e){X(e)}a()}),t}}var Me=function(e,i,u,n){if(void 0===e&&(e=U()&&A()),void 0===i&&(i=window.Headers),void 0===u&&(u=window.Request),void 0===n&&(n=H()),e&&i&&u){var a=he(n);return function(r,o){r.autoWrap&&T(e,"fetch",Ae)(r,o,i,u,a);return[function(e,n,t){return Ae(e,n=void 0===n?r:n,t=void 0===t?o:t,i,u,a)}]}}},Be="fetch",He={autoWrap:!0,hookCbAtReq:g,ignoreUrls:[],collectBodyOnError:!1};function Pe(e){var n,t,r;return!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?(i(e)||o(e)||h(e))&&(n={message:s(e)}):(r=Ye,n=(t=e)&&E(t)?r.reduce(function(e,n){return e[n]=t[n],e},{}):t),n}function Ue(e){return Pe(e.error)}function We(e){var n;try{var t=void 0;if("reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason),t){var r=Pe(t);return v(v({},r),{name:null!==(n=r&&r.name)&&void 0!==n?n:"UnhandledRejection"})}}catch(e){}}function Ge(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)?Ue(e):("[object PromiseRejectionEvent]"===Object.prototype.toString.call(e)?We:Pe)(e)}function Fe(n){function i(e){return _(e)?e._w_||(e._w_=function(){try{return(e.handleEvent||e).apply(this,[].map.call(arguments,i))}catch(e){throw t&&n(Pe(e)),e}}):e}var t=!0;return Ve.forEach(function(e){return window[e]&&T(window,e,function(r){return function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return r&&r.call.apply(r,y([this,i(e)],k(n),!1))}})()}),T(XMLHttpRequest.prototype,"send",function(r){return function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $e.forEach(function(e){return n[e]&&T(n,e,i)()}),r.apply(this,e)}})(),Je.forEach(function(e){e=window[e]&&window[e].prototype;e&&e[Ke]&&(T(e,Ke,function(o){return function(e,n,t){try{var r=n.handleEvent;_(r)&&(n.handleEvent=i(r))}catch(e){}return o&&o.call(this,e,i(n),t)}})(),T(e,"removeEventListener",function(r){return function(e,n,t){return null!=n&&n._w_&&r.call(this,e,n._w_,t),r.call(this,e,n,t)}})())}),function(){return t=!1}}function Xe(e,n){return e&&n&&e===n}function ze(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!Xe(n.message,t.message)||!Xe(n.stack,t.stack)))return void(r=e)}catch(e){X(e)}var n,t;return r=e}}var Ye=["name","message","stack","filename","lineno","colno"],Je=["EventTarget","Window","Node","ApplicationCache","ChannelMergerNode","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","MessagePort","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Ve=["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"],$e=["onload","onerror","onprogress","onreadystatechange"],Ke="addEventListener",Qe=function(d){if(d=void 0===d?A():d)return function(e,r){var n,t,o=e.ignoreErrors,i=e.onerror,u=e.onunhandledrejection,a=e.dedupe,e=e.captureGlobalAsync,c=m(o),f=[],s=ze(),l=function(e,n,t){e=a?s(e):e;r&&e&&(c&&c.test(e.message)||r({ev_type:"js_error",payload:{error:e,breadcrumbs:[],extra:n,react:t}}))};i&&(d.addEventListener("error",n=function(e){return l(Ue(e))}),f.push(function(){return d.removeEventListener("error",n)})),u&&(d.addEventListener("unhandledrejection",t=function(e){return l(We(e))}),f.push(function(){return d.removeEventListener("unhandledrejection",t)})),e&&f.push(Fe(l));return[function(e,n,t){return l(Ge(e),n,t)},function(){f.forEach(function(e){return e()})}]}},Ze="jsError",en={ignoreErrors:[],onerror:!0,onunhandledrejection:!0,captureGlobalAsync:!1,dedupe:!0};var nn=function(y,w,b){if(void 0===y&&(y=A()),void 0===w&&(w=B()),void 0===b&&(b=A()&&window.history),y&&w)return function(e,t){var r,n,o,i,u,a,c,f,s=e.sendInit,l=e.initPid,d=e.routeMode,p=e.extractPid,e=e.onPidUpdate,v=[],h="manual"===d?function(){return""}:(r=d,function(e){var n;return"hash"===r?(null===(n=K(e).hash)||void 0===n?void 0:n.replace(/^#/,""))||"/":K(e).path}),m=p||function(){},p=k(function(r,e,n,o){var i=n,u=e;o&&o(e);return[function(e,n,t){"user_set"!==e&&n!==i?(i=n,u=null!=t?t:i,o&&o(u),r(e,u)):"user_set"===e&&n!==u&&(u=n,o&&o(u),r(e,u))},function(){e&&r("init",e)}]}(function(e,n){t&&t({ev_type:"pageview",payload:{pid:n,source:e}})},l||(n=w.href,null!==(o=m(n))&&void 0!==o?o:h(n)),h(w.href),e),2),g=p[0],l=p[1],e=g.bind(null,"user_set");"manual"!==d&&(i=k((c=function(e,n){return g(e,h(n),m(n))},f="",[function(e,n){n!==f&&c(e,f=n)}]),1)[0],u=function(){return i("history",w.href)},b&&(p=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{t.apply(b,e)}finally{u()}}},v.push(D(b,"pushState",p)(),D(b,"replaceState",p)())),"hash"===d?(a=function(){return i("hash",w.href)},y.addEventListener("hashchange",a,!0),v.push(function(){return y.removeEventListener("hashchange",a,!0)})):(y.addEventListener("popstate",u,!0),v.push(function(){return y.removeEventListener("popstate",u,!0)})));return s&&l(),[e,function(){v.forEach(function(e){return e()})}]}},tn="pageview",rn={sendInit:!0,routeMode:"history"};var on="resource",un=["xmlhttprequest","fetch","beacon"],an=function(f,s,l){if(void 0===f&&(f=H()),void 0===s&&(s=e()),void 0===l&&(l=G()),f)return function(e,t){var n=e.ignoreUrls,r=e.slowSessionThreshold,o=e.ignoreTypes,i=m(n),u=[],a=function(e,n){void 0===n&&(n=!1),e=e.filter(function(e){return!(x(null!=o?o:un,e.initiatorType)||null!=i&&i.test(e.name))}),t&&e.length&&e.forEach(function(e){t([{ev_type:"resource",payload:e},n])})},c=k(Y(f),3)[2];ie(function(){var e,n;a(c(on),function(){if(!l)return!1;var e=l.loadEventEnd-l.navigationStart;return r<e}()),e=k(J(s,function(e,n,t){return 0===n&&a(t)}),2),n=e[0],e=e[1],n(on),u.push(e)});return[function(){u.forEach(function(e){return e()})}]}},cn="resource",fn={ignoreUrls:[],slowSessionThreshold:4e3};function sn(e){return e="link"===(n=e).tagName.toLowerCase()?"href":"src",_(n.getAttribute)?n.getAttribute(e)||"":n[e]||"";var n}var ln=function(l,d,p){if(void 0===l&&(l=A()),void 0===d&&(d=H()),void 0===p&&(p=null===location||void 0===location?void 0:location.href),l)return function(e,i){var n=e.ignoreUrls,t=e.includeUrls,u=e.dedupe,a=m(t),c=m(n),f=k(Y(d),5)[4],s=void 0,r=function(e){var n,t,r,o;p&&e.url===p||a&&!a.test(e.url)||c&&c.test(e.url)||(e.url||e.xpath&&e.xpath!==ne)&&(u&&e.url===s||(s=e.url,t=f,r=(n=e).url,o=e.tagName,n=e.xpath,r=$(r),t=t(r)[0],t={type:o.toLowerCase(),url:r,xpath:n,timing:t},i&&i({ev_type:"resource_error",payload:t})))},o=function(e){e=e||l.event;!e||(e=function(e){var n=e.target||e.srcElement;if(n){var t=n.tagName;if(t&&h(t)){e=sn(n);return{url:e,tagName:t,xpath:e?void 0:te(n)}}}}(e))&&r(e)};l.addEventListener("error",o,!0);return[r,function(){l.removeEventListener("error",o,!0)}]}},dn="resourceError",pn={includeUrls:[],ignoreUrls:[],dedupe:!0};function vn(e,n){return v({name:e,value:n},bn)}function hn(e){return{ev_type:"performance",payload:e}}function mn(i,u){return void 0===i&&(i=e()),void 0===u&&(u=H()),function(e,n){var t=vn("fid",0),r=k(fe(n),1)[0];if(!u||!i)return t.isSupport=!1,void r(t);function o(e){var n=e.processingStart,e=e.startTime;t.value=n-e,r(t)}n=(0,k(Y(u),3)[2])(En)[0];n?o(n):(0,k(J(i,o,!0),1)[0])(En)}}function gn(a){return void 0===a&&(a=e()),function(e,n){var e=e.precollect,t=vn("lcp",0),r=k(fe(n),1)[0];if(!a)return t.isSupport=!1,void r(t);(e.entries||[]).forEach(function(e){var n=e.entryType,e=e.startTime;n===_n&&(t.value=e)});var n=k(J(a,function(e){e=e.startTime;t.value=e}),2),e=n[0],o=n[1];e(_n);var i=function(){o(),xn.forEach(function(e){window.removeEventListener(e,u,!0)})},u=function(){r(t),i()};xn.forEach(function(e){window.addEventListener(e,u,!0)});ue(function(){t.isSupport=!1,u()});se(function(){t.isBounced=!0,u()})}}function yn(c,f){return void 0===c&&(c=e()),void 0===f&&(f=H()),function(e,n){var t=e.metricName,r=e.entryName,o=vn(t,0),i=k(fe(n),1)[0];if(!f||!c)return o.isSupport=!1,void i(o);var u,a=function(e){e=e.startTime;o.value=e,i(o)},t=(0,k(Y(f),5)[4])(r)[0];t?a(t):(t=(n=k(J(c,function(e){e.name===r&&(a(e),u())}),2))[0],u=n[1],t("paint"),ue(function(){o.isSupport=!1,i(o),u()}),se(function(){o.isBounced=!0,i(o),u()}))}}function wn(r,a){return void 0===r&&(r=e()),void 0===a&&(a=H()),function(e,n){var t=vn("mpfid",0),o=k(fe(n),1)[0];if(!r)return t.isSupport=!1,o(t),[b];var i=[],n=e.precollect;n&&(n.entries||[]).forEach(function(e){e.entryType===Tn&&i.push(e)});var e=k(J(r,function(e){return i.push(e)}),2),n=e[0],u=e[1];n(Tn);return[function(){u();var e=(0,k(Y(a),5)[4])(Sn)[0],r=e&&e.startTime||0;t.value=i.reduce(function(e,n){var t=n.duration,n=n.startTime;return e<t&&r<n?t:e},0),o(t)}]}}var bn={isSupport:!0,isPolyfill:!1,isBounced:!1,isCustom:!1,type:"perf"},En="first-input",_n="largest-contentful-paint",xn=["keydown","click"],Sn="first-contentful-paint",Tn="longtask",Dn=function(d){return void 0===d&&(d=H()),function(e,r){var n,o,t,i=e.precollect,u=e.fp,a=e.fcp,c=e.lcp,f=e.fid,s=e.mpfid,l=e.timing,e=function(e){r&&r({ev_type:"performance",payload:e})};u&&V(yn,{metricName:"fp",entryName:"first-paint"},e),a&&V(yn,{metricName:"fcp",entryName:Sn},e),c&&V(gn,{precollect:i},e),f&&V(mn,0,e),s&&(n=k(V(wn,{precollect:i},e),1)[0],ie(function(){return setTimeout(n,200)})),l&&(o=k(Y(d),3)[2],t=k(fe(function(e){var n=d&&d.timing||void 0,t=o("navigation")[0];r&&r({ev_type:"performance_timing",payload:{isBounced:e,timing:n,navigation_timing:t}})}),1)[0],ie(function(){t(!1)}),se(function(){t(!0)}))}},Rn="layout-shift",Ln=function(c){return void 0===c&&(c=e()),function(e,n){var t=k(e,1)[0],r=vn("cls",0);if(!c)return r.isSupport=!1,[function(){return n&&n(r)},b];var o,i,e=k((o=0,i=[],[function(){o=0},function(e,n){var t,r;n.hadRecentInput||(t=i[0],r=i[i.length-1],o&&n.startTime-r<1e3&&n.startTime-t<5e3?(o+=n.value,i.push(n.startTime)):(o=n.value,i=[n.startTime]),e(o))}]),2),u=e[0],a=e[1].bind(null,function(e){e>r.value&&(r.value=e)});(t.entries||[]).forEach(function(e){e.entryType===Rn&&a(e)});e=k(J(c,a),2),t=e[0],e=e[1];return t(Rn),ue(function(){u()},!1),[function(){n&&n(r),u(),r=vn("cls",0)},e]}},Cn="longtask",kn=function(o){return void 0===o&&(o=e()),function(e,n){function t(e){n&&n({longtasks:e,type:"pref"})}var r=(e.precollect||{}).entries,e=(void 0===r?[]:r).filter(function(e){return e.entryType===Cn});if(e.length&&t(e),!o)return[b];r=k(J(o,function(e){return t([e])},!1),2),e=r[0],r=r[1];return e(Cn),[r]}},jn=function(){return function(e,n){var t=0,r=vn("spa_load",0),o=function(e){r.value=e,n&&n(r)},i=function(){o(Date.now()-t),t=0};return se(function(){t&&(r.isBounced=!0,i())}),[function(){t=Date.now()},i]}},On="performance",qn={entries:[],observer:void 0},Nn={fp:!0,fcp:!0,fid:!0,mpfid:!0,lcp:!0,cls:!0,timing:!0,longtask:!0};function In(n){function t(e){e<o||!r||(u(),i=window.setTimeout(r,e-n()),o=e)}var r,o=-1/0,i=void 0,u=function(){return window.clearTimeout(i)};return[function(e,n){r=e,t(n)},function(){u(),r=void 0},t]}function An(e,t){var r=["img","script","iframe","link","audio","video","source"],n=(e=k(z(e,function(e){for(var n=0;n<e.length;n++)("childList"===e[n].type&&function e(n,t){for(var r=0;r<n.length;r++)if(x(t,n[r].nodeName.toLowerCase())||n[r].children&&e(n[r].children,t))return 1}(e[n].addedNodes,r)||"attributes"===e[n].type&&x(r,e[n].target.nodeName.toLowerCase()))&&t(e[n])}),2))[0];return[function(){return n(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]})},e[1]]}function Mn(e){var e=(n=e||{}).domContentLoadedEventEnd,n=n.navigationStart;return e?e-(void 0===n?0:n):null}function Bn(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._method=e[0],t.apply(this,e)}}function Hn(r,o,i){var u=0;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if("GET"!==this._method)return r.apply(this,e);var t=u+=2;return o(t,Date.now()),D(this,"onreadystatechange",function(n){return function(e){n&&n.call(this,e),4===this.readyState&&i(t)}})(),r.apply(this,e)}}function Pn(i,u,a){var c=1;return function(){for(var e,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return"GET"!==((null===(e=o[0])||void 0===e?void 0:e.method)||(null===(e=o[1])||void 0===e?void 0:e.method)||"GET")?i.apply(void 0,y([],k(o),!1)):new Promise(function(n,t){var r=c+=2;u(r,Date.now()),i.apply(void 0,y([],k(o),!1)).then(function(e){a(r),n(e)},function(e){a(r,e),t(e)})})}}function Un(_,x,S,T){return function(e,t,n){var c,f,r,o,i,u,a,s,l=k([c=[],f=[],function(u,a){return function(e){var n=e.startTime,t=e.duration,r=e.fetchStart,o=e.responseEnd,i=e.entryType;"longtask"===i?(e.start=n,e.end=n+t,c.push(e),u&&u(e)):"resource"===i&&(f.push({start:r,end:o}),a&&a(e))}}],3),d=l[0],p=l[1],v=l[2],h=k((r=_,o=x,h=k([i={},function(e,n){return i[e]=n},function(e){return delete i[e]}],3),y=h[0],l=h[1],h=h[2],u=o&&D(o.prototype,"open",Bn)(),a=o&&D(o.prototype,"send",Hn)(l,h),s=r&&D(r,"fetch",Pn)(l,h),[y,function(){u&&u(!0),a&&a(!0),s&&s(!0)}]),2),m=h[0],g=h[1],y=k(T&&An(T,function(){return t(n()+5e3)})||[],2),h=y[0],w=y[1];h&&h();function b(){return function(e,n,t){if(2<e.length)return t();for(var r=[],o=0;o<n.length;o++)r.push([n[o].start,0],[n[o].end,1]);for(o=0;o<e.length;o++)r.push([e[o],0]);r.sort(function(e,n){return e[0]-n[0]});for(var i=e.length,o=r.length-1;0<=o;o--){var u=k(r[o],2),a=u[0];switch(u[1]){case 0:i--;break;case 1:if(2<++i)return a}}return 0}(function(e){for(var n=Object.keys(e),t=[],r=0;r<n.length;r++){var o=e[n[r]];"number"==typeof o&&t.push(o)}return t}(m),p,n)}var y=k(J(S,v(function(e){var n=e.startTime,e=e.duration;return t(n+e+5e3)},function(){return t(b()+5e3)}),!1,function(){return d.notSupport=!0}),2),h=y[0],E=y[1];return h("longtask","resource"),e.forEach(v()),[d,function(){g(),E(),w&&w()},b]}}var Wn=function(_,x,S,T,D){return void 0===_&&(_=P()),void 0===x&&(x=U()&&A()),void 0===S&&(S=e()),void 0===T&&(T=W()),void 0===D&&(D=H()),function(e,n,t,r){var o=vn("tti",0),i=k(fe(function(e){e=hn(e);n&&n(e)}),1)[0];if(!(_&&x&&S&&D))return o.isSupport=!1,i(o),[function(){return 0}];var u=e.precollect,a=e.isAsync,a=void 0===a?0:a,e=e.minValue,c=void 0===e?null:e,e=u||{},u=e.entries,f=void 0===u?[]:u,s=e.observer,u=k(Y(D),5),l=u[0],d=u[1],p=u[4],e=k(In(d),3),u=e[0],v=e[1],h=e[2],a=k(Un(x,_,S,T)(a?[]:f,h,d),3),m=a[0],g=a[1],y=a[2],w=function(){v(),g(),t&&t(),s&&s.disconnect(),f.length=0},b=function(e){var n=p("first-contentful-paint")[0],n=function(e,n,t,r,o){if(r-t<5e3)return null;o=0===o.length?e:o[o.length-1].end;return r-o<5e3?null:Math.max(o,n)}((n?n.startTime:Mn(l))||0,c||Mn(l)||0,y(),d()+(e?0:5e3),m);return e?n?(w(),void e(n)):h(d()+1e3):(w(),n)};if(r&&r(m,h,o),m.notSupport)return o.isSupport=!1,i(o),[function(){return 0}];function E(e){o.value=e,i(o)}r=m[m.length-1];u(function(){return b(E)},Math.max(y()+5e3,r?r.end:0));return[function(){return b()||0}]}},Gn="tti";function Fn(e,t,n,r){if(!e||-1<r.indexOf(e.tagName))return 0;var o=e.children;if((o=[].slice.call(void 0===o?[]:o).reduceRight(function(e,n){return e+Fn(n,t+1,0<e,r)},0))<=0&&!n){if(!_(e.getBoundingClientRect))return 0;n=e.getBoundingClientRect()||{},e=n.top,n=n.height;if(e>window.innerHeight||n<=0)return 0}return o+1+.5*t}var Xn=["SCRIPT","STYLE","META","HEAD"],zn=function(h,m,g,y,w){var e;return void 0===h&&(h=M()),void 0===m&&(m=W()),void 0===g&&(g=null===(e=G())||void 0===e?void 0:e.navigationStart),void 0===y&&(y=function(){if(A()&&"requestAnimationFrame"in window)return window.requestAnimationFrame}()),void 0===w&&(w=function(){if(A()&&"cancelAnimationFrame"in window)return window.cancelAnimationFrame}()),function(e,n){var t=e.renderType,r=vn("fmp",0),o=function(e){e=hn(e);n&&n(e)};if("SSR"===t)return V(yn,{metricName:"fmp",entryName:Sn},o),[b];var i=k(fe(o),1)[0];if(!h||!m||!g)return r.isSupport=!1,i(r),[b];function u(){return d.push({time:Date.now()-l,score:Fn(h&&h.body,1,!1,Xn)})}var a,c,f,s,l=Date.now(),d=[],p=k((a=h,e=w,t=!0,f=!_(o=y)||t&&a&&a.hidden?function(e){return e(0),0}:o,s=_(e)?e:b,[function(e){c&&s(c),c=f(e)},f,s]),1)[0],o=k(z(m,function(){return p(u)}),2),e=o[0],v=o[1],o=l-(g||0);return e(h,{subtree:!0,childList:!0}),[function(e){void 0===e&&(e=0),v();var n,t,n=(n=(t=k(void 0===(n=d)?[]:n))[0],(t=t.slice(1))&&t.reduce(function(e,n){var t=k(e,2),r=t[0],e=t[1],t=n.score-r.score;return[n,n.time>=r.time&&e.rate<t?{time:n.time,rate:t}:e]},[n,{time:null==n?void 0:n.time,rate:0}])[1].time||0);r.value=n?n+e:0,i(r)}.bind(null,o)]}},Yn="fmp",Jn={renderType:"CSR"};function Vn(T,D,R,L,C){if(void 0===T&&(T=A()),void 0===D&&(D=M()),void 0===R&&(R=e()),void 0===L&&(L=W()),void 0===C&&(C=H()),D&&T)return function(e,n){var t,r,o,i,u,a,c=e.threshold,f=e.screenshot,s=e.rootSelector,l=e.autoDetect,d=e.ssUrl,p=tt(T),v=k(Y(C),2)[1],h=0,m=!1,g=function(e){t&&n&&n({ev_type:"blank_screen",payload:{timestamp:t[0],score:t[1],screenshot:e,error:r}})},y=(i=function(){t&&!m&&(m=!0,b(),f?it(g,d,T,D):g())},function(){u||(a=Date.now(),u=T.setTimeout(function(){u=0,a<h||i()},v()>Qn?et:Zn))});se(function(){m||g()});function w(){o&&clearTimeout(o),o=T.setTimeout(function(){p(function(){T.requestAnimationFrame(function(){var e=s?D.querySelector(s):D.body;e&&((e=ot(e,0,0,c))<c?(t=[Date.now(),e],y()):t=void 0)})})},1e3)}var b=function(){clearTimeout(o),x&&x(),S&&S()},E=k(z(L,w),2),_=E[0],x=E[1],e=k(J(R,function(e,n,t){return o&&1<t.length&&w()}),2),E=e[0],S=e[1];return l&&(_(null===(_=M())||void 0===_?void 0:_.body,{subtree:!0,childList:!0}),E("longtask","resource"),w()),[b,function(e){m||(h=Date.now(),r&&h-r.timestamp>nt&&(r=void 0),r=rt(r,e))},w]}}var $n=["SCRIPT","STYLE","META","HEAD"],Kn=["js_error","http","resource_error"],Qn=1e4,Zn=8e3,et=2e3,nt=1e4,tt=function(n){return n.requestIdleCallback||function(e){return n.setTimeout(e,1)}},rt=function(e,n){if(-1===Kn.indexOf(n.ev_type))return e;if("http"===n.ev_type&&n.payload.response.status<400)return e;if(e&&Kn.indexOf(e.type)<Kn.indexOf(n.ev_type))return e;var t="";switch(n.ev_type){case"js_error":t=n.payload.error.message;break;case"http":t=n.payload.request.url;break;case"resource_error":t=n.payload.url}return{type:n.ev_type,message:t,timestamp:Date.now()}},ot=function(t,r,e,o,i){if(void 0===r&&(r=0),void 0===e&&(e=0),void 0===o&&(o=1.5),void 0===i&&(i=$n),!t||-1<i.indexOf(t.tagName)||o<=e||4<r)return e;var n=function(){if(!r)return 0;var e=t.getBoundingClientRect(),n=e.top,e=e.height;return n>innerHeight||e<=0?0:1/Math.pow(2,r-1)}();return[].reduceRight.call(t.children,function(e,n){return ot(n,r+1,e,o,i)},e+n)},it=function(n,e,t,r){if(A()&&"Promise"in window&&Promise&&t&&r){if(t.html2canvas)return i();var o=r.createElement("script");o.src=e,null!==(e=r.head)&&void 0!==e&&e.appendChild(o),o.onload=i}function i(){tt(t)(function(){t.html2canvas&&t.html2canvas(r.body,{scale:360/t.innerWidth}).then(function(e){n(e.toDataURL("image/jpeg",.1))})})}},ut="blankScreen";var at={autoDetect:!0,threshold:1.5,screenshot:!0,ssUrl:"https://apm.volccdn.com/mars-web/apmplus/web/html2canvas.min.js"};function ct(e){var o,i,u;i=at,(o=e).on("init",function(){var e,n,t,r=Se(o,ut,i)||ae(u,i);r&&(r=k(V(Vn,r,o.report.bind(o)),3),e=r[0],n=r[1],r=r[2],o.on("report",t=function(e){return n(e),e}),o.on("beforeDestroy",function(){e(),o.off("report",t)}),o.provide("detectBlankScreen",r))})}var ft="custom",st=function(e){if(e&&E(e)&&e.name&&h(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&E(e.metrics)){var t=e.metrics,r={};for(o in t)f(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&E(e.categories)){var o,i=e.categories,u={};for(o in i)u[o]=s(i[o]);n.categories=u}return n}},lt=function(e){if(e&&E(e)&&e.content&&h(e.content)){var n={content:s(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&E(e.extra)){var t,r=e.extra,o={},i={};for(t in r)f(r[t])?o[t]=r[t]:i[t]=s(r[t]);n.metrics=o,n.categories=i}return n}};function dt(e){return(null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||""}function pt(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function vt(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function ht(e,n,t,r){if(void 0===(e=l(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":f(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return x(n,e);case"neq":return!x(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function mt(n,e){try{return"rule"===e.type?ht(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return mt(n,e)}):e.children.some(function(e){return mt(n,e)})}catch(e){return X(e),!1}}function gt(){var t=A();return t&&t.navigator.sendBeacon?{get:function(){},post:function(e,n){t.navigator.sendBeacon(e,n)}}:{get:b,post:b}}function yt(e,n,t){var r=n.url,o=n.data,i=n.success,u=void 0===i?b:i,a=void 0===(i=n.fail)?b:i,c=void 0===(i=n.getResponseText)?b:i,n=void 0!==(n=n.withCredentials)&&n;(t=new t).withCredentials=n,t.open(e,r,!0),t.setRequestHeader("Content-Type","application/json"),t.onload=function(){null!=c&&c(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),u(e)):u({})}catch(e){a(e)}},t.onerror=function(){a(new Error("Network request failed"))},t.onabort=function(){a(new Error("Network request aborted"))},t.send(o)}var wt=function(e){var n=F(),t=dt(n);n&&(n.onchange=function(){t=dt(n)}),e.on("report",function(e){return v(v({},e),{extra:v(v({},e.extra||{}),{network_type:t})})})},bt=function(e,n,t,r){if(!n)return g;var o=n.sample_rate,i=n.include_users,u=n.sample_granularity,a=n.rules,n=n.r,n=void 0===n?Math.random():n;if(x(i,e))return function(e){return pt(e,1)};var c,f,s,l,d,p,v,u="session"===u,h=vt(u,o,t,n,r),m=(c=a,f=u,s=o,l=t,d=n,p=r,v={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(v[e]={enable:t,sample_rate:r,effectiveSampleRate:r*s,hit:vt(f,r,l,d,p)},n&&(v[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:vt(f,n,l,d,p),effectiveSampleRate:n*s,filter:e}}))):v[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),v);return function(e){if(!h())return!1;if(!(e.ev_type in m))return pt(e,o);if(!m[e.ev_type].enable)return!1;if(null!==(n=e.common)&&void 0!==n&&n.sample_rate)return e;var n=m[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(mt(e,t[r].filter))return!!t[r].hit()&&pt(e,t[r].effectiveSampleRate);return!!n.hit()&&pt(e,n.effectiveSampleRate)}};function Et(e){var n,t,r,o,i,u,a,c,f=(t=(n=e).transport,r=e.endpoint,o=e.size,i=void 0===o?10:o,u=void 0===(n=e.wait)?1e3:n,a=[],c=0,{getSize:function(){return i},getWait:function(){return u},setSize:function(e){i=e},setWait:function(e){u=e},getEndpoint:function(){return r},setEndpoint:function(e){r=e},send:function(e){a.push(e),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?p(a):""},clear:function(){clearTimeout(c),a=[]}});function s(){a.length&&(t.post({url:r,data:this.getBatchData()}),a=[])}function l(e){d.post(f.getEndpoint(),p([e]))}var d=gt();return se(function(){var e=f.getBatchData();e&&(d.post(f.getEndpoint(),e),f.clear()),f.send=l}),f}var _t={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:v(v({},e.extra||{}),e.overrides||{})}}};function xt(e){var n,t=e.plugins||{};for(n in t)t[n]&&!E(t[n])&&(t[n]={});return v(v({},e),{plugins:t})}function St(e){return E(e)&&"aid"in e}function Tt(e){return v({},e)}function Dt(){var e=A(),n=M();if(e&&n)return(null===(n=null===(n=null===(n=n.currentScript)||void 0===n?void 0:n.getAttribute("src"))||void 0===n?void 0:n.match(/globalName=(.+)$/))||void 0===n?void 0:n[1])||kt}function Rt(e){return"APMPLUS"+e}function Lt(e){return function(e){try{var n=localStorage.getItem(e),t=n;return t=n&&"string"==typeof n?JSON.parse(n):t}catch(e){return}}(Rt(e))||{userId:q(),deviceId:q(),r:Math.random()}}function Ct(e){var n=e.aid,t=e.userId,r=e.deviceId,e=e.sample;!function(e,n){try{var t="string"==typeof n?n:JSON.stringify(n);localStorage.setItem(e,t)}catch(e){}}(Rt(n),{userId:t,deviceId:r,r:e.r})}var kt="APM_PLUS_WEB",jt="/settings/get/webpro",Ot="/monitor_web/collect",qt=[Ot,jt,"/monitor_browser/collect"],Nt={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},It=20,At=function(e,n){return void 0===n&&(n=Ot),(e&&0<=e.indexOf("//")?"":"https://")+e+n},Mt=q,Bt=function(n){var o,i,u,a=n,c={},f=b,t=b;return{getConfig:function(){return a},setConfig:function(e){var n,t,r;return c=v(v({},c),e||{}),s(),o||(o=e,a.useLocalConfig?(u={},f()):i?l():(n=a.transport,t=a.domain,e=a.aid,r=function(e){i=e,l()},n.get({withCredentials:!0,url:function(e,n){return void 0===n&&(n=jt),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(t)+"?aid="+e,success:function(e){r(e.data||{})},fail:function(){r()}}))),a},onChange:function(e){t=e},onReady:function(e){f=function(){!function(){n.userId!==a.userId&&(n.sample.r=Math.random(),s());Ct(a)}(),e()},u&&f()}};function s(){var e=v(v(v({},n),u||{}),c);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=d(t,e[r++]);return t}(n.plugins,(null==u?void 0:u.plugins)||{},c.plugins||{}),e.sample=Ht(Ht(n.sample,null==u?void 0:u.sample),c.sample),a=e,t()}function l(){u=function(e){if(!e)return{};var n=e.sample,t=e.timestamp,r=e.status;if(!n)return{};var o=n.sample_rate,e=n.sample_granularity;return{sample:{include_users:n.include_users,sample_rate:r&&4===r?0:o,sample_granularity:e,rules:n.rules.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:t}}(i),s(),f()}};function Ht(r,o){if(!r||!o)return r||o;var e=v(v({},r),o);return e.include_users=y(y([],k(r.include_users||[]),!1),k(o.include_users||[]),!1),e.rules=y(y([],k(Object.keys(r.rules||{})),!1),k(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=v(v({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=y(y([],k(r.rules[n].conditional_sample_rules||[]),!1),k(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}var Pt,Ut,Wt,Gt,Ft,Xt,zt,Yt,Jt,Vt,$t,Kt,Qt,Zt,er,nr,tr,rr,or=function(e){e.on("report",function(e){return n=e,e={url:Q(),timestamp:Date.now()},v(v({},n),{extra:v(v({},e),n.extra||{})});var n})},ir={sri:"reportSri",st:"reportResourceError",err:"captureException"},ur=function(e){return Object.keys(e).reduce(function(e,n){return e[n]=[],e},{})},ar=function(t){return Object.keys(t).reduce(function(e,n){return e[t[n]]=n,e},{})},cr=function(o,i,u){return function(e,n,t,r){void 0===t&&(t=Date.now()),void 0===r&&(r=location.href);r=v(v({},Z(o)),{url:r,timestamp:t});i[e]&&(o[u[e]]?ee(o,r)(function(){o[u[e]](n)}):null!==(t=i[e])&&void 0!==t&&t.push([n,r]))}},fr=function(r,n,o){return function(t){var e;t in o&&(null!==(e=n[o[t]])&&void 0!==e&&e.forEach(function(e){var e=k(e,2),n=e[0],e=e[1];ee(r,e)(function(){r[t](n)})}),n[o[t]]=null)}},sr=function(t){var r,o=!1;t.on("init",function(){r=(new Date).getTime(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=(new Date).getTime())-r<700&&n&&(e=n-(e+r)/2,!isNaN(e)&&(0<e||e<-6e5)&&t.set({offset:e})))})})},lr=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,v(v({},n),{extra:v(v({},e),n.extra||{})});var n,t})},dr=function(c){c.on("start",function(){var t,e=c.config(),n=e.deviceId,r=e.sessionId,o=e.release,i=e.env,u=e.offset,a=e.aid,e=e.token,a={did:n,sid:r,release:o,env:i,sname:kt,sversion:"1.4.2",soffset:u||0,biz_id:a,x_auth_token:e},e=c.getSender();e.setEndpoint(e.getEndpoint()+(E(t=a)?Object.keys(t).reduce(function(e,n){return e+="&"+n+"="+t[n]},"").replace("&","?"):""))})},pr=function(e){var n,e=Lt(e.aid);return{aid:0,pid:"",token:"",viewId:"__"+Date.now(),userId:e.userId,deviceId:e.deviceId,sessionId:Mt(),domain:"apmplus.volces.com",plugins:{ajax:{ignoreUrls:qt},fetch:{ignoreUrls:qt},breadcrumb:{},pageview:{},jsError:{},resource:{},resourceError:{},performance:{},tti:{},fmp:{},blankScreen:!1},release:"",env:"production",sample:v(v({},Nt),{r:e.r}),transport:(n=P())?{get:function(e){yt("GET",e,n)},post:function(e){yt("POST",e,n)}}:{get:b,post:b}}},vr=(rr=function(e){var n=void 0===e?{}:e,t=n.createSender,e=n.builder,n=n.createDefaultConfig,r=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,u=e.createConfigManager,a=e.userConfigNormalizer,c=e.initConfigNormalizer,f=e.validateInitConfig,s={};w.forEach(function(e){return s[e]=[]});var l=!1,d=!1,p=!1,v=[],h=[],m={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return v},init:function(e){if(l)R("already inited");else{if(!(e&&E(e)&&f(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=u(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&E(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&E(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(a(e))),null==r?void 0:r.getConfig()},provide:function(e,n){x(h,e)?R("cannot provide "+e+", reserved"):(m[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(d||null!=r&&r.onReady(function(){g("start",d=!0),v.forEach(function(e){return n.build(e)}),v=[]}))},report:function(e){e&&(!(e=L(s.beforeReport)(e))||(e=L(s.report)(e))&&(d?this.build(e):v.push(e)))},build:function(e){!d||(e=L(s.beforeBuild)(e))&&(!(e=n.build(e))||(e=L(s.build)(e))&&this.send(e))},send:function(e){!d||(e=L(s.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){g("beforeDestroy",p=!0)},on:function(e,n){"init"===e&&l||"start"===e&&d||"beforeDestroy"===e&&p?n():s[e]&&s[e].push(n)},off:function(e,n){s[e]&&(s[e]=S(s[e],n))}},h=Object.keys(m);return m;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];s[e].forEach(function(e){try{e.apply(void 0,y([],k(t),!1))}catch(e){}}),n&&(s[e].length=0)}}({validateInitConfig:St,initConfigNormalizer:xt,userConfigNormalizer:Tt,createSender:void 0===t?function(e){return Et({size:It,endpoint:At(e.domain),transport:e.transport})}:t,builder:void 0===e?_t:e,createDefaultConfig:void 0===n?pr:n,createConfigManager:Bt});N(r),sr(r),lr(r),or(r),wt(r),dr(r);var o,n=I(r,Z,function(e,n,t){return ee(e,n)(function(){var e=k(t),n=e[0],e=e.slice(1);r[n].apply(r,y([],k(e),!1))})});return(o=n).on("init",function(){var n=[],e=o.config();e&&e.integrations&&e.integrations.forEach(function(e){x(n,e.name)||(n.push(e.name),e.setup(o),e.tearDown&&o.on("beforeDestroy",e.tearDown))})}),n}(Pt=void 0===Pt?{}:Pt),(Ut=rr).on("start",function(){var e=Ut.config(),n=e.userId,e=e.sample;e&&0===e.sample_rate&&Ut.destroy();e=bt(n,e,j,O);Ut.on("build",e)}),Wt=rr,Ft=ur(Gt=void 0===Gt?ir:Gt),Pt=ar(Gt),Xt=cr(Wt,Ft,Gt),null!==(Gt=Wt.p)&&void 0!==Gt&&Gt.a&&"observe"in Wt.p.a&&Wt.p.a.observe(function(e){var n=k(e,5);n[0];var t=n[1],r=n[2],e=n[3],n=n[4];Xt(t,r,e,n)}),Wt.on("init",function(){var e;null!==(e=Wt.p)&&void 0!==e&&e.a.forEach(function(e){var n=k(e,5);n[0];var t=n[1],r=n[2],e=n[3],n=n[4];Xt(t,r,e,n)}),Wt.p&&Wt.p.a&&(Wt.p.a.length=0)}),Wt.provide("precollect",Xt),Wt.on("provide",fr(Wt,Ft,Pt)),(zt=rr).provide("sendEvent",function(e){e=st(e);e&&zt.report({ev_type:ft,payload:e,extra:{timestamp:Date.now()}})}),zt.provide("sendLog",function(e){e=lt(e);e&&zt.report({ev_type:ft,payload:e,extra:{timestamp:Date.now()}})}),(Yt=rr).on("init",function(){var e,n=Se(Yt,tn,rn);n&&(n=k(V(nn,v(v({},n),{initPid:null===(n=Yt.config())||void 0===n?void 0:n.pid,onPidUpdate:function(e){Yt.set({pid:e,viewId:e+"_"+Date.now(),actionId:void 0})}}),Yt.report.bind(Yt)),2),e=n[0],n=n[1],Yt.on("config",function(){e(Yt.config().pid)}),Yt.on("beforeDestroy",n),Yt.provide("sendPageview",e))}),(Jt=rr).on("init",function(){var n,e=Se(Jt,De,Re);e&&(n=!1,e=k(V(Ee,v(v({},e),{hookCbAtReq:Le(Jt),setTraceHeader:xe(e.trace,"app_id="+(null===(e=Jt.config())||void 0===e?void 0:e.aid)+",origin=web")}),function(e){return!n&&Jt.report(e)}),1)[0],Jt.on("beforeDestroy",function(){n=!0}),Jt.provide("wrapXhr",e))}),(Vt=rr).on("init",function(){var n,e=Se(Vt,Be,He);e&&(n=!1,e=k(V(Me,v(v({},e),{hookCbAtReq:Le(Vt),setTraceHeader:xe(e.trace,"app_id="+(null===(e=Vt.config())||void 0===e?void 0:e.aid)+",origin=web")}),function(e){return!n&&Vt.report(e)}),1)[0],Vt.on("beforeDestroy",function(){n=!0}),Vt.provide("wrapFetch",e))}),($t=rr).on("init",function(){var e,n=Se($t,Gn,{});n&&(e=$t.pp||qn,V(Wn,v(v({},n),{precollect:e}),Te($t)))}),(Kt=rr).on("init",function(){var e,n=Se(Kt,Yn,Jn);n&&(e=k(V(zn,n,Te(Kt)),1)[0],ie(function(){return setTimeout(e,200)}))}),(Qt=rr).on("init",function(){var n,e,t=Se(Qt,ke,je);t&&(t=(e=k(V(Ce,t,b),3))[0],n=e[1],e=e[2],Qt.on("report",function(e){return"http"===e.ev_type&&n({type:"http",category:e.payload.api,message:"",data:{method:e.payload.request.method,url:e.payload.request.url,status_code:String(e.payload.response.status)},timestamp:e.payload.request.timestamp}),e}),Qt.on("beforeDestroy",e),Qt.provide("getBreadcrumbs",t),Qt.provide("addBreadcrumb",n))}),(Zt=rr).on("init",function(){window.removeEventListener("error",Zt.pcErr,!0),window.removeEventListener("unhandledrejection",Zt.pcRej,!0);var e,n=Se(Zt,Ze,en);n&&(n=(e=k(V(Qe,n,function(e){Zt.getBreadcrumbs&&(e.payload.breadcrumbs=Zt.getBreadcrumbs()),Zt.report(e)}),2))[0],e=e[1],Zt.on("beforeDestroy",e),Zt.provide("captureException",n))}),(er=rr).on("init",function(){var e=er.pp||qn;null!==(t=e.observer)&&void 0!==t&&t.disconnect();var n,t,r,o,i,u=Se(er,On,Nn);u&&(V(Dn,v(v({},u),{precollect:e}),Te(er)),t=(r=k(V(jn,0,n=function(e){er.report({ev_type:"performance",payload:e})}),2))[0],r=r[1],er.provide("performanceInit",t),er.provide("performanceSend",r),u.longtask&&(r=k(V(kn,{precollect:e},function(e){er.report({ev_type:"performance_longtask",payload:e})}),1)[0],er.on("beforeDestroy",r)),u.cls&&(o=Q(),u=k(V(Ln,[e],function(e){er.report({ev_type:"performance",payload:e,overrides:{url:o}})}),2),i=u[0],u=u[1],er.on("beforeConfig",function(e){e.viewId&&e.viewId!==(null===(e=er.config())||void 0===e?void 0:e.viewId)&&(i(),o=Q())}),er.on("beforeDestroy",u),se(i)),e.entries.length=0,er.provide("sendCustomPerfMetric",function(e){e=v(v(v({},bn),e),{isCustom:!0});n(e)}))}),(nr=rr).on("init",function(){var e,n=Se(nr,dn,pn);n&&(n=(e=k(V(ln,n,nr.report.bind(nr)),2))[0],e=e[1],nr.on("beforeDestroy",e),nr.provide("reportResourceError",n))}),(tr=rr).on("init",function(){var e=Se(tr,cn,fn);e&&(e=k(V(an,e,function(e){var n=k(e,2),e=n[0],n=n[1];tr.report(n?v(v({},e),{extra:{sample_rate:1}}):e)}),1)[0],tr.on("beforeDestroy",e))}),ct(rr),rr),hr=function(){var e=A(),n=Dt();if(e&&n)return e[n]}();hr&&["p","pp","pcErr","pcRej"].forEach(function(e){vr.provide(e,hr[e])});var mr,gr,yr,wr,br=A(),Er=Dt();br&&Er&&(mr=(null==(mr=br[Er])?void 0:mr.q)||[],br[Er]=vr,mr.forEach(function(e){var n,t;t=e,e=v(v({},Z(n=vr)),{url:t.pop(),timestamp:t.pop()}),ee(n,e)(function(){n.apply(void 0,y([],k(t),!1))})}),mr.length=0,vr.p&&("observe"in vr.p.a&&console.warn("global precollect queue already updated"),vr.p.a=(yr=vr.p.a,wr=[],yr.observe=function(e){wr.push(e)},yr.push=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n.forEach(function(n){wr.forEach(function(e){return e(n)})}),(e=[].push).call.apply(e,y([yr],k(n),!1))},yr),(gr=vr.precollect)&&vr.provide("precollect",function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return vr.p.a.push(y(["precollect"],k(e),!1)),gr.apply(void 0,y([],k(e),!1))})))}(); |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var SETTINGS_DOMAIN = REPORT_DOMAIN; | ||
var SDK_VERSION = "1.4.2-alpha.1" ; | ||
var SDK_VERSION = "1.4.2" ; | ||
var SDK_NAME = 'APM_PLUS_WEB'; | ||
@@ -10,0 +10,0 @@ var SETTINGS_PATH = '/settings/get/webpro'; |
@@ -955,2 +955,3 @@ declare type BatchSender<E> = EventSender<E> & { | ||
aid: number; | ||
token: string; | ||
useLocalConfig?: boolean; | ||
@@ -973,2 +974,3 @@ domain?: string; | ||
domain: string; | ||
token: string; | ||
useLocalConfig?: boolean; | ||
@@ -1112,2 +1114,3 @@ release: string; | ||
pid: string; | ||
token: string; | ||
viewId: string; | ||
@@ -1114,0 +1117,0 @@ userId: string; |
{ | ||
"name": "@apmplus/web", | ||
"version": "1.4.2-alpha.1", | ||
"version": "1.4.2", | ||
"description": "APM Plus Web SDK", | ||
@@ -58,3 +58,3 @@ "main": "cn/index.cjs.js", | ||
}, | ||
"gitHead": "ce8827b84a9c70f48be4801dcaf1129595d86689" | ||
"gitHead": "0e6f30ac2631a19886ab6018c3899c8f8e63cb2f" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2209948
15439
1