-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmonitor.latest.js
7 lines (7 loc) · 105 KB
/
monitor.latest.js
1
2
3
4
5
6
7
/**
* @license
* @fe/monitor v1.0.18
* Released under the MIT license.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Monitor=e()}(this,(function(){"use strict";function t(){t=function(){return e};var e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new T(r||[]);return o(a,"_invoke",{value:E(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d={};function h(){}function p(){}function v(){}var m={};c(m,a,(function(){return this}));var g=Object.getPrototypeOf,_=g&&g(g(S([])));_&&_!==n&&r.call(_,a)&&(m=_);var y=v.prototype=h.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,u){var s=f(t[o],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function E(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return j()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=x(a,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=f(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=v,o(y,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:p,configurable:!0}),p.displayName=c(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,s,"GeneratorFunction")),t.prototype=Object.create(y),t},e.awrap=function(t){return{__await:t}},b(w.prototype),c(w.prototype,u,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(y),c(y,s,"Generator"),c(y,a,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function e(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function u(t){e(a,o,i,u,s,"next",t)}function s(t){e(a,o,i,u,s,"throw",t)}u(void 0)}))}}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o.apply(this,arguments)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,u(t,e)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function c(t,e,n){return c=s()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&u(o,n.prototype),o},c.apply(null,arguments)}function l(t){var e="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return c(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,t)},l(t)}function f(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p={},v={};!function(t){var e="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var o in r)n(r,o)&&(t[o]=r[o])}}return t},t.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,r,o){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+r),o);else for(var i=0;i<r;i++)t[o+i]=e[n+i]},flattenChunks:function(t){var e,n,r,o,i,a;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(a=new Uint8Array(r),o=0,e=0,n=t.length;e<n;e++)i=t[e],a.set(i,o),o+=i.length;return a}},o={arraySet:function(t,e,n,r,o){for(var i=0;i<r;i++)t[o+i]=e[n+i]},flattenChunks:function(t){return[].concat.apply([],t)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(e)}(v);var m={},g=v;function _(t){for(var e=t.length;--e>=0;)t[e]=0}var y=256,b=286,w=30,E=15,x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(576);_(S);var j=new Array(60);_(j);var A=new Array(512);_(A);var I=new Array(256);_(I);var L=new Array(29);_(L);var z,N,C,R=new Array(w);function P(t,e,n,r,o){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=t&&t.length}function U(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function M(t){return t<256?A[t]:A[256+(t>>>7)]}function B(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function D(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,B(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function H(t,e,n){D(t,n[2*e],n[2*e+1])}function F(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function q(t,e,n){var r,o,i=new Array(16),a=0;for(r=1;r<=E;r++)i[r]=a=a+n[r-1]<<1;for(o=0;o<=e;o++){var u=t[2*o+1];0!==u&&(t[2*o]=F(i[u]++,u))}}function G(t){var e;for(e=0;e<b;e++)t.dyn_ltree[2*e]=0;for(e=0;e<w;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function J(t){t.bi_valid>8?B(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function $(t,e,n,r){var o=2*e,i=2*n;return t[o]<t[i]||t[o]===t[i]&&r[e]<=r[n]}function W(t,e,n){for(var r=t.heap[n],o=n<<1;o<=t.heap_len&&(o<t.heap_len&&$(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!$(e,r,t.heap[o],t.depth));)t.heap[n]=t.heap[o],n=o,o<<=1;t.heap[n]=r}function V(t,e,n){var r,o,i,a,u=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],o=t.pending_buf[t.l_buf+u],u++,0===r?H(t,o,e):(H(t,(i=I[o])+y+1,e),0!==(a=x[i])&&D(t,o-=L[i],a),H(t,i=M(--r),n),0!==(a=k[i])&&D(t,r-=R[i],a))}while(u<t.last_lit);H(t,256,e)}function X(t,e){var n,r,o,i=e.dyn_tree,a=e.stat_desc.static_tree,u=e.stat_desc.has_stree,s=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<s;n++)0!==i[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):i[2*n+1]=0;for(;t.heap_len<2;)i[2*(o=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[o]=0,t.opt_len--,u&&(t.static_len-=a[2*o+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)W(t,i,n);o=s;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],W(t,i,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,i[2*o]=i[2*n]+i[2*r],t.depth[o]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,i[2*n+1]=i[2*r+1]=o,t.heap[1]=o++,W(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,o,i,a,u,s=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,p=e.stat_desc.max_length,v=0;for(i=0;i<=E;i++)t.bl_count[i]=0;for(s[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(i=s[2*s[2*(r=t.heap[n])+1]+1]+1)>p&&(i=p,v++),s[2*r+1]=i,r>c||(t.bl_count[i]++,a=0,r>=h&&(a=d[r-h]),u=s[2*r],t.opt_len+=u*(i+a),f&&(t.static_len+=u*(l[2*r+1]+a)));if(0!==v){do{for(i=p-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[p]--,v-=2}while(v>0);for(i=p;0!==i;i--)for(r=t.bl_count[i];0!==r;)(o=t.heap[--n])>c||(s[2*o+1]!==i&&(t.opt_len+=(i-s[2*o+1])*s[2*o],s[2*o+1]=i),r--)}}(t,e),q(i,c,t.bl_count)}function Y(t,e,n){var r,o,i=-1,a=e[1],u=0,s=7,c=4;for(0===a&&(s=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)o=a,a=e[2*(r+1)+1],++u<s&&o===a||(u<c?t.bl_tree[2*o]+=u:0!==o?(o!==i&&t.bl_tree[2*o]++,t.bl_tree[32]++):u<=10?t.bl_tree[34]++:t.bl_tree[36]++,u=0,i=o,0===a?(s=138,c=3):o===a?(s=6,c=3):(s=7,c=4))}function K(t,e,n){var r,o,i=-1,a=e[1],u=0,s=7,c=4;for(0===a&&(s=138,c=3),r=0;r<=n;r++)if(o=a,a=e[2*(r+1)+1],!(++u<s&&o===a)){if(u<c)do{H(t,o,t.bl_tree)}while(0!=--u);else 0!==o?(o!==i&&(H(t,o,t.bl_tree),u--),H(t,16,t.bl_tree),D(t,u-3,2)):u<=10?(H(t,17,t.bl_tree),D(t,u-3,3)):(H(t,18,t.bl_tree),D(t,u-11,7));u=0,i=o,0===a?(s=138,c=3):o===a?(s=6,c=3):(s=7,c=4)}}_(R);var Q=!1;function Z(t,e,n,r){D(t,0+(r?1:0),3),function(t,e,n,r){J(t),r&&(B(t,n),B(t,~n)),g.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}m._tr_init=function(t){Q||(!function(){var t,e,n,r,o,i=new Array(16);for(n=0,r=0;r<28;r++)for(L[r]=n,t=0;t<1<<x[r];t++)I[n++]=r;for(I[n-1]=r,o=0,r=0;r<16;r++)for(R[r]=o,t=0;t<1<<k[r];t++)A[o++]=r;for(o>>=7;r<w;r++)for(R[r]=o<<7,t=0;t<1<<k[r]-7;t++)A[256+o++]=r;for(e=0;e<=E;e++)i[e]=0;for(t=0;t<=143;)S[2*t+1]=8,t++,i[8]++;for(;t<=255;)S[2*t+1]=9,t++,i[9]++;for(;t<=279;)S[2*t+1]=7,t++,i[7]++;for(;t<=287;)S[2*t+1]=8,t++,i[8]++;for(q(S,287,i),t=0;t<w;t++)j[2*t+1]=5,j[2*t]=F(t,5);z=new P(S,x,257,b,E),N=new P(j,k,0,w,E),C=new P(new Array(0),O,0,19,7)}(),Q=!0),t.l_desc=new U(t.dyn_ltree,z),t.d_desc=new U(t.dyn_dtree,N),t.bl_desc=new U(t.bl_tree,C),t.bi_buf=0,t.bi_valid=0,G(t)},m._tr_stored_block=Z,m._tr_flush_block=function(t,e,n,r){var o,i,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<y;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),X(t,t.l_desc),X(t,t.d_desc),a=function(t){var e;for(Y(t,t.dyn_ltree,t.l_desc.max_code),Y(t,t.dyn_dtree,t.d_desc.max_code),X(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*T[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),o=t.opt_len+3+7>>>3,(i=t.static_len+3+7>>>3)<=o&&(o=i)):o=i=n+5,n+4<=o&&-1!==e?Z(t,e,n,r):4===t.strategy||i===o?(D(t,2+(r?1:0),3),V(t,S,j)):(D(t,4+(r?1:0),3),function(t,e,n,r){var o;for(D(t,e-257,5),D(t,n-1,5),D(t,r-4,4),o=0;o<r;o++)D(t,t.bl_tree[2*T[o]+1],3);K(t,t.dyn_ltree,e-1),K(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),V(t,t.dyn_ltree,t.dyn_dtree)),G(t),r&&J(t)},m._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(I[n]+y+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},m._tr_align=function(t){D(t,2,3),H(t,256,S),function(t){16===t.bi_valid?(B(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)};var tt=function(t,e,n,r){for(var o=65535&t|0,i=t>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{i=i+(o=o+e[r++]|0)|0}while(--a);o%=65521,i%=65521}return o|i<<16|0};var et=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();var nt,rt=function(t,e,n,r){var o=et,i=r+n;t^=-1;for(var a=r;a<i;a++)t=t>>>8^o[255&(t^e[a])];return-1^t},ot={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},it=v,at=m,ut=tt,st=rt,ct=ot,lt=-2,ft=258,dt=262,ht=103,pt=113,vt=666;function mt(t,e){return t.msg=ct[e],e}function gt(t){return(t<<1)-(t>4?9:0)}function _t(t){for(var e=t.length;--e>=0;)t[e]=0}function yt(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(it.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function bt(t,e){at._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)}function wt(t,e){t.pending_buf[t.pending++]=e}function Et(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function xt(t,e){var n,r,o=t.max_chain_length,i=t.strstart,a=t.prev_length,u=t.nice_match,s=t.strstart>t.w_size-dt?t.strstart-(t.w_size-dt):0,c=t.window,l=t.w_mask,f=t.prev,d=t.strstart+ft,h=c[i+a-1],p=c[i+a];t.prev_length>=t.good_match&&(o>>=2),u>t.lookahead&&(u=t.lookahead);do{if(c[(n=e)+a]===p&&c[n+a-1]===h&&c[n]===c[i]&&c[++n]===c[i+1]){i+=2,n++;do{}while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<d);if(r=ft-(d-i),i=d-ft,r>a){if(t.match_start=e,a=r,r>=u)break;h=c[i+a-1],p=c[i+a]}}}while((e=f[e&l])>s&&0!=--o);return a<=t.lookahead?a:t.lookahead}function kt(t){var e,n,r,o,i,a,u,s,c,l,f=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-dt)){it.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=n=t.hash_size;do{r=t.head[--e],t.head[e]=r>=f?r-f:0}while(--n);e=n=f;do{r=t.prev[--e],t.prev[e]=r>=f?r-f:0}while(--n);o+=f}if(0===t.strm.avail_in)break;if(a=t.strm,u=t.window,s=t.strstart+t.lookahead,c=o,l=void 0,(l=a.avail_in)>c&&(l=c),n=0===l?0:(a.avail_in-=l,it.arraySet(u,a.input,a.next_in,l,s),1===a.state.wrap?a.adler=ut(a.adler,u,l,s):2===a.state.wrap&&(a.adler=st(a.adler,u,l,s)),a.next_in+=l,a.total_in+=l,l),t.lookahead+=n,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+3-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<dt&&0!==t.strm.avail_in)}function Ot(t,e){for(var n,r;;){if(t.lookahead<dt){if(kt(t),t.lookahead<dt&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-dt&&(t.match_length=xt(t,n)),t.match_length>=3)if(r=at._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=at._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(bt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(bt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(bt(t,!1),0===t.strm.avail_out)?1:2}function Tt(t,e){for(var n,r,o;;){if(t.lookahead<dt){if(kt(t),t.lookahead<dt&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-dt&&(t.match_length=xt(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-3,r=at._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(bt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=at._tr_tally(t,0,t.window[t.strstart-1]))&&bt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=at._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(bt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(bt(t,!1),0===t.strm.avail_out)?1:2}function St(t,e,n,r,o){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=o}function jt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new it.Buf16(1146),this.dyn_dtree=new it.Buf16(122),this.bl_tree=new it.Buf16(78),_t(this.dyn_ltree),_t(this.dyn_dtree),_t(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new it.Buf16(16),this.heap=new it.Buf16(573),_t(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new it.Buf16(573),_t(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function At(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:pt,t.adler=2===e.wrap?0:1,e.last_flush=0,at._tr_init(e),0):mt(t,lt)}function It(t){var e=At(t);return 0===e&&function(t){t.window_size=2*t.w_size,_t(t.head),t.max_lazy_match=nt[t.level].max_lazy,t.good_match=nt[t.level].good_length,t.nice_match=nt[t.level].nice_length,t.max_chain_length=nt[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function Lt(t,e,n,r,o,i){if(!t)return lt;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),o<1||o>9||8!==n||r<8||r>15||e<0||e>9||i<0||i>4)return mt(t,lt);8===r&&(r=9);var u=new jt;return t.state=u,u.strm=t,u.wrap=a,u.gzhead=null,u.w_bits=r,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new it.Buf8(2*u.w_size),u.head=new it.Buf16(u.hash_size),u.prev=new it.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new it.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=i,u.method=n,It(t)}nt=[new St(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(kt(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,bt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-dt&&(bt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(bt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(bt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Ot),new St(4,5,16,8,Ot),new St(4,6,32,32,Ot),new St(4,4,16,16,Tt),new St(8,16,32,32,Tt),new St(8,16,128,128,Tt),new St(8,32,128,256,Tt),new St(32,128,258,1024,Tt),new St(32,258,258,4096,Tt)],p.deflateInit=function(t,e){return Lt(t,e,8,15,8,0)},p.deflateInit2=Lt,p.deflateReset=It,p.deflateResetKeep=At,p.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?lt:(t.state.gzhead=e,0):lt},p.deflate=function(t,e){var n,r,o,i;if(!t||!t.state||e>5||e<0)return t?mt(t,lt):lt;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||r.status===vt&&4!==e)return mt(t,0===t.avail_out?-5:lt);if(r.strm=t,n=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,wt(r,31),wt(r,139),wt(r,8),r.gzhead?(wt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),wt(r,255&r.gzhead.time),wt(r,r.gzhead.time>>8&255),wt(r,r.gzhead.time>>16&255),wt(r,r.gzhead.time>>24&255),wt(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),wt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(wt(r,255&r.gzhead.extra.length),wt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=st(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(wt(r,0),wt(r,0),wt(r,0),wt(r,0),wt(r,0),wt(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),wt(r,3),r.status=pt);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=pt,Et(r,a),0!==r.strstart&&(Et(r,t.adler>>>16),Et(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(t.adler=st(t.adler,r.pending_buf,r.pending-o,o)),yt(t),o=r.pending,r.pending!==r.pending_buf_size));)wt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(t.adler=st(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=st(t.adler,r.pending_buf,r.pending-o,o)),yt(t),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,wt(r,i)}while(0!==i);r.gzhead.hcrc&&r.pending>o&&(t.adler=st(t.adler,r.pending_buf,r.pending-o,o)),0===i&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=st(t.adler,r.pending_buf,r.pending-o,o)),yt(t),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,wt(r,i)}while(0!==i);r.gzhead.hcrc&&r.pending>o&&(t.adler=st(t.adler,r.pending_buf,r.pending-o,o)),0===i&&(r.status=ht)}else r.status=ht;if(r.status===ht&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&yt(t),r.pending+2<=r.pending_buf_size&&(wt(r,255&t.adler),wt(r,t.adler>>8&255),t.adler=0,r.status=pt)):r.status=pt),0!==r.pending){if(yt(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&>(e)<=gt(n)&&4!==e)return mt(t,-5);if(r.status===vt&&0!==t.avail_in)return mt(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==vt){var u=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(kt(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=at._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(bt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(bt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(bt(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var n,r,o,i,a=t.window;;){if(t.lookahead<=ft){if(kt(t),t.lookahead<=ft&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=a[o=t.strstart-1])===a[++o]&&r===a[++o]&&r===a[++o]){i=t.strstart+ft;do{}while(r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&r===a[++o]&&o<i);t.match_length=ft-(i-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=at._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=at._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(bt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(bt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(bt(t,!1),0===t.strm.avail_out)?1:2}(r,e):nt[r.level].func(r,e);if(3!==u&&4!==u||(r.status=vt),1===u||3===u)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===u&&(1===e?at._tr_align(r):5!==e&&(at._tr_stored_block(r,0,0,!1),3===e&&(_t(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),yt(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(wt(r,255&t.adler),wt(r,t.adler>>8&255),wt(r,t.adler>>16&255),wt(r,t.adler>>24&255),wt(r,255&t.total_in),wt(r,t.total_in>>8&255),wt(r,t.total_in>>16&255),wt(r,t.total_in>>24&255)):(Et(r,t.adler>>>16),Et(r,65535&t.adler)),yt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},p.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==ht&&e!==pt&&e!==vt?mt(t,lt):(t.state=null,e===pt?mt(t,-3):0):lt},p.deflateSetDictionary=function(t,e){var n,r,o,i,a,u,s,c,l=e.length;if(!t||!t.state)return lt;if(2===(i=(n=t.state).wrap)||1===i&&42!==n.status||n.lookahead)return lt;for(1===i&&(t.adler=ut(t.adler,e,l,0)),n.wrap=0,l>=n.w_size&&(0===i&&(_t(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new it.Buf8(n.w_size),it.arraySet(c,e,l-n.w_size,n.w_size,0),e=c,l=n.w_size),a=t.avail_in,u=t.next_in,s=t.input,t.avail_in=l,t.next_in=0,t.input=e,kt(n);n.lookahead>=3;){r=n.strstart,o=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--o);n.strstart=r,n.lookahead=2,kt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=u,t.input=s,t.avail_in=a,n.wrap=i,0},p.deflateInfo="pako deflate (from Nodeca project)";var zt={},Nt=v,Ct=!0,Rt=!0;try{String.fromCharCode.apply(null,[0])}catch(t){Ct=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Rt=!1}for(var Pt=new Nt.Buf8(256),Ut=0;Ut<256;Ut++)Pt[Ut]=Ut>=252?6:Ut>=248?5:Ut>=240?4:Ut>=224?3:Ut>=192?2:1;function Mt(t,e){if(e<65534&&(t.subarray&&Rt||!t.subarray&&Ct))return String.fromCharCode.apply(null,Nt.shrinkBuf(t,e));for(var n="",r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n}Pt[254]=Pt[254]=1,zt.string2buf=function(t){var e,n,r,o,i,a=t.length,u=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),u+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Nt.Buf8(u),i=0,o=0;i<u;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?e[i++]=n:n<2048?(e[i++]=192|n>>>6,e[i++]=128|63&n):n<65536?(e[i++]=224|n>>>12,e[i++]=128|n>>>6&63,e[i++]=128|63&n):(e[i++]=240|n>>>18,e[i++]=128|n>>>12&63,e[i++]=128|n>>>6&63,e[i++]=128|63&n);return e},zt.buf2binstring=function(t){return Mt(t,t.length)},zt.binstring2buf=function(t){for(var e=new Nt.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},zt.buf2string=function(t,e){var n,r,o,i,a=e||t.length,u=new Array(2*a);for(r=0,n=0;n<a;)if((o=t[n++])<128)u[r++]=o;else if((i=Pt[o])>4)u[r++]=65533,n+=i-1;else{for(o&=2===i?31:3===i?15:7;i>1&&n<a;)o=o<<6|63&t[n++],i--;i>1?u[r++]=65533:o<65536?u[r++]=o:(o-=65536,u[r++]=55296|o>>10&1023,u[r++]=56320|1023&o)}return Mt(u,r)},zt.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+Pt[t[n]]>e?n:e};var Bt=p,Dt=v,Ht=zt,Ft=ot,qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Gt=Object.prototype.toString;function Jt(t){if(!(this instanceof Jt))return new Jt(t);this.options=Dt.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qt,this.strm.avail_out=0;var n=Bt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(Ft[n]);if(e.header&&Bt.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(r="string"==typeof e.dictionary?Ht.string2buf(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=Bt.deflateSetDictionary(this.strm,r)))throw new Error(Ft[n]);this._dict_set=!0}}Jt.prototype.push=function(t,e){var n,r,o=this.strm,i=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=Ht.string2buf(t):"[object ArrayBuffer]"===Gt.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new Dt.Buf8(i),o.next_out=0,o.avail_out=i),1!==(n=Bt.deflate(o,r))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(Ht.buf2binstring(Dt.shrinkBuf(o.output,o.next_out))):this.onData(Dt.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==n);return 4===r?(n=Bt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==r||(this.onEnd(0),o.avail_out=0,!0)},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Dt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var $t,Wt=function(t,e){return(e=e||{}).gzip=!0,function(t,e){var n=new Jt(e);if(n.push(t,!0),n.err)throw n.msg||Ft[n.err];return n.result}(t,e)},Vt=function(){},Xt=function(t,e,n){return function(){var r=t.apply(void 0,arguments),o=n._activePlugin;if(o){o.has(e)||o.set(e,new Set);var i=o.get(e);i.add(r)}}},Yt=function(t){if("complete"===document.readyState)return t(),Vt;var e="load",n=function(){return window.removeEventListener(e,r)},r=function(){t(),n()};return window.addEventListener(e,r),n},Kt=function(){return/(ipod|ipad|iphone|android|mobile)/.test(navigator.userAgent.toLowerCase())},Qt=function(t){var e=function(){return t()};Kt()?window.addEventListener("pagehide",e):window.addEventListener("beforeunload",e);return function(){Kt()?window.removeEventListener("pagehide",e):window.removeEventListener("beforeunload",e)}},Zt=function(){var t=navigator.userAgent;return null!=window.navigator.brave&&"isBrave"==window.navigator.brave.isBrave.name?t+" brave":t},te=function(){var t=window.crypto||window.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");var e=t&&t.getRandomValues?function(){return t.getRandomValues(new Uint8Array(1))[0]}:function(){return 16*Math.random()};return"10000000100040008000100000000000".replace(/[018]/g,(function(t){return(Number(t)^(15&e())>>Number(t)/4).toString(16)}))},ee=function(t,e){void 0===e&&(e={});var n=t;"string"!=typeof t&&(n=JSON.stringify(t));var r=(new TextEncoder).encode(n),i=Wt(r,o({to:"string"},e));return btoa(i)},ne=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.once=function(t,e){var n=this.on(t,(function(){e.apply(void 0,arguments),n()}));return n},n.emit=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=this.eventPool.get(t);void 0!==o&&o.forEach((function(t){return t.apply(void 0,n)}))},e}(function(){function t(){this.eventPool=new Map}var e=t.prototype;return e.on=function(t,e){var n=this,r=this.eventPool.get(t);if(void 0!==r)r.add(e);else{var o=new Set;this.eventPool.set(t,o),o.add(e)}return function(){return n.off(t,e)}},e.off=function(t,e){var n=this.eventPool.get(t);void 0!==n&&(void 0!==e?n.has(e)&&(n.delete(e),0===n.size&&this.eventPool.delete(t)):this.eventPool.delete(t))},t}()),re=function(t){function e(){return t.apply(this,arguments)||this}i(e,t);var n=e.prototype;return n.once=function(t,e){var n=this.on(t,(function(t){var r=e(t);return n(),r}));return n},n.emit=function(t,e){var n=this.eventPool.get(t);if(void 0!==n){for(var r,o=e,i=h(n);!(r=i()).done;){o=(0,r.value)(o)}return o}},e}(ne);!function(t){t.DEV="dev",t.SITNET="sitnet",t.TESTNET="testnet",t.MAINNET="mainnet"}($t||($t={}));var oe="undefined"==typeof window,ie=window.location.hostname,ae=/^[^.]+\.[^.]+\.[^.]+$/.test(ie)||/^[^.]+\.[^.]+\.[^.]+\.(hk|uae|us|uk|jp|fr|de|au|ca|br|in|ru)$/.test(ie),ue=ae&&/^[^.]*testnet[^.]*\./.test(ie),se=ae&&!ue?$t.MAINNET:ue?$t.TESTNET:$t.SITNET;var ce,le=function(){var t="bybit.com";try{var e=ie,n=["cloud","announcements","sandbox","blog","newblog","learn"];if(ie&&n.some((function(t){return ie.includes(t)}))){var r=new RegExp("(?:(?:"+n.join("|")+")-testnet|testnet-(?:"+n.join("|")+"))","g"),o=new RegExp("^(?:"+n.join("|")+")(?=.)","g");e=ie.replace(r,"testnet").replace(o,"www")}var i=e?e.split("."):[];3===i.length&&(t=i.slice(-2).join(".")),4===i.length&&(t=ae?i.slice(-3).join("."):i.slice(-2).join(".")),5===i.length&&(t=i.slice(-3).join("."))}catch(t){}return t}(),fe=!!localStorage.getItem("monitor_debug"),de=oe?{}:window,he="GLOBAL_MONITOR_NOTICE",pe=de[he]||(de[he]=new ne);!function(t){t.MONITOR_READY="onMonitorReady"}(ce||(ce={}));var ve;de.LISTEN_MONITOR_READY||(de.LISTEN_MONITOR_READY=function(t){null!=de&&de.Monitor?t():pe.once(ce.MONITOR_READY,t)}),function(t){t.INIT="init",t.BEFORE_UPLOAD="beforeUpload",t.AFTER_UPLOAD="afterUpload",t.UNINSTALL="uninstall"}(ve||(ve={}));var me={syncHook:new ne,syncWaterfall:new re},ge="@fe/monitor",_e="1.0.18";function ye(t,e){return t===e||t!=t&&e!=e}function be(t,e){for(var n=t.length;n--;)if(ye(t[n][0],e))return n;return-1}var we=Array.prototype.splice;function Ee(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ee.prototype.clear=function(){this.__data__=[],this.size=0},Ee.prototype.delete=function(t){var e=this.__data__,n=be(e,t);return!(n<0)&&(n==e.length-1?e.pop():we.call(e,n,1),--this.size,!0)},Ee.prototype.get=function(t){var e=this.__data__,n=be(e,t);return n<0?void 0:e[n][1]},Ee.prototype.has=function(t){return be(this.__data__,t)>-1},Ee.prototype.set=function(t,e){var n=this.__data__,r=be(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var xe="object"==typeof global&&global&&global.Object===Object&&global,ke="object"==typeof self&&self&&self.Object===Object&&self,Oe=xe||ke||Function("return this")(),Te=Oe.Symbol,Se=Object.prototype,je=Se.hasOwnProperty,Ae=Se.toString,Ie=Te?Te.toStringTag:void 0;var Le=Object.prototype.toString;var ze=Te?Te.toStringTag:void 0;function Ne(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ze&&ze in Object(t)?function(t){var e=je.call(t,Ie),n=t[Ie];try{t[Ie]=void 0;var r=!0}catch(t){}var o=Ae.call(t);return r&&(e?t[Ie]=n:delete t[Ie]),o}(t):function(t){return Le.call(t)}(t)}function Ce(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Re(t){if(!Ce(t))return!1;var e=Ne(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Pe,Ue=Oe["__core-js_shared__"],Me=(Pe=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||""))?"Symbol(src)_1."+Pe:"";var Be=Function.prototype.toString;var De=/^\[object .+?Constructor\]$/,He=Function.prototype,Fe=Object.prototype,qe=He.toString,Ge=Fe.hasOwnProperty,Je=RegExp("^"+qe.call(Ge).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $e(t){return!(!Ce(t)||(e=t,Me&&Me in e))&&(Re(t)?Je:De).test(function(t){if(null!=t){try{return Be.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function We(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return $e(n)?n:void 0}var Ve=We(Oe,"Map"),Xe=We(Object,"create");var Ye=Object.prototype.hasOwnProperty;var Ke=Object.prototype.hasOwnProperty;function Qe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ze(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function tn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qe.prototype.clear=function(){this.__data__=Xe?Xe(null):{},this.size=0},Qe.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Qe.prototype.get=function(t){var e=this.__data__;if(Xe){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ye.call(e,t)?e[t]:void 0},Qe.prototype.has=function(t){var e=this.__data__;return Xe?void 0!==e[t]:Ke.call(e,t)},Qe.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Xe&&void 0===e?"__lodash_hash_undefined__":e,this},tn.prototype.clear=function(){this.size=0,this.__data__={hash:new Qe,map:new(Ve||Ee),string:new Qe}},tn.prototype.delete=function(t){var e=Ze(this,t).delete(t);return this.size-=e?1:0,e},tn.prototype.get=function(t){return Ze(this,t).get(t)},tn.prototype.has=function(t){return Ze(this,t).has(t)},tn.prototype.set=function(t,e){var n=Ze(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function en(t){var e=this.__data__=new Ee(t);this.size=e.size}en.prototype.clear=function(){this.__data__=new Ee,this.size=0},en.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},en.prototype.get=function(t){return this.__data__.get(t)},en.prototype.has=function(t){return this.__data__.has(t)},en.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ee){var r=n.__data__;if(!Ve||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new tn(r)}return n.set(t,e),this.size=n.size,this};var nn=function(){try{var t=We(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function rn(t,e,n){"__proto__"==e&&nn?nn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function on(t,e,n){(void 0!==n&&!ye(t[e],n)||void 0===n&&!(e in t))&&rn(t,e,n)}var an,un=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),a=i.length;a--;){var u=i[an?a:++r];if(!1===e(o[u],u,o))break}return t},sn="object"==typeof exports&&exports&&!exports.nodeType&&exports,cn=sn&&"object"==typeof module&&module&&!module.nodeType&&module,ln=cn&&cn.exports===sn?Oe.Buffer:void 0,fn=ln?ln.allocUnsafe:void 0;var dn=Oe.Uint8Array;function hn(t,e){var n,r,o=e?(n=t.buffer,r=new n.constructor(n.byteLength),new dn(r).set(new dn(n)),r):t.buffer;return new t.constructor(o,t.byteOffset,t.length)}var pn=Object.create,vn=function(){function t(){}return function(e){if(!Ce(e))return{};if(pn)return pn(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function mn(t,e){return function(n){return t(e(n))}}var gn=mn(Object.getPrototypeOf,Object),_n=Object.prototype;function yn(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_n)}function bn(t){return null!=t&&"object"==typeof t}function wn(t){return bn(t)&&"[object Arguments]"==Ne(t)}var En=Object.prototype,xn=En.hasOwnProperty,kn=En.propertyIsEnumerable,On=wn(function(){return arguments}())?wn:function(t){return bn(t)&&xn.call(t,"callee")&&!kn.call(t,"callee")},Tn=Array.isArray;function Sn(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function jn(t){return null!=t&&Sn(t.length)&&!Re(t)}var An="object"==typeof exports&&exports&&!exports.nodeType&&exports,In=An&&"object"==typeof module&&module&&!module.nodeType&&module,Ln=In&&In.exports===An?Oe.Buffer:void 0,zn=(Ln?Ln.isBuffer:void 0)||function(){return!1},Nn=Function.prototype,Cn=Object.prototype,Rn=Nn.toString,Pn=Cn.hasOwnProperty,Un=Rn.call(Object);var Mn={};Mn["[object Float32Array]"]=Mn["[object Float64Array]"]=Mn["[object Int8Array]"]=Mn["[object Int16Array]"]=Mn["[object Int32Array]"]=Mn["[object Uint8Array]"]=Mn["[object Uint8ClampedArray]"]=Mn["[object Uint16Array]"]=Mn["[object Uint32Array]"]=!0,Mn["[object Arguments]"]=Mn["[object Array]"]=Mn["[object ArrayBuffer]"]=Mn["[object Boolean]"]=Mn["[object DataView]"]=Mn["[object Date]"]=Mn["[object Error]"]=Mn["[object Function]"]=Mn["[object Map]"]=Mn["[object Number]"]=Mn["[object Object]"]=Mn["[object RegExp]"]=Mn["[object Set]"]=Mn["[object String]"]=Mn["[object WeakMap]"]=!1;var Bn,Dn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Hn=Dn&&"object"==typeof module&&module&&!module.nodeType&&module,Fn=Hn&&Hn.exports===Dn&&xe.process,qn=function(){try{var t=Hn&&Hn.require&&Hn.require("util").types;return t||Fn&&Fn.binding&&Fn.binding("util")}catch(t){}}(),Gn=qn&&qn.isTypedArray,Jn=Gn?(Bn=Gn,function(t){return Bn(t)}):function(t){return bn(t)&&Sn(t.length)&&!!Mn[Ne(t)]};function $n(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Wn=Object.prototype.hasOwnProperty;function Vn(t,e,n){var r=t[e];Wn.call(t,e)&&ye(r,n)&&(void 0!==n||e in t)||rn(t,e,n)}function Xn(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Yn=/^(?:0|[1-9]\d*)$/;function Kn(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Yn.test(t))&&t>-1&&t%1==0&&t<e}var Qn=Object.prototype.hasOwnProperty;function Zn(t,e){var n=Tn(t),r=!n&&On(t),o=!n&&!r&&zn(t),i=!n&&!r&&!o&&Jn(t),a=n||r||o||i,u=a?Xn(t.length,String):[],s=u.length;for(var c in t)!e&&!Qn.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Kn(c,s))||u.push(c);return u}var tr=Object.prototype.hasOwnProperty;function er(t){if(!Ce(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=yn(t),n=[];for(var r in t)("constructor"!=r||!e&&tr.call(t,r))&&n.push(r);return n}function nr(t){return jn(t)?Zn(t,!0):er(t)}function rr(t){return function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),o?rn(n,u,s):Vn(n,u,s)}return n}(t,nr(t))}function or(t,e,n,r,o,i,a){var u=$n(t,n),s=$n(e,n),c=a.get(s);if(c)on(t,n,c);else{var l,f=i?i(u,s,n+"",t,e,a):void 0,d=void 0===f;if(d){var h=Tn(s),p=!h&&zn(s),v=!h&&!p&&Jn(s);f=s,h||p||v?Tn(u)?f=u:bn(l=u)&&jn(l)?f=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(u):p?(d=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=fn?fn(n):new t.constructor(n);return t.copy(r),r}(s,!0)):v?(d=!1,f=hn(s,!0)):f=[]:function(t){if(!bn(t)||"[object Object]"!=Ne(t))return!1;var e=gn(t);if(null===e)return!0;var n=Pn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rn.call(n)==Un}(s)||On(s)?(f=u,On(u)?f=rr(u):Ce(u)&&!Re(u)||(f=function(t){return"function"!=typeof t.constructor||yn(t)?{}:vn(gn(t))}(s))):d=!1}d&&(a.set(s,f),o(f,s,r,i,a),a.delete(s)),on(t,n,f)}}function ir(t,e,n,r,o){t!==e&&un(e,(function(i,a){if(o||(o=new en),Ce(i))or(t,e,a,n,ir,r,o);else{var u=r?r($n(t,a),i,a+"",t,e,o):void 0;void 0===u&&(u=i),on(t,a,u)}}),nr)}function ar(t){return t}function ur(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var sr=Math.max;var cr=nn?function(t,e){return nn(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:ar,lr=Date.now;var fr=function(t){var e=0,n=0;return function(){var r=lr(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(cr);function dr(t,e){return fr(function(t,e,n){return e=sr(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=sr(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=r[o];return u[e]=n(a),ur(t,this,u)}}(t,e,ar),t+"")}function hr(t){return dr((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(t,e,n){if(!Ce(n))return!1;var r=typeof e;return!!("number"==r?jn(n)&&Kn(e,n.length):"string"==r&&e in n)&&ye(n[e],t)}(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r,i)}return e}))}var pr,vr=hr((function(t,e,n){ir(t,e,n)})),mr=function(t){return new Promise((function(e,n){var r=vr({method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"}},t),o=r.url,i=r.method,a=r.timeout,u=r.headers,s=r.data,c=r.params;if(void 0===o||""===o)throw new Error("request 参数的 url 为必传项");var l=new XMLHttpRequest,f="[object Object]"===Object.prototype.toString.call(c)?Object.keys(c).reduce((function(t,e){return t+(/\?$/.test(t)?"":"&")+e+"="+c[e]}),o+"?"):o;if(l.open(i.toUpperCase(),f),a&&"number"==typeof a&&(l.timeout=a),"[object Object]"===Object.prototype.toString.call(u))for(var d=0,h=Object.entries(u);d<h.length;d++){var p=h[d],v=p[0],m=p[1];l.setRequestHeader(v,m)}l.onreadystatechange=function(){l.readyState===XMLHttpRequest.DONE&&200===l.status&&e(l.responseText)},l.onabort=function(){l&&n(new Error("Ajax Cancel"))},l.onerror=function(){n(new Error("Network Error"))},l.ontimeout=function(){n(new Error("Ajax Timeout"))},l.send("GET"===i.toUpperCase()?null:"string"==typeof s?s:JSON.stringify(s))}))},gr="function"!=typeof navigator.sendBeacon?mr:function(t){return new Promise((function(e,n){var r=t.url,o=t.data;if(!navigator.sendBeacon(r,JSON.stringify(o)))return mr(t).catch((function(t){console.warn(t)}));e("success")}))};!function(t){t.INIT="init",t.PENDING="pending",t.FAIL="fail"}(pr||(pr={}));var _r,yr={limit:30,interval:15e3,onloadUpload:!0,errorHit:3,gzip:!0},br=function(t){return!1===t?{isOpen:!1,limit:0,interval:0,onloadUpload:!1}:o({isOpen:!0},yr,"[object Object]"===Object.prototype.toString.call(t)?t:{})},wr=function(t,e){return e._requestUrl+(t?"&g=1":"")},Er=function(t,e,n){var r=br(t.config.batchUpload),i=new Set,a=function(t){var e=[];return t.forEach((function(t){t.state!==pr.INIT&&t.state!==pr.FAIL||e.push(t)})),e},u=function(e){var n={url:wr(!!r.gzip,t),method:"POST",data:r.gzip?ee(e):e};return mr(n).catch((function(t){console.warn(t)}))},s=function(e){var n=function(t){for(var e="function"==typeof String.prototype.codePointAt?"codePointAt":"charCodeAt",n=0,r=0,o=t.length;r<o;r++){var i=t[e](r);n+=i<=127?1:i<=2047?2:i<=65535?3:4}return n}(JSON.stringify(e)),o=Math.ceil(n/5e4);if(o<=0)return gr({url:wr(!!r.gzip,t),data:r.gzip?ee(e):e});for(var i=[],a=Math.ceil(e.length/o),u=0;u<o;u++){var s=u*a,c=e.slice(s,s+a);i.push(gr({url:wr(!!r.gzip,t),data:r.gzip?ee(c):c}))}return Promise.all(i).then((function(){return"success"}))},c=function(t,e){return void 0===e&&(e=u),t.length<=0?Promise.resolve():e(t.map((function(t){return t.state=pr.PENDING,t.data}))).then((function(){t.forEach((function(t){return i.delete(t)}))})).catch((function(){t.forEach((function(t){t.errorHit+=1,t.state=pr.FAIL,t.errorHit>=r.errorHit&&i.delete(t)}))})).finally((function(){t.length=0}))},l=null,f=function t(){l=setTimeout((function(){var e=a(i);c(e).finally(t)}),r.interval)},d=Vt,h=Vt,p=function(){clearTimeout(l),d(),h()},v=function(){r.isOpen&&"number"==typeof r.interval&&r.interval>0&&f(),r.isOpen&&!0===r.onloadUpload&&(d=Yt((function(){var t=a(i);c(t)}))),r.isOpen&&(h=Qt((function(){var t=a(i);c(t,s)})))};return v(),t.hooks.init((function(t){var e=br(t.batchUpload);if(r.isOpen)if(p(),e.isOpen)r=e,v();else{var n=a(i);c(n)}else e.isOpen&&(r=e,v())})),function(t){if(fe&&console.debug("[upload:batch]",t),!r.isOpen)return n(t);var u;i.add({state:pr.INIT,errorHit:0,data:o({event_id:te(),timestamp:Date.now()/1e3},e(),t)}),"number"==typeof r.limit&&r.limit>0&&(u=a(i)).length>=r.limit&&c(u)}},xr=hr((function(t,e,n,r){ir(t,e,n,r)}));!function(t){t.HASH="hash",t.HISTORY="history",t.NONE="none"}(_r||(_r={}));var kr=function(t,e,n){var r=new Map,o=function(t,n){void 0===n&&(n=e);var o=r.get(t);if(void 0!==o){var i=function(t){var e={};return t.forEach((function(t){return xr(e,t,(function(t,e){if(Array.isArray(t)&&Array.isArray(e))return[].concat(t,e)}))})),e}(o);n(i),o.clear(),r.delete(t)}},i=function(t){void 0===t&&(t=e);for(var n,i=h(r.keys());!(n=i()).done;){var a=n.value;o(a,t)}};t.hooks.init((function(t){var e=t.roteMode,n=e!==_r.NONE&&e!==_r.HISTORY,r=e!==_r.NONE&&e!==_r.HASH;n&&window.addEventListener("hashchange",(function(){return i()})),r&&function(){function t(t){var e=history[t];return function(){var t=e.apply(this,arguments);return i(),t}}window.addEventListener("popstate",(function(){return i()})),history.pushState=t("pushState"),history.replaceState=t("replaceState")}()}));me.syncHook.once(ve.INIT,(function(){var t,e;t=function(){i(n)},e=function(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t()},window.addEventListener("pagehide",e),window.addEventListener("visibilitychange",e)}));return function(t,e){if(fe&&console.debug("[upload:bucket]",t,e),r.has(t)){r.get(t).add(e)}else{var n=new Set;n.add(e),r.set(t,n);var i=t.toString().match(/Symbol\(.*_t([0-9.]+)(s|m|h)?\)/);null!==i&&function(t,e){var n=e[1],r=0;switch(e[2]){case"s":r=1e3*Number(n);break;case"m":r=60*Number(n)*1e3;break;case"h":r=60*Number(n)*60*1e3;break;default:r=Number(n)}setTimeout((function(){o(t)}),r)}(t,[].concat(i))}}},Or=function(t){if("string"!=typeof t._requestUrl||""===t._requestUrl)throw new Error("Moniter 初始化需传递接口上报地址:config.url");console.info("["+ge+"版本]: "+_e);var e=function(){var e=t.config,n=e.env,r=e.release;return{platform:"javascript",environment:n,sdk:{name:ge,version:_e},release:r||"1.0.0",request:{ua:Zt()}}},n=function(n){return fe&&console.debug("[upload]",n),mr({url:t._requestUrl,method:"POST",data:[o({event_id:te(),timestamp:Date.now()/1e3},e(),n)]}).catch((function(t){console.warn(t)}))},r=function(t,e,n){return"function"!=typeof navigator.sendBeacon?n:function(n){var r={url:t._requestUrl,data:[o({event_id:te(),timestamp:Date.now()/1e3},e(),n)]};return gr(r)}}(t,e,n);return{upload:n,batchUpload:Er(t,e,n),bucketUpload:kr(t,n,r),beaconUpload:r}},Tr="unHookList",Sr="unExtendList";function jr(t){return t.url+"/api/"+t.appId+"/batch/"}function Ar(t){return function(e){var n=me.syncWaterfall.emit(ve.BEFORE_UPLOAD,e);t(n),me.syncHook.emit(ve.AFTER_UPLOAD)}}var Ir=function(){function t(t){if("string"!=typeof(null==t?void 0:t.appId)||""===t.appId)throw new Error("opts.appId 为必传参数");var e;this.config={url:"https://monitor-frontend-collector.a.bybit-aws.com",appId:t.appId||"",env:se,debug:fe,batchUpload:{gzip:!1}},this._requestUrl=jr(this.config),this.hooks={init:Xt((function(t){return me.syncHook.once(ve.INIT,t)}),Tr,e=this),beforeUpload:Xt((function(t){return me.syncWaterfall.on(ve.BEFORE_UPLOAD,t)}),Tr,e),afterUpload:Xt((function(t){return me.syncHook.on(ve.AFTER_UPLOAD,t)}),Tr,e),uninstall:Xt((function(t){return me.syncHook.once(ve.UNINSTALL,t)}),Tr,e)},this._pluginManager=new Map,this._activePlugin=null,this.initialized=!1;var n=Or(this),r=n.upload,o=n.batchUpload,i=n.bucketUpload,a=n.beaconUpload;this.report={upload:Ar(o),uploadOnce:Ar(r),beaconUpload:Ar(a),bucketUpload:function(t,e){var n=me.syncWaterfall.emit(ve.BEFORE_UPLOAD,e);i(t,n),me.syncHook.emit(ve.AFTER_UPLOAD)}}}var e=t.prototype;return e.init=function(t){if(this.initialized)console.error("Moniter 已经初始化完毕,不能再次初始化");else{var e;this.config=o({},this.config,t),this._requestUrl=jr(this.config);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(e=me.syncHook).emit.apply(e,[ve.INIT,o({},this.config)].concat(r)),this.initialized=!0}},e.extend=function(t,e){var n,r,o,i,a=this;if(Reflect.has(this.report,t))throw new Error("扩展名称不允许跟 Monitor.report 模块下的方法名称相同");if(Reflect.has(this,t)){if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("不允许覆盖已有内容");r=this[t],o=e,i=[],Object.keys(o).forEach((function(t){if(!Reflect.has(r,t)){var e=Reflect.get(o,t);Reflect.set(r,t,e),i.push(t)}})),n=function(){return i.forEach((function(t){return Reflect.deleteProperty(r,t)}))}}else Reflect.set(this,t,e),n=function(){return Reflect.deleteProperty(a,t)};return n},e._use=function(t,e){var n=this;if(void 0===e&&(e={}),"function"!=typeof t&&"[object Object]"!==Object.prototype.toString.call(t))throw new Error("plugin 期望类型是: Object | Function, 当前类型为: "+Object.prototype.toString.call(t));if(!t.name)throw new Error("函数类型的插件需设置函数名称,而当前插件为匿名插件");var r=this._pluginManager.get(t.name);if(!r||r.get("raw")!==t){if(r)throw new Error("当前插件名称 "+t.name+" 与已有插件名称冲突,请重新命名插件");var i={hooks:this.hooks,report:this.report,extend:Xt((function(t,e){return n.extend(t,e)}),Sr,this),getConfig:function(){return o({},n.config)}},a=new Map;this._pluginManager.set(t.name,a),a.set("raw",t),this._activePlugin=a,"function"==typeof t?t(i,e):"[object Object]"===Object.prototype.toString.call(t)&&t.install(i,e),this._activePlugin=null}},e.use=function(t,e){return void 0===e&&(e={}),this._use(t,e),this},e.useAsync=function(t,e){var n=this;return void 0===e&&(e={}),function(t){return import(t).then((function(t){return t.default}))}(t).then((function(t){return n._use(t,e)})),this},e.unUse=function(t){var e=this._pluginManager.get(t);return e&&(me.syncHook.emit(ve.UNINSTALL),["unHookList","unExtendList"].forEach((function(t){var n=e.get(t);n&&(n.forEach((function(t){return t()})),n.clear(),e.delete(t))}))),this},t}(),Lr={name:"report-extend-plugin",install:function(t){var e=t.extend,n=function(t){var e=t.upload,n=t.uploadOnce,r=t.bucketUpload,i={type:"custom"},a=function(t){return function(e){t(o({},i,{extra:o({},e)}))}};return{log:a(e),logOnce:a(n),logBucket:function(t,e){r(t,o({},i,{extra:o({},e)}))}}}(t.report);e("report",{log:n.log,logOnce:n.logOnce,logBucket:n.logBucket})}};function zr(t){var e=document.cookie.match("(^|;) ?"+t+"=([^;]*)(;|$)");return e?unescape(e[2]):null}var Nr,Cr,Rr=["extra","user"],Pr=function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?Object.prototype.toString.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e},Ur="FRONTEND_MONITOR_SDK_SESSION_ID",Mr="deviceId",Br=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},Dr=function(){return""+Br()+Br()+"-"+Br()+"-"+Br()+"-"+Br()+"-"+Br()+Br()+Br()},Hr=Dr(),Fr={name:"DataLego",userSetData:{},opts:{},eventOpts:{},install:function(t){var e=this,n=t.hooks,r=t.extend;n.init((function(t,n){e.opts=t,e.eventOpts=o({v:0,p:0},n)})),n.beforeUpload((function(t){var n,r=navigator.connection,i=e.opts,a=i.getGuid,u=i.getUid,s=Object.keys(e.eventOpts).reduce((function(t,n){var r,i=e.eventOpts[n],a=Pr(i)?i():i;return o({},t,((r={})[n]=a,r))}),{}),c=sessionStorage.getItem(Ur);c||(c=Dr(),sessionStorage.setItem(Ur,c));var l=zr(Mr);l||(l=Dr(),function(t,e,n,r,o){var i=e;-1!==e.indexOf(";")&&(i=escape(e));var a=t+"="+i;if(n&&(a+="; domain="+n),r&&(a+="; path="+r),o>0){var u=new Date;u.setTime(u.getTime()+60*o*1e3),a+=";expires="+u.toUTCString()}document.cookie=a}(Mr,l,"."+le,"/",5256e3));var d="0";try{var h=zr("sensorsdata2015jssdkcross");if(h){var p=JSON.parse(decodeURIComponent(h)).$device_id;d=void 0===p?"0":p}}catch(t){}var v=(null==u?void 0:u())||localStorage.getItem("BYBIT_GA_UID")||window.GA_UID||"",m=t.extra,g=t.user;return o({},f(t,Rr),{user:o({id:v,deviceId:l,sessionId:c,sensorsId:d},e.userSetData,g),extra:o({url:location.href,accessId:Hr,o:navigator.onLine,hidden:document.hidden,networkType:r?r.effectiveType:"",g:(null==a?void 0:a())||l,u:v,net:r?r.rtt:-1,w:r?r.downlink>10?99:r.downlink:-1,dt:(new Date).toISOString(),cl:(null==(n=document.cookie)?void 0:n.length)||0,st:localStorage.getItem("simulatedTrading"),sdk:ge+"-"+_e},s,m)})})),r("setUser",(function(t){Object.keys(t).forEach((function(n){if(["deviceId","sessionId"].includes(n))console.warn("字段"+n+"为保留字段, 请更换字段名!");else{var r=t[n];e.userSetData[n]=Pr(r)?r():r}}))}))}};!function(t){t.Empty="empty",t.Hidden="hidden",t.Changed="changed",t.Paint="paint"}(Cr||(Cr={}));var qr=((Nr={})[Cr.Empty]="content",Nr[Cr.Hidden]="top",Nr[Cr.Changed]="immutable",Nr[Cr.Paint]="paint",Nr),Gr={},Jr=function t(e,n){var r,o,i;if(void 0===e&&(e=document.body),void 0===n&&(n=Cr.Empty),e){var a=Gr[r=n]||(Gr[r]=[]),u=function(t,e){var n,r=qr[e];return null!=(null==t||null==(n=t.dataset)?void 0:n[r])}(e,n);if(u&&!a.includes(e)&&a.push(e),null!=(o=e)&&null!=(i=o.children)&&i.length)for(var s=0;s<e.children.length;s++)t(e.children[s],n)}},$r=function(t,e,n){var r,o;return void 0===e&&(e=100),void 0===n&&(n=1e4),function(){for(var i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];var s=Date.now();s-(o=o||s)>n||(clearTimeout(r),r=setTimeout((function(){o=void 0,t.apply(void 0,a)}),e))}},Wr=function(t){var e,n=t.tagName.toLowerCase(),r=getComputedStyle(t),o=""!==r.backgroundImage&&"none"!==r.backgroundImage||(null==r||null==(e=r.background)?void 0:e.includes("url(")),i="svg"===n,a="canvas"===n,u=("source"===n||"embed"===n||"img"===n)&&""!==t.src;return o||u||i||a},Vr=function t(e){var n;return!!Wr(e)||0!==(null==e||null==(n=e.children)?void 0:n.length)&&Array.from(e.children).some((function(e){return t(e)}))},Xr=function t(e,n){return e===n||!(null==e||!e.parentElement)&&t(e.parentElement,n)},Yr=function(t){var e={resources:performance.getEntriesByType("resource")||[],markMap:(performance.getEntriesByType("mark")||[]).reduce((function(t,e){return t[e.name]=e.startTime,t}),{})},n=e.resources,r=e.markMap,o=(t||[]).map((function(t){var e=function(t,e){var n,r=e.resources,o=e.markMap;if(Wr(t)){var i,a=getComputedStyle(t),u=null==(i=(a.backgroundImage||a.background).match(/(?<=url\(")[^"\)]+/i))?void 0:i[0],s=t.src||u;if(!s)return 0;var c=r.find((function(t){var e;return null==t||null==(e=t.name)||null==e.includes?void 0:e.includes(s)}));return(null==c?void 0:c.responseEnd)||0}return o[(null==(n=t.dataset)?void 0:n.mut)||t.getAttribute("data-mut")||""]||0}(t,{resources:n,markMap:r});return{node:t,value:e}})).filter((function(t){return t.value>0})).sort((function(t,e){return t.value>e.value?1:-1}));return fe&&console.debug("[paint:value]",t,o),null==o?void 0:o[0]},Kr=function(t,e){var n=this;this.reportedList=[],this.report=function(t,e){var r=n.genKey(t);n.reportedList.includes(r)||(n.reportFn({extra:t,type:"custom"},e),n.reportedList.push(r))},this.reportInBatch=function(t,e){t.forEach((function(t){n.report(t,e)}))},this.reportFn=t,this.genKey=e||JSON.stringify};Kr.getDomInfo=function(t){return t?{element:t.outerHTML,tagName:t.tagName.toLowerCase(),tagId:t.id,tagClass:t.className,domPath:ro(t)}:{}},Kr.getDom2Info=function(t){return{element2:t.outerHTML,tagName2:t.tagName.toLowerCase(),tagId2:t.id,tagClass2:t.className,domPath2:ro(t)}};var Qr,Zr,to,eo,no,ro=function(t){for(var e=[];"HTML"!==t.nodeName;){var n,r,o=(null==(n=t)||null==(r=n.parentElement)?void 0:r.children)||[];if(!o||0===o.length)return"--";var i=Array.from(o).indexOf(t),a="BODY"===t.nodeName,u=t.className?t.className.split(" ").join("."):"",s=t.id||"",c=(s?"#"+s:"")+(u?"."+u:"");e.push(a?""+t.nodeName.toLowerCase()+c:""+t.nodeName.toLowerCase()+c+"["+i+"]"),t=t.parentNode}return e.reverse().join(">")},oo=function(t){return""+t.domPath},io=function(t){return t.currentValue+"-"+t.domPath},ao=function(t){return t.domPath+"-"+t.domPath2},uo=function(t){return""+t.domPath},so=-1,co=function(t){addEventListener("pageshow",(function(e){e.persisted&&(so=e.timeStamp,t(e))}),!0)},lo=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},fo=function(){var t=lo();return t&&t.activationStart||0},ho=function(t,e){var n=lo(),r="navigate";return so>=0?r="back-forward-cache":n&&(r=document.prerendering||fo()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},po=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){e(t.getEntries())}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},vo=function(t,e){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},mo=function(t,e,n,r){var o,i;return function(a){e.value>=0&&(a||r)&&((i=e.value-(o||0))||void 0===o)&&(o=e.value,e.delta=i,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,n),t(e))}},go=-1,_o=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},yo=function(){vo((function(t){var e=t.timeStamp;go=e}),!0)},bo=function(){return go<0&&(go=_o(),yo(),co((function(){setTimeout((function(){go=_o(),yo()}),0)}))),{get firstHiddenTime(){return go}}},wo=function(t,e){e=e||{};var n,r=[1800,3e3],o=bo(),i=ho("FCP"),a=function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(s&&s.disconnect(),t.startTime<o.firstHiddenTime&&(i.value=Math.max(t.startTime-fo(),0),i.entries.push(t),n(!0)))}))},u=window.performance&&window.performance.getEntriesByName&&window.performance.getEntriesByName("first-contentful-paint")[0],s=u?null:po("paint",a);(u||s)&&(n=mo(t,i,r,e.reportAllChanges),u&&a([u]),co((function(o){i=ho("FCP"),n=mo(t,i,r,e.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){i.value=performance.now()-o.timeStamp,n(!0)}))}))})))},Eo=!1,xo=-1,ko={passive:!0,capture:!0},Oo=new Date,To=function(t,e){Qr||(Qr=e,Zr=t,to=new Date,Ao(removeEventListener),So())},So=function(){if(Zr>=0&&Zr<to-Oo){var t={entryType:"first-input",name:Qr.type,target:Qr.target,cancelable:Qr.cancelable,startTime:Qr.timeStamp,processingStart:Qr.timeStamp+Zr};eo.forEach((function(e){e(t)})),eo=[]}},jo=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){To(t,e),o()},r=function(){o()},o=function(){removeEventListener("pointerup",n,ko),removeEventListener("pointercancel",r,ko)};addEventListener("pointerup",n,ko),addEventListener("pointercancel",r,ko)}(e,t):To(e,t)}},Ao=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,jo,ko)}))},Io=0,Lo=1/0,zo=0,No=function(t){t.forEach((function(t){t.interactionId&&(Lo=Math.min(Lo,t.interactionId),zo=Math.max(zo,t.interactionId),Io=zo?(zo-Lo)/7+1:0)}))},Co=function(){return no?Io:performance.interactionCount||0},Ro=function(){"interactionCount"in performance||no||(no=po("event",No,{type:"event",buffered:!0,durationThreshold:0}))},Po=0,Uo=function(){return Co()-Po},Mo=[],Bo={},Do=function(t){var e=Mo[Mo.length-1],n=Bo[t.interactionId];if(n||Mo.length<10||t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};Bo[r.id]=r,Mo.push(r)}Mo.sort((function(t,e){return e.latency-t.latency})),Mo.splice(10).forEach((function(t){delete Bo[t.id]}))}},Ho={},Fo=function(t,e){e=e||{};var n,r=[2500,4e3],o=bo(),i=ho("LCP"),a=function(t){var e=t[t.length-1];if(e){var r=Math.max(e.startTime-fo(),0);r<o.firstHiddenTime&&(i.value=r,i.entries=[e],n())}},u=po("largest-contentful-paint",a);if(u){n=mo(t,i,r,e.reportAllChanges);var s=function(){Ho[i.id]||(a(u.takeRecords()),u.disconnect(),Ho[i.id]=!0,n(!0))};["keydown","click"].forEach((function(t){addEventListener(t,s,{once:!0,capture:!0})})),vo(s,!0),co((function(o){i=ho("LCP"),n=mo(t,i,r,e.reportAllChanges),requestAnimationFrame((function(){requestAnimationFrame((function(){i.value=performance.now()-o.timeStamp,Ho[i.id]=!0,n(!0)}))}))}))}},qo=function t(e){document.prerendering?addEventListener("prerenderingchange",(function(){return t(e)}),!0):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},Go=["entries"],Jo=[function(t,e){e=e||{};var n=[.1,.25];Eo||(wo((function(t){xo=t.value})),Eo=!0);var r,o=function(e){xo>-1&&t(e)},i=ho("CLS",0),a=0,u=[],s=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=u[0],n=u[u.length-1];a&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(a+=t.value,u.push(t)):(a=t.value,u=[t]),a>i.value&&(i.value=a,i.entries=u,r())}}))},c=po("layout-shift",s);c&&(r=mo(o,i,n,e.reportAllChanges),vo((function(){s(c.takeRecords()),r(!0)})),co((function(){a=0,xo=-1,i=ho("CLS",0),r=mo(o,i,n,e.reportAllChanges)})))},wo,function(t,e){e=e||{};var n,r=[100,300],o=bo(),i=ho("FID"),a=function(t){t.startTime<o.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},u=function(t){t.forEach(a)},s=po("first-input",u);n=mo(t,i,r,e.reportAllChanges),s&&vo((function(){u(s.takeRecords()),s.disconnect()}),!0),s&&co((function(){var o;i=ho("FID"),n=mo(t,i,r,e.reportAllChanges),eo=[],Zr=-1,Qr=null,Ao(addEventListener),o=a,eo.push(o),So()}))},Fo,function(t,e){e=e||{};var n=[200,500];Ro();var r,o=ho("INP"),i=function(t){t.forEach((function(t){t.interactionId&&Do(t),"first-input"===t.entryType&&!Mo.some((function(e){return e.entries.some((function(e){return t.duration===e.duration&&t.startTime===e.startTime}))}))&&Do(t)}));var e,n=(e=Math.min(Mo.length-1,Math.floor(Uo()/50)),Mo[e]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())},a=po("event",i,{durationThreshold:e.durationThreshold||40});r=mo(t,o,n,e.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),vo((function(){i(a.takeRecords()),o.value<0&&Uo()>0&&(o.value=0,o.entries=[]),r(!0)})),co((function(){Mo=[],Po=Co(),o=ho("INP"),r=mo(t,o,n,e.reportAllChanges)})))},function(t,e){e=e||{};var n=[800,1800],r=ho("TTFB"),o=mo(t,r,n,e.reportAllChanges);qo((function(){var i=lo();if(i){if(r.value=Math.max(i.responseStart-fo(),0),r.value<0||r.value>performance.now())return;r.entries=[i],o(!0),co((function(){r=ho("TTFB",0),(o=mo(t,r,n,e.reportAllChanges))(!0)}))}}))}],$o={type:"performance"},Wo=function(t){return void 0===t&&(t={}),o({},$o,t)},Vo=function(){if(localStorage){var t=0;for(var e in localStorage){if(localStorage.hasOwnProperty(e))t+=2*(localStorage[e].length+e.length)}return t}},Xo=function(t){Jo.forEach((function(e){return function(t,e){t((function(t){var n,r,o,i,a,u,s=t.name.toLowerCase();fe&&console.debug("[web-vital]",s,t),e(Wo({extra:{domPath:null!=(n=t.entries)&&null!=(r=n[0])&&r.element?ro(null==(o=t.entries)||null==(i=o[0])?void 0:i.element):"",paints:(a={},a[s]=t.value,a),rating:(u={},u[s]=t.rating,u)}}))}))}(e,t)}))},Yo=function(t){Yt((function(){setTimeout((function(){var e;if(window.performance){!function(t){var e,n;null!=(e=window)&&null!=(n=e.performance)&&n.memory&&window.setTimeout((function(){t(Wo({extra:{memory:performance.memory.usedJSHeapSize}}))}),3e3)}(t);var n={};((null==(e=performance)?void 0:e.getEntriesByType("paint"))||[]).forEach((function(t){"first-paint"===t.name&&(n.fp=t.startTime)}));var r=performance.getEntriesByType("navigation");if(r&&Array.isArray(r)&&!(r.length<1)){var o=r[0],i=o.domainLookupStart,a=o.domainLookupEnd,u=o.connectStart,s=o.connectEnd,c=o.requestStart,l=o.responseStart,f=o.responseEnd,d=o.fetchStart,h=o.workerStart,p=o.transferSize,v=o.encodedBodySize,m=o.redirectEnd,g=o.redirectStart,_=o.secureConnectionStart,y=o.domInteractive;o.domComplete;var b=o.loadEventStart,w=o.domContentLoadedEventStart,E=o.domContentLoadedEventEnd,x=o.loadEventEnd,k={appCache:i-d,ttfbNew:l-c,redirect:m-g,dns:a-i,tcp:s-u,ssl:_?s-_:0,download:f-l,serviceWorkerTime:h>0?f-h:0,headerSize:Math.abs(p-v)||0,white:f-d,tti:y-d,dom:y-f,domParsed:w-y,dcl:E-w,domready:E-d,loaded:b-d,resources:b-E,onLoad:x-b};t(Wo({extra:{normal:k,paints:n,localStorage:Vo()}}))}}}),0)}))},Ko=function(t){var e,n;if("string"!=typeof(null==t?void 0:t.release)||0===(null==t||null==(e=t.release)?void 0:e.length))return-1;var r,i=(null==t?void 0:t.appId)||"-1",a="b_m_r",u={};try{u=JSON.parse(localStorage.getItem(a)||"{}")}catch(t){}return(null==(n=u)?void 0:n[i])!==(null==t?void 0:t.release)?(localStorage.setItem(a,JSON.stringify(o({},u,((r={})[i]=null==t?void 0:t.release,r)))),1):0},Qo=Symbol("performance_t1m"),Zo={name:"performance-plugin",install:function(t){var e=t.report,n=e.upload,r=e.bucketUpload;t.hooks.init((function(t){var e=function(e){var n=Ko(t);r(Qo,o({},e,{extra:o({},(null==e?void 0:e.extra)||{},{firstVisit:n})}))};Xo(e),function(t){var e=1;Fo((function(n){var r,i,a,u=n.entries,s=f(n,Go),c=u.slice(-1)[0],l=null!=c&&c.element?{tagId:null==(r=c.element)?void 0:r.id,tagName:null==(i=c.element)?void 0:i.tagName,className:null==(a=c.element)?void 0:a.className}:{element:null},d={type:"trace_lcp",detail:o({seq:e},s,{startTime:null==c?void 0:c.startTime,duration:null==c?void 0:c.duration,size:null==c?void 0:c.size,renderTime:null==c?void 0:c.renderTime,loadTime:null==c?void 0:c.loadTime,firstAnimatedFrameTime:null==c?void 0:c.firstAnimatedFrameTime,url:null==c?void 0:c.url},l)};fe&&console.debug("[onLCP]",e,c,d),t(d),e+=1}),{reportAllChanges:!0})}(n),Yo(e)}))}},ti=Math.floor,ei=Math.random;function ni(t){var e,n,r=t.length;return r?t[(e=0,n=r-1,e+ti(ei()*(n-e+1)))]:void 0}function ri(t,e){return function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}(e,(function(e){return t[e]}))}var oi=mn(Object.keys,Object),ii=Object.prototype.hasOwnProperty;function ai(t){return jn(t)?Zn(t):function(t){if(!yn(t))return oi(t);var e=[];for(var n in Object(t))ii.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}function ui(t){return ni(null==(e=t)?[]:ri(e,ai(e)));var e}var si=/\s/;var ci=/^\s+/;function li(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&si.test(t.charAt(e)););return e}(t)+1).replace(ci,""):t}var fi=/^[-+]0x[0-9a-f]+$/i,di=/^0b[01]+$/i,hi=/^0o[0-7]+$/i,pi=parseInt;function vi(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||bn(t)&&"[object Symbol]"==Ne(t)}(t))return NaN;if(Ce(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ce(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=li(t);var n=di.test(t);return n||hi.test(t)?pi(t.slice(2),n?2:8):fi.test(t)?NaN:+t}var mi=1/0;function gi(t){var e=function(t){return t?(t=vi(t))===mi||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),n=e%1;return e==e?n?e-n:e:0}var _i=4294967295,yi=Math.min;function bi(t,e){if((t=gi(t))<1||t>9007199254740991)return[];var n,r=_i,o=yi(t,_i);t-=_i;for(var i=Xn(o,e="function"==typeof(n=e)?n:ar);++r<t;)e(r);return i}var wi=function(){function e(){this.CONFIG={operationSampling:{perOperationStrategies:[]},probabilisticSampling:{samplingRate:1},strategyType:0}}var o,i,a;return e.prototype.getConfig=function(){var e=n(t().mark((function e(n){var r,o,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.url,o=n.appId,t.next=3,fetch(r+"/api/v1/client/trace/sampling?projectId="+o).then((function(t){return t.json()}));case 3:0===(i=t.sent).ret_code&&(this.config=i.result);case 5:case"end":return t.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),o=e,(i=[{key:"config",get:function(){return this.CONFIG},set:function(t){this.CONFIG=t}}])&&r(o.prototype,i),a&&r(o,a),Object.defineProperty(o,"prototype",{writable:!1}),e}(),Ei=new wi,xi="0123456789abcdef".split(""),ki=function(){return(Tn(t=xi)?ni:ui)(t);var t},Oi=function(t){return bi(t,ki).join("")},Ti=new RegExp("^(https?:\\/\\/)?api2(-\\d+)?(-\\w+)?."+le);function Si(t){var e="00-"+Oi(32)+"-"+Oi(16)+"-01";try{e=function(t){var e,n,r,o=Ei.config,i="01",a=((null==o||null==(e=o.operationSampling)?void 0:e.perOperationStrategies)||[]).find((function(e){return t.includes(e.operation)}));return i=a?(null==a||null==(n=a.probabilisticSampling)?void 0:n.samplingRate)>=Math.random()?"01":"00":(null==o||null==(r=o.probabilisticSampling)?void 0:r.samplingRate)>=Math.random()?"01":"00","00-"+Oi(32)+"-"+Oi(16)+"-"+i}(t)}catch(t){}return e}function ji(t){var e,n,r;try{var o=t.split("-");e=o[2],n=o[1],r=o[3]||"01"}catch(t){}return{spanId:e,traceId:n,flag:r}}function Ai(t){var e,n,r,o,i=(null==t?void 0:t.message)||"";try{var a=JSON.parse(i)||{};return{status:null==a?void 0:a.status,code:(null==a?void 0:a.code)||(null==a?void 0:a.retCode)||(null==a?void 0:a.ret_code),path:null==a?void 0:a.path,msg:null==a?void 0:a.msg,message:i}}catch(t){}try{var u=i.split("$");e=u[0],n=u[1],r=u[2]||"",o=u[3]||""}catch(t){}return{status:e,code:n,path:r,msg:o,message:i}}function Ii(t,e,n){void 0===t&&(t="");var r=Array.isArray(n.traceWhiteList)?n.traceWhiteList:[],o=Array.isArray(n.blackList)?n.blackList:[],i=["sc-datasink","tms.","/translations/","onfido.com"].concat(o);return!r.find((function(e){return e instanceof RegExp?Boolean(e.test(t)):Boolean(t.includes(e))}))&&!Ti.test(t)||i.find((function(e){return e instanceof RegExp?Boolean(e.test(t)):Boolean(t.includes(e))}))?(Array.isArray(r)||console.info("traceWhiteList 如果未传入不会给接口添加 Trace Header 头"),{}):{traceparent:e}}function Li(t){var e=(null==t?void 0:t.split("?")[0])||"";return e.includes("//")?/^https?/.test(e)||(e=""+location.protocol+e):e=""+location.origin+e,e}function zi(t){return Object.entries({ttfbNew:t.responseStart-t.requestStart,redirect:t.redirectEnd-t.redirectStart,dns:t.domainLookupEnd-t.domainLookupStart,tcp:t.connectEnd-t.connectStart,ssl:t.secureConnectionStart?t.connectEnd-t.secureConnectionStart:0,download:t.responseEnd-t.responseStart,serviceWorkerTime:t.workerStart>0?t.responseEnd-t.workerStart:0,headerSize:Math.abs(t.transferSize-t.encodedBodySize)||0,white:t.responseEnd-t.fetchStart}).reduce((function(t,e){var n;return(null==e?void 0:e[1])>0?o({},t,((n={})[null==e?void 0:e[0]]=Math.floor(e[1]),n)):t}),{})}var Ni,Ci=function(t){void 0===t&&(t={});var e={};return["userToken","UserToken","user_token","Usertoken","usertoken"].forEach((function(n){var r;null!=(r=t)&&r[n]&&(e[n]="****")})),o({},t,e)},Ri=Symbol("resource_t1m"),Pi=function(t){return void 0===t&&(t={}),o({type:"resource"},t)},Ui=null,Mi=function(t){(Ui=t,window.performance)&&(window.addEventListener("load",(function(){var t=Date.now(),e=performance.getEntriesByType("resource")||[],n=e.filter((function(t){return"img"!==t.initiatorType})).map((function(e){return{url:Li(e.name),rawUrl:e.name,duration:e.duration,normal:zi(e),initiatorType:e.initiatorType,transferSize:e.transferSize,type:"success",startDate:t,methods:"GET"}}));null==Ui||Ui(Ri,Pi({extra:{resource:n}})),fe&&console.debug("[resource]",e,n)})),new PerformanceObserver((function(t){var e=Date.now(),n=((null==t?void 0:t.getEntries())||[]).filter((function(t){return"img"===(null==t?void 0:t.initiatorType)})).map((function(t){return{url:Li(t.name),rawUrl:t.name,duration:t.duration,normal:zi(t),initiatorType:t.initiatorType,transferSize:t.transferSize,type:"success",startDate:e,methods:"GET"}}));(null==n?void 0:n.length)>0&&(null==Ui||Ui(Ri,Pi({extra:{resource:n}})),fe&&console.debug("[resource]",n))})).observe({entryTypes:["resource"]}))};function Bi(t){return Di.apply(this,arguments)}function Di(){return(Di=n(t().mark((function e(n){var r;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,null==n?void 0:n.json();case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{});case 10:case"end":return t.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function Hi(t){return Fi.apply(this,arguments)}function Fi(){return(Fi=n(t().mark((function e(n){var r,o,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r={},n.type!==Ni.AJAX){t.next=5;break}try{r=JSON.parse(null==n?void 0:n.xhrResponse.response)}catch(t){r={}}t.next=10;break;case 5:if(n.type!==Ni.FETCH){t.next=10;break}return i=null==(o=n.fetchResponse)?void 0:o.res,t.next=9,Bi(null==i?void 0:i.clone());case 9:r=t.sent;case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),e)})))).apply(this,arguments)}function qi(t){if(t.type===Ni.AJAX){var e=t.xhrResponse;return{status:e.status,statusText:e.statusText,headers:e.config.headers,method:e.config.method,body:e.config.body}}if(t.type===Ni.FETCH){var n=t.fetchResponse,r=n.input instanceof Request?n.input.method:n.init.method;return{status:n.res.status,statusText:n.res.statusText,headers:n.init.headers,method:r||"GET",body:n.init.body}}return{}}function Gi(t,e,n,r,o){var i=0,a=t.find((function(t){return t instanceof RegExp?Boolean(t.test(r)):Boolean(r.includes(t))}));return Boolean(a)||("function"==typeof e.onResponse?i=e.onResponse(n,r,o):Reflect.has(n,"ret_code")?i=Number(n.ret_code):Reflect.has(n,"retCode")&&(i=Number(n.retCode))),i}function Ji(t){var e={pathname:"",search:""};try{t=/^\/\//.test(t)?"http:"+t:t,e=new URL(t)}catch(r){var n=t.split("?");e={pathname:n[0]||"",search:n[1]||""}}return e}!function(t){t[t.AJAX=0]="AJAX",t[t.FETCH=1]="FETCH"}(Ni||(Ni={}));var $i=function(){var e=n(t().mark((function e(n,r,o){var i,a,u,s,c,l,f,d,h,p,v,m,g,_,y,b;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=ji(o.traceparent),a=i.spanId,u=i.traceId,s=i.flag,t.next=3,Hi(o);case 3:c=t.sent,l=Ji(o.url),d=Gi(f=["/api/v1/client/trace/sampling",/\/api\/([0-9])*?\/batch\//],r,c,l.pathname,o),h=qi(o),p=o.endTime-o.startTime,v={},m={};try{0!==d&&(v=JSON.stringify(h.body).length>2e4?{}:h.body,"[object Object]"===Object.prototype.toString.call(c)&&Object.keys(c).forEach((function(t){var e,n=c[t];(null==(e=JSON.stringify(n))?void 0:e.length)<100&&(m[t]=n)})))}catch(t){}(g=null==h?void 0:h.status)<200||g>=300||0!==d?(_={type:"custom",contexts:{trace:{operation_name:l.pathname,span_id:a,tags:{},duration:p,trace_id:u}},extra:{m:h.statusText,r:l.pathname,t:"REQUEST_ERROR",h:null==l?void 0:l.host,d:p,ext:{traceparent:null==o?void 0:o.traceparent,t:"successHooks",retCode:d,retMsg:c.ret_msg||c.retMsg,resData:m,body:v,method:h.method||"GET",headers:Ci(h.headers),status:g,url:o.url,path:l.pathname,search:l.search}}},n(_)):(y=f.find((function(t){return t instanceof RegExp?Boolean(t.test(l.pathname)):Boolean(l.pathname.includes(t))})),Boolean(y)||(b=Li(null==o?void 0:o.url),e={extra:{resource:[{url:b,duration:p,initiatorType:"request",span_id:a,trace_id:u,flag:s,transferSize:0,type:"success",startDate:o.startTime,methods:h.method||"GET"}]}},null==Ui||Ui(Ri,Pi(e))));case 14:case"end":return t.stop()}var e}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Wi=function(t,e){var n=ji(e.traceparent),r=n.spanId,i=n.traceId,a=function(t){if(t.type===Ni.AJAX){var e=t.xhrError;return{status:(null==t?void 0:t.status)||500,statusText:"",message:(null==t?void 0:t.message)||"",headers:e.config.headers,method:e.config.method,body:e.config.body,stack:""}}if(t.type===Ni.FETCH){var n,r,o=t.fetchError,i=o.input instanceof Request?o.input.method:o.init.method;return{status:(null==t?void 0:t.status)||500,statusText:"",message:(null==t?void 0:t.message)||(null==(n=o.err)?void 0:n.message),headers:o.init.headers,method:i||"GET",body:o.init.body,stack:null==(r=o.err)?void 0:r.stack}}return{}}(e),u=Ji(e.url),s={};try{s=JSON.stringify(a.body).length>2e4?{}:a.body}catch(t){}var c=Li(null==e?void 0:e.url),l=e.endTime-e.startTime;t({type:"custom",contexts:{trace:{operation_name:e.url,span_id:r,tags:{},duration:l,trace_id:i}},extra:{m:a.message,r:u.pathname,status:a.status,t:"REQUEST_ERROR",h:null==u?void 0:u.host,d:l,ext:o({},e,{t:"errorHooks",stack:null==a?void 0:a.stack,m:a.message,body:s,method:a.method||"GET",headers:Ci(a.headers),retCode:e.code,url:c,path:u.pathname,search:u.search})}})},Vi=["load","loadend","timeout","error","readystatechange","abort"];function Xi(t,e){var n={};for(var r in t)n[r]=t[r];return n.target=n.currentTarget=e,n}var Yi=Vi[0],Ki=Vi[1],Qi=Vi[2],Zi=Vi[3],ta=Vi[4],ea=Vi[5];function na(t,e){if((e=e||window).__xhr)throw"Ajax is already hooked.";return function(t,e){var n=t.onRequest,r=t.onResponse,o=t.onError;function i(t,e){var n=new sa(t),o={response:e.response||e.responseText,status:e.status,statusText:e.statusText,config:t.config,headers:t.resHeader||t.getAllResponseHeaders().split("\r\n").reduce((function(t,e){if(""===e)return t;var n=e.split(":");return t[n.shift()]=function(t){return t.replace(/^\s+|\s+$/g,"")}(n.join(":")),t}),{})};if(!r)return n.resolve(o);r(o,n)}function a(t,e,n,r){var i=new ca(t);n={config:t.config,error:n,type:r},o?o(n,i):i.next(n)}function u(){return!0}function s(t){return function(e,n){return a(e,this,n,t),!0}}function c(t,e){return 4===t.readyState&&0!==t.status?i(t,e):4!==t.readyState&&oa(t,ta),!0}return function(t,e){function n(e){return function(){var n=this.hasOwnProperty(e+"_")?this[e+"_"]:this.xhr[e],r=(t[e]||{}).getter;return r&&r(n,this)||n}}function r(e){return function(n){var r=this.xhr,o=this,i=t[e];if("on"===e.substring(0,2))o[e+"_"]=n,r[e]=function(i){i=Xi(i,o),t[e]&&t[e].call(o,r,i)||n.call(o,i)};else{var a=(i||{}).setter;n=a&&a(n,o)||n,this[e+"_"]=n;try{r[e]=n}catch(t){}}}}function o(e){return function(){var n=[].slice.call(arguments);if(t[e]){var r=t[e].call(this,n,this.xhr);if(r)return r}return this.xhr[e].apply(this.xhr,n)}}return(e=e||window).__xhr=e.__xhr||e.XMLHttpRequest,e.XMLHttpRequest=function(){for(var t=new e.__xhr,i=0;i<Vi.length;++i){var a="on"+Vi[i];void 0===t[a]&&(t[a]=null)}for(var u in t){var s="";try{s=typeof t[u]}catch(t){}"function"===s?this[u]=o(u):Object.defineProperty(this,u,{get:n(u),set:r(u),enumerable:!0})}var c=this;t.getProxy=function(){return c},this.xhr=t},Object.assign(e.XMLHttpRequest,{UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4}),e.__xhr}({onload:u,onloadend:u,onerror:s(Zi),ontimeout:s(Qi),onabort:s(ea),onreadystatechange:function(t){return c(t,this)},open:function(t,e){var r=this,o=e.config={headers:{}};o.method=t[0],o.url=t[1],o.async=t[2],o.user=t[3],o.password=t[4],o.xhr=e;var i="on"+ta;if(e[i]||(e[i]=function(){return c(e,r)}),n)return!0},send:function(t,e){var r=e.config;if(r.withCredentials=e.withCredentials,r.body=t[0],n){var o=function(){n(r,new ua(e))};return!1===r.async?o():setTimeout(o),!0}},setRequestHeader:function(t,e){if(e.config.headers[t[0].toLowerCase()]=t[1],n)return!0},addEventListener:function(t,e){var n=this;if(-1!==Vi.indexOf(t[0])){var r=t[1];return ra(e).addEventListener(t[0],(function(e){var o=Xi(e,n);o.type=t[0],o.isTrusted=!0,r.call(n,o)})),!0}},getAllResponseHeaders:function(t,e){var n=e.resHeader;if(n){var r="";for(var o in n)r+=o+": "+n[o]+"\r\n";return r}},getResponseHeader:function(t,e){var n=e.resHeader;if(n)return n[(t[0]||"").toLowerCase()]}},e)}(t,e)}function ra(t){return t.watcher||(t.watcher=document.createElement("a"))}function oa(t,e){var n,r=t.getProxy(),o="on"+e+"_",i=Xi({type:e},r);r[o]&&r[o](i),"function"==typeof Event?n=new Event(e,{bubbles:!1}):(n=document.createEvent("Event")).initEvent(e,!1,!0),ra(t).dispatchEvent(n)}function ia(t){this.xhr=t,this.xhrProxy=t.getProxy()}function aa(t){function e(t){ia.call(this,t)}return e.prototype=Object.create(ia.prototype),e.prototype.next=t,e}ia.prototype=Object.create({resolve:function(t){var e=this.xhrProxy,n=this.xhr;e.readyState=4,n.resHeader=t.headers,e.response=e.responseText=t.response,e.statusText=t.statusText,e.status=t.status,oa(n,ta),oa(n,Yi),oa(n,Ki)},reject:function(t){this.xhrProxy.status=0,oa(this.xhr,t.type),oa(this.xhr,Ki)}});var ua=aa((function(t){var e=this.xhr;for(var n in t=t||e.config,e.withCredentials=t.withCredentials,e.open(t.method,t.url,!1!==t.async,t.user,t.password),t.headers)e.setRequestHeader(n,t.headers[n]);e.send(t.body)})),sa=aa((function(t){this.resolve(t)})),ca=aa((function(t){this.reject(t)}));var la={name:"request-plugin",install:function(e){var r=e.hooks,i=e.report,a=i.upload,u=i.bucketUpload;i.beaconUpload,r.init((function(e){var r=function(t){var e,n,r;("string"!=typeof(null==t||null==(e=t.extra)?void 0:e.h)||null!=t&&null!=(n=t.extra)&&null!=(r=n.h)&&r.includes(le))&&a(t)};Mi((function(t,e){var n;if(Array.isArray(null==e||null==(n=e.extra)?void 0:n.resource)){var r,o;if(e.extra.resource=e.extra.resource.filter((function(t){return!("img"!==(null==t?void 0:t.initiatorType)&&"string"==typeof(null==t?void 0:t.url)&&!t.url.includes(le))})),0===(null==(r=e.extra)||null==(o=r.resource)?void 0:o.length))return;u(t,e)}})),function(t,e){try{na({onRequest:function(t,n){var r=t.url,i=Si(r),a=Ii(r,i,e);t.headers="[object Object]"===Object.prototype.toString.call(t.headers)?o({},t.headers,a):a,t.startTime=Date.now(),t.traceparent=i,n.next(t)},onError:function(e,n){var r,o=Date.now(),i=e.config.startTime,a=null==e||null==(r=e.config)?void 0:r.traceparent;Wi(t,{type:Ni.AJAX,traceparent:a,url:e.config.url,xhrError:e,startTime:i,endTime:o}),n.next(e)},onResponse:function(n,r){var o,i=Date.now(),a=n.config.startTime,u=null==n||null==(o=n.config)?void 0:o.traceparent;$i(t,e,{type:Ni.AJAX,traceparent:u,url:n.config.url,xhrResponse:n,startTime:a,endTime:i}),r.next(n)}})}catch(t){console.error(t,"request error")}}(r,e),function(e,r){try{var i=window.fetch;window.fetch=function(){var a=n(t().mark((function n(a,u){var s,c,l,f;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===u&&(u={}),s=String(a instanceof Request?a.url:a),c=Si(s),l=Ii(s,c,r),a instanceof Request?Object.keys(l).forEach((function(t){return a.headers.append(t,l[t])})):u.headers="[object Object]"===Object.prototype.toString.call(u.headers)?o({},u.headers,l):l,f=Date.now(),t.abrupt("return",new Promise((function(t,n){i(a,u).then((function(n){var o=Date.now();$i(e,r,{type:Ni.FETCH,traceparent:c,url:s,fetchResponse:{res:n,input:a,init:u},startTime:f,endTime:o}),t(n)})).catch((function(t){var r=Date.now(),o=Ai(t);Wi(e,{type:Ni.FETCH,traceparent:c,url:s,fetchError:{err:t,input:a,init:u},startTime:f,endTime:r,code:null==o?void 0:o.code,status:null==o?void 0:o.status,path:null==o?void 0:o.path,msg:null==o?void 0:o.msg,message:null==o?void 0:o.message}),n(t)}))})));case 7:case"end":return t.stop()}}),n)})));return function(t,e){return a.apply(this,arguments)}}()}catch(t){console.error(t,"request error")}}(r,e),Ei.getConfig(e)}))}},fa=function(t){return t[t.length-1]},da=function(t){return t.replace(/\\/g,"/")},ha=da("")+"/",pa=function(t){function e(){var e;return(e=t.call(this)||this).errorInfo="",e}i(e,t);var n=e.prototype;return n.parse=function(t,e){if(void 0===e&&(e=0),this.errorInfo="","string"==typeof t){var n=this.rawParse(t).slice(e).map(this.extractEntryMetadata),r=this.errorInfo.split(":"),o=r[0],i=r[1];return{stackList:n,errorInfo:this.errorInfo,type:o,value:i}}var a=this.errorInfo.split(":"),u=a[0],s=a[1];return{stackList:[],errorInfo:this.errorInfo,type:u,value:s}},n.extractEntryMetadata=function(t){var n=e.relativePath(t.file||"");return Object.assign(t,{calleeShort:t.calleeShort||fa((t.callee||"").split(".")),fileShort:e.shortenPath(n),fileName:fa((t.file||"").split("/"))})},e.shortenPath=function(t){return t.replace(/^node_modules\//,"").replace(/^webpack\/bootstrap\//,"")},e.relativePath=function(t){return t.replace(ha,"").replace(/^.*\:\/\/?\/?/,"")},e.isThirdParty=function(t){return"~"===t[0]||"/"===t[0]||0===t.indexOf("node_modules")||0===t.indexOf("webpack/bootstrap")},n.rawParse=function(t){var e=(t||"").split("\n");return e[0]&&(this.errorInfo=e[0]),e.map((function(t){var e,n,r,o,i=[];if((r=(t=t.trim()).match(/at (.+) \((.+)\)/))||(r=t.match(/(.*)@(.*)/)))e=r[1],n="native"===r[2],i=(r[2].match(/(.*):(.+):(.+)/)||[]).slice(1);else{if(!(o=t.match(/^(at\s+)*(.+):([0-9]+):([0-9]+)/)))return;i=o.slice(2)}e&&!i[0]&&("Array"===e.split(".")[0]&&(n=!0));return{callee:e||"",native:n||!1,file:da(i[0]||""),line:parseInt(i[1]||"",10)||void 0,column:parseInt(i[2]||"",10)||void 0}})).filter((function(t){return void 0!==t&&""!==t.file&&!t.file.includes("app-cache-vue")}))},e}(l(Array)),va=["Geetest","geetest","chrome-extension","naver","adsrvr","adsct","facebook","twitter","Twitter","yandex","google","tiktok","contentstack","appsflyer","qbox","contentstack","affec.tv","ethers","ethereum","Ethereum","gstatic.com","stripe.com","scriptcdn.net","/akam","qq.com","vk.com","bidr.io","qbox.me","adx.io","apple.com","cdn-apple","ada.support","[web-sdk-error]"],ma=["Non-Error promise rejection","ResizeObserver","user no permission","onConsoleError","Network Error"],ga=["null","undefined","A client-side exception has occurred","Failed to execute","TypeError"],_a=["bot","spider","ether"],ya={public:["user no permission","login_fail","Cannot create property 'useCache' on string"],resource:["SCRIPT_ERROR","LINK_ERROR","IMG_ERROR"],network:["RequestError","ResponseError","Network Error","Failed to fetch","Ajax ","timeout","Timeout","网络错误","Network request failed","Request failed","ChunkLoadError","Loading","ret_code","retCode"],js:["TypeError","SyntaxError","onerror","UnhandledRejection","Script error","not defined","client-side exception","Failed to execute","insertBefore","removeChild","undefined is not","null is not","of undefined","of null","is undefined","Minified React"],custom:["onConsoleError"]},ba=function(){function t(e){this.message=e,this.message=e||"",this.spider=t.isSpider()?1:0,this.vendor=t.isVendor(this.message)?1:0,this.notConcern=t.isNotConcern(this.message)?1:0,this.danger=t.isDanger(this.message)?1:0,this.subType=function(t){return Object.keys(ya).find((function(e){return ya[e].some((function(e){return null==t?void 0:t.includes(e)}))}))||"js"}(this.message)}return t.prototype.getExtra=function(){return{vendor:this.vendor,not_concern:this.notConcern||this.spider,sub_type:this.subType,danger:this.danger}},t}();ba.isVendor=function(t){var e,n=(null==(e=navigator)?void 0:e.userAgent)||"",r=_a.some((function(t){return n.toLowerCase().includes(t)})),o=va.some((function(e){return null==t?void 0:t.includes(e)}));return r||o},ba.isNotConcern=function(t){return ma.some((function(e){return null==t?void 0:t.includes(e)}))},ba.isDanger=function(t){return ga.some((function(e){return null==t?void 0:t.includes(e)}))},ba.isSpider=function(){var t,e,n=(null==(t=navigator)||null==(e=t.userAgent)?void 0:e.toLowerCase())||"";return _a.some((function(t){return null==n?void 0:n.includes(t)}))};var wa=function(){function t(t){this.u=t,this.initOnerror(),this.initOnunhandledrejection(),this.initAddEventListener(),this.initConsole()}var e=t.prototype;return e.upload=function(t){var e;try{var n,r,i,a=(null==(n=t.newException)||null==(r=n.values)||null==(i=r[0])?void 0:i.value)||"",u=t.message||"",s=JSON.stringify(t.newException)||"";e=new ba(""+u+a+s).getExtra()}catch(t){console.log(t)}this.u(o({},t,{type:"event",extra:e}))},e.initOnerror=function(){var t=new pa,e=this,n=window.onerror;window.onerror=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n&&n.apply(void 0,o);var a=o[0];o[1],o[2],o[3];var u=o[4],s=t.parse(null==u?void 0:u.stack);s.type;var c=s.value,l=s.errorInfo,f=s.stackList,d=f.map((function(t){return{filename:t.file,function:t.callee,in_app:!0,lineno:t.line,colno:t.column}}));if(![l,a,c].includes("Failed to fetch")){var h={message:l||a,newException:{values:[{mechanism:{handled:!1,type:"onerror"},stacktrace:{frames:d},type:c||a,value:c}]}};e.upload(h)}}},e.initOnunhandledrejection=function(){var t=this,e=new pa,n=window.onunhandledrejection;window.onunhandledrejection=function(r){n&&n.call(window,r);var o=r.reason,i=o instanceof Error?o.message:o,a=e.parse(null==o?void 0:o.stack),u=a.type,s=a.value,c=a.stackList,l=a.errorInfo;if(![i,u].includes("Failed to fetch")){var f=c.map((function(t){return{filename:t.file,function:t.callee,in_app:!0,lineno:t.line,colno:t.column}})),d={message:u||l||"UnhandledRejection",newException:{values:[{mechanism:{handled:!1,synthetic:!0,type:"onunhandledrejection"},stacktrace:{frames:f},type:u||"UnhandledRejection",value:s||"Non-Error promise rejection "+JSON.stringify(i)}]}};t.upload(d)}}},e.initConsole=function(){var t=window.console.error,e=this,n=new pa;window.console.error=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t.apply(window,o);var a=[],u="onConsoleError";if(Array.prototype.slice.apply(o).forEach((function(t){if(null!=t&&t.stack){var e=t instanceof Error?t.message:t,r=n.parse(null==t?void 0:t.stack),o=r.type,i=r.value,s=r.stackList,c=r.errorInfo;u+=c||o;var l=s.map((function(t){return{filename:t.file,function:t.callee,in_app:!0,lineno:t.line,colno:t.column}}));"Failed to fetch"!==e&&a.push({mechanism:{handled:!1,type:"onConsoleError"},stacktrace:{frames:l},type:o,value:e||i})}else u+=JSON.stringify(t)||"onConsoleError",a.push({mechanism:{handled:!1,type:"onConsoleError"},type:"onConsoleError",value:JSON.stringify(t)})})),a.length>0){var s={message:u,newException:{values:a}};e.upload(s)}}},e.initAddEventListener=function(){var t=this;window.addEventListener("error",(function(e){var n,r=e.target||e.srcElement;if(!(r instanceof HTMLScriptElement||r instanceof HTMLLinkElement||r instanceof HTMLImageElement))return!1;n=r instanceof HTMLLinkElement?r.href:r.src;var o=(r.tagName||"")+"_ERROR",i={message:o,newException:{values:[{mechanism:{handled:!1,type:o},type:o,value:n}]}};t.upload(i)}),!0)},t}(),Ea=[],xa={},ka={name:"js-error-plugin",install:function(t){var e=t.report,n=e.upload;e.beaconUpload;var r=t.getConfig;new wa((function(t){var e,o=r().ignoreErrors;if(Array.isArray(o)&&o.some((function(e){var n;return"string"==typeof(null==t?void 0:t.message)&&(null==t||null==(n=t.message)?void 0:n.includes(e))})))return;var i=(null==t?void 0:t.message)+" "+(null==t||null==(e=t.extra)?void 0:e.t);if(!Ea.some((function(t){return i.includes(t)}))){var a=(new Date).toISOString().split(":");a.pop();var u=a.join(":"),s=xa[u]||0;s>=20||(xa[u]=s+1,fe&&console.debug("[error]",t),n(t))}}))}},Oa=function(){};function Ta(){return Oa}function Sa(t){return t.reverse().filter((function(t){return t!==document&&t!==window})).map((function(t){return t.id?t.nodeName.toLowerCase()+"#"+t.id:t.className&&"string"==typeof t.className?t.nodeName.toLowerCase()+"."+t.className.split(" ").join("."):t.nodeName.toLowerCase()})).join(" ")}["click","touchstart","mousedown","keydown","mouseover"].forEach((function(t){document.addEventListener(t,(function(t){Oa=t}),{capture:!0,passive:!0})}));var ja={name:"long-task-plugin",install:function(t){var e=t.report.beaconUpload;PerformanceObserver&&new PerformanceObserver((function(t){t.getEntries().forEach((function(t){if(t.duration>1e3){var n=Ta(),r=n?function(t){if(Array.isArray(t))return Sa(t);for(var e=[];t;)e.push(t),t=t.parentNode;return Sa(e)}(n.path||n.target):"";requestIdleCallback((function(){e({type:"custom",extra:{t:"LONG_TASK",ext:{kind:"experience",type:"longTask",eventType:n?n.type:"",duration:t.duration,startTime:t.startTime,selector:r}}})}))}}))})).observe({entryTypes:["longtask"]})}},Aa={name:"channel-plugin",data:{isNotIntroduced:!1},install:function(t){var e,n=this,r=t.report.beaconUpload;!function(t){t.TIMEOUT="timeout",t.UNLOAD="unload"}(e||(e={}));var o,i,a=function(){return void 0===window.DataPoolAttribution},u=function(t){n.data.isNotIntroduced||(n.data.isNotIntroduced=!0,r({type:"custom",extra:{t:"ATTRIBUTION_NOT_INTRODUCED",target:t}}))}.bind(this),s=(void 0===(o=15e3)&&(o=0),void 0===(i=10)&&(i=1),function(t){return new Promise((function(e,n){var r=0;!function a(){r+=1,t()?e():r>=i?n():setTimeout(a,o)}()}))});setTimeout((function(){Qt((function(){a()&&u(e.UNLOAD)}))}),1e4),Yt((function(){s((function(){return!a()})).catch((function(){return u(e.TIMEOUT)}))}))}},Ia=function(){return Oe.Date.now()},La=Math.max,za=Math.min;function Na(t,e,n){var r,o,i,a,u,s,c=0,l=!1,f=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){var n=r,i=o;return r=o=void 0,c=e,a=t.apply(i,n)}function p(t){return c=t,u=setTimeout(m,e),l?h(t):a}function v(t){var n=t-s;return void 0===s||n>=e||n<0||f&&t-c>=i}function m(){var t=Ia();if(v(t))return g(t);u=setTimeout(m,function(t){var n=e-(t-s);return f?za(n,i-(t-c)):n}(t))}function g(t){return u=void 0,d&&r?h(t):(r=o=void 0,a)}function _(){var t=Ia(),n=v(t);if(r=arguments,o=this,s=t,n){if(void 0===u)return p(s);if(f)return clearTimeout(u),u=setTimeout(m,e),h(s)}return void 0===u&&(u=setTimeout(m,e)),a}return e=vi(e)||0,Ce(n)&&(l=!!n.leading,i=(f="maxWait"in n)?La(vi(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d),_.cancel=function(){void 0!==u&&clearTimeout(u),c=0,r=s=o=u=void 0},_.flush=function(){return void 0===u?a:g(Ia())},_}var Ca=function(){return Gr[Cr.Empty].filter((function(t){return""===t.innerText&&!Vr(t)}))},Ra=function(t){function e(e){var n;return(n=t.call(this,e,oo)||this).collect=function(){var t=Ca(),e=t.map((function(t){return o({},Kr.getDomInfo(t),{detectType:Cr.Empty})}));(null==t?void 0:t.length)>0&&(n.reportInBatch(e),fe&&console.debug("[empty]",t,e))},n.detect=function(){Jr(document.body,Cr.Empty),n.run()},n.run=$r(n.collect,1500,5e3),n}return i(e,t),e}(Kr),Pa=new WeakMap,Ua=function(){var t=Gr[Cr.Hidden].filter((function(t){var e=function(t){var e=t.getBoundingClientRect();e.width,e.height;var n=window,r=n.innerWidth,o=n.innerHeight,i=Math.max(0,e.left),a=Math.max(0,e.top),u=Math.min(r,e.right),s=Math.min(o,e.bottom);return{left:i,top:a,right:u,bottom:s,width:u-i,height:s-a}}(t);if(e.width>0&&e.height>0){var n=function(t,e){void 0===e&&(e=6);for(var n=t.width,r=t.height,o=[],i=Math.random(),a=Math.floor(n/e),u=Math.floor(r/e),s=i*a,c=i*u,l=0;l+s<n;l+=a)for(var f=0;f+c<r;f+=u)o.push({x:t.left+l+s,y:t.top+f+c});return o}(e).some((function(e){var n=document.elementFromPoint(e.x,e.y),r=!Xr(n,t);return r&&Pa.set(t,n),r}));return n}return!1}));return t},Ma=function(t){function e(e){var n;return(n=t.call(this,e,ao)||this).collect=function(){var t=Ua(),e=t.map((function(t){var e=Kr.getDomInfo(t),n=Pa.get(t);return o({},e,n?Kr.getDom2Info(n):{},{detectType:Cr.Hidden})}));(null==t?void 0:t.length)>0&&(n.reportInBatch(e),fe&&console.debug("[hidden]",t,e))},n.detect=function(){Jr(document.body,Cr.Hidden),n.run()},n.run=$r(n.collect,1500,5e3),n}return i(e,t),e}(Kr),Ba=new WeakMap,Da=new WeakMap,Ha=function(t){function e(e){var n;return(n=t.call(this,e,io)||this).detect=function(){Jr(document.body,Cr.Changed);var t=Gr[Cr.Changed].filter((function(t){var e,n=(null==(e=t.dataset)?void 0:e.freeze)||"innerText",r=Ba.get(t);if(n){var o,i=null==(o=t[n])?void 0:o.trim();return Ba.set(t,i),Da.set(t,{currentValue:i,oldValue:r}),!!r&&r!==i}return!1}))||[],e=t.map((function(t){return o({},Kr.getDomInfo(t),Da.get(t),{detectType:Cr.Changed})}));(null==t?void 0:t.length)>0&&(n.reportInBatch(e),fe&&console.debug("[changed]",t,e))},n}return i(e,t),e}(Kr),Fa=function(t){function e(e,n){var r;return(r=t.call(this,e,uo)||this).reported=!1,r.setPaintUpload=function(t){r.paintUpload=t},r.mark=function(){var t=Gr[Cr.Paint]||[];performance.mark(""+r.count),t.forEach((function(t){var e;(null==t||null==(e=t.dataset)?void 0:e.mut)||t.getAttribute("data-mut")||(t.dataset.mut=""+r.count)})),r.count++},r.register=function(){window.addEventListener("click",(function(){r.collect()}),!1),window.addEventListener("scroll",(function(){r.collect()}),!1)},r.reportPaint=function(t){r.report(t);var e=Wo({extra:{domPath:t.domPath,paints:{newLcp:t.value},rating:{newLcp:"normal"}}});null==r.paintUpload||r.paintUpload(e),fe&&console.debug("[paint]",t,e)},r.collect=function(){if(!r.reported){var t,e,n=(t=Gr[Cr.Paint],e=Yr(t),{nodes:t,node:o({},null!=e&&e.node?Kr.getDomInfo(null==e?void 0:e.node):{},{value:null==e?void 0:e.value,detectType:Cr.Paint})}).node;(null==n?void 0:n.value)>0&&(r.reportPaint(n),r.reported=!0)}},r.detect=function(){Jr(document.body,Cr.Paint);try{r.mark()}catch(t){console.error(t)}},n&&(r.paintUpload=n),r.count=0,r.register(),r}return i(e,t),e}(Kr),qa={name:"detect-plugin",install:function(t){var e=t.report,n=e.upload,r=e.bucketUpload,i=t.hooks,a=new Ra(n),u=new Ma(n),s=new Ha(n),c=new Fa(n),l=Na((function(){a.detect(),u.detect(),s.detect()}),300);new MutationObserver((function(){c.detect()})).observe(document.documentElement,{subtree:!0,childList:!0}),window.addEventListener("DOMContentLoaded",(function(){l(),new MutationObserver((function(){l()})).observe(document.querySelector("body"),{subtree:!0,attributes:!0,characterData:!0,childList:!0})})),i.init((function(t){c.setPaintUpload((function(e){var n=Ko(t);r(Qo,o({},e,{extra:o({},(null==e?void 0:e.extra)||{},{firstVisit:n})}))}))}))}},Ga=function(){for(var t=document.querySelectorAll("script"),e=/monitor/,n=/.*(?:\?|&)id=(\d+).*/,r=0,o=t.length;r<o;r++){var i=t[r].src;if(e.test(i))return n.test(i)?i.replace(n,"$1"):window.appId||""}return window.appId||""}(),Ja=new Ir({appId:Ga});return pe.emit(ce.MONITOR_READY),Ja.use(Lr).use(Fr).use(Zo).use(la).use(ka).use(ja).use(Aa).use(qa),new Proxy(Ja,{get:function(t,e){if(void 0===t[e]){var n=t.report[e];if(void 0===n)return;return"function"==typeof n?n.bind(t.report):n}return"extend"===e?function(e,n){if("function"!=typeof n)throw new Error("extend 类型应该为 Function");return t.extend(e,n)}:t[e]}})}));
//# sourceMappingURL=monitor.latest.js.map