@datarangers/sdk-javascript 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r,n,i=function(t){return t&&t.Math==Math&&t},o=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")(),s=function(t){try{return!!t()}catch(t){return!0}},a=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=!s((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),u=Function.prototype.call,h=c?u.bind(u):function(){return u.apply(u,arguments)},l={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,p={f:f&&!l.call({1:2},1)?function(t){var e=f(this,t);return!!e&&e.enumerable}:l},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g=Function.prototype,v=g.bind,m=g.call,y=c&&v.bind(m,m),b=c?function(t){return t&&y(t)}:function(t){return t&&function(){return m.apply(t,arguments)}},_=b({}.toString),E=b("".slice),w=function(t){return E(_(t),8,-1)},S=o.Object,T=b("".split),A=s((function(){return!S("z").propertyIsEnumerable(0)}))?function(t){return"String"==w(t)?T(t,""):S(t)}:S,k=o.TypeError,x=function(t){if(null==t)throw k("Can't call method on "+t);return t},O=function(t){return A(x(t))},I=function(t){return"function"==typeof t},R=function(t){return"object"==typeof t?null!==t:I(t)},D=function(t){return I(t)?t:void 0},M=function(t,e){return arguments.length<2?D(o[t]):o[t]&&o[t][e]},C=b({}.isPrototypeOf),P=M("navigator","userAgent")||"",B=o.process,L=o.Deno,G=B&&B.versions||L&&L.version,U=G&&G.v8;U&&(n=(r=U.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&P&&(!(r=P.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=P.match(/Chrome\/(\d+)/))&&(n=+r[1]);var N=n,F=!!Object.getOwnPropertySymbols&&!s((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&N&&N<41})),j=F&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,z=o.Object,V=j?function(t){return"symbol"==typeof t}:function(t){var e=M("Symbol");return I(e)&&C(e.prototype,z(t))},q=o.String,H=function(t){try{return q(t)}catch(t){return"Object"}},K=o.TypeError,W=function(t){if(I(t))return t;throw K(H(t)+" is not a function")},J=function(t,e){var r=t[e];return null==r?void 0:W(r)},$=o.TypeError,Y=Object.defineProperty,X=function(t,e){try{Y(o,t,{value:e,configurable:!0,writable:!0})}catch(r){o[t]=e}return e},Z=o["__core-js_shared__"]||X("__core-js_shared__",{}),Q=e((function(t){(t.exports=function(t,e){return Z[t]||(Z[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.6",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.6/LICENSE",source:"https://github.com/zloirock/core-js"})})),tt=o.Object,et=function(t){return tt(x(t))},rt=b({}.hasOwnProperty),nt=Object.hasOwn||function(t,e){return rt(et(t),e)},it=0,ot=Math.random(),st=b(1..toString),at=function(t){return"Symbol("+(void 0===t?"":t)+")_"+st(++it+ot,36)},ct=Q("wks"),ut=o.Symbol,ht=ut&&ut.for,lt=j?ut:ut&&ut.withoutSetter||at,ft=function(t){if(!nt(ct,t)||!F&&"string"!=typeof ct[t]){var e="Symbol."+t;F&&nt(ut,t)?ct[t]=ut[t]:ct[t]=j&&ht?ht(e):lt(e)}return ct[t]},pt=o.TypeError,dt=ft("toPrimitive"),gt=function(t,e){if(!R(t)||V(t))return t;var r,n=J(t,dt);if(n){if(void 0===e&&(e="default"),r=h(n,t,e),!R(r)||V(r))return r;throw pt("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&I(r=t.toString)&&!R(n=h(r,t)))return n;if(I(r=t.valueOf)&&!R(n=h(r,t)))return n;if("string"!==e&&I(r=t.toString)&&!R(n=h(r,t)))return n;throw $("Can't convert object to primitive value")}(t,e)},vt=function(t){var e=gt(t,"string");return V(e)?e:e+""},mt=o.document,yt=R(mt)&&R(mt.createElement),bt=function(t){return yt?mt.createElement(t):{}},_t=!a&&!s((function(){return 7!=Object.defineProperty(bt("div"),"a",{get:function(){return 7}}).a})),Et=Object.getOwnPropertyDescriptor,wt={f:a?Et:function(t,e){if(t=O(t),e=vt(e),_t)try{return Et(t,e)}catch(t){}if(nt(t,e))return d(!h(p.f,t,e),t[e])}},St=a&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Tt=o.String,At=o.TypeError,kt=function(t){if(R(t))return t;throw At(Tt(t)+" is not an object")},xt=o.TypeError,Ot=Object.defineProperty,It=Object.getOwnPropertyDescriptor,Rt={f:a?St?function(t,e,r){if(kt(t),e=vt(e),kt(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=It(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Ot(t,e,r)}:Ot:function(t,e,r){if(kt(t),e=vt(e),kt(r),_t)try{return Ot(t,e,r)}catch(t){}if("get"in r||"set"in r)throw xt("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},Dt=a?function(t,e,r){return Rt.f(t,e,d(1,r))}:function(t,e,r){return t[e]=r,t},Mt=Function.prototype,Ct=a&&Object.getOwnPropertyDescriptor,Pt=nt(Mt,"name"),Bt={EXISTS:Pt,PROPER:Pt&&"something"===function(){}.name,CONFIGURABLE:Pt&&(!a||a&&Ct(Mt,"name").configurable)},Lt=b(Function.toString);I(Z.inspectSource)||(Z.inspectSource=function(t){return Lt(t)});var Gt,Ut,Nt,Ft=Z.inspectSource,jt=o.WeakMap,zt=I(jt)&&/native code/.test(Ft(jt)),Vt=Q("keys"),qt=function(t){return Vt[t]||(Vt[t]=at(t))},Ht={},Kt=o.TypeError,Wt=o.WeakMap;if(zt||Z.state){var Jt=Z.state||(Z.state=new Wt),$t=b(Jt.get),Yt=b(Jt.has),Xt=b(Jt.set);Gt=function(t,e){if(Yt(Jt,t))throw new Kt("Object already initialized");return e.facade=t,Xt(Jt,t,e),e},Ut=function(t){return $t(Jt,t)||{}},Nt=function(t){return Yt(Jt,t)}}else{var Zt=qt("state");Ht[Zt]=!0,Gt=function(t,e){if(nt(t,Zt))throw new Kt("Object already initialized");return e.facade=t,Dt(t,Zt,e),e},Ut=function(t){return nt(t,Zt)?t[Zt]:{}},Nt=function(t){return nt(t,Zt)}}var Qt={set:Gt,get:Ut,has:Nt,enforce:function(t){return Nt(t)?Ut(t):Gt(t,{})},getterFor:function(t){return function(e){var r;if(!R(e)||(r=Ut(e)).type!==t)throw Kt("Incompatible receiver, "+t+" required");return r}}},te=e((function(t){var e=Bt.CONFIGURABLE,r=Qt.enforce,n=Qt.get,i=Object.defineProperty,o=a&&!s((function(){return 8!==i((function(){}),"length",{value:8}).length})),c=String(String).split("String"),u=t.exports=function(t,n,s){if("Symbol("===String(n).slice(0,7)&&(n="["+String(n).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),s&&s.getter&&(n="get "+n),s&&s.setter&&(n="set "+n),(!nt(t,"name")||e&&t.name!==n)&&i(t,"name",{value:n,configurable:!0}),o&&s&&nt(s,"arity")&&t.length!==s.arity&&i(t,"length",{value:s.arity}),s&&nt(s,"constructor")&&s.constructor){if(a)try{i(t,"prototype",{writable:!1})}catch(t){}}else t.prototype=void 0;var u=r(t);return nt(u,"source")||(u.source=c.join("string"==typeof n?n:"")),t};Function.prototype.toString=u((function(){return I(this)&&n(this).source||Ft(this)}),"toString")})),ee=function(t,e,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:e;return I(r)&&te(r,o,n),n.global?i?t[e]=r:X(e,r):(n.unsafe?t[e]&&(i=!0):delete t[e],i?t[e]=r:Dt(t,e,r)),t},re=Math.ceil,ne=Math.floor,ie=Math.trunc||function(t){var e=+t;return(e>0?ne:re)(e)},oe=function(t){var e=+t;return e!=e||0===e?0:ie(e)},se=Math.max,ae=Math.min,ce=function(t,e){var r=oe(t);return r<0?se(r+e,0):ae(r,e)},ue=Math.min,he=function(t){return t>0?ue(oe(t),9007199254740991):0},le=function(t){return he(t.length)},fe=function(t){return function(e,r,n){var i,o=O(e),s=le(o),a=ce(n,s);if(t&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},pe={includes:fe(!0),indexOf:fe(!1)},de=pe.indexOf,ge=b([].push),ve=function(t,e){var r,n=O(t),i=0,o=[];for(r in n)!nt(Ht,r)&&nt(n,r)&&ge(o,r);for(;e.length>i;)nt(n,r=e[i++])&&(~de(o,r)||ge(o,r));return o},me=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ye=me.concat("length","prototype"),be={f:Object.getOwnPropertyNames||function(t){return ve(t,ye)}},_e={f:Object.getOwnPropertySymbols},Ee=b([].concat),we=M("Reflect","ownKeys")||function(t){var e=be.f(kt(t)),r=_e.f;return r?Ee(e,r(t)):e},Se=function(t,e,r){for(var n=we(e),i=Rt.f,o=wt.f,s=0;s<n.length;s++){var a=n[s];nt(t,a)||r&&nt(r,a)||i(t,a,o(e,a))}},Te=/#|\.prototype\./,Ae=function(t,e){var r=xe[ke(t)];return r==Ie||r!=Oe&&(I(e)?s(e):!!e)},ke=Ae.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},xe=Ae.data={},Oe=Ae.NATIVE="N",Ie=Ae.POLYFILL="P",Re=Ae,De=wt.f,Me=function(t,e){var r,n,i,s,a,c=t.target,u=t.global,h=t.stat;if(r=u?o:h?o[c]||X(c,{}):(o[c]||{}).prototype)for(n in e){if(s=e[n],i=t.dontCallGetSet?(a=De(r,n))&&a.value:r[n],!Re(u?n:c+(h?".":"#")+n,t.forced)&&void 0!==i){if(typeof s==typeof i)continue;Se(s,i)}(t.sham||i&&i.sham)&&Dt(s,"sham",!0),ee(r,n,s,t)}},Ce=b(b.bind),Pe=function(t,e){return W(t),void 0===e?t:c?Ce(t,e):function(){return t.apply(e,arguments)}},Be=Array.isArray||function(t){return"Array"==w(t)},Le={};Le[ft("toStringTag")]="z";var Ge="[object z]"===String(Le),Ue=ft("toStringTag"),Ne=o.Object,Fe="Arguments"==w(function(){return arguments}()),je=Ge?w:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Ne(t),Ue))?r:Fe?w(e):"Object"==(n=w(e))&&I(e.callee)?"Arguments":n},ze=function(){},Ve=[],qe=M("Reflect","construct"),He=/^\s*(?:class|function)\b/,Ke=b(He.exec),We=!He.exec(ze),Je=function(t){if(!I(t))return!1;try{return qe(ze,Ve,t),!0}catch(t){return!1}},$e=function(t){if(!I(t))return!1;switch(je(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return We||!!Ke(He,Ft(t))}catch(t){return!0}};$e.sham=!0;var Ye=!qe||s((function(){var t;return Je(Je.call)||!Je(Object)||!Je((function(){t=!0}))||t}))?$e:Je,Xe=ft("species"),Ze=o.Array,Qe=function(t,e){return new(function(t){var e;return Be(t)&&(e=t.constructor,(Ye(e)&&(e===Ze||Be(e.prototype))||R(e)&&null===(e=e[Xe]))&&(e=void 0)),void 0===e?Ze:e}(t))(0===e?0:e)},tr=b([].push),er=function(t){var e=1==t,r=2==t,n=3==t,i=4==t,o=6==t,s=7==t,a=5==t||o;return function(c,u,h,l){for(var f,p,d=et(c),g=A(d),v=Pe(u,h),m=le(g),y=0,b=l||Qe,_=e?b(c,m):r||s?b(c,0):void 0;m>y;y++)if((a||y in g)&&(p=v(f=g[y],y,d),t))if(e)_[y]=p;else if(p)switch(t){case 3:return!0;case 5:return f;case 6:return y;case 2:tr(_,f)}else switch(t){case 4:return!1;case 7:tr(_,f)}return o?-1:n||i?i:_}},rr={forEach:er(0),map:er(1),filter:er(2),some:er(3),every:er(4),find:er(5),findIndex:er(6),filterReject:er(7)},nr=function(t,e){var r=[][t];return!!r&&s((function(){r.call(null,e||function(){return 1},1)}))},ir=rr.forEach,or=nr("forEach")?[].forEach:function(t){return ir(this,t,arguments.length>1?arguments[1]:void 0)};Me({target:"Array",proto:!0,forced:[].forEach!=or},{forEach:or});var sr=pe.indexOf,ar=b([].indexOf),cr=!!ar&&1/ar([1],1,-0)<0,ur=nr("indexOf");Me({target:"Array",proto:!0,forced:cr||!ur},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return cr?ar(this,t,e)||0:sr(this,t,e)}}),Me({target:"Array",stat:!0},{isArray:Be});var hr,lr=Object.keys||function(t){return ve(t,me)},fr=a&&!St?Object.defineProperties:function(t,e){kt(t);for(var r,n=O(e),i=lr(e),o=i.length,s=0;o>s;)Rt.f(t,r=i[s++],n[r]);return t},pr={f:fr},dr=M("document","documentElement"),gr=qt("IE_PROTO"),vr=function(){},mr=function(t){return"<script>"+t+"<\/script>"},yr=function(t){t.write(mr("")),t.close();var e=t.parentWindow.Object;return t=null,e},br=function(){try{hr=new ActiveXObject("htmlfile")}catch(t){}var t,e;br="undefined"!=typeof document?document.domain&&hr?yr(hr):((e=bt("iframe")).style.display="none",dr.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(mr("document.F=Object")),t.close(),t.F):yr(hr);for(var r=me.length;r--;)delete br.prototype[me[r]];return br()};Ht[gr]=!0;var _r=Object.create||function(t,e){var r;return null!==t?(vr.prototype=kt(t),r=new vr,vr.prototype=null,r[gr]=t):r=br(),void 0===e?r:pr.f(r,e)},Er=Rt.f,wr=ft("unscopables"),Sr=Array.prototype;null==Sr[wr]&&Er(Sr,wr,{configurable:!0,value:_r(null)});var Tr,Ar,kr,xr=function(t){Sr[wr][t]=!0},Or={},Ir=!s((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Rr=qt("IE_PROTO"),Dr=o.Object,Mr=Dr.prototype,Cr=Ir?Dr.getPrototypeOf:function(t){var e=et(t);if(nt(e,Rr))return e[Rr];var r=e.constructor;return I(r)&&e instanceof r?r.prototype:e instanceof Dr?Mr:null},Pr=ft("iterator"),Br=!1;[].keys&&("next"in(kr=[].keys())?(Ar=Cr(Cr(kr)))!==Object.prototype&&(Tr=Ar):Br=!0);var Lr=null==Tr||s((function(){var t={};return Tr[Pr].call(t)!==t}));Lr&&(Tr={}),I(Tr[Pr])||ee(Tr,Pr,(function(){return this}));var Gr={IteratorPrototype:Tr,BUGGY_SAFARI_ITERATORS:Br},Ur=Rt.f,Nr=ft("toStringTag"),Fr=function(t,e,r){t&&!r&&(t=t.prototype),t&&!nt(t,Nr)&&Ur(t,Nr,{configurable:!0,value:e})},jr=Gr.IteratorPrototype,zr=function(){return this},Vr=function(t,e,r,n){var i=e+" Iterator";return t.prototype=_r(jr,{next:d(+!n,r)}),Fr(t,i,!1),Or[i]=zr,t},qr=o.String,Hr=o.TypeError,Kr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=b(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return kt(r),function(t){if("object"==typeof t||I(t))return t;throw Hr("Can't set "+qr(t)+" as a prototype")}(n),e?t(r,n):r.__proto__=n,r}}():void 0),Wr=Bt.PROPER,Jr=Bt.CONFIGURABLE,$r=Gr.IteratorPrototype,Yr=Gr.BUGGY_SAFARI_ITERATORS,Xr=ft("iterator"),Zr=function(){return this},Qr=function(t,e,r,n,i,o,s){Vr(r,e,n);var a,c,u,l=function(t){if(t===i&&v)return v;if(!Yr&&t in d)return d[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},f=e+" Iterator",p=!1,d=t.prototype,g=d[Xr]||d["@@iterator"]||i&&d[i],v=!Yr&&g||l(i),m="Array"==e&&d.entries||g;if(m&&(a=Cr(m.call(new t)))!==Object.prototype&&a.next&&(Cr(a)!==$r&&(Kr?Kr(a,$r):I(a[Xr])||ee(a,Xr,Zr)),Fr(a,f,!0)),Wr&&"values"==i&&g&&"values"!==g.name&&(Jr?Dt(d,"name","values"):(p=!0,v=function(){return h(g,this)})),i)if(c={values:l("values"),keys:o?v:l("keys"),entries:l("entries")},s)for(u in c)(Yr||p||!(u in d))&&ee(d,u,c[u]);else Me({target:e,proto:!0,forced:Yr||p},c);return d[Xr]!==v&&ee(d,Xr,v,{name:i}),Or[e]=v,c},tn=Rt.f,en=Qt.set,rn=Qt.getterFor("Array Iterator"),nn=Qr(Array,"Array",(function(t,e){en(this,{type:"Array Iterator",target:O(t),index:0,kind:e})}),(function(){var t=rn(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),on=Or.Arguments=Or.Array;if(xr("keys"),xr("values"),xr("entries"),a&&"values"!==on.name)try{tn(on,"name",{value:"values"})}catch(t){}var sn=b([].join),an=A!=Object,cn=nr("join",",");Me({target:"Array",proto:!0,forced:an||!cn},{join:function(t){return sn(O(this),void 0===t?",":t)}});var un=o.TypeError,hn=function(t){return function(e,r,n,i){W(r);var o=et(e),s=A(o),a=le(o),c=t?a-1:0,u=t?-1:1;if(n<2)for(;;){if(c in s){i=s[c],c+=u;break}if(c+=u,t?c<0:a<=c)throw un("Reduce of empty array with no initial value")}for(;t?c>=0:a>c;c+=u)c in s&&(i=r(i,s[c],c,o));return i}},ln={left:hn(!1),right:hn(!0)},fn="process"==w(o.process),pn=ln.left,dn=nr("reduce");Me({target:"Array",proto:!0,forced:!dn||!fn&&N>79&&N<83},{reduce:function(t){var e=arguments.length;return pn(this,t,e,e>1?arguments[1]:void 0)}});var gn=b([].reverse),vn=[1,2];Me({target:"Array",proto:!0,forced:String(vn)===String(vn.reverse())},{reverse:function(){return Be(this)&&(this.length=this.length),gn(this)}});var mn=function(t,e,r){var n=vt(e);n in t?Rt.f(t,n,d(0,r)):t[n]=r},yn=ft("species"),bn=function(t){return N>=51||!s((function(){var e=[];return(e.constructor={})[yn]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},_n=b([].slice),En=bn("slice"),wn=ft("species"),Sn=o.Array,Tn=Math.max;Me({target:"Array",proto:!0,forced:!En},{slice:function(t,e){var r,n,i,o=O(this),s=le(o),a=ce(t,s),c=ce(void 0===e?s:e,s);if(Be(o)&&(r=o.constructor,(Ye(r)&&(r===Sn||Be(r.prototype))||R(r)&&null===(r=r[wn]))&&(r=void 0),r===Sn||void 0===r))return _n(o,a,c);for(n=new(void 0===r?Sn:r)(Tn(c-a,0)),i=0;a<c;a++,i++)a in o&&mn(n,i,o[a]);return n.length=i,n}});var An="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,kn=function(t,e,r){for(var n in e)ee(t,n,e[n],r);return t},xn=o.TypeError,On=function(t,e){if(C(e,t))return t;throw xn("Incorrect invocation")},In=o.RangeError,Rn=function(t){if(void 0===t)return 0;var e=oe(t),r=he(e);if(e!==r)throw In("Wrong length or index");return r},Dn=o.Array,Mn=Math.abs,Cn=Math.pow,Pn=Math.floor,Bn=Math.log,Ln=Math.LN2,Gn=function(t,e,r){var n,i,o,s=Dn(r),a=8*r-e-1,c=(1<<a)-1,u=c>>1,h=23===e?Cn(2,-24)-Cn(2,-77):0,l=t<0||0===t&&1/t<0?1:0,f=0;for((t=Mn(t))!=t||t===1/0?(i=t!=t?1:0,n=c):(n=Pn(Bn(t)/Ln),t*(o=Cn(2,-n))<1&&(n--,o*=2),(t+=n+u>=1?h/o:h*Cn(2,1-u))*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(t*o-1)*Cn(2,e),n+=u):(i=t*Cn(2,u-1)*Cn(2,e),n=0));e>=8;)s[f++]=255&i,i/=256,e-=8;for(n=n<<e|i,a+=e;a>0;)s[f++]=255&n,n/=256,a-=8;return s[--f]|=128*l,s},Un=function(t,e){var r,n=t.length,i=8*n-e-1,o=(1<<i)-1,s=o>>1,a=i-7,c=n-1,u=t[c--],h=127&u;for(u>>=7;a>0;)h=256*h+t[c--],a-=8;for(r=h&(1<<-a)-1,h>>=-a,a+=e;a>0;)r=256*r+t[c--],a-=8;if(0===h)h=1-s;else{if(h===o)return r?NaN:u?-1/0:1/0;r+=Cn(2,e),h-=s}return(u?-1:1)*r*Cn(2,h-e)},Nn=function(t){for(var e=et(this),r=le(e),n=arguments.length,i=ce(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,s=void 0===o?r:ce(o,r);s>i;)e[i++]=t;return e},Fn=o.Array,jn=Math.max,zn=function(t,e,r){for(var n=le(t),i=ce(e,n),o=ce(void 0===r?n:r,n),s=Fn(jn(o-i,0)),a=0;i<o;i++,a++)mn(s,a,t[i]);return s.length=a,s},Vn=be.f,qn=Rt.f,Hn=Bt.PROPER,Kn=Bt.CONFIGURABLE,Wn=Qt.get,Jn=Qt.set,$n=o.ArrayBuffer,Yn=$n,Xn=Yn&&Yn.prototype,Zn=o.DataView,Qn=Zn&&Zn.prototype,ti=Object.prototype,ei=o.Array,ri=o.RangeError,ni=b(Nn),ii=b([].reverse),oi=Gn,si=Un,ai=function(t){return[255&t]},ci=function(t){return[255&t,t>>8&255]},ui=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},hi=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},li=function(t){return oi(t,23,4)},fi=function(t){return oi(t,52,8)},pi=function(t,e){qn(t.prototype,e,{get:function(){return Wn(this)[e]}})},di=function(t,e,r,n){var i=Rn(r),o=Wn(t);if(i+e>o.byteLength)throw ri("Wrong index");var s=Wn(o.buffer).bytes,a=i+o.byteOffset,c=zn(s,a,a+e);return n?c:ii(c)},gi=function(t,e,r,n,i,o){var s=Rn(r),a=Wn(t);if(s+e>a.byteLength)throw ri("Wrong index");for(var c=Wn(a.buffer).bytes,u=s+a.byteOffset,h=n(+i),l=0;l<e;l++)c[u+l]=h[o?l:e-l-1]};if(An){var vi=Hn&&"ArrayBuffer"!==$n.name;if(s((function(){$n(1)}))&&s((function(){new $n(-1)}))&&!s((function(){return new $n,new $n(1.5),new $n(NaN),vi&&!Kn})))vi&&Kn&&Dt($n,"name","ArrayBuffer");else{(Yn=function(t){return On(this,Xn),new $n(Rn(t))}).prototype=Xn;for(var mi,yi=Vn($n),bi=0;yi.length>bi;)(mi=yi[bi++])in Yn||Dt(Yn,mi,$n[mi]);Xn.constructor=Yn}Kr&&Cr(Qn)!==ti&&Kr(Qn,ti);var _i=new Zn(new Yn(2)),Ei=b(Qn.setInt8);_i.setInt8(0,2147483648),_i.setInt8(1,2147483649),!_i.getInt8(0)&&_i.getInt8(1)||kn(Qn,{setInt8:function(t,e){Ei(this,t,e<<24>>24)},setUint8:function(t,e){Ei(this,t,e<<24>>24)}},{unsafe:!0})}else Xn=(Yn=function(t){On(this,Xn);var e=Rn(t);Jn(this,{bytes:ni(ei(e),0),byteLength:e}),a||(this.byteLength=e)}).prototype,Qn=(Zn=function(t,e,r){On(this,Qn),On(t,Xn);var n=Wn(t).byteLength,i=oe(e);if(i<0||i>n)throw ri("Wrong offset");if(i+(r=void 0===r?n-i:he(r))>n)throw ri("Wrong length");Jn(this,{buffer:t,byteLength:r,byteOffset:i}),a||(this.buffer=t,this.byteLength=r,this.byteOffset=i)}).prototype,a&&(pi(Yn,"byteLength"),pi(Zn,"buffer"),pi(Zn,"byteLength"),pi(Zn,"byteOffset")),kn(Qn,{getInt8:function(t){return di(this,1,t)[0]<<24>>24},getUint8:function(t){return di(this,1,t)[0]},getInt16:function(t){var e=di(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=di(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return hi(di(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return hi(di(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return si(di(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return si(di(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){gi(this,1,t,ai,e)},setUint8:function(t,e){gi(this,1,t,ai,e)},setInt16:function(t,e){gi(this,2,t,ci,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){gi(this,2,t,ci,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){gi(this,4,t,ui,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){gi(this,4,t,ui,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){gi(this,4,t,li,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){gi(this,8,t,fi,e,arguments.length>2?arguments[2]:void 0)}});Fr(Yn,"ArrayBuffer"),Fr(Zn,"DataView");var wi={ArrayBuffer:Yn,DataView:Zn},Si=o.TypeError,Ti=function(t){if(Ye(t))return t;throw Si(H(t)+" is not a constructor")},Ai=ft("species"),ki=function(t,e){var r,n=kt(t).constructor;return void 0===n||null==(r=kt(n)[Ai])?e:Ti(r)},xi=wi.ArrayBuffer,Oi=wi.DataView,Ii=Oi.prototype,Ri=b(xi.prototype.slice),Di=b(Ii.getUint8),Mi=b(Ii.setUint8),Ci=s((function(){return!new xi(2).slice(1,void 0).byteLength}));Me({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Ci},{slice:function(t,e){if(Ri&&void 0===e)return Ri(kt(this),t);for(var r=kt(this).byteLength,n=ce(t,r),i=ce(void 0===e?r:e,r),o=new(ki(this,xi))(he(i-n)),s=new Oi(this),a=new Oi(o),c=0;n<i;)Mi(a,c++,Di(s,n++));return o}});var Pi=o.Date,Bi=b(Pi.prototype.getTime);Me({target:"Date",stat:!0},{now:function(){return Bi(new Pi)}});var Li=Date.prototype,Gi=b(Li.toString),Ui=b(Li.getTime);"Invalid Date"!=String(new Date(NaN))&&ee(Li,"toString",(function(){var t=Ui(this);return t==t?Gi(this):"Invalid Date"}));var Ni=Bt.EXISTS,Fi=Rt.f,ji=Function.prototype,zi=b(ji.toString),Vi=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,qi=b(Vi.exec);a&&!Ni&&Fi(ji,"name",{configurable:!0,get:function(){try{return qi(Vi,zi(this))[1]}catch(t){return""}}});var Hi=be.f,Ki="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Wi={f:function(t){return Ki&&"Window"==w(t)?function(t){try{return Hi(t)}catch(t){return zn(Ki)}}(t):Hi(O(t))}},Ji=s((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),$i=Object.isExtensible,Yi=s((function(){$i(1)}))||Ji?function(t){return!!R(t)&&((!Ji||"ArrayBuffer"!=w(t))&&(!$i||$i(t)))}:$i,Xi=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),Zi=e((function(t){var e=Rt.f,r=!1,n=at("meta"),i=0,o=function(t){e(t,n,{value:{objectID:"O"+i++,weakData:{}}})},s=t.exports={enable:function(){s.enable=function(){},r=!0;var t=be.f,e=b([].splice),i={};i[n]=1,t(i).length&&(be.f=function(r){for(var i=t(r),o=0,s=i.length;o<s;o++)if(i[o]===n){e(i,o,1);break}return i},Me({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Wi.f}))},fastKey:function(t,e){if(!R(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!nt(t,n)){if(!Yi(t))return"F";if(!e)return"E";o(t)}return t[n].objectID},getWeakData:function(t,e){if(!nt(t,n)){if(!Yi(t))return!0;if(!e)return!1;o(t)}return t[n].weakData},onFreeze:function(t){return Xi&&r&&Yi(t)&&!nt(t,n)&&o(t),t}};Ht[n]=!0}));Zi.enable,Zi.fastKey,Zi.getWeakData,Zi.onFreeze;var Qi=ft("iterator"),to=Array.prototype,eo=function(t){return void 0!==t&&(Or.Array===t||to[Qi]===t)},ro=ft("iterator"),no=function(t){if(null!=t)return J(t,ro)||J(t,"@@iterator")||Or[je(t)]},io=o.TypeError,oo=function(t,e){var r=arguments.length<2?no(t):e;if(W(r))return kt(h(r,t));throw io(H(t)+" is not iterable")},so=function(t,e,r){var n,i;kt(t);try{if(!(n=J(t,"return"))){if("throw"===e)throw r;return r}n=h(n,t)}catch(t){i=!0,n=t}if("throw"===e)throw r;if(i)throw n;return kt(n),r},ao=o.TypeError,co=function(t,e){this.stopped=t,this.result=e},uo=co.prototype,ho=function(t,e,r){var n,i,o,s,a,c,u,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_ITERATOR),d=!(!r||!r.INTERRUPTED),g=Pe(e,l),v=function(t){return n&&so(n,"normal",t),new co(!0,t)},m=function(t){return f?(kt(t),d?g(t[0],t[1],v):g(t[0],t[1])):d?g(t,v):g(t)};if(p)n=t;else{if(!(i=no(t)))throw ao(H(t)+" is not iterable");if(eo(i)){for(o=0,s=le(t);s>o;o++)if((a=m(t[o]))&&C(uo,a))return a;return new co(!1)}n=oo(t,i)}for(c=n.next;!(u=h(c,n)).done;){try{a=m(u.value)}catch(t){so(n,"throw",t)}if("object"==typeof a&&a&&C(uo,a))return a}return new co(!1)},lo=ft("iterator"),fo=!1;try{var po=0,go={next:function(){return{done:!!po++}},return:function(){fo=!0}};go[lo]=function(){return this},Array.from(go,(function(){throw 2}))}catch(t){}var vo=function(t,e){if(!e&&!fo)return!1;var r=!1;try{var n={};n[lo]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},mo=function(t,e,r){var n,i;return Kr&&I(n=e.constructor)&&n!==r&&R(i=n.prototype)&&i!==r.prototype&&Kr(t,i),t},yo=ft("species"),bo=function(t){var e=M(t),r=Rt.f;a&&e&&!e[yo]&&r(e,yo,{configurable:!0,get:function(){return this}})},_o=Rt.f,Eo=Zi.fastKey,wo=Qt.set,So=Qt.getterFor,To={getConstructor:function(t,e,r,n){var i=t((function(t,i){On(t,o),wo(t,{type:e,index:_r(null),first:void 0,last:void 0,size:0}),a||(t.size=0),null!=i&&ho(i,t[n],{that:t,AS_ENTRIES:r})})),o=i.prototype,s=So(e),c=function(t,e,r){var n,i,o=s(t),c=u(t,e);return c?c.value=r:(o.last=c={index:i=Eo(e,!0),key:e,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=c),n&&(n.next=c),a?o.size++:t.size++,"F"!==i&&(o.index[i]=c)),t},u=function(t,e){var r,n=s(t),i=Eo(e);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==e)return r};return kn(o,{clear:function(){for(var t=s(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,a?t.size=0:this.size=0},delete:function(t){var e=this,r=s(e),n=u(e,t);if(n){var i=n.next,o=n.previous;delete r.index[n.index],n.removed=!0,o&&(o.next=i),i&&(i.previous=o),r.first==n&&(r.first=i),r.last==n&&(r.last=o),a?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=s(this),n=Pe(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!u(this,t)}}),kn(o,r?{get:function(t){var e=u(this,t);return e&&e.value},set:function(t,e){return c(this,0===t?0:t,e)}}:{add:function(t){return c(this,t=0===t?0:t,t)}}),a&&_o(o,"size",{get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=So(e),o=So(n);Qr(t,e,(function(t,e){wo(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),bo(e)}};!function(t,e,r){var n=-1!==t.indexOf("Map"),i=-1!==t.indexOf("Weak"),a=n?"set":"add",c=o[t],u=c&&c.prototype,h=c,l={},f=function(t){var e=b(u[t]);ee(u,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(i&&!R(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return i&&!R(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(i&&!R(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(Re(t,!I(c)||!(i||u.forEach&&!s((function(){(new c).entries().next()})))))h=r.getConstructor(e,t,n,a),Zi.enable();else if(Re(t,!0)){var p=new h,d=p[a](i?{}:-0,1)!=p,g=s((function(){p.has(1)})),v=vo((function(t){new c(t)})),m=!i&&s((function(){for(var t=new c,e=5;e--;)t[a](e,e);return!t.has(-0)}));v||((h=e((function(t,e){On(t,u);var r=mo(new c,t,h);return null!=e&&ho(e,r[a],{that:r,AS_ENTRIES:n}),r}))).prototype=u,u.constructor=h),(g||m)&&(f("delete"),f("has"),n&&f("get")),(m||d)&&f(a),i&&u.clear&&delete u.clear}l[t]=h,Me({global:!0,constructor:!0,forced:h!=c},l),Fr(h,t),i||r.setStrong(h,t,n)}("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),To);var Ao=Object.assign,ko=Object.defineProperty,xo=b([].concat),Oo=!Ao||s((function(){if(a&&1!==Ao({b:1},Ao(ko({},"a",{enumerable:!0,get:function(){ko(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Ao({},t)[r]||lr(Ao({},e)).join("")!=n}))?function(t,e){for(var r=et(t),n=arguments.length,i=1,o=_e.f,s=p.f;n>i;)for(var c,u=A(arguments[i++]),l=o?xo(lr(u),o(u)):lr(u),f=l.length,d=0;f>d;)c=l[d++],a&&!h(s,u,c)||(r[c]=u[c]);return r}:Ao;Me({target:"Object",stat:!0,arity:2,forced:Object.assign!==Oo},{assign:Oo});var Io=Ge?{}.toString:function(){return"[object "+je(this)+"]"};Ge||ee(Object.prototype,"toString",Io,{unsafe:!0});var Ro,Do,Mo,Co,Po=Function.prototype,Bo=Po.apply,Lo=Po.call,Go="object"==typeof Reflect&&Reflect.apply||(c?Lo.bind(Bo):function(){return Lo.apply(Bo,arguments)}),Uo=o.TypeError,No=function(t,e){if(t<e)throw Uo("Not enough arguments");return t},Fo=/(?:ipad|iphone|ipod).*applewebkit/i.test(P),jo=o.setImmediate,zo=o.clearImmediate,Vo=o.process,qo=o.Dispatch,Ho=o.Function,Ko=o.MessageChannel,Wo=o.String,Jo=0,$o={};try{Ro=o.location}catch(t){}var Yo=function(t){if(nt($o,t)){var e=$o[t];delete $o[t],e()}},Xo=function(t){return function(){Yo(t)}},Zo=function(t){Yo(t.data)},Qo=function(t){o.postMessage(Wo(t),Ro.protocol+"//"+Ro.host)};jo&&zo||(jo=function(t){No(arguments.length,1);var e=I(t)?t:Ho(t),r=_n(arguments,1);return $o[++Jo]=function(){Go(e,void 0,r)},Do(Jo),Jo},zo=function(t){delete $o[t]},fn?Do=function(t){Vo.nextTick(Xo(t))}:qo&&qo.now?Do=function(t){qo.now(Xo(t))}:Ko&&!Fo?(Co=(Mo=new Ko).port2,Mo.port1.onmessage=Zo,Do=Pe(Co.postMessage,Co)):o.addEventListener&&I(o.postMessage)&&!o.importScripts&&Ro&&"file:"!==Ro.protocol&&!s(Qo)?(Do=Qo,o.addEventListener("message",Zo,!1)):Do="onreadystatechange"in bt("script")?function(t){dr.appendChild(bt("script")).onreadystatechange=function(){dr.removeChild(this),Yo(t)}}:function(t){setTimeout(Xo(t),0)});var ts,es,rs,ns,is,os,ss,as,cs={set:jo,clear:zo},us=/ipad|iphone|ipod/i.test(P)&&void 0!==o.Pebble,hs=/web0s(?!.*chrome)/i.test(P),ls=wt.f,fs=cs.set,ps=o.MutationObserver||o.WebKitMutationObserver,ds=o.document,gs=o.process,vs=o.Promise,ms=ls(o,"queueMicrotask"),ys=ms&&ms.value;ys||(ts=function(){var t,e;for(fn&&(t=gs.domain)&&t.exit();es;){e=es.fn,es=es.next;try{e()}catch(t){throw es?ns():rs=void 0,t}}rs=void 0,t&&t.enter()},Fo||fn||hs||!ps||!ds?!us&&vs&&vs.resolve?((ss=vs.resolve(void 0)).constructor=vs,as=Pe(ss.then,ss),ns=function(){as(ts)}):fn?ns=function(){gs.nextTick(ts)}:(fs=Pe(fs,o),ns=function(){fs(ts)}):(is=!0,os=ds.createTextNode(""),new ps(ts).observe(os,{characterData:!0}),ns=function(){os.data=is=!is}));var bs=ys||function(t){var e={fn:t,next:void 0};rs&&(rs.next=e),es||(es=e,ns()),rs=e},_s=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Es=function(){this.head=null,this.tail=null};Es.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var ws=Es,Ss=o.Promise,Ts="object"==typeof window&&"object"!=typeof Deno;Ss&&Ss.prototype;var As,ks,xs,Os=ft("species"),Is=!1,Rs=I(o.PromiseRejectionEvent),Ds=Re("Promise",(function(){var t=Ft(Ss),e=t!==String(Ss);if(!e&&66===N)return!0;if(N>=51&&/native code/.test(t))return!1;var r=new Ss((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(r.constructor={})[Os]=n,!(Is=r.then((function(){}))instanceof n)||!e&&Ts&&!Rs})),Ms={CONSTRUCTOR:Ds,REJECTION_EVENT:Rs,SUBCLASSING:Is},Cs=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=W(e),this.reject=W(r)},Ps={f:function(t){return new Cs(t)}},Bs=cs.set,Ls=Ms.CONSTRUCTOR,Gs=Ms.REJECTION_EVENT,Us=Ms.SUBCLASSING,Ns=Qt.getterFor("Promise"),Fs=Qt.set,js=Ss&&Ss.prototype,zs=Ss,Vs=js,qs=o.TypeError,Hs=o.document,Ks=o.process,Ws=Ps.f,Js=Ws,$s=!!(Hs&&Hs.createEvent&&o.dispatchEvent),Ys=function(t){var e;return!(!R(t)||!I(e=t.then))&&e},Xs=function(t,e){var r,n,i,o=e.value,s=1==e.state,a=s?t.ok:t.fail,c=t.resolve,u=t.reject,l=t.domain;try{a?(s||(2===e.rejection&&ra(e),e.rejection=1),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),i=!0)),r===t.promise?u(qs("Promise-chain cycle")):(n=Ys(r))?h(n,r,c,u):c(r)):u(o)}catch(t){l&&!i&&l.exit(),u(t)}},Zs=function(t,e){t.notified||(t.notified=!0,bs((function(){for(var r,n=t.reactions;r=n.get();)Xs(r,t);t.notified=!1,e&&!t.rejection&&ta(t)})))},Qs=function(t,e,r){var n,i;$s?((n=Hs.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),o.dispatchEvent(n)):n={promise:e,reason:r},!Gs&&(i=o["on"+t])?i(n):"unhandledrejection"===t&&function(t,e){var r=o.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))}("Unhandled promise rejection",r)},ta=function(t){h(Bs,o,(function(){var e,r=t.facade,n=t.value;if(ea(t)&&(e=_s((function(){fn?Ks.emit("unhandledRejection",n,r):Qs("unhandledrejection",r,n)})),t.rejection=fn||ea(t)?2:1,e.error))throw e.value}))},ea=function(t){return 1!==t.rejection&&!t.parent},ra=function(t){h(Bs,o,(function(){var e=t.facade;fn?Ks.emit("rejectionHandled",e):Qs("rejectionhandled",e,t.value)}))},na=function(t,e,r){return function(n){t(e,n,r)}},ia=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Zs(t,!0))},oa=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw qs("Promise can't be resolved itself");var n=Ys(e);n?bs((function(){var r={done:!1};try{h(n,e,na(oa,r,t),na(ia,r,t))}catch(e){ia(r,e,t)}})):(t.value=e,t.state=1,Zs(t,!1))}catch(e){ia({done:!1},e,t)}}};if(Ls&&(Vs=(zs=function(t){On(this,Vs),W(t),h(As,this);var e=Ns(this);try{t(na(oa,e),na(ia,e))}catch(t){ia(e,t)}}).prototype,(As=function(t){Fs(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new ws,rejection:!1,state:0,value:void 0})}).prototype=ee(Vs,"then",(function(t,e){var r=Ns(this),n=Ws(ki(this,zs));return r.parent=!0,n.ok=!I(t)||t,n.fail=I(e)&&e,n.domain=fn?Ks.domain:void 0,0==r.state?r.reactions.add(n):bs((function(){Xs(n,r)})),n.promise})),ks=function(){var t=new As,e=Ns(t);this.promise=t,this.resolve=na(oa,e),this.reject=na(ia,e)},Ps.f=Ws=function(t){return t===zs||undefined===t?new ks(t):Js(t)},I(Ss)&&js!==Object.prototype)){xs=js.then,Us||ee(js,"then",(function(t,e){var r=this;return new zs((function(t,e){h(xs,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete js.constructor}catch(t){}Kr&&Kr(js,Vs)}Me({global:!0,constructor:!0,wrap:!0,forced:Ls},{Promise:zs}),Fr(zs,"Promise",!1),bo("Promise");var sa=Ms.CONSTRUCTOR||!vo((function(t){Ss.all(t).then(void 0,(function(){}))}));Me({target:"Promise",stat:!0,forced:sa},{all:function(t){var e=this,r=Ps.f(e),n=r.resolve,i=r.reject,o=_s((function(){var r=W(e.resolve),o=[],s=0,a=1;ho(t,(function(t){var c=s++,u=!1;a++,h(r,e,t).then((function(t){u||(u=!0,o[c]=t,--a||n(o))}),i)})),--a||n(o)}));return o.error&&i(o.value),r.promise}});var aa=Ms.CONSTRUCTOR,ca=Ss&&Ss.prototype;if(Me({target:"Promise",proto:!0,forced:aa,real:!0},{catch:function(t){return this.then(void 0,t)}}),I(Ss)){var ua=M("Promise").prototype.catch;ca.catch!==ua&&ee(ca,"catch",ua,{unsafe:!0})}Me({target:"Promise",stat:!0,forced:sa},{race:function(t){var e=this,r=Ps.f(e),n=r.reject,i=_s((function(){var i=W(e.resolve);ho(t,(function(t){h(i,e,t).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}}),Me({target:"Promise",stat:!0,forced:Ms.CONSTRUCTOR},{reject:function(t){var e=Ps.f(this);return h(e.reject,void 0,t),e.promise}});var ha=Ms.CONSTRUCTOR;M("Promise"),Me({target:"Promise",stat:!0,forced:ha},{resolve:function(t){return function(t,e){if(kt(t),R(e)&&e.constructor===t)return e;var r=Ps.f(t);return(0,r.resolve)(e),r.promise}(this,t)}});var la=o.String,fa=function(t){if("Symbol"===je(t))throw TypeError("Cannot convert a Symbol value to a string");return la(t)},pa=function(){var t=kt(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},da=o.RegExp,ga=s((function(){var t=da("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),va=ga||s((function(){return!da("a","y").sticky})),ma={BROKEN_CARET:ga||s((function(){var t=da("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),MISSED_STICKY:va,UNSUPPORTED_Y:ga},ya=o.RegExp,ba=s((function(){var t=ya(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),_a=o.RegExp,Ea=s((function(){var t=_a("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),wa=Qt.get,Sa=Q("native-string-replace",String.prototype.replace),Ta=RegExp.prototype.exec,Aa=Ta,ka=b("".charAt),xa=b("".indexOf),Oa=b("".replace),Ia=b("".slice),Ra=function(){var t=/a/,e=/b*/g;return h(Ta,t,"a"),h(Ta,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),Da=ma.BROKEN_CARET,Ma=void 0!==/()??/.exec("")[1];(Ra||Ma||Da||ba||Ea)&&(Aa=function(t){var e,r,n,i,o,s,a,c=this,u=wa(c),l=fa(t),f=u.raw;if(f)return f.lastIndex=c.lastIndex,e=h(Aa,f,l),c.lastIndex=f.lastIndex,e;var p=u.groups,d=Da&&c.sticky,g=h(pa,c),v=c.source,m=0,y=l;if(d&&(g=Oa(g,"y",""),-1===xa(g,"g")&&(g+="g"),y=Ia(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==ka(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,m++),r=new RegExp("^(?:"+v+")",g)),Ma&&(r=new RegExp("^"+v+"$(?!\\s)",g)),Ra&&(n=c.lastIndex),i=h(Ta,d?r:c,y),d?i?(i.input=Ia(i.input,m),i[0]=Ia(i[0],m),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:Ra&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),Ma&&i&&i.length>1&&h(Sa,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&p)for(i.groups=s=_r(null),o=0;o<p.length;o++)s[(a=p[o])[0]]=i[a[1]];return i});var Ca=Aa;Me({target:"RegExp",proto:!0,forced:/./.exec!==Ca},{exec:Ca});var Pa=b("".charAt),Ba=b("".charCodeAt),La=b("".slice),Ga=function(t){return function(e,r){var n,i,o=fa(x(e)),s=oe(r),a=o.length;return s<0||s>=a?t?"":void 0:(n=Ba(o,s))<55296||n>56319||s+1===a||(i=Ba(o,s+1))<56320||i>57343?t?Pa(o,s):n:t?La(o,s,s+2):i-56320+(n-55296<<10)+65536}},Ua={codeAt:Ga(!1),charAt:Ga(!0)},Na=Ua.charAt,Fa=Qt.set,ja=Qt.getterFor("String Iterator");Qr(String,"String",(function(t){Fa(this,{type:"String Iterator",string:fa(t),index:0})}),(function(){var t,e=ja(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Na(r,n),e.index+=t.length,{value:t,done:!1})}));var za=ft("species"),Va=RegExp.prototype,qa=function(t,e,r,n){var i=ft(t),o=!s((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),a=o&&!s((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[za]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return e=!0,null},r[i](""),!e}));if(!o||!a||r){var c=b(/./[i]),u=e(i,""[t],(function(t,e,r,n,i){var s=b(t),a=e.exec;return a===Ca||a===Va.exec?o&&!i?{done:!0,value:c(e,r,n)}:{done:!0,value:s(r,e,n)}:{done:!1}}));ee(String.prototype,t,u[0]),ee(Va,i,u[1])}n&&Dt(Va[i],"sham",!0)},Ha=ft("match"),Ka=function(t){var e;return R(t)&&(void 0!==(e=t[Ha])?!!e:"RegExp"==w(t))},Wa=Ua.charAt,Ja=function(t,e,r){return e+(r?Wa(t,e).length:1)},$a=o.TypeError,Ya=function(t,e){var r=t.exec;if(I(r)){var n=h(r,t,e);return null!==n&&kt(n),n}if("RegExp"===w(t))return h(Ca,t,e);throw $a("RegExp#exec called on incompatible receiver")},Xa=ma.UNSUPPORTED_Y,Za=Math.min,Qa=[].push,tc=b(/./.exec),ec=b(Qa),rc=b("".slice);qa("split",(function(t,e,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var n=fa(x(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===t)return[n];if(!Ka(t))return h(e,n,t,i);for(var o,s,a,c=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,f=new RegExp(t.source,u+"g");(o=h(Ca,f,n))&&!((s=f.lastIndex)>l&&(ec(c,rc(n,l,o.index)),o.length>1&&o.index<n.length&&Go(Qa,c,zn(o,1)),a=o[0].length,l=s,c.length>=i));)f.lastIndex===o.index&&f.lastIndex++;return l===n.length?!a&&tc(f,"")||ec(c,""):ec(c,rc(n,l)),c.length>i?zn(c,0,i):c}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:h(e,this,t,r)}:e,[function(e,r){var i=x(this),o=null==e?void 0:J(e,t);return o?h(o,e,i,r):h(n,fa(i),e,r)},function(t,i){var o=kt(this),s=fa(t),a=r(n,o,s,i,n!==e);if(a.done)return a.value;var c=ki(o,RegExp),u=o.unicode,h=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Xa?"g":"y"),l=new c(Xa?"^(?:"+o.source+")":o,h),f=void 0===i?4294967295:i>>>0;if(0===f)return[];if(0===s.length)return null===Ya(l,s)?[s]:[];for(var p=0,d=0,g=[];d<s.length;){l.lastIndex=Xa?0:d;var v,m=Ya(l,Xa?rc(s,d):s);if(null===m||(v=Za(he(l.lastIndex+(Xa?d:0)),s.length))===p)d=Ja(s,d,u);else{if(ec(g,rc(s,p,d)),g.length===f)return g;for(var y=1;y<=m.length-1;y++)if(ec(g,m[y]),g.length===f)return g;d=p=v}}return ec(g,rc(s,p)),g}]}),!!s((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Xa);var nc,ic="\t\n\v\f\r                 \u2028\u2029\ufeff",oc=b("".replace),sc="["+ic+"]",ac=RegExp("^"+sc+sc+"*"),cc=RegExp(sc+sc+"*$"),uc=function(t){return function(e){var r=fa(x(e));return 1&t&&(r=oc(r,ac,"")),2&t&&(r=oc(r,cc,"")),r}},hc={start:uc(1),end:uc(2),trim:uc(3)},lc=Bt.PROPER,fc=hc.trim;Me({target:"String",proto:!0,forced:(nc="trim",s((function(){return!!ic[nc]()||"​…᠎"!=="​…᠎"[nc]()||lc&&ic[nc].name!==nc})))},{trim:function(){return fc(this)}});var pc,dc,gc,vc=Rt.f,mc=o.Int8Array,yc=mc&&mc.prototype,bc=o.Uint8ClampedArray,_c=bc&&bc.prototype,Ec=mc&&Cr(mc),wc=yc&&Cr(yc),Sc=Object.prototype,Tc=o.TypeError,Ac=ft("toStringTag"),kc=at("TYPED_ARRAY_TAG"),xc=at("TYPED_ARRAY_CONSTRUCTOR"),Oc=An&&!!Kr&&"Opera"!==je(o.opera),Ic=!1,Rc={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Dc={BigInt64Array:8,BigUint64Array:8},Mc=function(t){if(!R(t))return!1;var e=je(t);return nt(Rc,e)||nt(Dc,e)};for(pc in Rc)(gc=(dc=o[pc])&&dc.prototype)?Dt(gc,xc,dc):Oc=!1;for(pc in Dc)(gc=(dc=o[pc])&&dc.prototype)&&Dt(gc,xc,dc);if((!Oc||!I(Ec)||Ec===Function.prototype)&&(Ec=function(){throw Tc("Incorrect invocation")},Oc))for(pc in Rc)o[pc]&&Kr(o[pc],Ec);if((!Oc||!wc||wc===Sc)&&(wc=Ec.prototype,Oc))for(pc in Rc)o[pc]&&Kr(o[pc].prototype,wc);if(Oc&&Cr(_c)!==wc&&Kr(_c,wc),a&&!nt(wc,Ac))for(pc in Ic=!0,vc(wc,Ac,{get:function(){return R(this)?this[kc]:void 0}}),Rc)o[pc]&&Dt(o[pc],kc,pc);var Cc={NATIVE_ARRAY_BUFFER_VIEWS:Oc,TYPED_ARRAY_CONSTRUCTOR:xc,TYPED_ARRAY_TAG:Ic&&kc,aTypedArray:function(t){if(Mc(t))return t;throw Tc("Target is not a typed array")},aTypedArrayConstructor:function(t){if(I(t)&&(!Kr||C(Ec,t)))return t;throw Tc(H(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(a){if(r)for(var i in Rc){var s=o[i];if(s&&nt(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}wc[t]&&!r||ee(wc,t,r?e:Oc&&yc[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,i;if(a){if(Kr){if(r)for(n in Rc)if((i=o[n])&&nt(i,t))try{delete i[t]}catch(t){}if(Ec[t]&&!r)return;try{return ee(Ec,t,r?e:Oc&&Ec[t]||e)}catch(t){}}for(n in Rc)!(i=o[n])||i[t]&&!r||ee(i,t,e)}},isView:function(t){if(!R(t))return!1;var e=je(t);return"DataView"===e||nt(Rc,e)||nt(Dc,e)},isTypedArray:Mc,TypedArray:Ec,TypedArrayPrototype:wc},Pc=Cc.NATIVE_ARRAY_BUFFER_VIEWS,Bc=o.ArrayBuffer,Lc=o.Int8Array,Gc=!Pc||!s((function(){Lc(1)}))||!s((function(){new Lc(-1)}))||!vo((function(t){new Lc,new Lc(null),new Lc(1.5),new Lc(t)}),!0)||s((function(){return 1!==new Lc(new Bc(2),1,void 0).length})),Uc=Math.floor,Nc=Number.isInteger||function(t){return!R(t)&&isFinite(t)&&Uc(t)===t},Fc=o.RangeError,jc=o.RangeError,zc=function(t,e){var r=function(t){var e=oe(t);if(e<0)throw Fc("The argument can't be less than 0");return e}(t);if(r%e)throw jc("Wrong offset");return r},Vc=Cc.aTypedArrayConstructor,qc=function(t){var e,r,n,i,o,s,a=Ti(this),c=et(t),u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,p=no(c);if(p&&!eo(p))for(s=(o=oo(c,p)).next,c=[];!(i=h(s,o)).done;)c.push(i.value);for(f&&u>2&&(l=Pe(l,arguments[2])),r=le(c),n=new(Vc(a))(r),e=0;r>e;e++)n[e]=f?l(c[e],e):c[e];return n},Hc=e((function(t){var e=be.f,r=rr.forEach,n=Qt.get,i=Qt.set,s=Rt.f,c=wt.f,u=Math.round,l=o.RangeError,f=wi.ArrayBuffer,p=f.prototype,g=wi.DataView,v=Cc.NATIVE_ARRAY_BUFFER_VIEWS,m=Cc.TYPED_ARRAY_CONSTRUCTOR,y=Cc.TYPED_ARRAY_TAG,b=Cc.TypedArray,_=Cc.TypedArrayPrototype,E=Cc.aTypedArrayConstructor,w=Cc.isTypedArray,S="BYTES_PER_ELEMENT",T="Wrong length",A=function(t,e){E(t);for(var r=0,n=e.length,i=new t(n);n>r;)i[r]=e[r++];return i},k=function(t,e){s(t,e,{get:function(){return n(this)[e]}})},x=function(t){var e;return C(p,t)||"ArrayBuffer"==(e=je(t))||"SharedArrayBuffer"==e},O=function(t,e){return w(t)&&!V(e)&&e in t&&Nc(+e)&&e>=0},I=function(t,e){return e=vt(e),O(t,e)?d(2,t[e]):c(t,e)},D=function(t,e,r){return e=vt(e),!(O(t,e)&&R(r)&&nt(r,"value"))||nt(r,"get")||nt(r,"set")||r.configurable||nt(r,"writable")&&!r.writable||nt(r,"enumerable")&&!r.enumerable?s(t,e,r):(t[e]=r.value,t)};a?(v||(wt.f=I,Rt.f=D,k(_,"buffer"),k(_,"byteOffset"),k(_,"byteLength"),k(_,"length")),Me({target:"Object",stat:!0,forced:!v},{getOwnPropertyDescriptor:I,defineProperty:D}),t.exports=function(t,a,c){var p=t.match(/\d+$/)[0]/8,d=t+(c?"Clamped":"")+"Array",E="get"+t,k="set"+t,O=o[d],I=O,D=I&&I.prototype,M={},C=function(t,e){s(t,e,{get:function(){return function(t,e){var r=n(t);return r.view[E](e*p+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var i=n(t);c&&(r=(r=u(r))<0?0:r>255?255:255&r),i.view[k](e*p+i.byteOffset,r,!0)}(this,e,t)},enumerable:!0})};v?Gc&&(I=a((function(t,e,r,n){return On(t,D),mo(R(e)?x(e)?void 0!==n?new O(e,zc(r,p),n):void 0!==r?new O(e,zc(r,p)):new O(e):w(e)?A(I,e):h(qc,I,e):new O(Rn(e)),t,I)})),Kr&&Kr(I,b),r(e(O),(function(t){t in I||Dt(I,t,O[t])})),I.prototype=D):(I=a((function(t,e,r,n){On(t,D);var o,s,a,c=0,u=0;if(R(e)){if(!x(e))return w(e)?A(I,e):h(qc,I,e);o=e,u=zc(r,p);var d=e.byteLength;if(void 0===n){if(d%p)throw l(T);if((s=d-u)<0)throw l(T)}else if((s=he(n)*p)+u>d)throw l(T);a=s/p}else a=Rn(e),o=new f(s=a*p);for(i(t,{buffer:o,byteOffset:u,byteLength:s,length:a,view:new g(o)});c<a;)C(t,c++)})),Kr&&Kr(I,b),D=I.prototype=_r(_)),D.constructor!==I&&Dt(D,"constructor",I),Dt(D,m,I),y&&Dt(D,y,d);var P=I!=O;M[d]=I,Me({global:!0,constructor:!0,forced:P,sham:!v},M),S in I||Dt(I,S,p),S in D||Dt(D,S,p),bo(d)}):t.exports=function(){}}));Hc("Uint8",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var Kc=Math.min,Wc=b([].copyWithin||function(t,e){var r=et(this),n=le(r),i=ce(t,n),o=ce(e,n),s=arguments.length>2?arguments[2]:void 0,a=Kc((void 0===s?n:ce(s,n))-o,n-i),c=1;for(o<i&&i<o+a&&(c=-1,o+=a-1,i+=a-1);a-- >0;)o in r?r[i]=r[o]:delete r[i],i+=c,o+=c;return r}),Jc=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("copyWithin",(function(t,e){return Wc(Jc(this),t,e,arguments.length>2?arguments[2]:void 0)}));var $c=rr.every,Yc=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("every",(function(t){return $c(Yc(this),t,arguments.length>1?arguments[1]:void 0)}));var Xc=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("fill",(function(t){var e=arguments.length;return h(Nn,Xc(this),t,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}));var Zc=Cc.TYPED_ARRAY_CONSTRUCTOR,Qc=Cc.aTypedArrayConstructor,tu=function(t){return Qc(ki(t,t[Zc]))},eu=function(t,e){return function(t,e){for(var r=0,n=le(e),i=new t(n);n>r;)i[r]=e[r++];return i}(tu(t),e)},ru=rr.filter,nu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("filter",(function(t){var e=ru(nu(this),t,arguments.length>1?arguments[1]:void 0);return eu(this,e)}));var iu=rr.find,ou=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("find",(function(t){return iu(ou(this),t,arguments.length>1?arguments[1]:void 0)}));var su=rr.findIndex,au=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("findIndex",(function(t){return su(au(this),t,arguments.length>1?arguments[1]:void 0)}));var cu=rr.forEach,uu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("forEach",(function(t){cu(uu(this),t,arguments.length>1?arguments[1]:void 0)}));var hu=pe.includes,lu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("includes",(function(t){return hu(lu(this),t,arguments.length>1?arguments[1]:void 0)}));var fu=pe.indexOf,pu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("indexOf",(function(t){return fu(pu(this),t,arguments.length>1?arguments[1]:void 0)}));var du=ft("iterator"),gu=o.Uint8Array,vu=b(nn.values),mu=b(nn.keys),yu=b(nn.entries),bu=Cc.aTypedArray,_u=Cc.exportTypedArrayMethod,Eu=gu&&gu.prototype,wu=!s((function(){Eu[du].call([1])})),Su=!!Eu&&Eu.values&&Eu[du]===Eu.values&&"values"===Eu.values.name,Tu=function(){return vu(bu(this))};_u("entries",(function(){return yu(bu(this))}),wu),_u("keys",(function(){return mu(bu(this))}),wu),_u("values",Tu,wu||!Su,{name:"values"}),_u(du,Tu,wu||!Su,{name:"values"});var Au=Cc.aTypedArray,ku=Cc.exportTypedArrayMethod,xu=b([].join);ku("join",(function(t){return xu(Au(this),t)}));var Ou=Math.min,Iu=[].lastIndexOf,Ru=!!Iu&&1/[1].lastIndexOf(1,-0)<0,Du=nr("lastIndexOf"),Mu=Ru||!Du?function(t){if(Ru)return Go(Iu,this,arguments)||0;var e=O(this),r=le(e),n=r-1;for(arguments.length>1&&(n=Ou(n,oe(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:Iu,Cu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return Go(Mu,Cu(this),e>1?[t,arguments[1]]:[t])}));var Pu=rr.map,Bu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("map",(function(t){return Pu(Bu(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(tu(t))(e)}))}));var Lu=ln.left,Gu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return Lu(Gu(this),t,e,e>1?arguments[1]:void 0)}));var Uu=ln.right,Nu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return Uu(Nu(this),t,e,e>1?arguments[1]:void 0)}));var Fu=Cc.aTypedArray,ju=Cc.exportTypedArrayMethod,zu=Math.floor;ju("reverse",(function(){for(var t,e=this,r=Fu(e).length,n=zu(r/2),i=0;i<n;)t=e[i],e[i++]=e[--r],e[r]=t;return e}));var Vu=o.RangeError,qu=o.Int8Array,Hu=qu&&qu.prototype,Ku=Hu&&Hu.set,Wu=Cc.aTypedArray,Ju=Cc.exportTypedArrayMethod,$u=!s((function(){var t=new Uint8ClampedArray(2);return h(Ku,t,{length:1,0:3},1),3!==t[1]})),Yu=$u&&Cc.NATIVE_ARRAY_BUFFER_VIEWS&&s((function(){var t=new qu(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));Ju("set",(function(t){Wu(this);var e=zc(arguments.length>1?arguments[1]:void 0,1),r=et(t);if($u)return h(Ku,this,r,e);var n=this.length,i=le(r),o=0;if(i+e>n)throw Vu("Wrong length");for(;o<i;)this[e+o]=r[o++]}),!$u||Yu);var Xu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("slice",(function(t,e){for(var r=_n(Xu(this),t,e),n=tu(this),i=0,o=r.length,s=new n(o);o>i;)s[i]=r[i++];return s}),s((function(){new Int8Array(1).slice()})));var Zu=rr.some,Qu=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("some",(function(t){return Zu(Qu(this),t,arguments.length>1?arguments[1]:void 0)}));var th=Math.floor,eh=function(t,e){var r=t.length,n=th(r/2);return r<8?rh(t,e):nh(t,eh(zn(t,0,n),e),eh(zn(t,n),e),e)},rh=function(t,e){for(var r,n,i=t.length,o=1;o<i;){for(n=o,r=t[o];n&&e(t[n-1],r)>0;)t[n]=t[--n];n!==o++&&(t[n]=r)}return t},nh=function(t,e,r,n){for(var i=e.length,o=r.length,s=0,a=0;s<i||a<o;)t[s+a]=s<i&&a<o?n(e[s],r[a])<=0?e[s++]:r[a++]:s<i?e[s++]:r[a++];return t},ih=eh,oh=P.match(/firefox\/(\d+)/i),sh=!!oh&&+oh[1],ah=/MSIE|Trident/.test(P),ch=P.match(/AppleWebKit\/(\d+)\./),uh=!!ch&&+ch[1],hh=Cc.aTypedArray,lh=Cc.exportTypedArrayMethod,fh=o.Uint16Array,ph=fh&&b(fh.prototype.sort),dh=!(!ph||s((function(){ph(new fh(2),null)}))&&s((function(){ph(new fh(2),{})}))),gh=!!ph&&!s((function(){if(N)return N<74;if(sh)return sh<67;if(ah)return!0;if(uh)return uh<602;var t,e,r=new fh(516),n=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,n[t]=t-2*e+3;for(ph(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==n[t])return!0}));lh("sort",(function(t){return void 0!==t&&W(t),gh?ph(this,t):ih(hh(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!gh||dh);var vh=Cc.aTypedArray;(0,Cc.exportTypedArrayMethod)("subarray",(function(t,e){var r=vh(this),n=r.length,i=ce(t,n);return new(tu(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,he((void 0===e?n:ce(e,n))-i))}));var mh=o.Int8Array,yh=Cc.aTypedArray,bh=Cc.exportTypedArrayMethod,_h=[].toLocaleString,Eh=!!mh&&s((function(){_h.call(new mh(1))}));bh("toLocaleString",(function(){return Go(_h,Eh?_n(yh(this)):yh(this),_n(arguments))}),s((function(){return[1,2].toLocaleString()!=new mh([1,2]).toLocaleString()}))||!s((function(){mh.prototype.toLocaleString.call([1,2])})));var wh=Cc.exportTypedArrayMethod,Sh=o.Uint8Array,Th=Sh&&Sh.prototype||{},Ah=[].toString,kh=b([].join);s((function(){Ah.call({})}))&&(Ah=function(){return kh(this)});var xh=Th.toString!=Ah;wh("toString",Ah,xh);Me({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=kt(this),r=W(e.delete),n=!0,i=0,o=arguments.length;i<o;i++)t=h(r,e,arguments[i]),n=n&&t;return!!n}});var Oh=function(t){return h(Map.prototype.entries,t)};Me({target:"Map",proto:!0,real:!0,forced:!0},{every:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0);return!ho(r,(function(t,r,i){if(!n(r,t,e))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0),i=new(ki(e,M("Map"))),o=W(i.set);return ho(r,(function(t,r){n(r,t,e)&&h(o,i,t,r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{find:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0);return ho(r,(function(t,r,i){if(n(r,t,e))return i(r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0);return ho(r,(function(t,r,i){if(n(r,t,e))return i(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});Me({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(t){return ho(Oh(kt(this)),(function(e,r,n){if((i=r)===(o=t)||i!=i&&o!=o)return n();var i,o}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){return ho(Oh(kt(this)),(function(e,r,n){if(r===t)return n(e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0),i=new(ki(e,M("Map"))),o=W(i.set);return ho(r,(function(t,r){h(o,i,n(r,t,e),r)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0),i=new(ki(e,M("Map"))),o=W(i.set);return ho(r,(function(t,r){h(o,i,t,n(r,t,e))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),i}}),Me({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=kt(this),r=W(e.set),n=arguments.length,i=0;i<n;)ho(arguments[i++],r,{that:e,AS_ENTRIES:!0});return e}});var Ih=o.TypeError;Me({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=kt(this),r=Oh(e),n=arguments.length<2,i=n?void 0:arguments[1];if(W(t),ho(r,(function(r,o){n?(n=!1,i=o):i=t(i,o,r,e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),n)throw Ih("Reduce of empty map with no initial value");return i}}),Me({target:"Map",proto:!0,real:!0,forced:!0},{some:function(t){var e=kt(this),r=Oh(e),n=Pe(t,arguments.length>1?arguments[1]:void 0);return ho(r,(function(t,r,i){if(n(r,t,e))return i()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Rh=o.TypeError;Me({target:"Map",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=kt(this),n=W(r.get),i=W(r.has),o=W(r.set),s=arguments.length;W(e);var a=h(i,r,t);if(!a&&s<3)throw Rh("Updating absent value");var c=a?h(n,r,t):W(s>2?arguments[2]:void 0)(t,r);return h(o,r,t,e(c,t,r)),r}});var Dh={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Mh=bt("span").classList,Ch=Mh&&Mh.constructor&&Mh.constructor.prototype,Ph=Ch===Object.prototype?void 0:Ch,Bh=function(t){if(t&&t.forEach!==or)try{Dt(t,"forEach",or)}catch(e){t.forEach=or}};for(var Lh in Dh)Dh[Lh]&&Bh(o[Lh]&&o[Lh].prototype);Bh(Ph);var Gh=ft("iterator"),Uh=ft("toStringTag"),Nh=nn.values,Fh=function(t,e){if(t){if(t[Gh]!==Nh)try{Dt(t,Gh,Nh)}catch(e){t[Gh]=Nh}if(t[Uh]||Dt(t,Uh,e),Dh[e])for(var r in nn)if(t[r]!==nn[r])try{Dt(t,r,nn[r])}catch(e){t[r]=nn[r]}}};for(var jh in Dh)Fh(o[jh]&&o[jh].prototype,jh);Fh(Ph,"DOMTokenList");var zh=/MSIE .\./.test(P),Vh=o.Function,qh=function(t){return zh?function(e,r){var n=No(arguments.length,1)>2,i=I(e)?e:Vh(e),o=n?_n(arguments,2):void 0;return t(n?function(){Go(i,this,o)}:i,r)}:t},Hh={setTimeout:qh(o.setTimeout),setInterval:qh(o.setInterval)},Kh=Hh.setInterval;Me({global:!0,bind:!0,forced:o.setInterval!==Kh},{setInterval:Kh});var Wh=Hh.setTimeout;Me({global:!0,bind:!0,forced:o.setTimeout!==Wh},{setTimeout:Wh});var Jh=function(){return Jh=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Jh.apply(this,arguments)};function $h(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function Yh(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat($h(arguments[e]));return t}var Xh=bn("splice"),Zh=o.TypeError,Qh=Math.max,tl=Math.min;Me({target:"Array",proto:!0,forced:!Xh},{splice:function(t,e){var r,n,i,o,s,a,c=et(this),u=le(c),h=ce(t,u),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=u-h):(r=l-2,n=tl(Qh(oe(e),0),u-h)),u+r-n>9007199254740991)throw Zh("Maximum allowed length exceeded");for(i=Qe(c,n),o=0;o<n;o++)(s=h+o)in c&&mn(i,o,c[s]);if(i.length=n,r<n){for(o=h;o<u-n;o++)a=o+r,(s=o+n)in c?c[a]=c[s]:delete c[a];for(o=u;o>u-n+r;o--)delete c[o-1]}else if(r>n)for(o=u-n;o>h;o--)a=o+r-1,(s=o+n-1)in c?c[a]=c[s]:delete c[a];for(o=0;o<r;o++)c[o+h]=arguments[o+2];return c.length=u-n+r,i}});var el=function(){function t(){this._hooks={},this._cache=[],this._hooksCache={}}return t.prototype.on=function(t,e){t&&e&&"function"==typeof e&&(this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(e))},t.prototype.once=function(t,e){var r=this;if(t&&e&&"function"==typeof e){this.on(t,(function n(i){e(i),r.off(t,n)}))}},t.prototype.off=function(t,e){if(t&&this._hooks[t]&&this._hooks[t].length)if(e){var r=this._hooks[t].indexOf(e);-1!==r&&this._hooks[t].splice(r,1)}else this._hooks[t]=[]},t.prototype.emit=function(t,e,r){if(r){if(!t)return;-1!==this._cache.indexOf(r)?this._emit(t,e):(this._hooksCache.hasOwnProperty(r)||(this._hooksCache[r]={}),this._hooksCache[r].hasOwnProperty(t)||(this._hooksCache[r][t]=[]),this._hooksCache[r][t].push(e))}else this._emit(t,e)},t.prototype._emit=function(t,e){t&&this._hooks[t]&&this._hooks[t].length&&Yh(this._hooks[t]).forEach((function(t){try{t(e)}catch(t){}}))},t.prototype.set=function(t){t&&-1===this._cache.indexOf(t)&&this._cache.push(t)},t}(),rl=rr.map,nl=bn("map");Me({target:"Array",proto:!0,forced:!nl},{map:function(t){return rl(this,t,arguments.length>1?arguments[1]:void 0)}});var il=b(1..valueOf),ol=be.f,sl=wt.f,al=Rt.f,cl=hc.trim,ul=o.Number,hl=ul.prototype,ll=o.TypeError,fl=b("".slice),pl=b("".charCodeAt),dl=function(t){var e=gt(t,"number");return"bigint"==typeof e?e:gl(e)},gl=function(t){var e,r,n,i,o,s,a,c,u=gt(t,"number");if(V(u))throw ll("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=cl(u),43===(e=pl(u,0))||45===e){if(88===(r=pl(u,2))||120===r)return NaN}else if(48===e){switch(pl(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(s=(o=fl(u,2)).length,a=0;a<s;a++)if((c=pl(o,a))<48||c>i)return NaN;return parseInt(o,n)}return+u};if(Re("Number",!ul(" 0o1")||!ul("0b1")||ul("+0x1"))){for(var vl,ml=function(t){var e=arguments.length<1?0:ul(dl(t)),r=this;return C(hl,r)&&s((function(){il(r)}))?mo(Object(e),r,ml):e},yl=a?ol(ul):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),bl=0;yl.length>bl;bl++)nt(ul,vl=yl[bl])&&!nt(ml,vl)&&al(ml,vl,sl(ul,vl));ml.prototype=hl,hl.constructor=ml,ee(o,"Number",ml,{constructor:!0})}var _l=s((function(){lr(1)}));Me({target:"Object",stat:!0,forced:_l},{keys:function(t){return lr(et(t))}});var El=hc.trim,wl=o.parseInt,Sl=o.Symbol,Tl=Sl&&Sl.iterator,Al=/^[+-]?0x/i,kl=b(Al.exec),xl=8!==wl(ic+"08")||22!==wl(ic+"0x16")||Tl&&!s((function(){wl(Object(Tl))}))?function(t,e){var r=El(fa(t));return wl(r,e>>>0||(kl(Al,r)?16:10))}:wl;Me({global:!0,forced:parseInt!=xl},{parseInt:xl});var Ol=RegExp.prototype,Il=function(t){var e=t.flags;return void 0!==e||"flags"in Ol||nt(t,"flags")||!C(Ol,t)?e:h(pa,t)},Rl=Bt.PROPER,Dl=RegExp.prototype.toString,Ml=s((function(){return"/a/b"!=Dl.call({source:"a",flags:"b"})})),Cl=Rl&&"toString"!=Dl.name;(Ml||Cl)&&ee(RegExp.prototype,"toString",(function(){var t=kt(this);return"/"+fa(t.source)+"/"+fa(Il(t))}),{unsafe:!0}),qa("match",(function(t,e,r){return[function(e){var r=x(this),n=null==e?void 0:J(e,t);return n?h(n,e,r):new RegExp(e)[t](fa(r))},function(t){var n=kt(this),i=fa(t),o=r(e,n,i);if(o.done)return o.value;if(!n.global)return Ya(n,i);var s=n.unicode;n.lastIndex=0;for(var a,c=[],u=0;null!==(a=Ya(n,i));){var h=fa(a[0]);c[u]=h,""===h&&(n.lastIndex=Ja(i,he(n.lastIndex),s)),u++}return 0===u?null:c}]}));var Pl=Math.floor,Bl=b("".charAt),Ll=b("".replace),Gl=b("".slice),Ul=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Nl=/\$([$&'`]|\d{1,2})/g,Fl=function(t,e,r,n,i,o){var s=r+t.length,a=n.length,c=Nl;return void 0!==i&&(i=et(i),c=Ul),Ll(o,c,(function(o,c){var u;switch(Bl(c,0)){case"$":return"$";case"&":return t;case"`":return Gl(e,0,r);case"'":return Gl(e,s);case"<":u=i[Gl(c,1,-1)];break;default:var h=+c;if(0===h)return o;if(h>a){var l=Pl(h/10);return 0===l?o:l<=a?void 0===n[l-1]?Bl(c,1):n[l-1]+Bl(c,1):o}u=n[h-1]}return void 0===u?"":u}))},jl=ft("replace"),zl=Math.max,Vl=Math.min,ql=b([].concat),Hl=b([].push),Kl=b("".indexOf),Wl=b("".slice),Jl="$0"==="a".replace(/./,"$0"),$l=!!/./[jl]&&""===/./[jl]("a","$0");qa("replace",(function(t,e,r){var n=$l?"$":"$0";return[function(t,r){var n=x(this),i=null==t?void 0:J(t,jl);return i?h(i,t,n,r):h(e,fa(n),t,r)},function(t,i){var o=kt(this),s=fa(t);if("string"==typeof i&&-1===Kl(i,n)&&-1===Kl(i,"$<")){var a=r(e,o,s,i);if(a.done)return a.value}var c=I(i);c||(i=fa(i));var u=o.global;if(u){var h=o.unicode;o.lastIndex=0}for(var l=[];;){var f=Ya(o,s);if(null===f)break;if(Hl(l,f),!u)break;""===fa(f[0])&&(o.lastIndex=Ja(s,he(o.lastIndex),h))}for(var p,d="",g=0,v=0;v<l.length;v++){for(var m=fa((f=l[v])[0]),y=zl(Vl(oe(f.index),s.length),0),b=[],_=1;_<f.length;_++)Hl(b,void 0===(p=f[_])?p:String(p));var E=f.groups;if(c){var w=ql([m],b,y,s);void 0!==E&&Hl(w,E);var S=fa(Go(i,void 0,w))}else S=Fl(m,s,y,b,E,i);y>=g&&(d+=Wl(s,g,y)+S,g=y+m.length)}return d+Wl(s,g)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!Jl||$l);var Yl=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};qa("search",(function(t,e,r){return[function(e){var r=x(this),n=null==e?void 0:J(e,t);return n?h(n,e,r):new RegExp(e)[t](fa(r))},function(t){var n=kt(this),i=fa(t),o=r(e,n,i);if(o.done)return o.value;var s=n.lastIndex;Yl(s,0)||(n.lastIndex=0);var a=Ya(n,i);return Yl(n.lastIndex,s)||(n.lastIndex=s),null===a?-1:a.index}]}));var Xl,Zl=function(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)},Ql=function(t){return Array.isArray(t)},tf=(Xl=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return Xl+=1}),ef=function(t){return function(t,e,r){if("string"==typeof t&&"number"==typeof e&&"number"==typeof r){var n,i=[];r=r<=25?r:r%25;var o=String.fromCharCode(r+97);n=t.split(o);for(var s=0;s<n.length;s++){var a=parseInt(n[s],r);a=1*a^e;var c=String.fromCharCode(a);i.push(c)}return i.join("")}}(t,64,25)},rf=function(t){!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",t,!1):window.addEventListener("beforeunload",t,!1)},nf=function(){var t=0;return["hidden","msHidden","webkitHidden"].forEach((function(e){void 0!==document[e]&&(t=1)})),t},of=function(t){var e=document.createElement("a");return e.href=t,e},sf=function(t){var e={};try{var r=of(t).search;(r=r.slice(1)).split("&").forEach((function(t){var r,n,i=t.split("=");i.length&&(r=i[0],n=i[1]);try{e[r]=decodeURIComponent(void 0===n?"":n)}catch(t){e[r]=n}}))}catch(t){}return e},af=function(t){for(var e=0,r=0,n=(t+="").length,i=0;i<n;i++)((e=31*e+t.charCodeAt(r++))>0x7fffffffffff||e<-0x800000000000)&&(e&=0xffffffffffff);return e<0&&(e+=0x7ffffffffffff),e};var cf=function(t){var e,r,n=[],i=t.length;i%2!=0&&(r=i+1,t=(e=t).length>=r?e:new Array(r-e.length+1).join("0")+e),i=t.length;for(var o=0;o<i;o+=2)n.push(parseInt(t.substr(o,2),16));return n},uf=hc.trim,hf=b("".charAt),lf=o.parseFloat,ff=o.Symbol,pf=ff&&ff.iterator,df=1/lf(ic+"-0")!=-1/0||pf&&!s((function(){lf(Object(pf))}))?function(t){var e=uf(fa(t)),r=lf(e);return 0===r&&"-"==hf(e,0)?-0:r}:lf;Me({global:!0,forced:parseFloat!=df},{parseFloat:df});var gf=Rt.f,vf=function(t,e,r){r in t||gf(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})},mf=be.f,yf=Qt.enforce,bf=ft("match"),_f=o.RegExp,Ef=_f.prototype,wf=o.SyntaxError,Sf=b(Ef.exec),Tf=b("".charAt),Af=b("".replace),kf=b("".indexOf),xf=b("".slice),Of=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,If=/a/g,Rf=/a/g,Df=new _f(If)!==If,Mf=ma.MISSED_STICKY,Cf=ma.UNSUPPORTED_Y,Pf=a&&(!Df||Mf||ba||Ea||s((function(){return Rf[bf]=!1,_f(If)!=If||_f(Rf)==Rf||"/a/i"!=_f(If,"i")})));if(Re("RegExp",Pf)){for(var Bf=function(t,e){var r,n,i,o,s,a,c=C(Ef,this),u=Ka(t),h=void 0===e,l=[],f=t;if(!c&&u&&h&&t.constructor===Bf)return t;if((u||C(Ef,t))&&(t=t.source,h&&(e=Il(f))),t=void 0===t?"":fa(t),e=void 0===e?"":fa(e),f=t,ba&&"dotAll"in If&&(n=!!e&&kf(e,"s")>-1)&&(e=Af(e,/s/g,"")),r=e,Mf&&"sticky"in If&&(i=!!e&&kf(e,"y")>-1)&&Cf&&(e=Af(e,/y/g,"")),Ea&&(o=function(t){for(var e,r=t.length,n=0,i="",o=[],s={},a=!1,c=!1,u=0,h="";n<=r;n++){if("\\"===(e=Tf(t,n)))e+=Tf(t,++n);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:Sf(Of,xf(t,n+1))&&(n+=2,c=!0),i+=e,u++;continue;case">"===e&&c:if(""===h||nt(s,h))throw new wf("Invalid capture group name");s[h]=!0,o[o.length]=[h,u],c=!1,h="";continue}c?h+=e:i+=e}return[i,o]}(t),t=o[0],l=o[1]),s=mo(_f(t,e),c?this:Ef,Bf),(n||i||l.length)&&(a=yf(s),n&&(a.dotAll=!0,a.raw=Bf(function(t){for(var e,r=t.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(e=Tf(t,n))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),i+=e):i+="[\\s\\S]":i+=e+Tf(t,++n);return i}(t),r)),i&&(a.sticky=!0),l.length&&(a.groups=l)),t!==f)try{Dt(s,"source",""===f?"(?:)":f)}catch(t){}return s},Lf=mf(_f),Gf=0;Lf.length>Gf;)vf(Bf,_f,Lf[Gf++]);Ef.constructor=Bf,Bf.prototype=Ef,ee(o,"RegExp",Bf,{constructor:!0})}bo("RegExp");var Uf=e((function(t,e){t.exports=function(){function t(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function e(r,n){function i(e,i,o){if("undefined"!=typeof document){"number"==typeof(o=t({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+r.write(i,e)+s}}function o(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var e=document.cookie?document.cookie.split("; "):[],n={},i=0;i<e.length;i++){var o=e[i].split("="),s=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(n[a]=r.read(s,a),t===a)break}catch(t){}}return t?n[t]:n}}return Object.create({set:i,get:o,remove:function(e,r){i(e,"",t({},r,{expires:-1}))},withAttributes:function(r){return e(this.converter,t({},this.attributes,r))},withConverter:function(r){return e(t({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}return e({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()})),Nf=Uf,Ff=function(){function t(){this.cache={}}return t.prototype.setItem=function(t,e){this.cache[t]=e},t.prototype.getItem=function(t){return this.cache[t]},t.prototype.removeItem=function(t){this.cache[t]=void 0},t.prototype.getCookie=function(t){this.getItem(t)},t.prototype.setCookie=function(t,e){this.setItem(t,e)},t}();var jf,zf,Vf={getItem:function(t){try{var e=localStorage.getItem(t),r=e;try{e&&"string"==typeof e&&(r=JSON.parse(e))}catch(t){}return r||{}}catch(t){}return{}},setItem:function(t,e){try{var r="string"==typeof e?e:JSON.stringify(e);localStorage.setItem(t,r)}catch(t){}},removeItem:function(t){try{localStorage.removeItem(t)}catch(t){}},getCookie:function(t,e){try{return Nf.get(t,{domain:e||document.domain})}catch(t){return""}},setCookie:function(t,e,r,n){try{var i=n||document.domain,o=+new Date+r;Nf.set(t,e,{expires:new Date(o),path:"/",domain:i})}catch(t){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(t){return!1}}()},qf={getItem:function(t){try{var e=sessionStorage.getItem(t),r=e;try{e&&"string"==typeof e&&(r=JSON.parse(e))}catch(t){}return r||{}}catch(t){}return{}},setItem:function(t,e){try{var r="string"==typeof e?e:JSON.stringify(e);sessionStorage.setItem(t,r)}catch(t){}},removeItem:function(t){try{sessionStorage.removeItem(t)}catch(t){}},getCookie:function(t){this.getItem(t)},setCookie:function(t,e){this.setItem(t,e)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(t){return!1}}()},Hf=function(){function t(t,e){this._storage=e&&"session"===e?qf:!t&&Vf.isSupportLS?Vf:new Ff}return t.prototype.getItem=function(t){return this._storage.getItem(t)},t.prototype.setItem=function(t,e){this._storage.setItem(t,e)},t.prototype.getCookie=function(t,e){return this._storage.getCookie(t,e)},t.prototype.setCookie=function(t,e,r,n){this._storage.setCookie(t,e,r,n)},t.prototype.removeItem=function(t){this._storage.removeItem(t)},t}(),Kf=function(){function t(t,e,r){this.appid=t,this.domain=e,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=r}return t.prototype.init=function(){var t=window.navigator.userAgent,e=window.navigator.language,r=document.referrer,n=r?of(r).hostname:"",i=sf(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(t,e,r,n){var i=new Hf(!1),o=new Hf(!1,"session"),s=t?"_tea_utm_cache_"+t:"_tea_utm_cache",a=t?"_$utm_from_url_"+t:"_$utm_from_url",c={},u=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],h={ad_id:Number(e.ad_id)||void 0,campaign_id:Number(e.campaign_id)||void 0,creative_id:Number(e.creative_id)||void 0,utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content,tr_shareuser:e.tr_shareuser,tr_admaster:e.tr_admaster,tr_param1:e.tr_param1,tr_param2:e.tr_param2,tr_param3:e.tr_param3,tr_param4:e.tr_param4};try{var l=!1;for(var f in h)h[f]&&(-1!==u.indexOf(f)?(c.hasOwnProperty("tracer_data")||(c.tracer_data={}),c.tracer_data[f]=h[f]):c[f]=h[f],l=!0);if(l)o.setItem(a,"1"),i.setCookie(s,JSON.stringify(c),n,r);else{var p=i.getCookie(s,r);p&&(c=JSON.parse(p))}o.getItem(a)&&(c.hasOwnProperty("tracer_data")||(c.tracer_data={}),c.tracer_data.$utm_from_url=1)}catch(t){return h}return c}(this.appid,i,this.domain,this.cookie_expire);var s=this.browser(),a=this.os();return{browser:s.browser,browser_version:s.browser_version,platform:o,os_name:a.os_name,os_version:a.os_version,userAgent:t,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(a.os_name),language:e,referrer:r,referrer_host:n,utm:this.utm,latest_data:this.last(r,n)}},t.prototype.last=function(t,e){var r="",n="",i="",o=location.hostname,s=!1;if(t&&e&&o!==e){r=t,n=e,s=!0;var a=sf(t);a.keyword&&(i=a.keyword)}return{$latest_referrer:r,$latest_referrer_host:n,$latest_search_keyword:i,isLast:s}},t.prototype.browser=function(){var t,e,r="",n=""+parseFloat(this.appVersion),i=this.userAgent;return-1!==i.indexOf("Edge")||-1!==i.indexOf("Edg")?(r="Microsoft Edge",-1!==i.indexOf("Edge")?(t=i.indexOf("Edge"),n=i.substring(t+5)):(t=i.indexOf("Edg"),n=i.substring(t+4))):-1!==(t=i.indexOf("MSIE"))?(r="Microsoft Internet Explorer",n=i.substring(t+5)):-1!==(t=i.indexOf("Lark"))?(r="Lark",n=i.substring(t+5,t+11)):-1!==(t=i.indexOf("MetaSr"))?(r="sougoubrowser",n=i.substring(t+7,t+10)):-1!==i.indexOf("MQQBrowser")||-1!==i.indexOf("QQBrowser")?(r="qqbrowser",-1!==i.indexOf("MQQBrowser")?(t=i.indexOf("MQQBrowser"),n=i.substring(t+11,t+15)):-1!==i.indexOf("QQBrowser")&&(t=i.indexOf("QQBrowser"),n=i.substring(t+10,t+17))):-1!==i.indexOf("Chrome")?-1!==(t=i.indexOf("MicroMessenger"))?(r="weixin",n=i.substring(t+15,t+20)):-1!==(t=i.indexOf("360"))?(r="360browser",n=i.substring(i.indexOf("Chrome")+7)):-1!==i.indexOf("baidubrowser")||-1!==i.indexOf("BIDUBrowser")?(-1!==i.indexOf("baidubrowser")?(t=i.indexOf("baidubrowser"),n=i.substring(t+13,t+16)):-1!==i.indexOf("BIDUBrowser")&&(t=i.indexOf("BIDUBrowser"),n=i.substring(t+12,t+15)),r="baidubrowser"):-1!==(t=i.indexOf("xiaomi"))?-1!==i.indexOf("openlanguagexiaomi")?(r="openlanguage xiaomi",n=i.substring(t+7,t+13)):(r="xiaomi",n=i.substring(t-7,t-1)):-1!==(t=i.indexOf("TTWebView"))?(r="TTWebView",n=i.substring(t+10,t+23)):(-1!==(t=i.indexOf("Chrome"))||-1!==(t=i.indexOf("Chrome")))&&(r="Chrome",n=i.substring(t+7)):-1!==i.indexOf("Safari")?-1!==(t=i.indexOf("QQ"))?(r="qqbrowser",n=i.substring(t+10,t+16)):-1!==(t=i.indexOf("Safari"))&&(r="Safari",n=i.substring(t+7),-1!==(t=i.indexOf("Version"))&&(n=i.substring(t+8))):-1!==(t=i.indexOf("Firefox"))?(r="Firefox",n=i.substring(t+8)):-1!==(t=i.indexOf("MicroMessenger"))?(r="weixin",n=i.substring(t+15,t+20)):-1!==(t=i.indexOf("QQ"))?(r="qqbrowser",n=i.substring(t+3,t+8)):-1!==(t=i.indexOf("Opera"))&&(r="Opera",n=i.substring(t+6),-1!==(t=i.indexOf("Version"))&&(n=i.substring(t+8))),-1!==(e=n.indexOf(";"))&&(n=n.substring(0,e)),-1!==(e=n.indexOf(" "))&&(n=n.substring(0,e)),-1!==(e=n.indexOf(")"))&&(n=n.substring(0,e)),{browser:r,browser_version:n}},t.prototype.os=function(){for(var t="",e="",r=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<r.length;n++){var i=r[n];if(i.r.test(this.userAgent)){"Mac OS X"===(t=i.s)&&this.isNewIpad()&&(t="iOS");break}}var o=function(t,e){var r=t.exec(e);return r&&r[1]?r[1]:""},s=function(t,e){var r=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+t+")","i").exec(e);return r?r.slice(1)[0]:""};/Windows/.test(t)&&(e=o(/Windows (.*)/,t),t="windows");switch(t){case"Mac OS X":e=s("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),t="mac";break;case"Android":e=function(t){var e=o(/Android ([\.\_\d]+)/,t);return e||(e=o(/Android\/([\.\_\d]+)/,t)),e}(this.userAgent),t="android";break;case"iOS":e=this.isNewIpad()?s("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(e=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?e[1]+"."+e[2]+"."+(0|e[3]):"",t="ios"}return{os_name:t,os_version:e}},t.prototype.getDeviceModel=function(t){var e="";try{if("android"===t)navigator.userAgent.split(";").forEach((function(t){t.indexOf("Build/")>-1&&(e=t.slice(0,t.indexOf("Build/")))}));else if("ios"===t||"mac"===t||"windows"===t)if(this.isNewIpad())e="iPad";else{var r=navigator.userAgent.replace("Mozilla/5.0 (",""),n=r.indexOf(";");e=r.slice(0,n)}}catch(t){return e.trim()}return e.trim()},t.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},t}(),Wf={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},Jf={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},$f=function(){function t(t,e){this.collector=t,this.config=e,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","_be_active","$bav2b_slide"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","$user_unique_id_type","_staging_flag","$exposure_type","$direction","$offsetY","$offsetX"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return t.prototype.checkVerify=function(t){var e=this;if(!t||!t.length)return!1;var r=t[0];if(!r)return!1;var n=r.events,i=r.header;if(!n||!n.length)return!1;var o=!0;return n.forEach((function(t){e.checkEventName(t.event)||(o=!1,t.checkEvent="事件名不能以 $ or __开头"),e.checkEventParams(t.params)||(o=!1,t.checkParams="属性名不能以 $ or __开头")})),this.checkEventParams(i)||(o=!1),o},t.prototype.checkEventName=function(t){return!!t&&this.calculate(t,"event")},t.prototype.checkEventParams=function(t){var e=t;"string"==typeof t&&(e=JSON.parse(e));var r=!0;if(!Object.keys(e).length)return r;for(var n in e){if(!this.calculate(n,"params")){r=!1;break}if("string"==typeof e[n]&&e[n].length>1024){console.warn("params: "+n+" can not over 1024 byte, please check;"),r=!1;break}}return r},t.prototype.calculate=function(t,e){return-1!==("event"===e?this.eventNameWhiteList:"params"===e?this.paramsNameWhiteList:[]).indexOf(t)||(!new RegExp("^\\$").test(t)&&!new RegExp("^__").test(t)||(console.warn(e+" name: "+t+" can not start with $ or __, pleace check;"),!1))},t}();!function(t){t.Init="init",t.Config="config",t.Start="start",t.Ready="ready",t.TokenComplete="token-complete",t.TokenStorage="token-storage",t.TokenFetch="token-fetch",t.TokenError="token-error",t.ConfigUuid="config-uuid",t.ConfigWebId="config-webid",t.ConfigDomain="config-domain",t.CustomWebId="custom-webid",t.AnonymousId="anonymous-id",t.TokenChange="token-change",t.TokenReset="token-reset",t.ConfigTransform="config-transform",t.EnvTransform="env-transform",t.SessionReset="session-reset",t.SessionResetTime="session-reset-time",t.Event="event",t.Events="events",t.EventNow="event-now",t.CleanEvents="clean-events",t.BeconEvent="becon-event",t.SubmitBefore="submit-before",t.SubmitScuess="submit-scuess",t.SubmitAfter="submit-after",t.SubmitError="submit-error",t.SubmitVerifyH="submit-verify-h5",t.Stay="stay",t.ResetStay="reset-stay",t.StayReady="stay-ready",t.SetStay="set-stay",t.RouteChange="route-change",t.RouteReady="route-ready",t.Ab="ab",t.AbVar="ab-var",t.AbAllVars="ab-all-vars",t.AbConfig="ab-config",t.AbExternalVersion="ab-external-version",t.AbVersionChangeOn="ab-version-change-on",t.AbVersionChangeOff="ab-version-change-off",t.AbOpenLayer="ab-open-layer",t.AbCloseLayer="ab-close-layer",t.AbReady="ab-ready",t.AbComplete="ab-complete",t.AbTimeout="ab-timeout",t.Profile="profile",t.ProfileSet="profile-set",t.ProfileSetOnce="profile-set-once",t.ProfileUnset="profile-unset",t.ProfileIncrement="profile-increment",t.ProfileAppend="profile-append",t.ProfileClear="profile-clear",t.TrackDuration="track-duration",t.TrackDurationStart="track-duration-start",t.TrackDurationEnd="track-duration-end",t.TrackDurationPause="track-duration-pause",t.TrackDurationResume="tracl-duration-resume",t.Autotrack="autotrack",t.AutotrackReady="autotrack-ready",t.CepReady="cep-ready",t.TracerReady="tracer-ready"}(jf||(jf={})),function(t){t.DEBUGGER_MESSAGE="debugger-message",t.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",t.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",t.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",t.DEBUGGER_MESSAGE_EVENT="debugger-message-event",t.DEVTOOL_WEB_READY="devtool-web-ready"}(zf||(zf={}));var Yf=jf,Xf=void 0,Zf=(new Date).getTimezoneOffset(),Qf=parseInt(""+-Zf/60,10),tp=60*Zf,ep=function(){function t(t,e){this.is_first_time=!0,this.configPersist=!1,this.initConfig=e,this.collect=t;var r=new Kf(e.app_id,e.cookie_domain||"",e.cookie_expire||7776e6).init();this.eventCheck=new $f(t,e);var n="__tea_cache_first_"+e.app_id;this.configKey="__tea_cache_config_"+e.app_id,this.sessionStorage=new Hf(!1,"session"),this.localStorage=new Hf(!1,"local"),e.configPersist&&(this.configPersist=!0,this.storage=1===e.configPersist?this.sessionStorage:this.localStorage);var i=this.localStorage.getItem(n);i&&1==i?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(n,"1")),this.envInfo={user:{user_unique_id:Xf,user_type:Xf,user_id:Xf,user_is_auth:Xf,user_is_login:Xf,device_id:Xf,web_id:Xf,ip_addr_id:Xf,user_unique_id_type:Xf,anonymous_id:Xf},header:{app_id:Xf,app_name:Xf,app_install_id:Xf,install_id:Xf,app_package:Xf,app_channel:Xf,app_version:Xf,ab_version:Xf,os_name:r.os_name,os_version:r.os_version,device_model:r.device_model,ab_client:Xf,traffic_type:Xf,client_ip:Xf,device_brand:Xf,os_api:Xf,access:Xf,language:r.language,region:Xf,app_language:Xf,app_region:Xf,creative_id:r.utm.creative_id,ad_id:r.utm.ad_id,campaign_id:r.utm.campaign_id,log_type:Xf,rnd:Xf,platform:r.platform,sdk_version:"0.1.0",sdk_lib:"js",province:Xf,city:Xf,timezone:Qf,tz_offset:tp,tz_name:Xf,sim_region:Xf,carrier:Xf,resolution:r.screen_width+"x"+r.screen_height,browser:r.browser,browser_version:r.browser_version,referrer:r.referrer,referrer_host:r.referrer_host,width:r.screen_width,height:r.screen_height,screen_width:r.screen_width,screen_height:r.screen_height,utm_term:r.utm.utm_term,utm_content:r.utm.utm_content,utm_source:r.utm.utm_source,utm_medium:r.utm.utm_medium,utm_campaign:r.utm.utm_campaign,tracer_data:JSON.stringify(r.utm.tracer_data),custom:{},wechat_unionid:Xf,wechat_openid:Xf}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(r),this.initDomain(),this.initABData()}return t.prototype.initDomain=function(){var t=this.initConfig.channel_domain;if(t)this.domain=t;else{var e=this.initConfig.channel;this.domain=ef(Wf[e])}},t.prototype.setDomain=function(t){this.domain=t},t.prototype.getDomain=function(){return this.domain},t.prototype.initABData=function(){var t="__tea_sdk_ab_version_"+this.initConfig.app_id,e=null;if(this.initConfig.ab_cross){var r=this.localStorage.getCookie(t,this.initConfig.ab_cookie_domain);e=r?JSON.parse(r):null}else e=this.localStorage.getItem(t);this.setAbCache(e)},t.prototype.setAbCache=function(t){this.ab_cache=t},t.prototype.getAbCache=function(){return this.ab_cache},t.prototype.clearAbCache=function(){this.ab_cache={},this.ab_version=""},t.prototype.setAbVersion=function(t){this.ab_version=t},t.prototype.getAbVersion=function(){return this.ab_version},t.prototype.getUrl=function(t){var e="";switch(t){case"event":e="/list";break;case"webid":e="/webid";break;case"tobid":e="/tobid";break;case"profile":e="/profile/list"}var r="";return this.initConfig.caller&&(r="?sdk_version=0.1.0&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),this.initConfig.enable_encryption&&"event"===t&&"sm"!==this.initConfig.encryption_type&&(r=this.initConfig.caller?r+"&encryption=1":r+"?encryption=1"),this.initConfig.report_url?""+this.initConfig.report_url+r:""+this.getDomain()+e+r},t.prototype.setCustom=function(t){if(t&&t.latest_data&&t.latest_data.isLast)for(var e in delete t.latest_data.isLast,this.isLast=!0,t.latest_data)this.envInfo.header.custom[e]=t.latest_data[e]},t.prototype.set=function(t){var e=this;Object.keys(t).forEach((function(r){void 0!==t[r]&&null!==t[r]||e.delete(r);try{e.eventCheck.calculate(r,"config")}catch(t){}if("traffic_type"===r&&e.isLast&&(e.envInfo.header.custom.$latest_traffic_source_type=t[r]),"evtParams"===r)e.evtParams=Jh({},e.evtParams||{},t.evtParams||{});else if("_staging_flag"===r)e.evtParams=Jh({},e.evtParams||{},{_staging_flag:t._staging_flag});else if("reportErrorCallback"===r&&"function"==typeof t[r])e.reportErrorCallback=t[r];else{var n="",i="";if(r.indexOf(".")>-1){var o=r.split(".");n=o[0],i=o[1]}n?"user"===n||"header"===n?e.envInfo[n][i]=t[r]:e.envInfo.header.custom[i]=t[r]:Object.hasOwnProperty.call(e.envInfo.user,r)?["user_type","ip_addr_id"].indexOf(r)>-1?e.envInfo.user[r]=t[r]?Number(t[r]):t[r]:["user_id","web_id","user_unique_id","user_unique_id_type","anonymous_id"].indexOf(r)>-1?e.envInfo.user[r]=t[r]?String(t[r]):t[r]:["user_is_auth","user_is_login"].indexOf(r)>-1?e.envInfo.user[r]=Boolean(t[r]):"device_id"===r&&(e.envInfo.user[r]=t[r]):Object.hasOwnProperty.call(e.envInfo.header,r)?e.envInfo.header[r]=t[r]:e.envInfo.header.custom[r]=t[r]}}))},t.prototype.get=function(t){try{return t?"evtParams"===t?this.evtParams:"reportErrorCallback"===t?this[t]:Object.hasOwnProperty.call(this.envInfo.user,t)?this.envInfo.user[t]:Object.hasOwnProperty.call(this.envInfo.header,t)?this.envInfo.header[t]:JSON.parse(JSON.stringify(this.envInfo[t])):JSON.parse(JSON.stringify(this.envInfo))}catch(t){console.log("get config stringify error "),this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},t.prototype.setStore=function(t){try{if(!this.configPersist)return;var e=this.storage.getItem(this.configKey)||{};if(e&&Object.keys(t).length){var r=Object.assign(t,e);this.storage.setItem(this.configKey,r)}}catch(t){console.log("setStore error"),this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},t.prototype.getStore=function(){try{if(!this.configPersist)return null;var t=this.storage.getItem(this.configKey)||{};return t&&Object.keys(t).length?t:null}catch(t){return this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),null}},t.prototype.delete=function(t){try{if(!this.configPersist)return;var e=this.storage.getItem(this.configKey)||{};e&&Object.hasOwnProperty.call(e,t)&&(delete e[t],this.storage.setItem(this.configKey,e))}catch(t){this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("delete error")}},t}(),rp=function(){function t(t,e){this.isLog=e||!1,this.name=t||""}return t.prototype.info=function(t){this.isLog&&console.log("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+t)},t.prototype.warn=function(t){this.isLog&&console.warn("%c %s","color: yellow; background-color: black;","[instance: "+this.name+"] "+t)},t.prototype.error=function(t){this.isLog&&console.error("[instance: "+this.name+"] "+t)},t.prototype.throw=function(t){throw this.error(this.name),new Error(t)},t}(),np=function(){function t(t,e){this.native=t.enable_native||t["evitaN".split("").reverse().join("")],this.os=e.get("os_name")}var e=t.prototype;return e.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(t){return console.log("AppLogBridge is not inject"),!1}},e.bridgeReady=function(){var t=this;return new Promise((function(e,r){try{t.bridgeInject()?AppLogBridge.hasStarted((function(t){console.log("AppLogBridge is started? : "+t),t?e(!0):r(!1)})):r(!1)}catch(t){console.log("AppLogBridge, error:"+JSON.stringify(t.stack)),r(!1)}}))},e.setNativeAppId=function(t){try{AppLogBridge.setNativeAppId(JSON.stringify(t)),console.log("change bridge appid, event report with appid: "+t)}catch(t){console.error("setNativeAppId error")}},e.setConfig=function(t){var e=this;try{Object.keys(t).forEach((function(r){"user_unique_id"===r?e.setUserUniqueId(t[r]):t[r]?e.addHeaderInfo(r,t[r]):e.removeHeaderInfo(r)}))}catch(t){console.error("setConfig error")}},e.setUserUniqueId=function(t){try{AppLogBridge.setUserUniqueId(t)}catch(t){console.error("setUserUniqueId error")}},e.addHeaderInfo=function(t,e){try{AppLogBridge.addHeaderInfo(t,e)}catch(t){console.error("addHeaderInfo error")}},e.setHeaderInfo=function(t){try{AppLogBridge.setHeaderInfo(JSON.stringify(t))}catch(t){console.error("setHeaderInfo error")}},e.removeHeaderInfo=function(t){try{AppLogBridge.removeHeaderInfo(t)}catch(t){console.error("removeHeaderInfo error")}},e.reportPv=function(t){this.onEventV3("predefine_pageview",t)},e.onEventV3=function(t,e){try{AppLogBridge.onEventV3(t,e)}catch(t){console.error("onEventV3 error")}},e.profileSet=function(t){try{AppLogBridge.profileSet(t)}catch(t){console.error("profileSet error")}},e.profileSetOnce=function(t){try{AppLogBridge.profileSetOnce(t)}catch(t){console.error("profileSetOnce error")}},e.profileIncrement=function(t){try{AppLogBridge.profileIncrement(t)}catch(t){console.error("profileIncrement error")}},e.profileUnset=function(t){try{AppLogBridge.profileUnset(t)}catch(t){console.error("profileUnset error")}},e.profileAppend=function(t){try{AppLogBridge.profileAppend(t)}catch(t){console.error("profileAppend error")}},e.setExternalAbVersion=function(t){try{AppLogBridge.setExternalAbVersion(t)}catch(t){console.error("setExternalAbVersion error")}},e.getVar=function(t,e,r){try{"android"===this.os?r(AppLogBridge.getABTestConfigValueForKey(t,e)):AppLogBridge.getABTestConfigValueForKey(t,e,(function(t){r(t)}))}catch(t){console.error("getVar error"),r(e)}},e.getAllVars=function(t){try{"android"===this.os?t(AppLogBridge.getAllAbTestConfigs()):AppLogBridge.getAllAbTestConfigs((function(e){t(e)}))}catch(e){console.error("getAllVars error"),t(null)}},e.getAbSdkVersion=function(t){try{"android"===this.os?t(AppLogBridge.getAbSdkVersion()):AppLogBridge.getAbSdkVersion((function(e){t(e)}))}catch(e){console.error("getAbSdkVersion error"),t("")}},t}(),ip=rr.filter,op=bn("filter");Me({target:"Array",proto:!0,forced:!op},{filter:function(t){return ip(this,t,arguments.length>1?arguments[1]:void 0)}});var sp=500,ap=5005;function cp(t,e,r,n,i,o,s,a,c,u){try{var h=new XMLHttpRequest,l=a||"POST";h.open(l,""+t,!0),c&&u?h.setRequestHeader("Content-Type","application/octet-stream;tt-data="+u):h.setRequestHeader("Content-Type","application/json; charset=utf-8"),s&&h.setRequestHeader("X-MCS-AppKey",""+s),n&&(h.withCredentials=!0),r&&(h.timeout=r,h.ontimeout=function(){o&&o(e,ap)}),h.onload=function(){if(i){var t=null;if(h.responseText){try{t=JSON.parse(h.responseText)}catch(e){t={}}i(t,e)}}},h.onerror=function(){h.abort(),o&&o(e,sp)},c?h.send(e):h.send(JSON.stringify(e))}catch(t){}}var up=4001,hp=4e3,lp=4002,fp=4003,pp=function(t,e,r,n){try{var i=t.match(/\/v\d\//),o="";o=i?i[0]:-1!==t.indexOf("/v1/")?"/v1/":"/v2/";var s=t.split(o)[0];if(!s)return void n(t,e,up);e.forEach((function(i){var o=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&void 0!==t[r]&&(e+="&"+r+"="+encodeURIComponent(JSON.stringify(t[r])));return"&"===e[0]?e.slice(1):e}(i),a=new Image(1,1);a.onload=function(){a=null,r&&r()},a.onerror=function(){a=null,n&&n(t,e,hp)},a.src=s+"/gif?"+o}))}catch(r){n&&n(t,e,lp,r.message)}},dp=function(t,e,r,n,i,o,s,a,c){var u=window.navigator.userAgent;if(-1===window.navigator.appName.indexOf("Microsoft Internet Explorer")||-1===u.indexOf("MSIE 8.0")&&-1===u.indexOf("MSIE 9.0")){if(s)return window.navigator&&window.navigator.sendBeacon?void(window.navigator.sendBeacon(t,JSON.stringify(e))?i():o(t,e,fp)):void pp(t,e,i,o)}else pp(t,e,i,o);cp(t,e,r,n,i,o,"","",a,c)},gp=function(){function t(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return t.prototype.apply=function(t,e){var r=this;this.collect=t,this.config=e,this.configManager=t.configManager,this.cacheStorgae=new Hf(!0),this.localStorage=new Hf(!1),this.eventCheck=new $f(t,e),this.maxReport=e.max_report||20,this.reportTime=e.reportTime||30,this.timeout=e.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.collect.on(Yf.Ready,(function(){r.reportAll(!1)})),this.collect.on(Yf.ConfigDomain,(function(){r.reportUrl=r.configManager.getUrl("event")})),this.collect.on(Yf.Event,(function(t){r.event(t)})),this.collect.on(Yf.BeconEvent,(function(t){r.beconEvent(t)})),this.collect.on(Yf.CleanEvents,(function(){r.reportAll(!1)})),this.linster()},t.prototype.linster=function(){var t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),rf((function(){t.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)},t.prototype.reportAll=function(t){this.report(t),this.reportBecon()},t.prototype.event=function(t){var e=this;try{var r=Yh(t,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,r),this.reportTimeout&&clearTimeout(this.reportTimeout),r.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout((function(){e.report(!1),e.reportTimeout=null}),n)}}catch(t){this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},t.prototype.beconEvent=function(t){var e=Yh(t,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,e),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))},t.prototype.reportBecon=function(){var t=this.cacheStorgae.getItem(this.beconKey)||[];t&&t.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},t.prototype.report=function(t){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.eventKey)||[];e.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(e,t))}},t.prototype.sliceEvent=function(t,e){if(t.length>this.eventLimit)for(var r=0;r<t.length;r+=this.eventLimit){var n;n=t.slice(r,r+this.eventLimit);var i=this.split(this.merge(n));this.send(i,e)}else{i=this.split(this.merge(t));this.send(i,e)}},t.prototype.handleRefer=function(){var t="";try{if(this.config.spa||this.config.autotrack){var e=this.localStorage.getItem(this.refer_key)||{};t=e.routeChange?e.refer_key:this.configManager.get("referrer")}else t=this.configManager.get("referrer")}catch(e){t=document.referrer}return t},t.prototype.merge=function(t,e){var r=this,n=this.configManager.get(),i=n.header,o=n.user;i.referrer=this.handleRefer(),i.custom=JSON.stringify(i.custom);var s=this.configManager.get("evtParams"),a=this.configManager.get("user_unique_id_type"),c=t.map((function(t){try{if(Object.keys(s).length&&!e&&(t.params=Jh({},t.params,s)),r.collect.dynamicParamsFilter){var n=r.collect.dynamicParamsFilter();Object.keys(n).length&&(t.params=Jh({},t.params,n))}a&&(t.params.$user_unique_id_type=a);var i=r.configManager.getAbCache(),c=r.configManager.getAbVersion();return c&&i&&(r.config.disable_ab_reset||i.uuid===o.user_unique_id)&&(t.ab_sdk_version=c),t.session_id=r.collect.sessionManager.getSessionId(),t.params=JSON.stringify(t.params),t}catch(e){return r.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),t}})),u=[];if(!Object.keys(o).length)return console.warn("user info error,cant report"),u;this.config.enable_anonymousid&&delete o.web_id;var h=JSON.parse(JSON.stringify({events:c,user:o,header:i}));return h.local_time=Math.floor(Date.now()/1e3),h.verbose=1,h.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,u.push(h),u},t.prototype.split=function(t){return t=t.map((function(t){var e=[];return e.push(t),e}))},t.prototype.send=function(t,e){var r=this;t.length&&t.forEach((function(t){try{var n=JSON.parse(JSON.stringify(t));r.config.filter&&((n=r.config.filter(n))||console.warn("filter must return data !!")),r.collect.eventFilter&&n&&((n=r.collect.eventFilter(n))||console.warn("filterEvent api must return data !!"));var i=n||t,o=JSON.parse(JSON.stringify(i));if(r.eventCheck.checkVerify(o),!i.length)return;r.collect.emit(Yf.SubmitBefore,i);var s=r.collect.cryptoData(i);dp(r.reportUrl,s,r.timeout,!1,(function(t,e){t&&0!==t.e?(r.collect.emit(Yf.SubmitError,{type:"f_data",eventData:e,errorCode:t.e,response:t}),r.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_EVENT,info:"埋点上报失败",time:Date.now(),data:o,code:t.e,failType:"数据异常",status:"fail"})):(r.collect.emit(Yf.SubmitScuess,{eventData:e,res:t}),r.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:o,code:200,status:"success"}))}),(function(t,e){r.configManager.get("reportErrorCallback")(t,e),r.collect.emit(Yf.SubmitError,{type:"f_net",eventData:t,errorCode:e}),r.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_EVENT,info:"埋点上报网络异常",time:Date.now(),data:o,code:e,failType:"网络异常",status:"fail"})}),e,r.config.enable_encryption,r.config.encryption_header),r.eventCheck.checkVerify(i),r.collect.emit(Yf.SubmitVerifyH,i),r.collect.emit(Yf.SubmitAfter,i)}catch(t){console.warn("something error, "+JSON.stringify(t.stack)),r.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}}))},t}(),vp=function t(e){return e?(e^16*Math.random()>>e/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)},mp=function(){return vp().replace(/-/g,"").slice(0,19)},yp=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},bp=function(){function t(){}return t.prototype.apply=function(t,e){var r=this;this.collect=t,this.storage=new Hf(!1,"session"),this.sessionKey="__tea_session_id_"+e.app_id,this.expireTime=e.expireTime||18e5,this.disableSession=e.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(Yf.SessionReset,(function(){r.resetSessionId()})),this.collect.on(Yf.SessionResetTime,(function(){r.updateSessionIdTime()})))},t.prototype.updateSessionIdTime=function(){var t=this.storage.getItem(this.sessionKey);if(t&&t.sessionId){var e=t.timestamp;Date.now()-e>this.expireTime?t={sessionId:yp(),timestamp:Date.now()}:t.timestamp=Date.now(),this.storage.setItem(this.sessionKey,t),this.resetExpTime()}},t.prototype.setSessionId=function(){var t=this,e=this.storage.getItem(this.sessionKey);e&&e.sessionId?e.timestamp=Date.now():e={sessionId:yp(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e),this.sessionExp=setInterval((function(){t.checkEXp()}),this.expireTime)},t.prototype.getSessionId=function(){var t=this.storage.getItem(this.sessionKey);return this.disableSession?"":t&&t.sessionId?t.sessionId:""},t.prototype.resetExpTime=function(){var t=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){t.checkEXp()}),this.expireTime))},t.prototype.resetSessionId=function(){var t={sessionId:yp(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,t)},t.prototype.checkEXp=function(){var t=this.storage.getItem(this.sessionKey);t&&t.sessionId&&(Date.now()-t.timestamp+30>=this.expireTime&&(t={sessionId:yp(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t)))},t}(),_p=function(){function t(){this.cacheToken={},this.enableCookie=!1,this.enableTTwebid=!1,this.enableCustomWebid=!1,this.enableAnonymousid=!1}return t.prototype.apply=function(t,e){var r=this;this.collect=t,this.config=e,this.configManager=this.collect.configManager,this.storage=new Hf(!1),this.tokenKey="__tea_cache_tokens_"+e.app_id,this.enableAnonymousid=e.enable_anonymousid,this.enableTTwebid=e.enable_ttwebid,this.enableCustomWebid=e.enable_custom_webid,this.collect.on(Yf.AnonymousId,(function(t){r.setAnonymousId(t)})),this.collect.on(Yf.ConfigUuid,(function(t){r.setUuid(t)})),this.collect.on(Yf.ConfigWebId,(function(t){r.setWebId(t)})),this.enableCookie=e.cross_subdomain,this.expiresTime=e.cookie_expire||6048e5,this.cookieDomain=e.cookie_domain||"",this.checkStorage()},t.prototype.checkStorage=function(){var t=this;if(this.enableCookie){var e=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=e&&"string"==typeof e?JSON.parse(e):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid||this.enableAnonymousid?this.enableAnonymousid?this.completeAnonymous(this.cacheToken):this.enableCustomWebid?this.collect.on(Yf.CustomWebId,(function(){t.tokenReady=!0,t.collect.emit(Yf.TokenComplete)})):this.checkEnv()||(this.enableTTwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},t.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:mp(),user_unique_id:this.configManager.get("user_unique_id")||mp()}):this.remoteWebid()},t.prototype.checkEnv=function(){var t=window.navigator.userAgent;if(-1!==t.indexOf("miniProgram")||-1!==t.indexOf("MiniProgram")){var e=sf(window.location.href);return!(!e||!e.Web_ID)&&(this.complete({web_id:""+e.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+e.Web_ID}),!0)}return!1},t.prototype.remoteWebid=function(){var t=this,e=this.configManager.getUrl("webid"),r={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 发起WEBID请求",logType:"fetch",level:"info",time:Date.now(),data:r});var n=mp();cp(e,this.collect.cryptoData(r),3e5,!1,(function(e){var r;e&&0===e.e?(r=e.web_id,t.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"WEBID请求成功",logType:"fetch",level:"info",time:Date.now(),data:e})):(r=n,t.collect.configManager.set({localWebId:n}),t.collect.emit(Yf.TokenError),t.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"WEBID请求返回值异常",logType:"fetch",level:"warn",time:Date.now(),data:e}),t.collect.logger.warn("appid: "+t.config.app_id+" get webid error, use local webid~")),t.complete({web_id:t.configManager.get("web_id")||r,user_unique_id:t.configManager.get("user_unique_id")||r})}),(function(){t.complete({web_id:t.configManager.get("web_id")||n,user_unique_id:t.configManager.get("user_unique_id")||n}),t.collect.configManager.set({localWebId:n}),t.collect.emit(Yf.TokenError),t.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"WEBID请求网络异常",logType:"fetch",level:"error",time:Date.now(),data:null}),t.collect.logger.warn("appid: "+t.config.app_id+", get webid error, use local webid~")}),"","",this.config.enable_encryption,this.config.encryption_header)},t.prototype.complete=function(t){var e=t.web_id,r=t.user_unique_id;if(!e&&!r)return this.collect.emit(Yf.TokenError),void console.warn("token error");t.timestamp=Date.now(),this.collect.configManager.set({web_id:e,user_unique_id:r}),this.setStorage(t),this.tokenReady=!0,this.collect.emit(Yf.TokenComplete)},t.prototype.completeAnonymous=function(t){var e=t.anonymous_id||yp(),r=t.user_unique_id||this.configManager.get("user_unique_id");this.collect.configManager.set({anonymous_id:e,user_unique_id:r||e}),t.anonymous_id=e,t.user_unique_id=r||e,this.setStorage(t),this.tokenReady=!0,this.collect.emit(Yf.TokenComplete)},t.prototype.completeTtWid=function(t){var e=t.user_unique_id||"",r=this.configManager.get("user_unique_id");this.configManager.set({user_unique_id:r||e}),this.setStorage(t),this.tokenReady=!0,this.collect.emit(Yf.TokenComplete)},t.prototype.setUuid=function(t){if(t&&-1===["null","undefined","Null","None"].indexOf(t)){var e=String(t),r=this.configManager.get("user_unique_id"),n=this.cacheToken&&this.cacheToken.user_unique_id;if(e===r&&e===n)return;this.configManager.set({user_unique_id:e}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=e,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(Yf.TokenChange,{type:"uuid",id:t}),this.collect.emit(Yf.SessionReset)}else this.clearUuid()},t.prototype.clearUuid=function(){if(!this.config.enable_ttwebid){var t=this.enableAnonymousid?this.configManager.get("anonymous_id"):this.configManager.get("web_id");this.configManager.get("user_unique_id")!==t&&(this.configManager.set({user_unique_id:t}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(Yf.TokenReset))}},t.prototype.setAnonymousId=function(t){if(t&&this.enableAnonymousid){var e=this.configManager.get("anonymous_id"),r=this.configManager.get("user_unique_id");e!==t&&(e!==r&&r||(this.configManager.set({user_unique_id:t}),this.cacheToken.user_unique_id=t,this.collect.emit(Yf.TokenChange,{type:"uuid",id:t})),this.configManager.set({anonymous_id:t}),this.cacheToken.anonymous_id=t,this.collect.emit(Yf.TokenChange,{type:"anonymous_id",id:t}),this.setStorage(this.cacheToken))}},t.prototype.setWebId=function(t){if(t&&!this.config.enable_ttwebid&&!this.enableAnonymousid){var e=this.configManager.get("web_id"),r=this.configManager.get("user_unique_id");r&&r!==e||(this.configManager.set({user_unique_id:t}),this.cacheToken.user_unique_id=t,this.collect.emit(Yf.TokenChange,{type:"uuid",id:t})),e!==t&&(this.configManager.set({web_id:t}),this.cacheToken.web_id=t,this.collect.emit(Yf.TokenChange,{type:"webid",id:t})),this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}},t.prototype.setStorage=function(t){t._type_=this.enableCustomWebid?"custom":"default",delete t["diss".split("").reverse().join("")],this.enableCookie||this.enableTTwebid?this.storage.setCookie(this.tokenKey,t,this.expiresTime,this.cookieDomain):this.storage.setItem(this.tokenKey,t),this.cacheToken=t},t.prototype.getReady=function(){return this.tokenReady},t.prototype.getTobId=function(){var t=this,e=this.configManager.getUrl("tobid"),r={app_id:this.config.app_id,user_unique_id:this.configManager.get("user_unique_id"),user_unique_id_type:this.configManager.get("user_unique_id_type")};this.enableAnonymousid?r.anonymous_id=this.configManager.get("anonymous_id"):r.web_id=this.configManager.get("web_id");var n=this.collect.cryptoData(r);return new Promise((function(r){cp(e,n,3e4,t.enableTTwebid,(function(t){t&&0===t.e?r(t.tobid):r("")}),(function(){r("")}),"","",t.config.enable_encryption,t.config.encryption_header)}))},t}(),Ep=e((function(e,r){(function(){var t;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function n(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var c=32767&this[t],u=this[t++]>>15,h=a*c+u*s;i=((c=s*c+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+a*u+(i>>>30),r[n++]=1073741823&c}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},t=26):(r.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var c=16383&this[t],u=this[t++]>>14,h=a*c+u*s;i=((c=s*c+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+a*u,r[n++]=268435455&c}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var o,s,a=new Array;for(o="0".charCodeAt(0),s=0;s<=9;++s)a[o++]=s;for(o="a".charCodeAt(0),s=10;s<36;++s)a[o++]=s;for(o="A".charCodeAt(0),s=10;s<36;++s)a[o++]=s;function c(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function u(t,e){var r=a[t.charCodeAt(e)];return null==r?-1:r}function h(t){var e=n();return e.fromInt(t),e}function l(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function f(t){this.m=t}function p(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function d(t,e){return t&e}function g(t,e){return t|e}function v(t,e){return t^e}function m(t,e){return t&~e}function y(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function _(){}function E(t){return t}function w(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}f.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},f.prototype.revert=function(t){return t},f.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},p.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},p.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},p.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},p.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},p.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==n?255&t[i]:u(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+s+1]=this[r]>>i|a,a=(this[r]&o)<<n;for(r=s-1;r>=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<i,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o<i.t;++o)e[o+n.t]=n.am(0,i[o],e,o,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=n());var a=n(),c=this.s,u=t.s,h=this.DB-l(o[o.t-1]);h>0?(o.lShiftTo(h,a),s.lShiftTo(h,i)):(o.copyTo(a),s.copyTo(i));var f=a.t,p=a[f-1];if(0!=p){var d=p*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),g=this.FV/d,v=(1<<this.F1)/d,m=1<<this.F2,y=i.t,b=y-f,_=null==e?n():e;for(a.dlShiftTo(b,_),i.compareTo(_)>=0&&(i[i.t++]=1,i.subTo(_,i)),r.ONE.dlShiftTo(f,_),_.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--b>=0;){var E=i[--y]==p?this.DM:Math.floor(i[y]*g+(i[y-1]+m)*v);if((i[y]+=a.am(0,E,i,b,0,f))<E)for(a.dlShiftTo(b,_),i.subTo(_,i);i[y]<--E;)i.subTo(_,i)}null!=e&&(i.drShiftTo(f,e),c!=u&&r.ZERO.subTo(e,e)),i.t=f,i.clamp(),h>0&&i.rShiftTo(h,i),c<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=n(),o=n(),s=e.convert(this),a=l(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<<a)>0)e.mulTo(o,s,i);else{var c=i;i=o,o=c}return e.revert(i)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=c(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=c(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new f(e):new p(e),this.exp(t,r)},r.ZERO=h(0),r.ONE=h(1),_.prototype.convert=E,_.prototype.revert=E,_.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},_.prototype.sqrTo=function(t,e){t.squareTo(e)},w.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},w.prototype.revert=function(t){return t},w.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},w.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var S,T,A,k=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/k[k.length-1];function O(){var t;t=(new Date).getTime(),T[A++]^=255&t,T[A++]^=t>>8&255,T[A++]^=t>>16&255,T[A++]^=t>>24&255,A>=B&&(A-=B)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=h(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,s=0,a=0,c=0;c<t.length;++c){var h=u(t,c);h<0?"-"==t.charAt(c)&&0==this.signum()&&(o=!0):(a=e*a+h,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),g,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},r.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>k.length&&(t=k.length);for(var s=n(),a=0;a<t;++a){s.fromInt(k[Math.floor(Math.random()*k.length)]);var c=s.modPow(o,this);if(0!=c.compareTo(r.ONE)&&0!=c.compareTo(e)){for(var u=1;u++<i&&0!=c.compareTo(e);)if(0==(c=c.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=c.compareTo(e))return!1}}return!0},r.prototype.clone=function(){var t=n();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,d,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,v,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+y(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=b(this[r]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function(t){return this.changeBit(t,g)},r.prototype.clearBit=function(t){return this.changeBit(t,m)},r.prototype.flipBit=function(t){return this.changeBit(t,v)},r.prototype.add=function(t){var e=n();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=n(),r=n();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function(t,e){var r,i,o=t.bitLength(),s=h(1);if(o<=0)return s;r=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new f(e):e.isEven()?new w(e):new p(e);var a=new Array,c=3,u=r-1,d=(1<<r)-1;if(a[1]=i.convert(this),r>1){var g=n();for(i.sqrTo(a[1],g);c<=d;)a[c]=n(),i.mulTo(g,a[c-2],a[c]),c+=2}var v,m,y=t.t-1,b=!0,_=n();for(o=l(t[y])-1;y>=0;){for(o>=u?v=t[y]>>o-u&d:(v=(t[y]&(1<<o+1)-1)<<u-o,y>0&&(v|=t[y-1]>>this.DB+o-u)),c=r;0==(1&v);)v>>=1,--c;if((o-=c)<0&&(o+=this.DB,--y),b)a[v].copyTo(s),b=!1;else{for(;c>1;)i.sqrTo(s,_),i.sqrTo(_,s),c-=2;c>0?i.sqrTo(s,_):(m=s,s=_,_=m),i.mulTo(_,a[v],s)}for(;y>=0&&0==(t[y]&1<<o);)i.sqrTo(s,_),m=s,s=_,_=m,--o<0&&(o=this.DB-1,--y)}return i.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var n=t.clone(),i=this.clone(),o=h(1),s=h(0),a=h(0),c=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),e?(a.isEven()&&c.isEven()||(a.addTo(this,a),c.subTo(t,c)),a.rShiftTo(1,a)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);n.compareTo(i)>=0?(n.subTo(i,n),e&&o.subTo(a,o),s.subTo(c,s)):(i.subTo(n,i),e&&a.subTo(o,a),c.subTo(s,c))}return 0!=i.compareTo(r.ONE)?r.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},r.prototype.pow=function(t){return this.exp(t,new _)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=k[k.length-1]){for(e=0;e<k.length;++e)if(r[0]==k[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<k.length;){for(var n=k[e],i=e+1;i<k.length&&n<x;)n*=k[i++];for(n=r.modInt(n);e<i;)if(n%k[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function(){var t=n();return this.squareTo(t),t},r.prototype.Barrett=w,null==T){var I;if(T=new Array,A=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var R=new Uint8Array(32);for(window.crypto.getRandomValues(R),I=0;I<32;++I)T[A++]=R[I]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var D=window.crypto.random(32);for(I=0;I<D.length;++I)T[A++]=255&D.charCodeAt(I)}for(;A<B;)I=Math.floor(65536*Math.random()),T[A++]=I>>>8,T[A++]=255&I;A=0,O()}function M(){if(null==S){for(O(),(S=new P).init(T),A=0;A<T.length;++A)T[A]=0;A=0}return S.next()}function C(){}function P(){this.i=0,this.j=0,this.S=new Array}C.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=M()},P.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},P.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var B=256;e.exports={default:r,BigInteger:r,SecureRandom:C}}).call(t)}));Ep.BigInteger,Ep.SecureRandom;const{BigInteger:wp}=Ep;class Sp{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const t=this.v.length/2;let e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;return(128+e.length/2).toString(16)+e}getValue(){return""}}class Tp extends Sp{constructor(t){super(),this.t="02",t&&(this.v=function(t){let e=t.toString(16);if("-"!==e[0])e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{e=e.substr(1);let r=e.length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);let n="";for(let t=0;t<r;t++)n+="f";n=new wp(n,16),e=n.xor(t).add(wp.ONE),e=e.toString(16).replace(/^-/,"")}return e}(t))}getValue(){return this.v}}class Ap extends Sp{constructor(t){super(),this.t="30",this.asn1Array=t}getValue(){return this.v=this.asn1Array.map((t=>t.getEncodedHex())).join(""),this.v}}function kp(t,e){return+t[e+2]<8?1:128&+t.substr(e+2,2)}function xp(t,e){const r=kp(t,e),n=t.substr(e+2,2*r);if(!n)return-1;return(+n[0]<8?new wp(n,16):new wp(n.substr(2),16)).intValue()}function Op(t,e){return e+2*(kp(t,e)+1)}var Ip={encodeDer(t,e){const r=new Tp(t),n=new Tp(e);return new Ap([r,n]).getEncodedHex()},decodeDer(t){const e=Op(t,0),r=Op(t,e),n=xp(t,e),i=t.substr(r,2*n),o=r+i.length,s=Op(t,o),a=xp(t,o),c=t.substr(s,2*a);return{r:new wp(i,16),s:new wp(c,16)}}};const{BigInteger:Rp}=Ep,Dp=new Rp("2"),Mp=new Rp("3");class Cp{constructor(t,e){this.x=e,this.q=t}equals(t){return t===this||this.q.equals(t.q)&&this.x.equals(t.x)}toBigInteger(){return this.x}negate(){return new Cp(this.q,this.x.negate().mod(this.q))}add(t){return new Cp(this.q,this.x.add(t.toBigInteger()).mod(this.q))}subtract(t){return new Cp(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))}multiply(t){return new Cp(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))}divide(t){return new Cp(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new Cp(this.q,this.x.square().mod(this.q))}}class Pp{constructor(t,e,r,n){this.curve=t,this.x=e,this.y=r,this.z=null==n?Rp.ONE:n,this.zinv=null}getX(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(t){if(t===this)return!0;if(this.isInfinity())return t.isInfinity();if(t.isInfinity())return this.isInfinity();if(!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(Rp.ZERO))return!1;return t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(Rp.ZERO)}isInfinity(){return null===this.x&&null===this.y||this.z.equals(Rp.ZERO)&&!this.y.toBigInteger().equals(Rp.ZERO)}negate(){return new Pp(this.curve,this.x,this.y.negate(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=this.x.toBigInteger(),r=this.y.toBigInteger(),n=this.z,i=t.x.toBigInteger(),o=t.y.toBigInteger(),s=t.z,a=this.curve.q,c=e.multiply(s).mod(a),u=i.multiply(n).mod(a),h=c.subtract(u),l=r.multiply(s).mod(a),f=o.multiply(n).mod(a),p=l.subtract(f);if(Rp.ZERO.equals(h))return Rp.ZERO.equals(p)?this.twice():this.curve.infinity;const d=c.add(u),g=n.multiply(s).mod(a),v=h.square().mod(a),m=h.multiply(v).mod(a),y=g.multiply(p.square()).subtract(d.multiply(v)).mod(a),b=h.multiply(y).mod(a),_=p.multiply(v.multiply(c).subtract(y)).subtract(l.multiply(m)).mod(a),E=m.multiply(g).mod(a);return new Pp(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(_),E)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const t=this.x.toBigInteger(),e=this.y.toBigInteger(),r=this.z,n=this.curve.q,i=this.curve.a.toBigInteger(),o=t.square().multiply(Mp).add(i.multiply(r.square())).mod(n),s=e.shiftLeft(1).multiply(r).mod(n),a=e.square().mod(n),c=a.multiply(t).multiply(r).mod(n),u=s.square().mod(n),h=o.square().subtract(c.shiftLeft(3)).mod(n),l=s.multiply(h).mod(n),f=o.multiply(c.shiftLeft(2).subtract(h)).subtract(u.shiftLeft(1).multiply(a)).mod(n),p=s.multiply(u).mod(n);return new Pp(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(f),p)}multiply(t){if(this.isInfinity())return this;if(!t.signum())return this.curve.infinity;const e=t.multiply(Mp),r=this.negate();let n=this;for(let i=e.bitLength()-2;i>0;i--){n=n.twice();const o=e.testBit(i);o!==t.testBit(i)&&(n=n.add(o?this:r))}return n}}var Bp={ECPointFp:Pp,ECCurveFp:class{constructor(t,e,r){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(r),this.infinity=new Pp(this,null,null)}equals(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)}fromBigInteger(t){return new Cp(this.q,t)}decodePointHex(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const e=this.fromBigInteger(new Rp(t.substr(2),16));let r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new Rp("4")).add(Rp.ONE),this.q));return r.toBigInteger().mod(Dp).equals(new Rp(t.substr(0,2),16).subtract(Dp))||(r=r.negate()),new Pp(this,e,r);case 4:case 6:case 7:const n=(t.length-2)/2,i=t.substr(2,n),o=t.substr(n+2,n);return new Pp(this,this.fromBigInteger(new Rp(i,16)),this.fromBigInteger(new Rp(o,16)));default:return null}}}};const{BigInteger:Lp,SecureRandom:Gp}=Ep,{ECCurveFp:Up}=Bp,Np=new Gp,{curve:Fp,G:jp,n:zp}=Vp();function Vp(){const t=new Lp("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new Lp("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),r=new Lp("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),n=new Up(t,e,r),i=n.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:n,G:i,n:new Lp("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function qp(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}var Hp={getGlobalCurve:function(){return Fp},generateEcparam:Vp,generateKeyPairHex:function(t,e,r){const n=(t?new Lp(t,e,r):new Lp(zp.bitLength(),Np)).mod(zp.subtract(Lp.ONE)).add(Lp.ONE),i=qp(n.toString(16),64),o=jp.multiply(n);return{privateKey:i,publicKey:"04"+qp(o.getX().toBigInteger().toString(16),64)+qp(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");const e=(t.length-2)/2,r=t.substr(2,e);let n="03";return new Lp(t.substr(e+2,e),16).mod(new Lp("2")).equals(Lp.ZERO)&&(n="02"),n+r},utf8ToHex:function(t){const e=(t=unescape(encodeURIComponent(t))).length,r=[];for(let n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;const n=[];for(let t=0;t<e;t++){const e=r[t>>>2]>>>24-t%4*8&255;n.push((e>>>4).toString(16)),n.push((15&e).toString(16))}return n.join("")},leftPad:qp,arrayToHex:function(t){return t.map((t=>1===(t=t.toString(16)).length?"0"+t:t)).join("")},arrayToUtf8:function(t){const e=[];let r=0;for(let n=0;n<2*t.length;n+=2)e[n>>>3]|=parseInt(t[r],10)<<24-n%8*4,r++;try{const r=[];for(let n=0;n<t.length;n++){const t=e[n>>>2]>>>24-n%4*8&255;r.push(String.fromCharCode(t))}return decodeURIComponent(escape(r.join("")))}catch(t){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){const e=[];let r=t.length;r%2!=0&&(t=qp(t,r+1)),r=t.length;for(let n=0;n<r;n+=2)e.push(parseInt(t.substr(n,2),16));return e},verifyPublicKey:function(t){const e=Fp.decodePointHex(t);if(!e)return!1;const r=e.getX();return e.getY().square().equals(r.multiply(r.square()).add(r.multiply(Fp.a)).add(Fp.b))},comparePublicKeyHex:function(t,e){const r=Fp.decodePointHex(t);if(!r)return!1;const n=Fp.decodePointHex(e);return!!n&&r.equals(n)}};const Kp=new Uint32Array(68),Wp=new Uint32Array(64);function Jp(t,e){const r=31&e;return t<<r|t>>>32-r}function $p(t,e){const r=[];for(let n=t.length-1;n>=0;n--)r[n]=255&(t[n]^e[n]);return r}function Yp(t){return t^Jp(t,9)^Jp(t,17)}function Xp(t){let e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;const n=new Array((r-7)/8),i=new Array(8);for(let t=0,e=n.length;t<e;t++)n[t]=0;for(let t=0,e=i.length;t<e;t++)i[t]=0;e=e.toString(2);for(let t=7;t>=0;t--)if(e.length>8){const r=e.length-8;i[t]=parseInt(e.substr(r),2),e=e.substr(0,r)}else e.length>0&&(i[t]=parseInt(e,2),e="");const o=new Uint8Array([...t,128,...n,...i]),s=new DataView(o.buffer,0),a=o.length/64,c=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let t=0;t<a;t++){Kp.fill(0),Wp.fill(0);const e=16*t;for(let t=0;t<16;t++)Kp[t]=s.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)Kp[t]=(u=Kp[t-16]^Kp[t-9]^Jp(Kp[t-3],15))^Jp(u,15)^Jp(u,23)^Jp(Kp[t-13],7)^Kp[t-6];for(let t=0;t<64;t++)Wp[t]=Kp[t]^Kp[t+4];const r=2043430169,n=2055708042;let i,o,a,h,l,f=c[0],p=c[1],d=c[2],g=c[3],v=c[4],m=c[5],y=c[6],b=c[7];for(let t=0;t<64;t++)l=t>=0&&t<=15?r:n,i=Jp(Jp(f,12)+v+Jp(l,t),7),o=i^Jp(f,12),a=(t>=0&&t<=15?f^p^d:f&p|f&d|p&d)+g+o+Wp[t],h=(t>=0&&t<=15?v^m^y:v&m|~v&y)+b+i+Kp[t],g=d,d=Jp(p,9),p=f,f=a,b=y,y=Jp(m,19),m=v,v=Yp(h);c[0]^=f,c[1]^=p,c[2]^=d,c[3]^=g,c[4]^=v,c[5]^=m,c[6]^=y,c[7]^=b}var u;const h=[];for(let t=0,e=c.length;t<e;t++){const e=c[t];h.push((4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e)}return h}const Zp=new Uint8Array(64),Qp=new Uint8Array(64);for(let t=0;t<64;t++)Zp[t]=54,Qp[t]=92;var td={sm3:Xp,hmac:function(t,e){for(e.length>64&&(e=Xp(e));e.length<64;)e.push(0);const r=$p(e,Zp),n=$p(e,Qp),i=Xp([...r,...t]);return Xp([...n,...i])}};const{BigInteger:ed}=Ep,{encodeDer:rd,decodeDer:nd}=Ip,id=td.sm3,{G:od,curve:sd,n:ad}=Hp.generateEcparam();function cd(t,e,r="1234567812345678"){r=Hp.utf8ToHex(r);const n=Hp.leftPad(od.curve.a.toBigInteger().toRadix(16),64),i=Hp.leftPad(od.curve.b.toBigInteger().toRadix(16),64),o=Hp.leftPad(od.getX().toBigInteger().toRadix(16),64),s=Hp.leftPad(od.getY().toBigInteger().toRadix(16),64);let a,c;if(128===e.length)a=e.substr(0,64),c=e.substr(64,64);else{const t=od.curve.decodePointHex(e);a=Hp.leftPad(t.getX().toBigInteger().toRadix(16),64),c=Hp.leftPad(t.getY().toBigInteger().toRadix(16),64)}const u=Hp.hexToArray(r+n+i+o+s+a+c),h=4*r.length;u.unshift(255&h),u.unshift(h>>8&255);const l=id(u);return Hp.arrayToHex(id(l.concat(Hp.hexToArray(t))))}function ud(){const t=Hp.generateKeyPairHex(),e=sd.decodePointHex(t.publicKey);return t.k=new ed(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}var hd={generateKeyPairHex:Hp.generateKeyPairHex,compressPublicKeyHex:Hp.compressPublicKeyHex,comparePublicKeyHex:Hp.comparePublicKeyHex,doEncrypt:function(t,e,r=1){t="string"==typeof t?Hp.hexToArray(Hp.utf8ToHex(t)):Array.prototype.slice.call(t),e=Hp.getGlobalCurve().decodePointHex(e);const n=Hp.generateKeyPairHex(),i=new ed(n.privateKey,16);let o=n.publicKey;o.length>128&&(o=o.substr(o.length-128));const s=e.multiply(i),a=Hp.hexToArray(Hp.leftPad(s.getX().toBigInteger().toRadix(16),64)),c=Hp.hexToArray(Hp.leftPad(s.getY().toBigInteger().toRadix(16),64)),u=Hp.arrayToHex(id([].concat(a,t,c)));let h=1,l=0,f=[];const p=[].concat(a,c),d=()=>{f=id([...p,h>>24&255,h>>16&255,h>>8&255,255&h]),h++,l=0};d();for(let e=0,r=t.length;e<r;e++)l===f.length&&d(),t[e]^=255&f[l++];const g=Hp.arrayToHex(t);return 0===r?o+g+u:o+u+g},doDecrypt:function(t,e,r=1,{output:n="string"}={}){e=new ed(e,16);let i=t.substr(128,64),o=t.substr(192);0===r&&(i=t.substr(t.length-64),o=t.substr(128,t.length-128-64));const s=Hp.hexToArray(o),a=Hp.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(e),c=Hp.hexToArray(Hp.leftPad(a.getX().toBigInteger().toRadix(16),64)),u=Hp.hexToArray(Hp.leftPad(a.getY().toBigInteger().toRadix(16),64));let h=1,l=0,f=[];const p=[].concat(c,u),d=()=>{f=id([...p,h>>24&255,h>>16&255,h>>8&255,255&h]),h++,l=0};d();for(let t=0,e=s.length;t<e;t++)l===f.length&&d(),s[t]^=255&f[l++];return Hp.arrayToHex(id([].concat(c,s,u)))===i.toLowerCase()?"array"===n?s:Hp.arrayToUtf8(s):"array"===n?[]:""},doSignature:function(t,e,{pointPool:r,der:n,hash:i,publicKey:o,userId:s}={}){let a="string"==typeof t?Hp.utf8ToHex(t):Hp.arrayToHex(t);i&&(o=o||function(t){const e=od.multiply(new ed(t,16)),r=Hp.leftPad(e.getX().toBigInteger().toString(16),64),n=Hp.leftPad(e.getY().toBigInteger().toString(16),64);return"04"+r+n}(e),a=cd(a,o,s));const c=new ed(e,16),u=new ed(a,16);let h=null,l=null,f=null;do{do{let t;t=r&&r.length?r.pop():ud(),h=t.k,l=u.add(t.x1).mod(ad)}while(l.equals(ed.ZERO)||l.add(h).equals(ad));f=c.add(ed.ONE).modInverse(ad).multiply(h.subtract(l.multiply(c))).mod(ad)}while(f.equals(ed.ZERO));return n?rd(l,f):Hp.leftPad(l.toString(16),64)+Hp.leftPad(f.toString(16),64)},doVerifySignature:function(t,e,r,{der:n,hash:i,userId:o}={}){let s,a,c="string"==typeof t?Hp.utf8ToHex(t):Hp.arrayToHex(t);if(i&&(c=cd(c,r,o)),n){const t=nd(e);s=t.r,a=t.s}else s=new ed(e.substring(0,64),16),a=new ed(e.substring(64),16);const u=sd.decodePointHex(r),h=new ed(c,16),l=s.add(a).mod(ad);if(l.equals(ed.ZERO))return!1;const f=od.multiply(a).add(u.multiply(l)),p=h.add(f.getX().toBigInteger()).mod(ad);return s.equals(p)},getPoint:ud,verifyPublicKey:Hp.verifyPublicKey};const{sm3:ld,hmac:fd}=td;function pd(t){return t.map((t=>1===(t=t.toString(16)).length?"0"+t:t)).join("")}function dd(t){const e=[];let r=t.length;var n,i;r%2!=0&&(i=r+1,t=(n=t).length>=i?n:new Array(i-n.length+1).join("0")+n),r=t.length;for(let n=0;n<r;n+=2)e.push(parseInt(t.substr(n,2),16));return e}const gd=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],vd=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function md(t){const e=[];for(let r=0,n=t.length;r<n;r+=2)e.push(parseInt(t.substr(r,2),16));return e}function yd(t,e){return t<<e|t>>>32-e}function bd(t){return(255&gd[t>>>24&255])<<24|(255&gd[t>>>16&255])<<16|(255&gd[t>>>8&255])<<8|255&gd[255&t]}function _d(t){return t^yd(t,2)^yd(t,10)^yd(t,18)^yd(t,24)}function Ed(t){return t^yd(t,13)^yd(t,23)}function wd(t,e,r){const n=new Array(4),i=new Array(4);for(let e=0;e<4;e++)i[0]=255&t[4*e],i[1]=255&t[4*e+1],i[2]=255&t[4*e+2],i[3]=255&t[4*e+3],n[e]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(let t,e=0;e<32;e+=4)t=n[1]^n[2]^n[3]^r[e+0],n[0]^=_d(bd(t)),t=n[2]^n[3]^n[0]^r[e+1],n[1]^=_d(bd(t)),t=n[3]^n[0]^n[1]^r[e+2],n[2]^=_d(bd(t)),t=n[0]^n[1]^n[2]^r[e+3],n[3]^=_d(bd(t));for(let t=0;t<16;t+=4)e[t]=n[3-t/4]>>>24&255,e[t+1]=n[3-t/4]>>>16&255,e[t+2]=n[3-t/4]>>>8&255,e[t+3]=255&n[3-t/4]}function Sd(t,e,r,{padding:n="pkcs#7",mode:i,iv:o=[],output:s="string"}={}){if("cbc"===i&&("string"==typeof o&&(o=md(o)),16!==o.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=md(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==r?function(t){const e=[];for(let r=0,n=t.length;r<n;r++){const n=t.codePointAt(r);if(n<=127)e.push(n);else if(n<=2047)e.push(192|n>>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}(t):md(t):[...t],("pkcs#5"===n||"pkcs#7"===n)&&0!==r){const e=16-t.length%16;for(let r=0;r<e;r++)t.push(e)}const a=new Array(32);!function(t,e,r){const n=new Array(4),i=new Array(4);for(let e=0;e<4;e++)i[0]=255&t[0+4*e],i[1]=255&t[1+4*e],i[2]=255&t[2+4*e],i[3]=255&t[3+4*e],n[e]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];n[0]^=2746333894,n[1]^=1453994832,n[2]^=1736282519,n[3]^=2993693404;for(let t,r=0;r<32;r+=4)t=n[1]^n[2]^n[3]^vd[r+0],e[r+0]=n[0]^=Ed(bd(t)),t=n[2]^n[3]^n[0]^vd[r+1],e[r+1]=n[1]^=Ed(bd(t)),t=n[3]^n[0]^n[1]^vd[r+2],e[r+2]=n[2]^=Ed(bd(t)),t=n[0]^n[1]^n[2]^vd[r+3],e[r+3]=n[3]^=Ed(bd(t));if(0===r)for(let t,r=0;r<16;r++)t=e[r],e[r]=e[31-r],e[31-r]=t}(e,a,r);const c=[];let u=o,h=t.length,l=0;for(;h>=16;){const e=t.slice(l,l+16),n=new Array(16);if("cbc"===i)for(let t=0;t<16;t++)0!==r&&(e[t]^=u[t]);wd(e,n,a);for(let t=0;t<16;t++)"cbc"===i&&0===r&&(n[t]^=u[t]),c[l+t]=n[t];"cbc"===i&&(u=0!==r?n:e),h-=16,l+=16}if(("pkcs#5"===n||"pkcs#7"===n)&&0===r){const t=c.length,e=c[t-1];for(let r=1;r<=e;r++)if(c[t-r]!==e)throw new Error("padding is invalid");c.splice(t-e,e)}return"array"!==s?0!==r?c.map((t=>1===(t=t.toString(16)).length?"0"+t:t)).join(""):function(t){const e=[];for(let r=0,n=t.length;r<n;r++)t[r]>=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}(c):c}var Td={encrypt:(t,e,r)=>Sd(t,e,1,r),decrypt:(t,e,r)=>Sd(t,e,0,r)},Ad={sm2:hd,sm3:function(t,e){if(t="string"==typeof t?function(t){const e=[];for(let r=0,n=t.length;r<n;r++){const n=t.codePointAt(r);if(n<=127)e.push(n);else if(n<=2047)e.push(192|n>>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}(t):Array.prototype.slice.call(t),e){if("hmac"!==(e.mode||"hmac"))throw new Error("invalid mode");let r=e.key;if(!r)throw new Error("invalid key");return r="string"==typeof r?dd(r):Array.prototype.slice.call(r),pd(fd(t,r))}return pd(ld(t))},sm4:Td},kd=Ad.sm2;var xd=function(){function t(t){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.adapters={},this.sdkReady=!1,this.name=t,this.hook=new el,this.logger=new rp(t),this.remotePlugin=new Map,this.Types=Yf,this.adapters.fetch=cp,this.adapters.storage=Hf}return t.usePlugin=function(e,r,n){if(r){for(var i=!1,o=0,s=t.plugins.length;o<s;o++){if(t.plugins[o].name===r){t.plugins[o].plugin=e,t.plugins[o].options=n||{},i=!0;break}}i||t.plugins.push({name:r,plugin:e,options:n})}else t.plugins.push({plugin:e})},t.prototype.init=function(e){var r,n=this;this.inited?console.log("init can be call only one time"):e&&Zl(e)?e.app_id&&("number"==typeof(r=e.app_id)&&!isNaN(r))?!e.app_key||function(t){return"string"==typeof t}(e.app_key)?(e.channel_domain||-1!==["cn","sg","va"].indexOf(e.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),e.channel="cn"),this.logger=new rp(this.name,e.log),this.configManager=new ep(this,e),this.appBridge=new np(e,this.configManager),this.bridgeReport=this.appBridge.bridgeInject(),this.initConfig=e,this.env=e.channel_domain?"self":"public",this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行INIT",data:e,level:"info",time:Date.now()}),e.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport?(this.inited=!0,this.emit(Yf.Init)):(e.enable_encryption&&"sm"===e.encryption_type&&this.initCrypto(),this.configManager.set({app_id:e.app_id}),this.eventManager=new gp,this.tokenManager=new _p,this.sessionManager=new bp,Promise.all([new Promise((function(t){n.once(Yf.TokenComplete,(function(){t(!0)}))})),new Promise((function(t){n.once(Yf.Start,(function(){t(!0)}))}))]).then((function(){try{t.plugins.reduce((function(t,e){var r=e.plugin,i=e.options,o=Object.assign(n.initConfig,i),s=new r;return s.apply(n,o),t.push(s),t}),n.pluginInstances)}catch(t){console.log("load plugin error, "+t.message),n.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}n.sdkReady=!0,n.emit(Yf.Ready),n.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 初始化完成",time:Date.now(),level:"info",data:n.configManager.get("user")}),n.logger.info("appid: "+e.app_id+", userInfo:"+JSON.stringify(n.configManager.get("user"))),n.logger.info("appid: "+e.app_id+", sdk is ready, version is 0.1.0, you can report now !!!");try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(t){n.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}n.pageView(),n.on(Yf.TokenChange,(function(t){"webid"!==t.type&&"anonymous_id"!==t.type||n.pageView(),n.logger.info("appid: "+e.app_id+" token change, new userInfo:"+JSON.stringify(n.configManager.get("user"))),n.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 设置了用户信息",time:Date.now(),secType:"USER",level:"info",data:n.configManager.get("user")})})),n.on(Yf.TokenReset,(function(){n.logger.info("appid: "+e.app_id+" token reset, new userInfo:"+JSON.stringify(n.configManager.get("user"))),n.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 重置了用户信息",time:Date.now(),secType:"USER",level:"info",data:n.configManager.get("user")})})),n.on(Yf.RouteChange,(function(t){t.init||e.disable_route_report||n.pageView()}))})),this.tokenManager.apply(this,e),this.eventManager.apply(this,e),this.sessionManager.apply(this,e),this.inited=!0,this.emit(Yf.Init))):console.warn("app_key param is error, must be string, please check!"):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},t.prototype.config=function(t){if(this.inited)if(t&&Zl(t))if(this.bridgeReport)this.appBridge.setConfig(t);else{t._staging_flag&&1===t._staging_flag&&(this.staging=!0),t.disable_auto_pv&&(this.disableAutoPageView=!0,delete t.disable_auto_pv);var e=Jh({},t);if(this.initConfig&&this.initConfig.configPersist){var r=this.configManager.getStore();r&&(e=Object.assign(r,t)),this.configManager.setStore(t)}e.web_id,e.user_unique_id;var n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(e,["web_id","user_unique_id"]);e.hasOwnProperty("web_id")&&this.emit(Yf.ConfigWebId,e.web_id),e.hasOwnProperty("user_unique_id")&&this.emit(Yf.ConfigUuid,e.user_unique_id),this.configManager.set(n),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行CONFIG",level:"info",time:Date.now(),data:e})}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},t.prototype.setDomain=function(t){this.configManager&&this.configManager.setDomain(t),this.emit(Yf.ConfigDomain)},t.prototype.getConfig=function(t){return this.configManager.get(t)},t.prototype.send=function(){this.start()},t.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(Yf.Start),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(Yf.Ready)))},t.prototype.event=function(t,e){var r=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var n=[];if(Array.isArray(t))t.forEach((function(t){var e=r.processEvent(t[0],t[1]||{});e&&n.push(e)}));else{var i=this.processEvent(t,e);if(!i)return;n.push(i)}this.bridgeReport?n.forEach((function(t){var e=t.event,n=t.params;r.appBridge.onEventV3(e,JSON.stringify(n))})):n.length&&(this.emit(Yf.Event,n),this.emit(Yf.SessionResetTime))}catch(t){this.logger.warn("something error, please check"),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},t.prototype.beconEvent=function(t,e){if(!this.initConfig||!this.initConfig.disable_track_event)if(Array.isArray(t))console.warn("beconEvent not support batch report, please check");else{var r=[],n=this.processEvent(t,e||{});n&&(r.push(n),r.length&&(this.emit(Yf.BeconEvent,r),this.emit(Yf.SessionResetTime)))}},t.prototype.processEvent=function(t,e){void 0===e&&(e={});try{if(!t)return this.logger.warn("eventName is null, please check"),null;var r=t;/^event\./.test(t)&&(r=t.slice(6));var n=e;"object"!=typeof n&&(n={}),n.profile?delete n.profile:n.event_index=tf();var i=void 0;return n.local_ms?(i=n.local_ms,delete n.local_ms):i=+new Date,{event:r,params:n,local_time_ms:i,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(r){return this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:r.message}),{event:t,params:e}}},t.prototype.dynamicParams=function(t){this.dynamicParamsFilter=t},t.prototype.filterEvent=function(t){this.eventFilter=t},t.prototype.on=function(t,e){this.hook.on(t,e)},t.prototype.once=function(t,e){this.hook.once(t,e)},t.prototype.off=function(t,e){this.hook.off(t,e)},t.prototype.emit=function(t,e,r){this.hook.emit(t,e,r)},t.prototype.set=function(t){this.hook.set(t)},t.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},t.prototype.predefinePageView=function(t){if(void 0===t&&(t={}),this.inited){var e={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},r=Jh({},e,t);this.event("predefine_pageview",r)}else console.warn("predefinePageView should call after init")},t.prototype.clearEventCache=function(){this.emit(Yf.CleanEvents)},t.prototype.setWebIDviaUnionID=function(t){if(t){var e=af(t);this.config({web_id:""+e,wechat_unionid:t}),this.emit(Yf.CustomWebId)}},t.prototype.setWebIDviaOpenID=function(t){if(t){var e=af(t);this.config({web_id:""+e,wechat_openid:t}),this.emit(Yf.CustomWebId)}},t.prototype.setAnonymousId=function(t){this.emit(Yf.AnonymousId,t)},t.prototype.setNativeAppId=function(t){this.bridgeReport&&this.appBridge.setNativeAppId(t)},t.prototype.resetStayDuration=function(t,e,r){void 0===t&&(t=""),void 0===e&&(e=""),void 0===r&&(r=""),this.emit(Yf.ResetStay,{url_path:t,title:e,url:r},Yf.Stay)},t.prototype.resetStayParams=function(t,e,r){void 0===t&&(t=""),void 0===e&&(e=""),void 0===r&&(r=""),this.emit(Yf.SetStay,{url_path:t,title:e,url:r},Yf.Stay)},t.prototype.getToken=function(t,e){var r=this;if(this.inited){var n=!1,i=function(e){if(!n){n=!0;var i=r.configManager.get().user;return e&&(i.tobid=e,i["diss".split("").reverse().join("")]=e),t(Jh({},i))}},o=function(){r.tokenManager.getTobId().then((function(t){i(t)}))};this.sdkReady?o():(e&&setTimeout((function(){i()}),e),this.on(Yf.Ready,(function(){o()})))}else this.logger.warn("getToken must be use after function init")},t.prototype.startTrackEvent=function(t){t&&this.emit(Yf.TrackDurationStart,t,Yf.TrackDuration)},t.prototype.endTrackEvent=function(t,e){void 0===e&&(e={}),t&&this.emit(Yf.TrackDurationEnd,{eventName:t,params:e},Yf.TrackDuration)},t.prototype.pauseTrackEvent=function(t){t&&this.emit(Yf.TrackDurationPause,t,Yf.TrackDuration)},t.prototype.resumeTrackEvent=function(t){t&&this.emit(Yf.TrackDurationResume,t,Yf.TrackDuration)},t.prototype.profileSet=function(t){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(t)):this.emit(Yf.ProfileSet,t,Yf.Profile),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSet",level:"info",time:Date.now(),data:t})},t.prototype.profileSetOnce=function(t){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(t)):this.emit(Yf.ProfileSetOnce,t,Yf.Profile),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileSetOnce",level:"info",time:Date.now(),data:t})},t.prototype.profileIncrement=function(t){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(t)):this.emit(Yf.ProfileIncrement,t,Yf.Profile),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileIncrement",level:"info",time:Date.now(),data:t})},t.prototype.profileUnset=function(t){this.bridgeReport?this.appBridge.profileUnset(t):this.emit(Yf.ProfileUnset,t,Yf.Profile),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileUnset",level:"info",time:Date.now(),data:t})},t.prototype.profileAppend=function(t){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(t)):this.emit(Yf.ProfileAppend,t,Yf.Profile),this.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行profileAppend",level:"info",time:Date.now(),data:t})},t.prototype.setExternalAbVersion=function(t){this.bridgeReport?this.appBridge.setExternalAbVersion(t):this.emit(Yf.AbExternalVersion,"string"==typeof t&&t?(""+t).trim():null,Yf.Ab)},t.prototype.getVar=function(t,e,r){this.bridgeReport?this.appBridge.getVar(t,e,r):this.emit(Yf.AbVar,{name:t,defaultValue:e,callback:r},Yf.Ab)},t.prototype.getAllVars=function(t){this.bridgeReport?this.appBridge.getAllVars(t):this.emit(Yf.AbAllVars,t,Yf.Ab)},t.prototype.getABconfig=function(t,e){this.emit(Yf.AbConfig,{params:t,callback:e},Yf.Ab)},t.prototype.getAbSdkVersion=function(t){if(!this.bridgeReport||!t)return this.configManager.getAbVersion()||"";this.appBridge.getAbSdkVersion(t)},t.prototype.onAbSdkVersionChange=function(t){var e=this;return this.emit(Yf.AbVersionChangeOn,t,Yf.Ab),function(){e.emit(Yf.AbVersionChangeOff,t,Yf.Ab)}},t.prototype.offAbSdkVersionChange=function(t){this.emit(Yf.AbVersionChangeOff,t,Yf.Ab)},t.prototype.openOverlayer=function(){this.emit(Yf.AbOpenLayer,"",Yf.Ab)},t.prototype.closeOverlayer=function(){this.emit(Yf.AbCloseLayer,"",Yf.Ab)},t.prototype.initCrypto=function(){this.publicKey=this.initConfig.crypto_publicKey||"04BA9E229380DC0E41E10839B0C52A4763D3EDFE8903F3B8E81395523381E03AA995D295BD4A4088792E4785B224F7837EB4D2C7C05973C7AE8687A35ACAE470A0"},t.prototype.cryptoData=function(t){try{if(!this.initConfig.enable_encryption)return t;var e=void 0;if("sm"===this.initConfig.encryption_type){var r=(o=JSON.stringify(t),s=this.publicKey,void 0===(a=1)&&(a=1),"04"+kd.doEncrypt(o,s,a)),n=cf(r);e=new Uint8Array(n)}else e="data="+(i=JSON.stringify(t),window.btoa?window.btoa(encodeURIComponent(i)):encodeURIComponent(i));return e}catch(e){return t}var i,o,s,a},t.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(Yf.TokenComplete))},t.plugins=[],t}(),Od=ft("isConcatSpreadable"),Id=o.TypeError,Rd=N>=51||!s((function(){var t=[];return t[Od]=!1,t.concat()[0]!==t})),Dd=bn("concat"),Md=function(t){if(!R(t))return!1;var e=t[Od];return void 0!==e?!!e:Be(t)};Me({target:"Array",proto:!0,arity:1,forced:!Rd||!Dd},{concat:function(t){var e,r,n,i,o,s=et(this),a=Qe(s,0),c=0;for(e=-1,n=arguments.length;e<n;e++)if(Md(o=-1===e?s:arguments[e])){if(c+(i=le(o))>9007199254740991)throw Id("Maximum allowed index exceeded");for(r=0;r<i;r++,c++)r in o&&mn(a,c,o[r])}else{if(c>=9007199254740991)throw Id("Maximum allowed index exceeded");mn(a,c++,o)}return a.length=c,a}});var Cd=pe.includes,Pd=s((function(){return!Array(1).includes()}));Me({target:"Array",proto:!0,forced:Pd},{includes:function(t){return Cd(this,t,arguments.length>1?arguments[1]:void 0)}}),xr("includes");var Bd=o.TypeError,Ld=function(t){if(Ka(t))throw Bd("The method doesn't accept regular expressions");return t},Gd=ft("match"),Ud=b("".indexOf);Me({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Gd]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~Ud(fa(x(this)),fa(Ld(t)),arguments.length>1?arguments[1]:void 0)}});var Nd=ft("iterator"),Fd=!s((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[Nd]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),jd=function(t,e,r){return r.get&&te(r.get,e,{getter:!0}),r.set&&te(r.set,e,{setter:!0}),Rt.f(t,e,r)},zd=function(t,e,r,n){try{return n?e(kt(r)[0],r[1]):e(r)}catch(e){so(t,"throw",e)}},Vd=o.Array,qd=function(t){var e=et(t),r=Ye(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=Pe(i,n>2?arguments[2]:void 0));var s,a,c,u,l,f,p=no(e),d=0;if(!p||this==Vd&&eo(p))for(s=le(e),a=r?new this(s):Vd(s);s>d;d++)f=o?i(e[d],d):e[d],mn(a,d,f);else for(l=(u=oo(e,p)).next,a=r?new this:[];!(c=h(l,u)).done;d++)f=o?zd(u,i,[c.value,d],!0):c.value,mn(a,d,f);return a.length=d,a},Hd=/[^\0-\u007E]/,Kd=/[.\u3002\uFF0E\uFF61]/g,Wd="Overflow: input needs wider integers to process",Jd=o.RangeError,$d=b(Kd.exec),Yd=Math.floor,Xd=String.fromCharCode,Zd=b("".charCodeAt),Qd=b([].join),tg=b([].push),eg=b("".replace),rg=b("".split),ng=b("".toLowerCase),ig=function(t){return t+22+75*(t<26)},og=function(t,e,r){var n=0;for(t=r?Yd(t/700):t>>1,t+=Yd(t/e);t>455;)t=Yd(t/35),n+=36;return Yd(n+36*t/(t+38))},sg=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var i=Zd(t,r++);if(i>=55296&&i<=56319&&r<n){var o=Zd(t,r++);56320==(64512&o)?tg(e,((1023&i)<<10)+(1023&o)+65536):(tg(e,i),r--)}else tg(e,i)}return e}(t);var r,n,i=t.length,o=128,s=0,a=72;for(r=0;r<t.length;r++)(n=t[r])<128&&tg(e,Xd(n));var c=e.length,u=c;for(c&&tg(e,"-");u<i;){var h=2147483647;for(r=0;r<t.length;r++)(n=t[r])>=o&&n<h&&(h=n);var l=u+1;if(h-o>Yd((2147483647-s)/l))throw Jd(Wd);for(s+=(h-o)*l,o=h,r=0;r<t.length;r++){if((n=t[r])<o&&++s>2147483647)throw Jd(Wd);if(n==o){for(var f=s,p=36;;){var d=p<=a?1:p>=a+26?26:p-a;if(f<d)break;var g=f-d,v=36-d;tg(e,Xd(ig(d+g%v))),f=Yd(g/v),p+=36}tg(e,Xd(ig(f))),a=og(s,l,u==c),s=0,u++}}s++,o++}return Qd(e,"")},ag=ft("iterator"),cg=Qt.set,ug=Qt.getterFor("URLSearchParams"),hg=Qt.getterFor("URLSearchParamsIterator"),lg=Object.getOwnPropertyDescriptor,fg=function(t){if(!a)return o[t];var e=lg(o,t);return e&&e.value},pg=fg("fetch"),dg=fg("Request"),gg=fg("Headers"),vg=dg&&dg.prototype,mg=gg&&gg.prototype,yg=o.RegExp,bg=o.TypeError,_g=o.decodeURIComponent,Eg=o.encodeURIComponent,wg=b("".charAt),Sg=b([].join),Tg=b([].push),Ag=b("".replace),kg=b([].shift),xg=b([].splice),Og=b("".split),Ig=b("".slice),Rg=/\+/g,Dg=Array(4),Mg=function(t){return Dg[t-1]||(Dg[t-1]=yg("((?:%[\\da-f]{2}){"+t+"})","gi"))},Cg=function(t){try{return _g(t)}catch(e){return t}},Pg=function(t){var e=Ag(t,Rg," "),r=4;try{return _g(e)}catch(t){for(;r;)e=Ag(e,Mg(r--),Cg);return e}},Bg=/[!'()~]|%20/g,Lg={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Gg=function(t){return Lg[t]},Ug=function(t){return Ag(Eg(t),Bg,Gg)},Ng=Vr((function(t,e){cg(this,{type:"URLSearchParamsIterator",iterator:oo(ug(t).entries),kind:e})}),"Iterator",(function(){var t=hg(this),e=t.kind,r=t.iterator.next(),n=r.value;return r.done||(r.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),r}),!0),Fg=function(t){this.entries=[],this.url=null,void 0!==t&&(R(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===wg(t,0)?Ig(t,1):t:fa(t)))};Fg.prototype={type:"URLSearchParams",bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,i,o,s,a,c=no(t);if(c)for(r=(e=oo(t,c)).next;!(n=h(r,e)).done;){if(o=(i=oo(kt(n.value))).next,(s=h(o,i)).done||(a=h(o,i)).done||!h(o,i).done)throw bg("Expected sequence with length 2");Tg(this.entries,{key:fa(s.value),value:fa(a.value)})}else for(var u in t)nt(t,u)&&Tg(this.entries,{key:u,value:fa(t[u])})},parseQuery:function(t){if(t)for(var e,r,n=Og(t,"&"),i=0;i<n.length;)(e=n[i++]).length&&(r=Og(e,"="),Tg(this.entries,{key:Pg(kg(r)),value:Pg(Sg(r,"="))}))},serialize:function(){for(var t,e=this.entries,r=[],n=0;n<e.length;)t=e[n++],Tg(r,Ug(t.key)+"="+Ug(t.value));return Sg(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var jg=function(){On(this,zg);var t=arguments.length>0?arguments[0]:void 0;cg(this,new Fg(t))},zg=jg.prototype;if(kn(zg,{append:function(t,e){No(arguments.length,2);var r=ug(this);Tg(r.entries,{key:fa(t),value:fa(e)}),r.updateURL()},delete:function(t){No(arguments.length,1);for(var e=ug(this),r=e.entries,n=fa(t),i=0;i<r.length;)r[i].key===n?xg(r,i,1):i++;e.updateURL()},get:function(t){No(arguments.length,1);for(var e=ug(this).entries,r=fa(t),n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function(t){No(arguments.length,1);for(var e=ug(this).entries,r=fa(t),n=[],i=0;i<e.length;i++)e[i].key===r&&Tg(n,e[i].value);return n},has:function(t){No(arguments.length,1);for(var e=ug(this).entries,r=fa(t),n=0;n<e.length;)if(e[n++].key===r)return!0;return!1},set:function(t,e){No(arguments.length,1);for(var r,n=ug(this),i=n.entries,o=!1,s=fa(t),a=fa(e),c=0;c<i.length;c++)(r=i[c]).key===s&&(o?xg(i,c--,1):(o=!0,r.value=a));o||Tg(i,{key:s,value:a}),n.updateURL()},sort:function(){var t=ug(this);ih(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=ug(this).entries,n=Pe(t,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((e=r[i++]).value,e.key,this)},keys:function(){return new Ng(this,"keys")},values:function(){return new Ng(this,"values")},entries:function(){return new Ng(this,"entries")}},{enumerable:!0}),ee(zg,ag,zg.entries,{name:"entries"}),ee(zg,"toString",(function(){return ug(this).serialize()}),{enumerable:!0}),Fr(jg,"URLSearchParams"),Me({global:!0,constructor:!0,forced:!Fd},{URLSearchParams:jg}),!Fd&&I(gg)){var Vg=b(mg.has),qg=b(mg.set),Hg=function(t){if(R(t)){var e,r=t.body;if("URLSearchParams"===je(r))return e=t.headers?new gg(t.headers):new gg,Vg(e,"content-type")||qg(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),_r(t,{body:d(0,fa(r)),headers:d(0,e)})}return t};if(I(pg)&&Me({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return pg(t,arguments.length>1?Hg(arguments[1]):{})}}),I(dg)){var Kg=function(t){return On(this,vg),new dg(t,arguments.length>1?Hg(arguments[1]):{})};vg.constructor=Kg,Kg.prototype=vg,Me({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Kg})}}var Wg,Jg={URLSearchParams:jg,getState:ug},$g=Ua.codeAt,Yg=Qt.set,Xg=Qt.getterFor("URL"),Zg=Jg.URLSearchParams,Qg=Jg.getState,tv=o.URL,ev=o.TypeError,rv=o.parseInt,nv=Math.floor,iv=Math.pow,ov=b("".charAt),sv=b(/./.exec),av=b([].join),cv=b(1..toString),uv=b([].pop),hv=b([].push),lv=b("".replace),fv=b([].shift),pv=b("".split),dv=b("".slice),gv=b("".toLowerCase),vv=b([].unshift),mv=/[a-z]/i,yv=/[\d+-.a-z]/i,bv=/\d/,_v=/^0x/i,Ev=/^[0-7]+$/,wv=/^\d+$/,Sv=/^[\da-f]+$/i,Tv=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Av=/[\0\t\n\r #/:<>?@[\\\]^|]/,kv=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,xv=/[\t\n\r]/g,Ov=function(t){var e,r,n,i;if("number"==typeof t){for(e=[],r=0;r<4;r++)vv(e,t%256),t=nv(t/256);return av(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,i=0,o=0;o<8;o++)0!==t[o]?(i>r&&(e=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(e=n,r=i),e}(t),r=0;r<8;r++)i&&0===t[r]||(i&&(i=!1),n===r?(e+=r?":":"::",i=!0):(e+=cv(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},Iv={},Rv=Oo({},Iv,{" ":1,'"':1,"<":1,">":1,"`":1}),Dv=Oo({},Rv,{"#":1,"?":1,"{":1,"}":1}),Mv=Oo({},Dv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Cv=function(t,e){var r=$g(t,0);return r>32&&r<127&&!nt(e,t)?t:encodeURIComponent(t)},Pv={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Bv=function(t,e){var r;return 2==t.length&&sv(mv,ov(t,0))&&(":"==(r=ov(t,1))||!e&&"|"==r)},Lv=function(t){var e;return t.length>1&&Bv(dv(t,0,2))&&(2==t.length||"/"===(e=ov(t,2))||"\\"===e||"?"===e||"#"===e)},Gv=function(t){return"."===t||"%2e"===gv(t)},Uv={},Nv={},Fv={},jv={},zv={},Vv={},qv={},Hv={},Kv={},Wv={},Jv={},$v={},Yv={},Xv={},Zv={},Qv={},tm={},em={},rm={},nm={},im={},om=function(t,e,r){var n,i,o,s=fa(t);if(e){if(i=this.parse(s))throw ev(i);this.searchParams=null}else{if(void 0!==r&&(n=new om(r,!0)),i=this.parse(s,null,n))throw ev(i);(o=Qg(new Zg)).bindURL(this),this.searchParams=o}};om.prototype={type:"URL",parse:function(t,e,r){var n,i,o,s,a,c=this,u=e||Uv,h=0,l="",f=!1,p=!1,d=!1;for(t=fa(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=lv(t,kv,"")),t=lv(t,xv,""),n=qd(t);h<=n.length;){switch(i=n[h],u){case Uv:if(!i||!sv(mv,i)){if(e)return"Invalid scheme";u=Fv;continue}l+=gv(i),u=Nv;break;case Nv:if(i&&(sv(yv,i)||"+"==i||"-"==i||"."==i))l+=gv(i);else{if(":"!=i){if(e)return"Invalid scheme";l="",u=Fv,h=0;continue}if(e&&(c.isSpecial()!=nt(Pv,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,e)return void(c.isSpecial()&&Pv[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?u=Xv:c.isSpecial()&&r&&r.scheme==c.scheme?u=jv:c.isSpecial()?u=Hv:"/"==n[h+1]?(u=zv,h++):(c.cannotBeABaseURL=!0,hv(c.path,""),u=rm)}break;case Fv:if(!r||r.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(r.cannotBeABaseURL&&"#"==i){c.scheme=r.scheme,c.path=zn(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,u=im;break}u="file"==r.scheme?Xv:Vv;continue;case jv:if("/"!=i||"/"!=n[h+1]){u=Vv;continue}u=Kv,h++;break;case zv:if("/"==i){u=Wv;break}u=em;continue;case Vv:if(c.scheme=r.scheme,i==Wg)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=zn(r.path),c.query=r.query;else if("/"==i||"\\"==i&&c.isSpecial())u=qv;else if("?"==i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=zn(r.path),c.query="",u=nm;else{if("#"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=zn(r.path),c.path.length--,u=em;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=zn(r.path),c.query=r.query,c.fragment="",u=im}break;case qv:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,u=em;continue}u=Wv}else u=Kv;break;case Hv:if(u=Kv,"/"!=i||"/"!=ov(l,h+1))continue;h++;break;case Kv:if("/"!=i&&"\\"!=i){u=Wv;continue}break;case Wv:if("@"==i){f&&(l="%40"+l),f=!0,o=qd(l);for(var g=0;g<o.length;g++){var v=o[g];if(":"!=v||d){var m=Cv(v,Mv);d?c.password+=m:c.username+=m}else d=!0}l=""}else if(i==Wg||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(f&&""==l)return"Invalid authority";h-=qd(l).length+1,l="",u=Jv}else l+=i;break;case Jv:case $v:if(e&&"file"==c.scheme){u=Qv;continue}if(":"!=i||p){if(i==Wg||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==l)return"Invalid host";if(e&&""==l&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(l))return s;if(l="",u=tm,e)return;continue}"["==i?p=!0:"]"==i&&(p=!1),l+=i}else{if(""==l)return"Invalid host";if(s=c.parseHost(l))return s;if(l="",u=Yv,e==$v)return}break;case Yv:if(!sv(bv,i)){if(i==Wg||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||e){if(""!=l){var y=rv(l,10);if(y>65535)return"Invalid port";c.port=c.isSpecial()&&y===Pv[c.scheme]?null:y,l=""}if(e)return;u=tm;continue}return"Invalid port"}l+=i;break;case Xv:if(c.scheme="file","/"==i||"\\"==i)u=Zv;else{if(!r||"file"!=r.scheme){u=em;continue}if(i==Wg)c.host=r.host,c.path=zn(r.path),c.query=r.query;else if("?"==i)c.host=r.host,c.path=zn(r.path),c.query="",u=nm;else{if("#"!=i){Lv(av(zn(n,h),""))||(c.host=r.host,c.path=zn(r.path),c.shortenPath()),u=em;continue}c.host=r.host,c.path=zn(r.path),c.query=r.query,c.fragment="",u=im}}break;case Zv:if("/"==i||"\\"==i){u=Qv;break}r&&"file"==r.scheme&&!Lv(av(zn(n,h),""))&&(Bv(r.path[0],!0)?hv(c.path,r.path[0]):c.host=r.host),u=em;continue;case Qv:if(i==Wg||"/"==i||"\\"==i||"?"==i||"#"==i){if(!e&&Bv(l))u=em;else if(""==l){if(c.host="",e)return;u=tm}else{if(s=c.parseHost(l))return s;if("localhost"==c.host&&(c.host=""),e)return;l="",u=tm}continue}l+=i;break;case tm:if(c.isSpecial()){if(u=em,"/"!=i&&"\\"!=i)continue}else if(e||"?"!=i)if(e||"#"!=i){if(i!=Wg&&(u=em,"/"!=i))continue}else c.fragment="",u=im;else c.query="",u=nm;break;case em:if(i==Wg||"/"==i||"\\"==i&&c.isSpecial()||!e&&("?"==i||"#"==i)){if(".."===(a=gv(a=l))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||hv(c.path,"")):Gv(l)?"/"==i||"\\"==i&&c.isSpecial()||hv(c.path,""):("file"==c.scheme&&!c.path.length&&Bv(l)&&(c.host&&(c.host=""),l=ov(l,0)+":"),hv(c.path,l)),l="","file"==c.scheme&&(i==Wg||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)fv(c.path);"?"==i?(c.query="",u=nm):"#"==i&&(c.fragment="",u=im)}else l+=Cv(i,Dv);break;case rm:"?"==i?(c.query="",u=nm):"#"==i?(c.fragment="",u=im):i!=Wg&&(c.path[0]+=Cv(i,Iv));break;case nm:e||"#"!=i?i!=Wg&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":Cv(i,Iv)):(c.fragment="",u=im);break;case im:i!=Wg&&(c.fragment+=Cv(i,Rv))}h++}},parseHost:function(t){var e,r,n;if("["==ov(t,0)){if("]"!=ov(t,t.length-1))return"Invalid host";if(e=function(t){var e,r,n,i,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,h=null,l=0,f=function(){return ov(t,l)};if(":"==f()){if(":"!=ov(t,1))return;l+=2,h=++u}for(;f();){if(8==u)return;if(":"!=f()){for(e=r=0;r<4&&sv(Sv,f());)e=16*e+rv(f(),16),l++,r++;if("."==f()){if(0==r)return;if(l-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;l++}if(!sv(bv,f()))return;for(;sv(bv,f());){if(o=rv(f(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==f()){if(l++,!f())return}else if(f())return;c[u++]=e}else{if(null!==h)return;l++,h=++u}}if(null!==h)for(s=u-h,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[h+s-1],c[h+--s]=a;else if(8!=u)return;return c}(dv(t,1,-1)),!e)return"Invalid host";this.host=e}else if(this.isSpecial()){if(t=function(t){var e,r,n=[],i=rg(eg(ng(t),Kd,"."),".");for(e=0;e<i.length;e++)r=i[e],tg(n,$d(Hd,r)?"xn--"+sg(r):r);return Qd(n,".")}(t),sv(Tv,t))return"Invalid host";if(e=function(t){var e,r,n,i,o,s,a,c=pv(t,".");if(c.length&&""==c[c.length-1]&&c.length--,(e=c.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(i=c[n]))return t;if(o=10,i.length>1&&"0"==ov(i,0)&&(o=sv(_v,i)?16:8,i=dv(i,8==o?1:2)),""===i)s=0;else{if(!sv(10==o?wv:8==o?Ev:Sv,i))return t;s=rv(i,o)}hv(r,s)}for(n=0;n<e;n++)if(s=r[n],n==e-1){if(s>=iv(256,5-e))return null}else if(s>255)return null;for(a=uv(r),n=0;n<r.length;n++)a+=r[n]*iv(256,3-n);return a}(t),null===e)return"Invalid host";this.host=e}else{if(sv(Av,t))return"Invalid host";for(e="",r=qd(t),n=0;n<r.length;n++)e+=Cv(r[n],Iv);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return nt(Pv,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&Bv(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,i=t.host,o=t.port,s=t.path,a=t.query,c=t.fragment,u=e+":";return null!==i?(u+="//",t.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=Ov(i),null!==o&&(u+=":"+o)):"file"==e&&(u+="//"),u+=t.cannotBeABaseURL?s[0]:s.length?"/"+av(s,"/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},setHref:function(t){var e=this.parse(t);if(e)throw ev(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new sm(t.path[0]).origin}catch(t){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+Ov(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(fa(t)+":",Uv)},getUsername:function(){return this.username},setUsername:function(t){var e=qd(fa(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=Cv(e[r],Mv)}},getPassword:function(){return this.password},setPassword:function(t){var e=qd(fa(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=Cv(e[r],Mv)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?Ov(t):Ov(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Jv)},getHostname:function(){var t=this.host;return null===t?"":Ov(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,$v)},getPort:function(){var t=this.port;return null===t?"":fa(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=fa(t))?this.port=null:this.parse(t,Yv))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+av(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,tm))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=fa(t))?this.query=null:("?"==ov(t,0)&&(t=dv(t,1)),this.query="",this.parse(t,nm)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=fa(t))?("#"==ov(t,0)&&(t=dv(t,1)),this.fragment="",this.parse(t,im)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var sm=function(t){var e=On(this,am),r=No(arguments.length,1)>1?arguments[1]:void 0,n=Yg(e,new om(t,!1,r));a||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},am=sm.prototype,cm=function(t,e){return{get:function(){return Xg(this)[t]()},set:e&&function(t){return Xg(this)[e](t)},configurable:!0,enumerable:!0}};if(a&&(jd(am,"href",cm("serialize","setHref")),jd(am,"origin",cm("getOrigin")),jd(am,"protocol",cm("getProtocol","setProtocol")),jd(am,"username",cm("getUsername","setUsername")),jd(am,"password",cm("getPassword","setPassword")),jd(am,"host",cm("getHost","setHost")),jd(am,"hostname",cm("getHostname","setHostname")),jd(am,"port",cm("getPort","setPort")),jd(am,"pathname",cm("getPathname","setPathname")),jd(am,"search",cm("getSearch","setSearch")),jd(am,"searchParams",cm("getSearchParams")),jd(am,"hash",cm("getHash","setHash"))),ee(am,"toJSON",(function(){return Xg(this).serialize()}),{enumerable:!0}),ee(am,"toString",(function(){return Xg(this).serialize()}),{enumerable:!0}),tv){var um=tv.createObjectURL,hm=tv.revokeObjectURL;um&&ee(sm,"createObjectURL",Pe(um,tv)),hm&&ee(sm,"revokeObjectURL",Pe(hm,tv))}Fr(sm,"URL"),Me({global:!0,constructor:!0,forced:!Fd,sham:!a},{URL:sm});var lm,fm="__rangers_ab_style__";!function(t){t[t.Var=0]="Var",t[t.All=1]="All"}(lm||(lm={}));var pm=function(){function t(){this.fetchStatus="no",this.refreshFetchStatus="complete",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data=null,this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[]}return t.prototype.apply=function(t,e){var r=this;if(this.collect=t,this.config=e,this.config.enable_ab_test){var n=e.enable_multilink,i=e.ab_channel_domain,o=e.enable_ab_visual,s=e.ab_cross,a=e.ab_cookie_domain,c=e.disable_ab_reset,u=i||ef(Jf[e.channel||"cn"]),h=t.adapters,l=h.storage,f=h.fetch;this.cacheStorgae=new l(!1),this.fetch=f,this.enable_multilink=n,this.enable_ab_visual=o,this.abKey="__tea_sdk_ab_version_"+e.app_id,this.ab_cross=s,this.ab_cookie_domain=a||"",this.fetchUrl=u+"/service/2/abtest_config/",this.reportUrl=""+t.configManager.getUrl("event"),this.exposureLimit=e.exposure_limit||20,this.ab_batch_time=e.ab_batch_time||500;var p=this.collect.Types;this.types=p,this.collect.on(p.TokenChange,(function(t){c||"uuid"===t.type&&r.readyStatus&&(r.clearCache(),r.fetchAB())})),this.collect.on(p.TokenReset,(function(){c||r.readyStatus&&(r.clearCache(),r.fetchAB())})),this.collect.on(p.AbVar,(function(t){var e=t.name,n=t.defaultValue,i=t.callback;r.getVar(e,n,i)})),this.collect.on(p.AbAllVars,(function(t){r.getAllVars(t)})),this.collect.on(p.AbConfig,(function(t){var e=t.params,n=t.callback;r.getABconfig(e,n)})),this.collect.on(p.AbExternalVersion,(function(t){r.setExternalAbVersion(t)})),this.collect.on(p.AbOpenLayer,(function(){r.openOverlayer()})),this.collect.on(p.AbCloseLayer,(function(){r.closeOverlayer()})),this.collect.on(p.AbVersionChangeOn,(function(t){r.changeListener.set(t,t)})),this.collect.on(p.AbVersionChangeOff,(function(t){r.changeListener.get(t)&&r.changeListener.delete(t)})),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(this.fetchAB(),this.readyStatus=!0),this.collect.emit(p.AbReady)}},t.prototype.ready=function(t){var e=this;if(this.collect.set(t),this.collect.hook._hooksCache.hasOwnProperty(t)){var r=this.collect.hook._hooksCache[t];if(!Object.keys(r).length)return;var n=function(t){r[t].length&&r[t].forEach((function(r){e.collect.hook.emit(t,r)}))};for(var i in r)n(i)}},t.prototype.loadMode=function(){},t.prototype.checkLocal=function(){var t=this.getABCache(),e=t.ab_version,r=t.ab_ext_version,n=t.ab_version_multilink,i=t.data,o=this.checkFromUrl();o?this.mulilinkVersions.push(o):this.mulilinkVersions=n||[],this.extVersions=r||[],this.versions=e||[],this.data=i;var s=this.versions.concat(this.extVersions);this.enable_multilink&&(s=s.concat(this.mulilinkVersions)),this.configVersions(s.join(","))},t.prototype.checkFromUrl=function(){var t=sf(window.location.href);return t&&t.vid?t.vid:""},t.prototype.updateVersions=function(){var t=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(t=t.concat(this.mulilinkVersions)),this.configVersions(t.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach((function(e){"function"==typeof e&&e(t)}))},t.prototype.configVersions=function(t){this.collect.configManager.setAbVersion(t)},t.prototype.getVar=function(t,e,r){if(!t)throw new Error("variable must not be empty");if(void 0===e)throw new Error("variable no default value");if("function"!=typeof r)throw new Error("callback must be a function");var n={name:t,defaultValue:e,callback:r,type:lm.Var};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(n,t):this.callbacks.push(n)},t.prototype.getRealVar=function(t,e){var r=t.name,n=t.defaultValue,i=t.callback,o=this.data;if(o){if(Zl(o[r])){var s=o[r].vid;return"$ab_url"===e?this.mulilinkVersions.includes(s)||this.mulilinkVersions.push(s):this.versions.includes(s)||this.versions.push(s),this.updateVersions(),this.fechEvent(s,e,n),i(o[r].val),void this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 曝光了实验"+r,level:"info",time:Date.now(),data:o[r]})}this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getVar",level:"info",time:Date.now(),data:n}),i(n)}else i(n)},t.prototype.getAllVars=function(t){if("function"!=typeof t)throw new Error("callback must be a function");var e={callback:t,type:lm.All};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(e):this.callbacks.push(e)},t.prototype.getRealAllVars=function(t){(0,t.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK 调用getAllVars",level:"info",time:Date.now(),data:this.data})},t.prototype.fechEvent=function(t,e,r){try{if(this.config.disable_track_event)return;if(!t)return;var n=this.collect.configManager.get(),i=n.header,o=n.user,s=this.getABCache();if(s&&s.uuid&&s.uuid!==o.user_unique_id)return;var a={event:"abtest_exposure",ab_sdk_version:""+t,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===e?r:window.location.href}),local_time_ms:Date.now()};i.custom=JSON.stringify(i.custom);var c={events:[a],user:o,header:i};"$ab_url"===e&&window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify([c])):this.reportExposure(c)}catch(t){this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},t.prototype.reportExposure=function(t){var e=this;this.exposureCache.push(t),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report():this.reportTimeout=setTimeout((function(){e.report(),clearTimeout(e.reportTimeout)}),this.ab_batch_time)},t.prototype.report=function(){var t=this,e=this.collect.cryptoData(this.exposureCache);this.fetch(this.reportUrl,e,1e5,!1,(function(){}),(function(){}),"","POST",this.config.enable_encryption,this.config.encryption_header),this.exposureCache.forEach((function(e){t.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:[e],code:200,status:"success"})})),this.exposureCache=[]},t.prototype.setExternalAbVersion=function(t){this.extVersions=[t],this.updateVersions()},t.prototype.getABconfig=function(t,e){var r=Object.keys(t);r&&r.length&&this.collect.configManager.set(t),this.fetchAB(e)},t.prototype.get=function(t){if(this.ab_cross){var e=this.cacheStorgae.getCookie(t,this.ab_cookie_domain);return e?JSON.parse(e):null}return this.cacheStorgae.getItem(t)},t.prototype.set=function(t,e){this.ab_cross?this.cacheStorgae.setCookie(t,e,2592e6,this.ab_cookie_domain):this.cacheStorgae.setItem(t,e),this.collect.configManager.setAbCache(e)},t.prototype.getABCache=function(t){var e={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return e=this.get(this.abKey)||e,Date.now()-e.timestamp>=2592e6?(this.cacheStorgae.removeItem(this.abKey),null):t?e[t]:e},t.prototype.updateABCache=function(){var t=this.getABCache();t.ab_version_multilink=this.mulilinkVersions,t.ab_ext_version=this.extVersions,t.ab_version=this.versions,t.timestamp=Date.now(),this.set(this.abKey,t)},t.prototype.setAbCache=function(t){var e=this.getABCache();e.data=this.data,e.uuid=t,e.timestamp=Date.now(),this.set(this.abKey,e)},t.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},t.prototype.openOverlayer=function(t){var e=this;if(function(){if(!document.getElementById(fm)){var t="body { opacity: 0 !important; }",e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.id=fm,r.type="text/css",r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t)),e.appendChild(r)}}(),t)var r=setTimeout((function(){e.closeOverlayer(),clearTimeout(r)}),t)},t.prototype.closeOverlayer=function(){var t;(t=document.getElementById(fm))&&t.parentElement.removeChild(t)},t.prototype.fetchComplete=function(t,e){var r=this;if(t&&"[object Object]"==Object.prototype.toString.call(t)){this.data=t,this.setAbCache(e);var n=[];Object.keys(t).forEach((function(e){var r=t[e].vid;r&&n.push(r)})),this.versions=this.versions.filter((function(t){return n.includes(t)}));var i=t.$ab_url,o=t.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroyInstance)return;this.getVar("$ab_modification",window.location.href,(function(){r.closeOverlayer()}))}else if(i&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(t){return n.includes(t)}));var s=i.val,a=i.vid;s&&a&&this.getVar("$ab_url",s,(function(){r.editMode||(s!==window.location.href?setTimeout((function(){if(!r.collect.destroyInstance){var t=""+s;t=-1===t.indexOf("http")?"https://"+t:t;var e=of(t).host;try{var n=new URL(t);e!==location.host?n.searchParams.append("vid",a):window.history.replaceState("","",t),window.location.href=n.href}catch(e){window.location.href=t}}}),100):r.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(t){return r[t.type===lm.Var?"getRealVar":"getRealAllVars"](t,"")})),this.callbacks=[]},t.prototype.fetchAB=function(t){var e=this,r=this.collect.configManager.get(),n=r.header,i=r.user;this.config.enable_anonymousid&&delete i.web_id;var o=i.user_unique_id,s={header:Jh({aid:this.config.app_id},i||{},n||{},{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 发起AB实验请求",level:"info",logType:"fetch",time:Date.now(),data:s});var a=this.collect.cryptoData(s);this.fetch(this.fetchUrl,a,this.config.ab_timeout||3e3,!1,(function(r){e.fetchStatus="complete",e.refreshFetchStatus="complete";var n=r.data;"success"===r.message?(e.fetchComplete(n,o),t&&t(n)):(e.fetchComplete(null,o),t&&t(null)),e.collect.emit(e.types.AbComplete,n),e.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求成功",level:"info",logType:"fetch",time:Date.now(),data:n})}),(function(){e.fetchStatus="complete",e.refreshFetchStatus="complete",e.fetchComplete(null,o),t&&t(null),e.collect.emit(e.types.AbTimeout),e.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"AB实验请求网络异常",level:"error",logType:"fetch",time:Date.now()})}),"","",this.config.enable_encryption,this.config.encryption_header)},t.prototype.filterUrl=function(t){try{var e="";-1!==t.indexOf("&multilink=true")?e="&multilink=true[\0-ÿ]*":-1!==t.indexOf("?multilink=true")&&(e="\\?multilink=true[\0-ÿ]*");var r=new RegExp(e,"g");t=t.replace(r,"")}catch(t){}return t},t}(),dm=o.Function,gm=b([].concat),vm=b([].join),mm={},ym=function(t,e,r){if(!nt(mm,e)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";mm[e]=dm("C,a","return new C("+vm(n,",")+")")}return mm[e](t,r)},bm=c?dm.bind:function(t){var e=W(this),r=e.prototype,n=_n(arguments,1),i=function(){var r=gm(n,_n(arguments));return this instanceof i?ym(e,r.length,r):e.apply(t,r)};return R(r)&&(i.prototype=r),i};Me({target:"Function",proto:!0,forced:Function.bind!==bm},{bind:bm});var _m=function(){function t(t,e){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.collect=t,this.config=e,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,Zl(e.enable_stay_duration)&&(this.options=Object.assign(this.options,e.enable_stay_duration))}return t.prototype.setParams=function(t,e,r){this.set_path=t,this.set_url=r,this.set_title=e},t.prototype.resetParams=function(t,e,r){this.url_path=t,this.url=r,this.title=e},t.prototype.enable=function(t,e,r){this.url_path=t||this.url_path,this.url=r||this.url,this.title=e||this.title,this.disableCallback=this.enablePageAlive(),this.options.params instanceof Function?this.customParmas=this.options.params():this.customParmas=this.options.params},t.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},t.prototype.sendEvent=function(t,e){void 0===e&&(e=!1);var r=e?this.aliveDTime:Date.now()-this.sessionStartTime;r<0||r>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||(this.collect.beconEvent(this.options.aliveName,Jh({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:r,is_support_visibility_change:nf(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:t},this.customParmas)),this.sessionStartTime=Date.now(),this.resetParams(location.pathname,document.title,location.href))},t.prototype.getParams=function(t){switch(t){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},t.prototype.setUpTimer=function(){var t=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-t.sessionStartTime>t.aliveDTime&&t.sendEvent(!1,!0)}),1e3)},t.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},t.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},t.prototype.enablePageAlive=function(){var t=this;this.timerHandler=this.setUpTimer();var e=this.visibilitychange.bind(this),r=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",r),function(){t.beforeunload(),document.removeEventListener("visibilitychange",e),window.removeEventListener("beforeunload",r),window.removeEventListener("pagehide",r)}},t}(),Em=function(){function t(t,e){var r=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.visibilitychange=function(){"hidden"===document.visibilityState?r.activeEndTime=Date.now():"visible"===document.visibilityState&&(r.activeEndTime&&(r.totalTime+=r.activeEndTime-r.activeStartTime,r.activeTimes+=1),r.activeEndTime=void 0,r.activeStartTime=Date.now())},this.beforeunload=function(){if(r.totalTime+=(r.activeEndTime||Date.now())-r.activeStartTime,r.config.autotrack){try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:r.totalTime,page_title:document.title||location.pathname}))}catch(t){}}r.sendEventPageClose()},this.collect=t,this.config=e,this.maxDuration=e.maxDuration||864e5,this.pageStartTime=Date.now(),Zl(e.enable_stay_duration)&&(this.options=Object.assign(this.options,e.enable_stay_duration)),this.resetData()}return t.prototype.setParams=function(t,e,r){this.set_path=t,this.set_url=r,this.set_title=e},t.prototype.resetParams=function(t,e,r){this.url_path=t,this.url=r,this.title=e},t.prototype.enable=function(t,e,r){this.url_path=t||this.url_path,this.url=r||this.url,this.title=e||this.title,this.disableCallback=this.enablePageClose()},t.prototype.disable=function(){this.disableCallback()},t.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.options.params instanceof Function?this.customParmas=this.options.params():this.customParmas=this.options.params,this.resetParams(location.pathname,document.title,location.href)},t.prototype.sendEventPageClose=function(){var t=Date.now()-this.pageStartTime;this.totalTime<0||t<0||this.totalTime>=this.maxDuration||(this.collect.beconEvent(this.options.closeName,Jh({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:t,is_support_visibility_change:nf()},this.customParmas)),this.pageStartTime=Date.now(),this.resetData())},t.prototype.getParams=function(t){switch(t){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},t.prototype.enablePageClose=function(){var t=this,e=this.visibilitychange.bind(this),r=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",r),function(){t.beforeunload(),document.removeEventListener("visibilitychange",e),window.removeEventListener("beforeunload",r),window.removeEventListener("pagehide",r)}},t}(),wm=function(){function t(){}return t.prototype.apply=function(t,e){var r=this;if(this.collect=t,this.config=e,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new _m(t,e),this.pageClose=new Em(t,e);var n=this.collect.Types;this.collect.on(n.ResetStay,(function(t){var e=t.url_path,n=t.title,i=t.url;r.resetStayDuration(e,n,i)})),this.collect.on(n.RouteChange,(function(t){t.init||e.disable_route_report||r.resetStayDuration()})),this.collect.on(n.SetStay,(function(t){var e=t.url_path,n=t.title,i=t.url;r.setStayParmas(e,n,i)})),this.enable(this.url_path,this.title,this.url),this.ready(n.Stay),this.collect.emit(n.StayReady)}},t.prototype.ready=function(t){var e=this;if(this.collect.set(t),this.collect.hook._hooksCache.hasOwnProperty(t)){var r=this.collect.hook._hooksCache[t];if(!Object.keys(r).length)return;var n=function(t){r[t].length&&r[t].forEach((function(r){e.collect.hook.emit(t,r)}))};for(var i in r)n(i)}},t.prototype.enable=function(t,e,r){this.pageAlive.enable(t,e,r),this.pageClose.enable(t,e,r)},t.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},t.prototype.setStayParmas=function(t,e,r){void 0===t&&(t=""),void 0===e&&(e=""),void 0===r&&(r=""),this.pageAlive.setParams(t,e,r),this.pageClose.setParams(t,e,r),this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayParams",level:"info",time:Date.now(),data:{url_path:t,title:e,url:r}})},t.prototype.reset=function(t,e,r){this.disable(),this.enable(t,e,r)},t.prototype.resetStayDuration=function(t,e,r){this.reset(t,e,r),this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayDuration",level:"info",time:Date.now(),data:{url_path:t,title:e,url:r}})},t}(),Sm=function(){function t(){}return t.prototype.apply=function(t,e){var r=this;this.collect=t,this.config=e,this.duration=6e4,this.reportUrl=t.configManager.getDomain()+"/profile/list";var n=t.Types,i=t.adapters.fetch;this.eventCheck=new $f(t,e),this.fetch=i,this.cache={},this.collect.on(n.ProfileSet,(function(t){r.setProfile(t)})),this.collect.on(n.ProfileSetOnce,(function(t){r.setOnceProfile(t)})),this.collect.on(n.ProfileUnset,(function(t){r.unsetProfile(t)})),this.collect.on(n.ProfileIncrement,(function(t){r.incrementProfile(t)})),this.collect.on(n.ProfileAppend,(function(t){r.appendProfile(t)})),this.collect.on(n.ProfileClear,(function(){r.cache={}})),this.ready(n.Profile)},t.prototype.ready=function(t){var e=this;if(this.collect.set(t),this.collect.hook._hooksCache.hasOwnProperty(t)){var r=this.collect.hook._hooksCache[t];if(!Object.keys(r).length)return;var n=function(t){r[t].length&&r[t].forEach((function(r){e.collect.hook.emit(t,r)}))};for(var i in r)n(i)}},t.prototype.report=function(t,e){void 0===e&&(e={});try{if(this.config.disable_track_event)return;var r=[];r.push(this.collect.processEvent(t,e));var n=this.collect.eventManager.merge(r,!0),i=this.collect.cryptoData(n),o=this.collect.configManager.getUrl("profile");this.fetch(o,i,1e5,!1,(function(){}),(function(){}),"","POST",this.config.enable_encryption,this.config.encryption_header),this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_EVENT,info:"埋点上报成功",time:Date.now(),data:n,code:200,status:"success"})}catch(t){this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message})}},t.prototype.setProfile=function(t){var e=this.formatParams(t);e&&Object.keys(e).length&&(this.pushCache(e),this.report("__profile_set",Jh({},e,{profile:!0})))},t.prototype.setOnceProfile=function(t){var e=this.formatParams(t,!0);e&&Object.keys(e).length&&(this.pushCache(e),this.report("__profile_set_once",Jh({},e,{profile:!0})))},t.prototype.incrementProfile=function(t){t?this.report("__profile_increment",Jh({},t,{profile:!0})):console.warn("please check the params, must be object!!!")},t.prototype.unsetProfile=function(t){if(t){var e={};e[t]="1",this.report("__profile_unset",Jh({},e,{profile:!0}))}else console.warn("please check the key, must be string!!!")},t.prototype.appendProfile=function(t){if(t){var e={};for(var r in t)"string"==typeof t[r]||"Array"===Object.prototype.toString.call(t[r]).slice(8,-1)?e[r]=t[r]:console.warn("please check the value of param: "+r+", must be string or array !!!");Object.keys(e).length&&this.report("__profile_append",Jh({},e,{profile:!0}))}else console.warn("please check the params, must be object!!!")},t.prototype.pushCache=function(t){var e=this;Object.keys(t).forEach((function(r){e.cache[r]={val:e.clone(t[r]),timestamp:Date.now()}}))},t.prototype.formatParams=function(t,e){var r=this;void 0===e&&(e=!1);try{if(!t||"[object Object]"!==Object.prototype.toString.call(t))return void console.warn("please check the params type, must be object !!!");var n={};for(var i in t)"string"==typeof t[i]||"number"==typeof t[i]||"Array"===Object.prototype.toString.call(t[i]).slice(8,-1)?n[i]=t[i]:console.warn("please check the value of params:"+i+", must be string,number,Array !!!");var o=Object.keys(n);if(!o.length)return;var s=Date.now();return o.filter((function(n){var i=r.cache[n];return e?!i:!(i&&r.compare(i.val,t[n])&&s-i.timestamp<r.duration)})).reduce((function(t,e){return t[e]=n[e],t}),{})}catch(t){this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),console.log("error")}},t.prototype.compare=function(t,e){try{return JSON.stringify(t)===JSON.stringify(e)}catch(t){return this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),!1}},t.prototype.clone=function(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),t}},t.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},t}(),Tm=function(){function t(){var t=this;this.setInterval=function(){t.clearIntervalFunc=function(t,e){void 0===t&&(t=function(){}),void 0===e&&(e=1e3);var r,n=Date.now()+e;return r=window.setTimeout((function i(){var o=Date.now()-n;t(),n+=e,r=window.setTimeout(i,Math.max(0,e-o))}),e),function(){window.clearTimeout(r)}}((function(){t.isSessionhasEvent&&t.endCurrentSession()}),t.sessionInterval)},this.clearInterval=function(){t.clearIntervalFunc&&t.clearIntervalFunc()}}return t.prototype.apply=function(t,e){var r=this;if(this.collect=t,!e.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var n=this.collect.Types;this.collect.on(n.SessionReset,(function(){r.process()}))}},t.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},t.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var t=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-t>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},t}(),Am=function(){function t(){}return t.prototype.apply=function(t,e){var r=this;if(this.collect=t,this.config=e,!this.config.channel_domain&&!this.config.disable_track_event&&!this.config.disable_sdk_monitor){var n=t.adapters.fetch;this.fetch=n,this.url=t.configManager.getUrl("event");var i=this.collect.Types;this.collect.on(i.Ready,(function(){r.sdkOnload()})),this.collect.on(i.SubmitError,(function(t){var e=t.type,n=t.eventData,i=t.errorCode;"f_data"===e&&r.sdkError(n,i)}))}},t.prototype.sdkOnload=function(){var t=this;try{var e=this.collect.configManager.get(),r=e.header,n=e.user,i=r.app_id,o=r.app_name,s=r.sdk_version,a=n.web_id,c={events:[{event:"onload",params:JSON.stringify({app_id:i,app_name:o||"",sdk_version:s,sdk_type:"npm",sdk_config:this.config,sdk_desc:"TOB"}),local_time_ms:Date.now()}],user:{user_unique_id:a},header:{}};setTimeout((function(){t.fetch(t.url,[c],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(t){}},t.prototype.sdkError=function(t,e){var r=this;try{var n=t[0],i=n.user,o=n.header,s=[];t.forEach((function(t){t.events.forEach((function(t){s.push(t)}))}));var a={events:s.map((function(t){return{event:"on_error",params:JSON.stringify({error_code:e,app_id:o.app_id,app_name:o.app_name||"",error_event:t.event,sdk_version:o.sdk_version,local_time_ms:t.local_time_ms,tea_event_index:Date.now(),params:t.params,header:JSON.stringify(o),user:JSON.stringify(i)}),local_time_ms:Date.now()}})),user:{user_unique_id:i.user_unique_id},header:{}};setTimeout((function(){r.fetch(r.url,[a],3e4,!1,(function(){}),(function(){}),"566f58151b0ed37e")}),16)}catch(t){}},t}(),km=rr.some,xm=nr("some");function Om(t,e){if(void 0===e&&(e="list"),!t)return!1;if(e&&"list"===e){if(["LI","TR","DL"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty("teaIdx"))return!0;if(t.hasAttribute&&t.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(t.nodeName))return!0;if(t.dataset&&t.dataset.hasOwnProperty("teaContainer"))return!0;if(t.hasAttribute&&t.hasAttribute("data-tea-container"))return!0;if(t.hasAttribute&&Cm(t,"ss"))return!0}return!1}Me({target:"Array",proto:!0,forced:!xm},{some:function(t){return km(this,t,arguments.length>1?arguments[1]:void 0)}});var Im=function(t,e){return!!Cm(t,e)};function Rm(t){for(var e=t;e&&!Om(e,"container");){if("HTML"===e.nodeName||"BODY"===e.nodeName)return t;e=e.parentElement}return e||t}function Dm(t){for(var e=t;e&&e.parentNode;){if(e.hasAttribute("data-tea-ignore"))return!0;if("HTML"===e.nodeName||"body"===e.nodeName)return!1;e=e.parentNode}return!1}var Mm=function(t,e){return t.hasAttribute?t.hasAttribute(e):t.attributes?!(!t.attributes[e]||!t.attributes[e].specified):void 0},Cm=function(t,e){if("string"==typeof e)return Mm(t,e);if(Ql(e)){for(var r=!1,n=0;n<e.length;n++){if(Mm(t,e[n])){r=!0;break}}return r}},Pm=function(t,e){var r={};if("string"==typeof e)Mm(t,e)&&(r[e]=t.getAttribute(e));else if(Ql(e))for(var n=0;n<e.length;n++){Mm(t,e[n])&&(r[e[n]]=t.getAttribute(e[n]))}return r};var Bm=function(){function t(t,e,r){var n=this;this.clickEvent=function(t){(function(t,e){if(1!==t.nodeType)return!1;if(!e.svg&&function(t){if("svg"===t.tagName.toLowerCase())return!0;for(var e=t.parentElement,r=!1;e;)"svg"===e.tagName.toLowerCase()?(e=null,r=!0):e=e.parentElement;return r}(t))return!1;if(["HTML","BODY"].includes(t.tagName.toUpperCase()))return!1;var r=t;return!!("none"!==r.style.display&&(Om(r,"container")||e.track_attr&&Im(r,e.track_attr)||function(t){if(t.children.length){var e=t.children;return![].slice.call(e).some((function(t){return t.children.length>0}))}return!0}(r)))})(t.target,n.options)&&n.eventHandel({eventType:"dom",eventName:"click"},t)},this.changeEvent=function(t){n.eventHandel({eventType:"dom",eventName:"change"},t)},this.submitEvent=function(t){n.eventHandel({eventType:"dom",eventName:"submit"},t)},this.getPageViewEvent=function(t,e){e&&"pushState"===e&&n.eventHandel({eventType:"dom",eventName:"beat"},Jh({beat_type:0},t)),n.eventHandel({eventType:"dom",eventName:"page_view"},t)},this.getPageLoadEvent=function(t){n.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:t})},this.config=r.getConfig().eventConfig,this.collect=e,this.options=t,this.beatTime=t.beat,this.statistics=!1}return t.prototype.init=function(t){this.eventHandel=t;var e=this.config.mode;this.addListener(e)},t.prototype.addListener=function(t){var e=this;if("proxy-capturing"===t&&(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv&&this.collect.on("route-change",(function(t){var r=t.config,n=t.name;e.getPageViewEvent(r,n)})),this.config.beat)){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){e.beatEvent(e.beatTime)}));var r=0,n=null;window.addEventListener("scroll",(function(){clearTimeout(n),n=setTimeout(i,500),r=document.documentElement.scrollTop||document.body.scrollTop}));var i=function(){(document.documentElement.scrollTop||document.body.scrollTop)==r&&e.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(t){}try{var o=window.performance&&window.performance.getEntriesByType("paint");if(o&&o.length){var s=new PerformanceObserver((function(t){var r=t.getEntries(),n=r[r.length-1],i=n.renderTime||n.loadTime;e.statistics||(e.getPageLoadEvent(i),e.statistics=!0)}));s.observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){e.statistics||(e.getPageLoadEvent(o[0].startTime||0),e.statistics=!0)}),2e3)}else this.getPageLoadEvent(0)}catch(t){this.getPageLoadEvent(0)}}},t.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},t.prototype.beatEvent=function(t){var e=this;try{var r;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(r=setInterval((function(){e.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),t)),rf((function(){e.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),e.beatTime&&clearInterval(r)}))}catch(t){}},t}(),Lm={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},Gm=function(){function t(t,e){this.config=t,this.config.eventConfig=Object.assign(this.config.eventConfig,e)}return t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){return this.config=t},t}();function Um(t){for(var e=[];null!==t.parentElement;)e.push(t),t=t.parentElement;var r=[],n=[];return e.forEach((function(t){var e=function(t){if(null===t)return{str:"",index:0};var e=0,r=t.parentElement;if(r)for(var n=r.children,i=0;i<n.length&&n[i]!==t;i++)n[i].nodeName===t.nodeName&&e++;return{str:[t.nodeName.toLowerCase(),Om(t,"list")?"[]":""].join(""),index:e}}(t),i=e.str,o=e.index;r.unshift(i),n.unshift(o)})),{element_path:"/"+r.join("/"),positions:n}}function Nm(t,e,r,n){var i={},o=function(t){if(t){var e=t.getBoundingClientRect(),r=e.width,n=e.height;return{left:e.left,top:e.top,element_width:r,element_height:n}}}(e),s=function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var r=t.clientX,n=t.clientY,i=e.left,o=e.top,s=r-i>=0?r-i:0,a=n-o>=0?n-o:0;return{touch_x:Math.floor(s),touch_y:Math.floor(a)}}(t,o),a=o.element_width,c=o.element_height,u=s.touch_x,h=s.touch_y,l=Um(e),f=l.element_path,p=l.positions,d=function(t){var e=Rm(t),r=[];return function t(e){var n=function(t){var e="";return 3===t.nodeType?e=t.textContent.trim():t.dataset&&t.dataset.hasOwnProperty("teaTitle")||t.hasAttribute("ata-tea-title")?e=t.getAttribute("data-tea-title"):t.hasAttribute("title")?e=t.getAttribute("title"):"INPUT"===t.nodeName&&["button","submit"].includes(t.getAttribute("type"))?e=t.getAttribute("value"):"IMG"===t.nodeName&&t.getAttribute("alt")&&(e=t.getAttribute("alt")),e.slice(0,200)}(e);if(n&&-1===r.indexOf(n)&&r.push(n),e.childNodes.length>0)for(var i=e.childNodes,o=0;o<i.length;o++)8!==i[o].nodeType&&t(i[o])}(e),r}(e),g=window.performance.timing.navigationStart,v=Date.now()-g,m=p.map((function(t){return""+t})),y=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(y=window.TEAVisualEditor.getOriginXpath({xpath:f,positions:m})),i.element_path=y&&y.xpath||f,i.positions=y&&y.positions||m,n&&!n.text&&(i.texts=d,i.element_title=function(t){if(!t)return"";var e="";return t.textContent?e=t.textContent.trim():t.innerText&&(e=t.innerText.trim()),"input"!==t.tagName&&"INPUT"!==t.tagName||(e=t.value||""),e}(e)),i.element_id=e.getAttribute("id")||"",i.element_class_name=e.getAttribute("class")||"",i.element_type=e.nodeType,i.element_width=Math.floor(a),i.element_height=Math.floor(c),i.touch_x=u,i.touch_y=h,i.page_manual_key="",i.elememt_manual_key="",i.since_page_start_ms=v,i.page_start_ms=g,i.page_path=location.pathname,i.page_host=location.host,r.track_attr&&Im(e,r.track_attr)){var b=Pm(e,r.track_attr);for(var _ in b)i[_]=b[_]}if(r.custom_attr)try{if(Im(e,r.custom_attr)){b=Pm(e,r.custom_attr),_=decodeURIComponent(b[r.custom_attr]);var E=JSON.parse(_);if(Object.keys(E))for(var w in E)i[w]=E[w]}}catch(t){console.log("custom attr error")}var S=Rm(e);return"A"===S.tagName&&(i.href=S.getAttribute("href")),!1!==r.src&&("IMG"!==e.tagName||e.getAttribute("src").includes("base64")||(i.src=e.getAttribute("src"))),i}var Fm,jm=function(t,e,r,n,i){return Jh({event:t},Nm(e,r,n,i),{is_html:1,page_key:window.location.href,page_title:document.title})},zm=function(){function t(t,e){this.ignore={text:!1},this.initConfig=t,this.options=e,this.eventName=e&&"tea"===e.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure",scroll:"$bav2b_slide"},e&&!1===e.text&&(this.ignore.text=!0),e&&e.exposure&&e.exposure.eventName&&(this.eventName.exposure=e.exposure.eventName)}return t.prototype.handleEvent=function(t,e){try{if(Dm(t.target))return null;var r="bav2b_click";switch(e){case"click":return r=this.eventName.click,jm(r,t,t.target,this.options,this.ignore);case"exposure":return r=this.eventName.exposure,jm(r,t,t.target,this.options,this.ignore);case"change":return Jh({},jm(r="bav2b_change",t,t.target,this.options),function(t,e){try{if("bav2b_change"===t)return e.hasAttribute("data-tea-track")?{value:e.value}:{}}catch(t){return{}}}(r,t.target));case"submit":return jm(r="bav2b_submit",t,t.target,this.options)}}catch(t){return console.error(t),null}},t.prototype.handleViewEvent=function(t){t.event=this.eventName.page,t.page_title=document.title,t.page_total_width=window.innerWidth,t.page_total_height=window.innerHeight;try{var e=window.sessionStorage.getItem("_tea_cache_duration");if(e){var r=JSON.parse(e);t.refer_page_duration_ms=r?r.duration:""}t.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,t.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,t.page_start_ms=window.performance.timing.navigationStart}catch(t){console.log("page event error "+JSON.stringify(t))}return t},t.prototype.handleStatisticsEvent=function(t){var e={};e.event=this.eventName.static,e.is_html=1,e.page_key=location.href,e.refer_page_key=document.referrer||"",e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"",e.refer_page_manual_key="";try{var r=t.lcp,n=window.performance.timing,i=n.loadEventEnd-n.navigationStart;e.page_init_cost_ms=parseInt(r||(i>0?i:0)),e.page_start_ms=n.navigationStart}catch(t){console.log("page_statistics event error "+JSON.stringify(t))}return e},t.prototype.handleBeadtEvent=function(t){t.event=this.eventName.beat,t.page_key=window.location.href,t.is_html=1,t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{t.page_viewport_width=window.innerWidth,t.page_viewport_height=window.innerHeight,t.page_total_width=document.documentElement.scrollWidth,t.page_total_height=document.documentElement.scrollHeight,t.scroll_width=document.documentElement.scrollLeft+window.innerWidth,t.scroll_height=document.documentElement.scrollTop+window.innerHeight,t.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,t.page_start_ms=window.performance.timing.navigationStart}catch(t){console.log("beat event error "+JSON.stringify(t))}return t},t.prototype.handleExposureEvent=function(t,e){if(Dm(e.target))return null;var r=jm(t.event||this.eventName.exposure,e,e.target||e,this.options,this.ignore);if(r.$exposure_type=t.exposureType,this.options.exposure.callback){var n=this.options.exposure.callback(r);return n||Object.keys(n).length?n:(console.warn("exposure callback must return data!"),r)}return r},t.prototype.handleScrollEvent=function(t,e){var r=jm(t.event||this.eventName.scroll,e,e.target||e,this.options,this.ignore);if(r=Object.assign(r,t.params),!this.options.scroll.callback||(r=this.options.scroll.callback(r))||Object.keys(r).length)return r;console.warn("scroll callback must return data!")},t}(),Vm=function(){function t(t){this.collect=t}return t.prototype.send=function(t,e){var r=e.event;delete e.event,t&&"becon"===t.eventSend?this.collect.beconEvent(r,e):this.collect.event(r,e)},t.prototype.get=function(t,e){var r=Object.assign({headers:{"content-type":"application/json"},method:"GET"},e);fetch(t,r)},t.prototype.post=function(t,e){var r=Object.assign({headers:{"content-type":"application/json"},method:"POST"},e);fetch(t,r)},t}(),qm=function(){function t(t,e){this._instance=null,this._intersection=t,this.config=e,this._intersection&&this.init()}return t.prototype.init=function(){var t=this;if(window.MutationObserver)try{if(this._instance=new MutationObserver((function(e){e.forEach((function(e){"attributes"===e.type&&t.attributeChangeObserve(e),"childList"===e.type&&t.modifyNodeObserve(e)}))})),!document||!document.body)return void console.warn("please use sdk api init after body element");var e=!1!==this.config.autotrack.exposure.attributes;this._instance.observe(document.body,{childList:!0,attributes:e,subtree:!0,attributeOldValue:!1})}catch(t){console.log("your browser cannot support MutationObserver,so cannot report exposure event, please update")}else console.log("your browser cannot support MutationObserver,so cannot report exposure event, please update")},t.prototype.attributeChangeObserve=function(t){t.target.hasAttribute("data-exposure")?this.exposureAdd(t,"mutation"):this.exposureRemove(t)},t.prototype.modifyNodeObserve=function(t){var e=this;Array.prototype.forEach.call(t.addedNodes,(function(t){1===t.nodeType&&t.hasAttribute("data-exposure")&&e.exposureAdd(t,"intersect"),e.mapChild(t,e.exposureAdd.bind(e))})),Array.prototype.forEach.call(t.removedNodes,(function(t){1===t.nodeType&&t.hasAttribute("data-exposure")&&e.exposureRemove(t),e.mapChild(t,e.exposureRemove.bind(e))}))},t.prototype.mapChild=function(t,e){var r=this;1===t.nodeType&&t.children.length&&Array.prototype.forEach.call(t.children,(function(t){1===t.nodeType&&t.hasAttribute("data-exposure")&&e(t),r.mapChild(t,e)}))},t.prototype.exposureAdd=function(t,e){try{this._intersection&&this._intersection.exposureAdd(t,e)}catch(t){console.log("intersection error",JSON.stringify(t.message))}},t.prototype.exposureRemove=function(t){try{this._intersection&&this._intersection.exposureRemove(t)}catch(t){console.log("intersection error",JSON.stringify(t.message))}},t._exposure_observer=null,t}();!function(t){t[t.EXPOSURE_ONCE=0]="EXPOSURE_ONCE",t[t.LIFECYCLE_SHOW_NEW=3]="LIFECYCLE_SHOW_NEW",t[t.RESUME_FORM_PAGE=6]="RESUME_FORM_PAGE",t[t.RESUME_FORM_BACK=7]="RESUME_FORM_BACK",t[t.NOT_EXPOSURE=-1]="NOT_EXPOSURE"}(Fm||(Fm={}));var Hm,Km=function(){function t(e,r,n){var i=this;this.backStatus=!1,this.instance=this.buildObserver(),this.collect=e,this.observeMap=t._observer_map,r.autotrack.exposure.ratio?this.ratio=r.autotrack.exposure.ratio:0===r.autotrack.exposure.ratio?this.ratio=0:this.ratio=.5,this.timeLimit=r.autotrack.exposure.stay||0,this.exposureType=Fm.NOT_EXPOSURE,this.eventHandle=n,this.hashMap=new Map,this.backStatus=!1,this.lastState=null,this.collect.on("re-start-sdk",(function(){i.visibilitychange()})),this.addListen()}return t.prototype.buildObserver=function(){var e=this;if(t._observer_instance)return console.log("your browser cannot support IntersectionObserver, so cannot report exposure event, please update"),null;if(window.IntersectionObserver){for(var r=[],n=0;n<=1;n+=.01)r.push(n);r.push(1);try{t._observer_instance=new IntersectionObserver((function(t){t.forEach((function(t){var r=t.target.observeId,n=e.observeMap.get(r),i=(t.target,t.isIntersecting,t.intersectionRatio);if(n.intersectionRatio=i,i<=.1&&(t.target.backStatus=!1),e.observeMap.set(r,n),i<e.ratio)return n.isIntersecting=!1,n.added=!1,n.exposured=!1,n.startTime=Date.now(),void e.observeMap.set(r,n);if(!n.added){if(n.startTime=Date.now(),n.added=!0,n.isIntersecting=!0,e.timeLimit){var o=setTimeout((function(){try{if(n.isIntersecting&&!n.exposured&&e.observeMap.get(r)){var i=e.observeMap.get(r).intersectionRatio;e.exposureEvent(t,i,r,n)}}catch(t){console.log("IntersectionObserver setTimeout error,msg: "+JSON.stringify(t))}}),e.timeLimit);n.wait=o}e.observeMap.set(r,n)}Date.now()-n.startTime>=e.timeLimit&&!n.exposured&&e.exposureEvent(t,i,r,n)}))}),{threshold:r})}catch(t){console.log("IntersectionObserver error,msg: "+JSON.stringify(t))}return t._observer_instance}return console.log("your browser cannot support IntersectionObserver, so cannot report exposure event, please update"),null},t.prototype.exposureAdd=function(t,e){var r="mutation"===e?t.target:t,n=r.observeId,i=mp();if(n||this.observeMap.has(n)){var o=this.observeMap.get(n);if(o&&r!==o.instance)this.unobserve(r),this.observeMap.delete(n),r.observeId=i,r.visible=!1,this.observeMap.set(i,{instance:r.cloneNode(!0),isIntersecting:!1}),this.observe(r);else{if(!0===r.visible)return;this.handleBoundingExposure(r)}}else r.observeId=i,r.visible=!1,this.observeMap.set(i,{instance:r.cloneNode(!0),isIntersecting:!1}),this.observe(r)},t.prototype.exposureRemove=function(t){this.observeMap.has(t.observeId)&&(this.observeMap.delete(t.observeId),this.unobserve(t),t.observeId="",t.visible=!1)},t.prototype.exposureEvent=function(t,e,r,n){if(e>=this.ratio){if("0"===t.target.style.opacity||"hidden"===t.target.style.visibility)return;if(!0===n.exposured)return;n.startWait&&clearTimeout(n.startWait);var i=t.target.getAttribute("data-exposure-event");this.eventHandle({eventType:"dom",eventName:"exposure",event:i,exposureType:this.getExposureType(t.target)},t),t.target.visible=!0,t.target.hasExposure=!0,n.startTime=Date.now(),n.exposured=!0}else n.startTime=Date.now(),n.exposured=!1;this.observeMap.set(r,n)},t.prototype.observe=function(t){this.instance&&this.instance.observe(t)},t.prototype.unobserve=function(t){this.instance&&this.instance.unobserve(t)},t.prototype.getExposureDomToExposure=function(){var t=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(e){t.handleBoundingExposure(e)}))},t.prototype.visibilitychange=function(){var t=this,e=null;"visible"===document.visibilityState?this.timeLimit?e=setTimeout((function(){t.getExposureDomToExposure()}),this.timeLimit):this.getExposureDomToExposure():(clearTimeout(e),this.customType=void 0)},t.prototype.handleBoundingExposure=function(t){if(this.getBoundingRatio(t)>=this.ratio){t.visible=!0;var e=t.getAttribute&&t.getAttribute("data-exposure-event");this.eventHandle({eventType:"dom",eventName:"exposure",event:e,exposureType:this.customType||Fm.RESUME_FORM_BACK},t)}},t.prototype.getBoundingRatio=function(t){var e=t.getBoundingClientRect(),r=e.top,n=e.left,i=e.width,o=e.height,s=window.innerWidth||document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return r>=0&&n>=0&&r<=a&&n<=s?(i>s?s:i)*(a-r)/(i*o):0},t.prototype.getExposureType=function(t){return t.visible?!1!==t.backStatus&&(this.backStatus||this.customType||2===window.performance.navigation.type)?this.exposureType=Fm.RESUME_FORM_PAGE:this.exposureType=Fm.LIFECYCLE_SHOW_NEW:(t.hasExposure,!1!==t.backStatus&&(this.backStatus||this.customType||2===window.performance.navigation.type)?this.exposureType=Fm.RESUME_FORM_PAGE:this.exposureType=Fm.EXPOSURE_ONCE),this.exposureType},t.prototype.addListen=function(){var t=this;this.collect.on("set-exposure-type",(function(e){t.customType=e}));var e=this.visibilitychange.bind(this);if(function(t,e,r,n){t.addEventListener?t.addEventListener(e,r,n):t.attachEven?t.attachEven("on"+e,r):t["on"+e]=r}(document,"visibilitychange",e,!1),window.addEventListener("hashchange",(function(e){var r=t.hashMap.get(e.oldURL);r&&location.href===r.prev?(t.backStatus=!0,t.exposureType=Fm.RESUME_FORM_PAGE):(t.backStatus=!1,t.hashMap.set(location.href,{current:e.newURL,prev:e.oldURL}))})),this.collect.bridgeReport){var r=window.history.pushState;history.pushState=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];"function"==typeof history.onpushstate&&history.onpushstate({state:e});var o=r.call.apply(r,Yh([history,e],n));return t.lastState=e,o};var n=history.replaceState;history.replaceState=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];"function"==typeof history.onreplacestate&&history.onreplacestate({state:e});var o=n.call.apply(n,Yh([history,e],r));return t.lastState=e,o}}else this.collect.on("STATE_CHANGE",(function(e){t.lastState=e}));return window.addEventListener("popstate",(function(e){var r=e.state;r&&r.current&&t.lastState&&t.lastState.back&&r.current===t.lastState.back?(t.backStatus=!0,t.exposureType=Fm.RESUME_FORM_PAGE):t.backStatus=!1})),function(){!function(t,e,r,n){t.addEventListener?t.removeEventListener(e,r,n):t.attachEven&&t.detachEven("on"+e,r)}(document,"visibilitychange",e,!1)}},t._observer_instance=null,t._observer_map=new Map,t}(),Wm=function(){function t(t,e,r){e.autotrack&&e.autotrack.exposure&&(this._intersection=new Km(t,e,r),this._observer=new qm(this._intersection,e),this._intersection&&this._observer?this.initObserver():console.log("your browser version cannot support exposure event, please update~"))}return t.prototype.initObserver=function(){var t=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(e){t._intersection.exposureAdd(e,"intersect")}))},t}();!function(t){t[t.SCROLL_UP=1]="SCROLL_UP",t[t.SCROLL_DOWN=2]="SCROLL_DOWN",t[t.SCROLL_LEFT=3]="SCROLL_LEFT",t[t.SCROLL_RIGHT=4]="SCROLL_RIGHT",t[t.NOT_SCROLL=-1]="NOT_SCROLL"}(Hm||(Hm={}));var Jm=function(){function t(t,e){this.distance=30,t.autotrack&&t.autotrack.scroll&&(t.autotrack.scroll.distance&&(this.distance=t.autotrack.scroll.distance),this.eventHandle=e,this.addLinstenr(),this.mutation())}return t.prototype.addLinstenr=function(){var t=this;Array.prototype.forEach.call(document.querySelectorAll("[data-scroll]"),(function(e){t.scrollHandle(e)}))},t.prototype.mutation=function(){var t=this;if(window.MutationObserver)try{var e=new MutationObserver((function(e){e.forEach((function(e){"childList"===e.type&&t.modifyNodeObserve(e)}))}));if(!document||!document.body)return void console.warn("please use sdk api init after body element");e.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})}catch(t){console.log("your browser cannot support MutationObserver")}else console.log("your browser cannot support MutationObserver")},t.prototype.modifyNodeObserve=function(t){var e=this;Array.prototype.forEach.call(t.addedNodes,(function(t){1===t.nodeType&&t.hasAttribute("data-scroll")&&e.scrollHandle(t),e.mapChild(t,e.scrollHandle.bind(e))})),Array.prototype.forEach.call(t.removedNodes,(function(t){1===t.nodeType&&t.hasAttribute("data-scroll")&&e.scrollHandle(t,"remove"),e.mapChild(t,e.scrollHandle.bind(e))}))},t.prototype.mapChild=function(t,e){var r=this;1===t.nodeType&&t.children.length&&Array.prototype.forEach.call(t.children,(function(t){1===t.nodeType&&t.hasAttribute("data-scroll")&&e(t),r.mapChild(t,e)}))},t.prototype.scrollHandle=function(t,e){var r=this;try{var n=t.scrollTop,i=t.scrollLeft,o=null,s=0,a=0,c=function(e){clearTimeout(o),o=setTimeout((function(){var o=t.scrollTop,l=t.scrollLeft,f=e.target&&e.target.getAttribute("data-scroll-event")||"";1===h||2===h?o===c&&(a=c-n,Math.abs(a)>=r.distance&&r.distance&&r.eventHandle({eventType:"dom",eventName:"scroll",event:f,params:{$direction:h,$offsetY:a,$offsetX:s}},e)):3!==h&&4!==h||l===u&&(s=u-i,Math.abs(s)>=r.distance&&r.distance&&r.eventHandle({eventType:"dom",eventName:"scroll",event:f,params:{$direction:h,$offsetY:a,$offsetX:s}},e)),n=c,i=u}),100);var c=t.scrollTop,u=t.scrollLeft,h=Hm.NOT_SCROLL;c>n?h=Hm.SCROLL_DOWN:c<n?h=Hm.SCROLL_UP:u>i?h=Hm.SCROLL_LEFT:u<i&&(h=Hm.SCROLL_RIGHT)};return"remove"===e?t.removeEventListener("scroll",c,!1):t.addEventListener("scroll",c,!1),function(){t.removeEventListener("scroll",c,!1)}}catch(t){console.warn("scroll event error",JSON.stringify(t))}},t}(),$m={hashTag:!1,impr:!1},Ym=function(){function t(){}return t.prototype.apply=function(t,e){if(this.autoTrackStart=!1,this.collect=t,this.config=e,e.autotrack&&(!e.autotrack||!e.autotrack.collect_url||e.autotrack.collect_url())){var r=t.Types;this.ready(r.Autotrack),this.collect.emit(r.AutotrackReady)}},t.prototype.ready=function(t){this.collect.set(t);var e=this.config.autotrack;e="object"==typeof e?e:{},e=Object.assign($m,e),this.destroyed=!1,this.options=e,this.Config=new Gm(Lm,this.options),this.Exposure=new Wm(this.collect,this.config,this.handle.bind(this)),this.Scroll=new Jm(this.config,this.handle.bind(this)),this.Listener=new Bm(e,this.collect,this.Config),this.EventHandle=new zm(this.config,e),this.Request=new Vm(this.collect),this.autoTrackStart=!0,this.init()},t.prototype.init=function(){this.Listener.init(this.handle.bind(this))},t.prototype.handle=function(t,e){try{if(this.config.autotrack.collect_url&&!this.config.autotrack.collect_url())return}catch(t){}this.collect.sdkStop||"dom"===t.eventType&&this.handleDom(t,e)},t.prototype.handleDom=function(t,e){try{var r=t.eventName;if("click"===r||"change"===r||"submit"===r)(s=this.EventHandle.handleEvent(e,r))&&this.Request.send({eventType:"custom"},s);else if("page_view"===r||"page_statistics"===r){var n=void 0;(n="page_view"===r?this.EventHandle.handleViewEvent(e):this.EventHandle.handleStatisticsEvent(e))&&this.Request.send({eventType:"custom"},n)}else if("beat"===r){var i=this.EventHandle.handleBeadtEvent(e),o=t.eventSend;i&&this.Request.send({eventType:"custom",eventSend:o},i)}else if("exposure"===r){(s=this.EventHandle.handleExposureEvent(t,e))&&this.Request.send({eventType:"custom"},s)}else if("scroll"===r){var s;(s=this.EventHandle.handleScrollEvent(t,e))&&this.Request.send({eventType:"custom"},s)}}catch(t){console.log("handel dom event error "+JSON.stringify(t))}},t.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},t}(),Xm=function(){function t(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return t.prototype.apply=function(t,e){if(e.spa||e.autotrack){var r=t.Types;this.collect=t,this.config=e,this.appid=e.app_id,this.allowHash=e.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),t.emit(r.RouteReady)}},t.prototype.setKey=function(){var t=this.collect.adapters.storage;this.storage=new t(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==typeof this.config.autotrack&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},t.prototype.hack=function(){var t=this,e=window.history.pushState;history.pushState=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];"function"==typeof history.onpushstate&&history.onpushstate({state:r});var o=e.call.apply(e,Yh([history,r],n));if(t.lastLocation!==location.href){var s=t.getPopStateChangeEventData();return t.setReferCache(t.lastLocation),t.lastLocation=location.href,t.sendPv(s,"pushState"),o}};var r=history.replaceState;history.replaceState=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];"function"==typeof history.onreplacestate&&history.onreplacestate({state:e});var o=r.call.apply(r,Yh([history,e],n));if(t.lastLocation!==location.href){var s=t.getPopStateChangeEventData();return t.setReferCache(t.lastLocation),t.lastLocation=location.href,t.sendPv(s),o}}},t.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},t.prototype.getLocation=function(){return this.lastLocation},t.prototype.init=function(){var t=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:t,init:!0})},t.prototype.listener=function(){var t=this,e=null;window.addEventListener("hashchange",(function(r){if(t.lastLocation!==window.location.href&&(clearTimeout(e),t.allowHash)){t.setReferCache(t.lastLocation),t.lastLocation=window.location.href;var n=t.getPopStateChangeEventData();t.sendPv(n)}})),window.addEventListener("popstate",(function(r){t.lastLocation!==window.location.href&&(e=setTimeout((function(){t.setReferCache(t.lastLocation),t.lastLocation=window.location.href;var e=t.getPopStateChangeEventData();t.sendPv(e)}),10))}))},t.prototype.getPopStateChangeEventData=function(){var t=this.pageConfig();return t.is_back=0,t},t.prototype.pageConfig=function(){try{var t=this.storage.getItem(this.cache_key)||{},e=!1,r=this.storage.getItem("__tea_cache_first_"+this.appid);return e=!r||1!=r,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:t&&t.refer_manual_key||"",refer_page_title:t&&t.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+e}}catch(t){return this.collect.emit(zf.DEBUGGER_MESSAGE,{type:zf.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:t.message}),{}}},t.prototype.sendPv=function(t,e){this.collect.emit("route-change",{config:t,init:!1})},t.prototype.handleRefer=function(){var t="";try{var e=this.storage.getItem()||{};t=e.routeChange?e.refer_key:this.collect.configManager.get("referrer")}catch(e){t=document.referrer}return t},t.prototype.setReferCache=function(t){var e=this.storage.getItem(this.cache_key)||{};e.refer_key=t,e.routeChange=!0,this.storage.setItem(this.cache_key,e)},t}(),Zm=function(){function t(){this.verifyReady=!1,this.cleanStatus=!1}return t.prototype.apply=function(t,e){var r=this;this.collector=t,this.config=e,this.eventStorage=[],this.collector.on("submit-verify-h5",(function(t){t&&t.length&&r.eventStore(t[0])})),this.checkUrl(),this.heartbeat()},t.prototype.checkUrl=function(){var t=window.location.href,e=sf(t);e._r_d_&&e._r_c_k_?(this.verifyReady=!0,this.domain=e._r_d_,this.key=e._r_c_k_,this.checkCache()):this.collector.off("submit-verify-h5")},t.prototype.checkCache=function(){this.eventStorage.length&&this.postVerify(this.eventStorage)},t.prototype.heartbeat=function(){var t=this;this.heart=setInterval((function(){var e={event:"simulator_test__",local_time_ms:Date.now()},r=t.collector.configManager.get(),n=r.header,i={events:[e],user:r.user,header:n};t.eventStore(i)}),6e4)},t.prototype.eventStore=function(t){this.cleanStatus||(this.verifyReady?this.postVerify(t):this.eventStorage.push(t))},t.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[],clearInterval(this.heart)},t.prototype.postVerify=function(t){var e=this;try{var r=JSON.parse(JSON.stringify(t));Ql(t)?r.forEach((function(t){e.fetchLog(t)})):this.fetchLog(r)}catch(t){console.log("web verify post error ~")}},t.prototype.fetchLog=function(t){cp(this.domain+"/simulator/h5/log?connection_key="+this.key,t,2e4,!1)},t.prototype.leave=function(){var t=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.cleanVerify()})),rf((function(){t.cleanVerify()}))},t}(),Qm=function(){function t(){this.retryWaitTime=3e3,this.retryStatus=!1,this.retryCacheStatus=!1}return t.prototype.apply=function(t,e){var r=this;if(e.enable_storage&&!e.disable_storage&&(this.collect=t,this.config=e,!this.collect.destroyInstance)){var n=t.Types,i=t.adapters,o=i.storage,s=i.fetch;this.storage=new o(!1),this.fetch=s,this.eventUrl=this.collect.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+e.app_id,this.storageNum=e.storage_num||50,this.retryNum=e.retry_num||3,this.retryInterval=1e3,t.on(n.SubmitError,(function(t){"f_data"===t.type&&r.storeData(t)})),t.on(n.Ready,(function(){r.checkStorage()}))}},t.prototype.retryRightNow=function(t){var e=this;if(this.retryStatus)this.errorCache.push(t);else{var r=0;this.retryStatus=!0;var n=setInterval((function(){if(3===r)return e.storeData(e.errorCache),e.retryStatus=!1,void clearInterval(n);var i=t.eventData;e.fetchData(i,(function(){e.retryStatus=!1,clearInterval(n),e.retryCacheStatus&&e.errorCache.splice(0,1),e.errorCache.length&&(e.retryCacheStatus=!0,e.retryRightNow(e.errorCache[0]))}),(function(){r++}))}),this.retryInterval)}},t.prototype.storeData=function(t){var e=this.storage.getItem(this.eventKey),r=t.eventData;Object.keys(e).length!==this.storageNum&&(e[Date.now()]=r,this.storage.setItem(this.eventKey,e))},t.prototype.checkStorage=function(){var t=this;try{if(!window.navigator.onLine)return;var e=this.storage.getItem(this.eventKey);if(!e||!Object.keys(e).length)return;var r={events:[{event:"ontest",params:{app_id:this.config.app_id},local_time_ms:Date.now()}],user:{user_unique_id:this.collect.configManager.get("web_id")},header:{}};this.fetchData([r],(function(){var r=JSON.parse(JSON.stringify(e)),n=function(n){t.fetchData(e[n],(function(){delete r[n],t.storage.setItem(t.eventKey,r)}),(function(){}),!1)};for(var i in e)n(i)}),(function(){}),!0)}catch(t){console.warn("error check storage")}},t.prototype.fetchData=function(t,e,r,n){this.fetch(this.eventUrl,t,3e4,!1,(function(){e&&e()}),(function(){r&&r(),console.log("network error,compensate report failk")}),n&&!this.config.channel_domain?"566f58151b0ed37e":"")},t}(),ty=function(){function t(){}return t.prototype.apply=function(t,e){var r=this;this.collector=t,this.config=e;var n=t.Types;t.on(n.TrackDurationStart,(function(t){r.trackStart(t)})),t.on(n.TrackDurationEnd,(function(t){r.trackEnd(t)})),t.on(n.TrackDurationPause,(function(t){r.trackPause(t)})),t.on(n.TrackDurationResume,(function(t){r.trackResume(t)})),this.Types=n,this.TrackMap=new Map,this.ready(n.TrackDuration)},t.prototype.ready=function(t){var e=this;if(this.collector.set(t),this.collector.hook._hooksCache.hasOwnProperty(t)){var r=this.collector.hook._hooksCache[t];if(!Object.keys(r).length)return;var n=function(t){r[t].length&&r[t].forEach((function(r){e.collector.hook.emit(t,r)}))};for(var i in r)n(i)}},t.prototype.trackStart=function(t){this.TrackMap.set(t,{startTime:Date.now(),isPause:!1,pauseTime:0,resumeTime:0})},t.prototype.trackEnd=function(t){var e=t.eventName,r=t.params;if(this.TrackMap.has(e)){var n=this.TrackMap.get(e),i=0;i=n.isPause?n.pauseTime-n.startTime:n.resumeTime?n.pauseTime-n.startTime+(Date.now()-n.resumeTime):Date.now()-n.startTime;var o=Object.assign(r,{event_duration:i});this.collector.event(e,o),this.cleanTrack(e)}},t.prototype.trackPause=function(t){if(this.TrackMap.has(t)){var e=this.TrackMap.get(t);e.isPause||(e.isPause=!0,e.pauseTime=Date.now(),this.TrackMap.set(t,e))}},t.prototype.trackResume=function(t){if(this.TrackMap.has(t)){var e=this.TrackMap.get(t);e.isPause&&(e.isPause=!1,e.resumeTime=Date.now(),this.TrackMap.set(t,e))}},t.prototype.cleanTrack=function(t){this.TrackMap.delete(t)},t}();xd.usePlugin(pm,"ab"),xd.usePlugin(wm,"stay"),xd.usePlugin(Qm,"store"),xd.usePlugin(Ym,"autotrack"),xd.usePlugin(ty,"trackDuration"),xd.usePlugin(Zm,"verify"),xd.usePlugin(Sm,"profile"),xd.usePlugin(Tm,"heartbeat"),xd.usePlugin(Am,"monitor"),xd.usePlugin(Xm,"route");var ey=new xd("default"),ry=xd;exports.Collector=ry,exports.default=ey;