hm-tracking-sdk 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.
Files changed (46) hide show
  1. package/README.md +291 -0
  2. package/dist/browser/index.es.js +36247 -0
  3. package/dist/browser/index.umd.js +1245 -0
  4. package/dist/browser.d.ts +1 -0
  5. package/dist/browser.js +8 -0
  6. package/dist/browser.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +4 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/sdk/HmTgTrackingSDK.d.ts +68 -0
  11. package/dist/sdk/HmTgTrackingSDK.js +336 -0
  12. package/dist/sdk/HmTgTrackingSDK.js.map +1 -0
  13. package/dist/sdk/HmTrackingSDK.d.ts +68 -0
  14. package/dist/sdk/HmTrackingSDK.js +336 -0
  15. package/dist/sdk/HmTrackingSDK.js.map +1 -0
  16. package/dist/sdk/TgTrackingSDK.d.ts +68 -0
  17. package/dist/sdk/TgTrackingSDK.js +336 -0
  18. package/dist/sdk/TgTrackingSDK.js.map +1 -0
  19. package/dist/sdk/adMonitor.d.ts +13 -0
  20. package/dist/sdk/adMonitor.js +51 -0
  21. package/dist/sdk/adMonitor.js.map +1 -0
  22. package/dist/sdk/api.d.ts +35 -0
  23. package/dist/sdk/api.js +73 -0
  24. package/dist/sdk/api.js.map +1 -0
  25. package/dist/sdk/http.d.ts +16 -0
  26. package/dist/sdk/http.js +43 -0
  27. package/dist/sdk/http.js.map +1 -0
  28. package/dist/sdk/index.d.ts +3 -0
  29. package/dist/sdk/index.js +4 -0
  30. package/dist/sdk/index.js.map +1 -0
  31. package/dist/sdk/monetag.d.ts +29 -0
  32. package/dist/sdk/monetag.js +115 -0
  33. package/dist/sdk/monetag.js.map +1 -0
  34. package/dist/sdk/storage.d.ts +8 -0
  35. package/dist/sdk/storage.js +30 -0
  36. package/dist/sdk/storage.js.map +1 -0
  37. package/dist/sdk/telegram.d.ts +12 -0
  38. package/dist/sdk/telegram.js +139 -0
  39. package/dist/sdk/telegram.js.map +1 -0
  40. package/dist/sdk/tonWalletProvider.d.ts +13 -0
  41. package/dist/sdk/tonWalletProvider.js +142 -0
  42. package/dist/sdk/tonWalletProvider.js.map +1 -0
  43. package/dist/sdk/types.d.ts +212 -0
  44. package/dist/sdk/types.js +7 -0
  45. package/dist/sdk/types.js.map +1 -0
  46. package/package.json +63 -0
@@ -0,0 +1,1245 @@
1
+ (function(r,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("crypto-js")):typeof define=="function"&&define.amd?define(["exports","crypto-js"],f):(r=typeof globalThis<"u"?globalThis:r||self,f(r.HmTrackingSDK={},r.CryptoJS))})(this,(function(exports,CryptoJS){"use strict";var buffer$1={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup$1=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i$1=0,len=code.length;i$1<len;++i$1)lookup$1[i$1]=code[i$1],revLookup[code.charCodeAt(i$1)]=i$1;revLookup[45]=62,revLookup[95]=63;function getLens(r){var f=r.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var d=r.indexOf("=");d===-1&&(d=f);var g=d===f?0:4-d%4;return[d,g]}function byteLength(r){var f=getLens(r),d=f[0],g=f[1];return(d+g)*3/4-g}function _byteLength(r,f,d){return(f+d)*3/4-d}function toByteArray(r){var f,d=getLens(r),g=d[0],v=d[1],m=new Arr(_byteLength(r,g,v)),w=0,_=v>0?g-4:g,S;for(S=0;S<_;S+=4)f=revLookup[r.charCodeAt(S)]<<18|revLookup[r.charCodeAt(S+1)]<<12|revLookup[r.charCodeAt(S+2)]<<6|revLookup[r.charCodeAt(S+3)],m[w++]=f>>16&255,m[w++]=f>>8&255,m[w++]=f&255;return v===2&&(f=revLookup[r.charCodeAt(S)]<<2|revLookup[r.charCodeAt(S+1)]>>4,m[w++]=f&255),v===1&&(f=revLookup[r.charCodeAt(S)]<<10|revLookup[r.charCodeAt(S+1)]<<4|revLookup[r.charCodeAt(S+2)]>>2,m[w++]=f>>8&255,m[w++]=f&255),m}function tripletToBase64(r){return lookup$1[r>>18&63]+lookup$1[r>>12&63]+lookup$1[r>>6&63]+lookup$1[r&63]}function encodeChunk(r,f,d){for(var g,v=[],m=f;m<d;m+=3)g=(r[m]<<16&16711680)+(r[m+1]<<8&65280)+(r[m+2]&255),v.push(tripletToBase64(g));return v.join("")}function fromByteArray(r){for(var f,d=r.length,g=d%3,v=[],m=16383,w=0,_=d-g;w<_;w+=m)v.push(encodeChunk(r,w,w+m>_?_:w+m));return g===1?(f=r[d-1],v.push(lookup$1[f>>2]+lookup$1[f<<4&63]+"==")):g===2&&(f=(r[d-2]<<8)+r[d-1],v.push(lookup$1[f>>10]+lookup$1[f>>4&63]+lookup$1[f<<2&63]+"=")),v.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(r,f,d,g,v){var m,w,_=v*8-g-1,S=(1<<_)-1,x=S>>1,b=-7,C=d?v-1:0,E=d?-1:1,M=r[f+C];for(C+=E,m=M&(1<<-b)-1,M>>=-b,b+=_;b>0;m=m*256+r[f+C],C+=E,b-=8);for(w=m&(1<<-b)-1,m>>=-b,b+=g;b>0;w=w*256+r[f+C],C+=E,b-=8);if(m===0)m=1-x;else{if(m===S)return w?NaN:(M?-1:1)*(1/0);w=w+Math.pow(2,g),m=m-x}return(M?-1:1)*w*Math.pow(2,m-g)},ieee754.write=function(r,f,d,g,v,m){var w,_,S,x=m*8-v-1,b=(1<<x)-1,C=b>>1,E=v===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=g?0:m-1,A=g?1:-1,T=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(_=isNaN(f)?1:0,w=b):(w=Math.floor(Math.log(f)/Math.LN2),f*(S=Math.pow(2,-w))<1&&(w--,S*=2),w+C>=1?f+=E/S:f+=E*Math.pow(2,1-C),f*S>=2&&(w++,S/=2),w+C>=b?(_=0,w=b):w+C>=1?(_=(f*S-1)*Math.pow(2,v),w=w+C):(_=f*Math.pow(2,C-1)*Math.pow(2,v),w=0));v>=8;r[d+M]=_&255,M+=A,_/=256,v-=8);for(w=w<<v|_,x+=v;x>0;r[d+M]=w&255,M+=A,w/=256,x-=8);r[d+M-A]|=T*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(r){const f=base64Js,d=ieee754,g=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=b,r.SlowBuffer=X,r.INSPECT_MAX_BYTES=50;const v=2147483647;r.kMaxLength=v;const{Uint8Array:m,ArrayBuffer:w,SharedArrayBuffer:_}=globalThis;b.TYPED_ARRAY_SUPPORT=S(),!b.TYPED_ARRAY_SUPPORT&&typeof console<"u";function S(){try{const le=new m(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,m.prototype),Object.setPrototypeOf(le,Z),le.foo()===42}catch{return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function x(le){if(le>v)throw new RangeError('The value "'+le+'" is invalid for option "size"');const Z=new m(le);return Object.setPrototypeOf(Z,b.prototype),Z}function b(le,Z,J){if(typeof le=="number"){if(typeof Z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(le)}return C(le,Z,J)}b.poolSize=8192;function C(le,Z,J){if(typeof le=="string")return T(le,Z);if(w.isView(le))return O(le);if(le==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le);if(ut(le,w)||le&&ut(le.buffer,w)||typeof _<"u"&&(ut(le,_)||le&&ut(le.buffer,_)))return N(le,Z,J);if(typeof le=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ge=le.valueOf&&le.valueOf();if(ge!=null&&ge!==le)return b.from(ge,Z,J);const Ee=H(le);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof le[Symbol.toPrimitive]=="function")return b.from(le[Symbol.toPrimitive]("string"),Z,J);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le)}b.from=function(le,Z,J){return C(le,Z,J)},Object.setPrototypeOf(b.prototype,m.prototype),Object.setPrototypeOf(b,m);function E(le){if(typeof le!="number")throw new TypeError('"size" argument must be of type number');if(le<0)throw new RangeError('The value "'+le+'" is invalid for option "size"')}function M(le,Z,J){return E(le),le<=0?x(le):Z!==void 0?typeof J=="string"?x(le).fill(Z,J):x(le).fill(Z):x(le)}b.alloc=function(le,Z,J){return M(le,Z,J)};function A(le){return E(le),x(le<0?0:V(le)|0)}b.allocUnsafe=function(le){return A(le)},b.allocUnsafeSlow=function(le){return A(le)};function T(le,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!b.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);const J=oe(le,Z)|0;let ge=x(J);const Ee=ge.write(le,Z);return Ee!==J&&(ge=ge.slice(0,Ee)),ge}function L(le){const Z=le.length<0?0:V(le.length)|0,J=x(Z);for(let ge=0;ge<Z;ge+=1)J[ge]=le[ge]&255;return J}function O(le){if(ut(le,m)){const Z=new m(le);return N(Z.buffer,Z.byteOffset,Z.byteLength)}return L(le)}function N(le,Z,J){if(Z<0||le.byteLength<Z)throw new RangeError('"offset" is outside of buffer bounds');if(le.byteLength<Z+(J||0))throw new RangeError('"length" is outside of buffer bounds');let ge;return Z===void 0&&J===void 0?ge=new m(le):J===void 0?ge=new m(le,Z):ge=new m(le,Z,J),Object.setPrototypeOf(ge,b.prototype),ge}function H(le){if(b.isBuffer(le)){const Z=V(le.length)|0,J=x(Z);return J.length===0||le.copy(J,0,0,Z),J}if(le.length!==void 0)return typeof le.length!="number"||gt(le.length)?x(0):L(le);if(le.type==="Buffer"&&Array.isArray(le.data))return L(le.data)}function V(le){if(le>=v)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+v.toString(16)+" bytes");return le|0}function X(le){return+le!=le&&(le=0),b.alloc(+le)}b.isBuffer=function(Z){return Z!=null&&Z._isBuffer===!0&&Z!==b.prototype},b.compare=function(Z,J){if(ut(Z,m)&&(Z=b.from(Z,Z.offset,Z.byteLength)),ut(J,m)&&(J=b.from(J,J.offset,J.byteLength)),!b.isBuffer(Z)||!b.isBuffer(J))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Z===J)return 0;let ge=Z.length,Ee=J.length;for(let Re=0,qe=Math.min(ge,Ee);Re<qe;++Re)if(Z[Re]!==J[Re]){ge=Z[Re],Ee=J[Re];break}return ge<Ee?-1:Ee<ge?1:0},b.isEncoding=function(Z){switch(String(Z).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},b.concat=function(Z,J){if(!Array.isArray(Z))throw new TypeError('"list" argument must be an Array of Buffers');if(Z.length===0)return b.alloc(0);let ge;if(J===void 0)for(J=0,ge=0;ge<Z.length;++ge)J+=Z[ge].length;const Ee=b.allocUnsafe(J);let Re=0;for(ge=0;ge<Z.length;++ge){let qe=Z[ge];if(ut(qe,m))Re+qe.length>Ee.length?(b.isBuffer(qe)||(qe=b.from(qe)),qe.copy(Ee,Re)):m.prototype.set.call(Ee,qe,Re);else if(b.isBuffer(qe))qe.copy(Ee,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=qe.length}return Ee};function oe(le,Z){if(b.isBuffer(le))return le.length;if(w.isView(le)||ut(le,w))return le.byteLength;if(typeof le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof le);const J=le.length,ge=arguments.length>2&&arguments[2]===!0;if(!ge&&J===0)return 0;let Ee=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":return je(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J*2;case"hex":return J>>>1;case"base64":return Je(le).length;default:if(Ee)return ge?-1:je(le).length;Z=(""+Z).toLowerCase(),Ee=!0}}b.byteLength=oe;function se(le,Z,J){let ge=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((J===void 0||J>this.length)&&(J=this.length),J<=0)||(J>>>=0,Z>>>=0,J<=Z))return"";for(le||(le="utf8");;)switch(le){case"hex":return R(this,Z,J);case"utf8":case"utf-8":return I(this,Z,J);case"ascii":return D(this,Z,J);case"latin1":case"binary":return W(this,Z,J);case"base64":return $(this,Z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,Z,J);default:if(ge)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),ge=!0}}b.prototype._isBuffer=!0;function de(le,Z,J){const ge=le[Z];le[Z]=le[J],le[J]=ge}b.prototype.swap16=function(){const Z=this.length;if(Z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let J=0;J<Z;J+=2)de(this,J,J+1);return this},b.prototype.swap32=function(){const Z=this.length;if(Z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let J=0;J<Z;J+=4)de(this,J,J+3),de(this,J+1,J+2);return this},b.prototype.swap64=function(){const Z=this.length;if(Z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let J=0;J<Z;J+=8)de(this,J,J+7),de(this,J+1,J+6),de(this,J+2,J+5),de(this,J+3,J+4);return this},b.prototype.toString=function(){const Z=this.length;return Z===0?"":arguments.length===0?I(this,0,Z):se.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(Z){if(!b.isBuffer(Z))throw new TypeError("Argument must be a Buffer");return this===Z?!0:b.compare(this,Z)===0},b.prototype.inspect=function(){let Z="";const J=r.INSPECT_MAX_BYTES;return Z=this.toString("hex",0,J).replace(/(.{2})/g,"$1 ").trim(),this.length>J&&(Z+=" ... "),"<Buffer "+Z+">"},g&&(b.prototype[g]=b.prototype.inspect),b.prototype.compare=function(Z,J,ge,Ee,Re){if(ut(Z,m)&&(Z=b.from(Z,Z.offset,Z.byteLength)),!b.isBuffer(Z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Z);if(J===void 0&&(J=0),ge===void 0&&(ge=Z?Z.length:0),Ee===void 0&&(Ee=0),Re===void 0&&(Re=this.length),J<0||ge>Z.length||Ee<0||Re>this.length)throw new RangeError("out of range index");if(Ee>=Re&&J>=ge)return 0;if(Ee>=Re)return-1;if(J>=ge)return 1;if(J>>>=0,ge>>>=0,Ee>>>=0,Re>>>=0,this===Z)return 0;let qe=Re-Ee,Xe=ge-J;const He=Math.min(qe,Xe),Ze=this.slice(Ee,Re),_t=Z.slice(J,ge);for(let tt=0;tt<He;++tt)if(Ze[tt]!==_t[tt]){qe=Ze[tt],Xe=_t[tt];break}return qe<Xe?-1:Xe<qe?1:0};function he(le,Z,J,ge,Ee){if(le.length===0)return-1;if(typeof J=="string"?(ge=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,gt(J)&&(J=Ee?0:le.length-1),J<0&&(J=le.length+J),J>=le.length){if(Ee)return-1;J=le.length-1}else if(J<0)if(Ee)J=0;else return-1;if(typeof Z=="string"&&(Z=b.from(Z,ge)),b.isBuffer(Z))return Z.length===0?-1:we(le,Z,J,ge,Ee);if(typeof Z=="number")return Z=Z&255,typeof m.prototype.indexOf=="function"?Ee?m.prototype.indexOf.call(le,Z,J):m.prototype.lastIndexOf.call(le,Z,J):we(le,[Z],J,ge,Ee);throw new TypeError("val must be string, number or Buffer")}function we(le,Z,J,ge,Ee){let Re=1,qe=le.length,Xe=Z.length;if(ge!==void 0&&(ge=String(ge).toLowerCase(),ge==="ucs2"||ge==="ucs-2"||ge==="utf16le"||ge==="utf-16le")){if(le.length<2||Z.length<2)return-1;Re=2,qe/=2,Xe/=2,J/=2}function He(_t,tt){return Re===1?_t[tt]:_t.readUInt16BE(tt*Re)}let Ze;if(Ee){let _t=-1;for(Ze=J;Ze<qe;Ze++)if(He(le,Ze)===He(Z,_t===-1?0:Ze-_t)){if(_t===-1&&(_t=Ze),Ze-_t+1===Xe)return _t*Re}else _t!==-1&&(Ze-=Ze-_t),_t=-1}else for(J+Xe>qe&&(J=qe-Xe),Ze=J;Ze>=0;Ze--){let _t=!0;for(let tt=0;tt<Xe;tt++)if(He(le,Ze+tt)!==He(Z,tt)){_t=!1;break}if(_t)return Ze}return-1}b.prototype.includes=function(Z,J,ge){return this.indexOf(Z,J,ge)!==-1},b.prototype.indexOf=function(Z,J,ge){return he(this,Z,J,ge,!0)},b.prototype.lastIndexOf=function(Z,J,ge){return he(this,Z,J,ge,!1)};function te(le,Z,J,ge){J=Number(J)||0;const Ee=le.length-J;ge?(ge=Number(ge),ge>Ee&&(ge=Ee)):ge=Ee;const Re=Z.length;ge>Re/2&&(ge=Re/2);let qe;for(qe=0;qe<ge;++qe){const Xe=parseInt(Z.substr(qe*2,2),16);if(gt(Xe))return qe;le[J+qe]=Xe}return qe}function q(le,Z,J,ge){return Ge(je(Z,le.length-J),le,J,ge)}function k(le,Z,J,ge){return Ge(Ye(Z),le,J,ge)}function y(le,Z,J,ge){return Ge(Je(Z),le,J,ge)}function B(le,Z,J,ge){return Ge(st(Z,le.length-J),le,J,ge)}b.prototype.write=function(Z,J,ge,Ee){if(J===void 0)Ee="utf8",ge=this.length,J=0;else if(ge===void 0&&typeof J=="string")Ee=J,ge=this.length,J=0;else if(isFinite(J))J=J>>>0,isFinite(ge)?(ge=ge>>>0,Ee===void 0&&(Ee="utf8")):(Ee=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-J;if((ge===void 0||ge>Re)&&(ge=Re),Z.length>0&&(ge<0||J<0)||J>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");let qe=!1;for(;;)switch(Ee){case"hex":return te(this,Z,J,ge);case"utf8":case"utf-8":return q(this,Z,J,ge);case"ascii":case"latin1":case"binary":return k(this,Z,J,ge);case"base64":return y(this,Z,J,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,Z,J,ge);default:if(qe)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),qe=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(le,Z,J){return Z===0&&J===le.length?f.fromByteArray(le):f.fromByteArray(le.slice(Z,J))}function I(le,Z,J){J=Math.min(le.length,J);const ge=[];let Ee=Z;for(;Ee<J;){const Re=le[Ee];let qe=null,Xe=Re>239?4:Re>223?3:Re>191?2:1;if(Ee+Xe<=J){let He,Ze,_t,tt;switch(Xe){case 1:Re<128&&(qe=Re);break;case 2:He=le[Ee+1],(He&192)===128&&(tt=(Re&31)<<6|He&63,tt>127&&(qe=tt));break;case 3:He=le[Ee+1],Ze=le[Ee+2],(He&192)===128&&(Ze&192)===128&&(tt=(Re&15)<<12|(He&63)<<6|Ze&63,tt>2047&&(tt<55296||tt>57343)&&(qe=tt));break;case 4:He=le[Ee+1],Ze=le[Ee+2],_t=le[Ee+3],(He&192)===128&&(Ze&192)===128&&(_t&192)===128&&(tt=(Re&15)<<18|(He&63)<<12|(Ze&63)<<6|_t&63,tt>65535&&tt<1114112&&(qe=tt))}}qe===null?(qe=65533,Xe=1):qe>65535&&(qe-=65536,ge.push(qe>>>10&1023|55296),qe=56320|qe&1023),ge.push(qe),Ee+=Xe}return j(ge)}const F=4096;function j(le){const Z=le.length;if(Z<=F)return String.fromCharCode.apply(String,le);let J="",ge=0;for(;ge<Z;)J+=String.fromCharCode.apply(String,le.slice(ge,ge+=F));return J}function D(le,Z,J){let ge="";J=Math.min(le.length,J);for(let Ee=Z;Ee<J;++Ee)ge+=String.fromCharCode(le[Ee]&127);return ge}function W(le,Z,J){let ge="";J=Math.min(le.length,J);for(let Ee=Z;Ee<J;++Ee)ge+=String.fromCharCode(le[Ee]);return ge}function R(le,Z,J){const ge=le.length;(!Z||Z<0)&&(Z=0),(!J||J<0||J>ge)&&(J=ge);let Ee="";for(let Re=Z;Re<J;++Re)Ee+=rt[le[Re]];return Ee}function z(le,Z,J){const ge=le.slice(Z,J);let Ee="";for(let Re=0;Re<ge.length-1;Re+=2)Ee+=String.fromCharCode(ge[Re]+ge[Re+1]*256);return Ee}b.prototype.slice=function(Z,J){const ge=this.length;Z=~~Z,J=J===void 0?ge:~~J,Z<0?(Z+=ge,Z<0&&(Z=0)):Z>ge&&(Z=ge),J<0?(J+=ge,J<0&&(J=0)):J>ge&&(J=ge),J<Z&&(J=Z);const Ee=this.subarray(Z,J);return Object.setPrototypeOf(Ee,b.prototype),Ee};function ye(le,Z,J){if(le%1!==0||le<0)throw new RangeError("offset is not uint");if(le+Z>J)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z],Re=1,qe=0;for(;++qe<J&&(Re*=256);)Ee+=this[Z+qe]*Re;return Ee},b.prototype.readUintBE=b.prototype.readUIntBE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z+--J],Re=1;for(;J>0&&(Re*=256);)Ee+=this[Z+--J]*Re;return Ee},b.prototype.readUint8=b.prototype.readUInt8=function(Z,J){return Z=Z>>>0,J||ye(Z,1,this.length),this[Z]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(Z,J){return Z=Z>>>0,J||ye(Z,2,this.length),this[Z]|this[Z+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(Z,J){return Z=Z>>>0,J||ye(Z,2,this.length),this[Z]<<8|this[Z+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),(this[Z]|this[Z+1]<<8|this[Z+2]<<16)+this[Z+3]*16777216},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]*16777216+(this[Z+1]<<16|this[Z+2]<<8|this[Z+3])},b.prototype.readBigUInt64LE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24,Re=this[++Z]+this[++Z]*2**8+this[++Z]*2**16+ge*2**24;return BigInt(Ee)+(BigInt(Re)<<BigInt(32))}),b.prototype.readBigUInt64BE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=J*2**24+this[++Z]*2**16+this[++Z]*2**8+this[++Z],Re=this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ge;return(BigInt(Ee)<<BigInt(32))+BigInt(Re)}),b.prototype.readIntLE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z],Re=1,qe=0;for(;++qe<J&&(Re*=256);)Ee+=this[Z+qe]*Re;return Re*=128,Ee>=Re&&(Ee-=Math.pow(2,8*J)),Ee},b.prototype.readIntBE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=J,Re=1,qe=this[Z+--Ee];for(;Ee>0&&(Re*=256);)qe+=this[Z+--Ee]*Re;return Re*=128,qe>=Re&&(qe-=Math.pow(2,8*J)),qe},b.prototype.readInt8=function(Z,J){return Z=Z>>>0,J||ye(Z,1,this.length),this[Z]&128?(255-this[Z]+1)*-1:this[Z]},b.prototype.readInt16LE=function(Z,J){Z=Z>>>0,J||ye(Z,2,this.length);const ge=this[Z]|this[Z+1]<<8;return ge&32768?ge|4294901760:ge},b.prototype.readInt16BE=function(Z,J){Z=Z>>>0,J||ye(Z,2,this.length);const ge=this[Z+1]|this[Z]<<8;return ge&32768?ge|4294901760:ge},b.prototype.readInt32LE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]|this[Z+1]<<8|this[Z+2]<<16|this[Z+3]<<24},b.prototype.readInt32BE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]<<24|this[Z+1]<<16|this[Z+2]<<8|this[Z+3]},b.prototype.readBigInt64LE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=this[Z+4]+this[Z+5]*2**8+this[Z+6]*2**16+(ge<<24);return(BigInt(Ee)<<BigInt(32))+BigInt(J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24)}),b.prototype.readBigInt64BE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=(J<<24)+this[++Z]*2**16+this[++Z]*2**8+this[++Z];return(BigInt(Ee)<<BigInt(32))+BigInt(this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ge)}),b.prototype.readFloatLE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),d.read(this,Z,!0,23,4)},b.prototype.readFloatBE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),d.read(this,Z,!1,23,4)},b.prototype.readDoubleLE=function(Z,J){return Z=Z>>>0,J||ye(Z,8,this.length),d.read(this,Z,!0,52,8)},b.prototype.readDoubleBE=function(Z,J){return Z=Z>>>0,J||ye(Z,8,this.length),d.read(this,Z,!1,52,8)};function Ce(le,Z,J,ge,Ee,Re){if(!b.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Z>Ee||Z<Re)throw new RangeError('"value" argument is out of bounds');if(J+ge>le.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,ge=ge>>>0,!Ee){const Xe=Math.pow(2,8*ge)-1;Ce(this,Z,J,ge,Xe,0)}let Re=1,qe=0;for(this[J]=Z&255;++qe<ge&&(Re*=256);)this[J+qe]=Z/Re&255;return J+ge},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,ge=ge>>>0,!Ee){const Xe=Math.pow(2,8*ge)-1;Ce(this,Z,J,ge,Xe,0)}let Re=ge-1,qe=1;for(this[J+Re]=Z&255;--Re>=0&&(qe*=256);)this[J+Re]=Z/qe&255;return J+ge},b.prototype.writeUint8=b.prototype.writeUInt8=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,1,255,0),this[J]=Z&255,J+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,65535,0),this[J]=Z&255,this[J+1]=Z>>>8,J+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,65535,0),this[J]=Z>>>8,this[J+1]=Z&255,J+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,4294967295,0),this[J+3]=Z>>>24,this[J+2]=Z>>>16,this[J+1]=Z>>>8,this[J]=Z&255,J+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,4294967295,0),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4};function me(le,Z,J,ge,Ee){Ie(Z,ge,Ee,le,J,7);let Re=Number(Z&BigInt(4294967295));le[J++]=Re,Re=Re>>8,le[J++]=Re,Re=Re>>8,le[J++]=Re,Re=Re>>8,le[J++]=Re;let qe=Number(Z>>BigInt(32)&BigInt(4294967295));return le[J++]=qe,qe=qe>>8,le[J++]=qe,qe=qe>>8,le[J++]=qe,qe=qe>>8,le[J++]=qe,J}function ie(le,Z,J,ge,Ee){Ie(Z,ge,Ee,le,J,7);let Re=Number(Z&BigInt(4294967295));le[J+7]=Re,Re=Re>>8,le[J+6]=Re,Re=Re>>8,le[J+5]=Re,Re=Re>>8,le[J+4]=Re;let qe=Number(Z>>BigInt(32)&BigInt(4294967295));return le[J+3]=qe,qe=qe>>8,le[J+2]=qe,qe=qe>>8,le[J+1]=qe,qe=qe>>8,le[J]=qe,J+8}b.prototype.writeBigUInt64LE=wt(function(Z,J=0){return me(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=wt(function(Z,J=0){return ie(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,!Ee){const He=Math.pow(2,8*ge-1);Ce(this,Z,J,ge,He-1,-He)}let Re=0,qe=1,Xe=0;for(this[J]=Z&255;++Re<ge&&(qe*=256);)Z<0&&Xe===0&&this[J+Re-1]!==0&&(Xe=1),this[J+Re]=(Z/qe>>0)-Xe&255;return J+ge},b.prototype.writeIntBE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,!Ee){const He=Math.pow(2,8*ge-1);Ce(this,Z,J,ge,He-1,-He)}let Re=ge-1,qe=1,Xe=0;for(this[J+Re]=Z&255;--Re>=0&&(qe*=256);)Z<0&&Xe===0&&this[J+Re+1]!==0&&(Xe=1),this[J+Re]=(Z/qe>>0)-Xe&255;return J+ge},b.prototype.writeInt8=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,1,127,-128),Z<0&&(Z=255+Z+1),this[J]=Z&255,J+1},b.prototype.writeInt16LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,32767,-32768),this[J]=Z&255,this[J+1]=Z>>>8,J+2},b.prototype.writeInt16BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,32767,-32768),this[J]=Z>>>8,this[J+1]=Z&255,J+2},b.prototype.writeInt32LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,2147483647,-2147483648),this[J]=Z&255,this[J+1]=Z>>>8,this[J+2]=Z>>>16,this[J+3]=Z>>>24,J+4},b.prototype.writeInt32BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,2147483647,-2147483648),Z<0&&(Z=4294967295+Z+1),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4},b.prototype.writeBigInt64LE=wt(function(Z,J=0){return me(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=wt(function(Z,J=0){return ie(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(le,Z,J,ge,Ee,Re){if(J+ge>le.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function pe(le,Z,J,ge,Ee){return Z=+Z,J=J>>>0,Ee||ee(le,Z,J,4),d.write(le,Z,J,ge,23,4),J+4}b.prototype.writeFloatLE=function(Z,J,ge){return pe(this,Z,J,!0,ge)},b.prototype.writeFloatBE=function(Z,J,ge){return pe(this,Z,J,!1,ge)};function be(le,Z,J,ge,Ee){return Z=+Z,J=J>>>0,Ee||ee(le,Z,J,8),d.write(le,Z,J,ge,52,8),J+8}b.prototype.writeDoubleLE=function(Z,J,ge){return be(this,Z,J,!0,ge)},b.prototype.writeDoubleBE=function(Z,J,ge){return be(this,Z,J,!1,ge)},b.prototype.copy=function(Z,J,ge,Ee){if(!b.isBuffer(Z))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),!Ee&&Ee!==0&&(Ee=this.length),J>=Z.length&&(J=Z.length),J||(J=0),Ee>0&&Ee<ge&&(Ee=ge),Ee===ge||Z.length===0||this.length===0)return 0;if(J<0)throw new RangeError("targetStart out of bounds");if(ge<0||ge>=this.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),Z.length-J<Ee-ge&&(Ee=Z.length-J+ge);const Re=Ee-ge;return this===Z&&typeof m.prototype.copyWithin=="function"?this.copyWithin(J,ge,Ee):m.prototype.set.call(Z,this.subarray(ge,Ee),J),Re},b.prototype.fill=function(Z,J,ge,Ee){if(typeof Z=="string"){if(typeof J=="string"?(Ee=J,J=0,ge=this.length):typeof ge=="string"&&(Ee=ge,ge=this.length),Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!b.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee);if(Z.length===1){const qe=Z.charCodeAt(0);(Ee==="utf8"&&qe<128||Ee==="latin1")&&(Z=qe)}}else typeof Z=="number"?Z=Z&255:typeof Z=="boolean"&&(Z=Number(Z));if(J<0||this.length<J||this.length<ge)throw new RangeError("Out of range index");if(ge<=J)return this;J=J>>>0,ge=ge===void 0?this.length:ge>>>0,Z||(Z=0);let Re;if(typeof Z=="number")for(Re=J;Re<ge;++Re)this[Re]=Z;else{const qe=b.isBuffer(Z)?Z:b.from(Z,Ee),Xe=qe.length;if(Xe===0)throw new TypeError('The value "'+Z+'" is invalid for argument "value"');for(Re=0;Re<ge-J;++Re)this[Re+J]=qe[Re%Xe]}return this};const ae={};function ne(le,Z,J){ae[le]=class extends J{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${le}]`,this.stack,delete this.name}get code(){return le}set code(Ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ee,writable:!0})}toString(){return`${this.name} [${le}]: ${this.message}`}}}ne("ERR_BUFFER_OUT_OF_BOUNDS",function(le){return le?`${le} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ne("ERR_INVALID_ARG_TYPE",function(le,Z){return`The "${le}" argument must be of type number. Received type ${typeof Z}`},TypeError),ne("ERR_OUT_OF_RANGE",function(le,Z,J){let ge=`The value of "${le}" is out of range.`,Ee=J;return Number.isInteger(J)&&Math.abs(J)>2**32?Ee=Se(String(J)):typeof J=="bigint"&&(Ee=String(J),(J>BigInt(2)**BigInt(32)||J<-(BigInt(2)**BigInt(32)))&&(Ee=Se(Ee)),Ee+="n"),ge+=` It must be ${Z}. Received ${Ee}`,ge},RangeError);function Se(le){let Z="",J=le.length;const ge=le[0]==="-"?1:0;for(;J>=ge+4;J-=3)Z=`_${le.slice(J-3,J)}${Z}`;return`${le.slice(0,J)}${Z}`}function ke(le,Z,J){Oe(Z,"offset"),(le[Z]===void 0||le[Z+J]===void 0)&&Ue(Z,le.length-(J+1))}function Ie(le,Z,J,ge,Ee,Re){if(le>J||le<Z){const qe=typeof Z=="bigint"?"n":"";let Xe;throw Z===0||Z===BigInt(0)?Xe=`>= 0${qe} and < 2${qe} ** ${(Re+1)*8}${qe}`:Xe=`>= -(2${qe} ** ${(Re+1)*8-1}${qe}) and < 2 ** ${(Re+1)*8-1}${qe}`,new ae.ERR_OUT_OF_RANGE("value",Xe,le)}ke(ge,Ee,Re)}function Oe(le,Z){if(typeof le!="number")throw new ae.ERR_INVALID_ARG_TYPE(Z,"number",le)}function Ue(le,Z,J){throw Math.floor(le)!==le?(Oe(le,J),new ae.ERR_OUT_OF_RANGE("offset","an integer",le)):Z<0?new ae.ERR_BUFFER_OUT_OF_BOUNDS:new ae.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Z}`,le)}const De=/[^+/0-9A-Za-z-_]/g;function $e(le){if(le=le.split("=")[0],le=le.trim().replace(De,""),le.length<2)return"";for(;le.length%4!==0;)le=le+"=";return le}function je(le,Z){Z=Z||1/0;let J;const ge=le.length;let Ee=null;const Re=[];for(let qe=0;qe<ge;++qe){if(J=le.charCodeAt(qe),J>55295&&J<57344){if(!Ee){if(J>56319){(Z-=3)>-1&&Re.push(239,191,189);continue}else if(qe+1===ge){(Z-=3)>-1&&Re.push(239,191,189);continue}Ee=J;continue}if(J<56320){(Z-=3)>-1&&Re.push(239,191,189),Ee=J;continue}J=(Ee-55296<<10|J-56320)+65536}else Ee&&(Z-=3)>-1&&Re.push(239,191,189);if(Ee=null,J<128){if((Z-=1)<0)break;Re.push(J)}else if(J<2048){if((Z-=2)<0)break;Re.push(J>>6|192,J&63|128)}else if(J<65536){if((Z-=3)<0)break;Re.push(J>>12|224,J>>6&63|128,J&63|128)}else if(J<1114112){if((Z-=4)<0)break;Re.push(J>>18|240,J>>12&63|128,J>>6&63|128,J&63|128)}else throw new Error("Invalid code point")}return Re}function Ye(le){const Z=[];for(let J=0;J<le.length;++J)Z.push(le.charCodeAt(J)&255);return Z}function st(le,Z){let J,ge,Ee;const Re=[];for(let qe=0;qe<le.length&&!((Z-=2)<0);++qe)J=le.charCodeAt(qe),ge=J>>8,Ee=J%256,Re.push(Ee),Re.push(ge);return Re}function Je(le){return f.toByteArray($e(le))}function Ge(le,Z,J,ge){let Ee;for(Ee=0;Ee<ge&&!(Ee+J>=Z.length||Ee>=le.length);++Ee)Z[Ee+J]=le[Ee];return Ee}function ut(le,Z){return le instanceof Z||le!=null&&le.constructor!=null&&le.constructor.name!=null&&le.constructor.name===Z.name}function gt(le){return le!==le}const rt=(function(){const le="0123456789abcdef",Z=new Array(256);for(let J=0;J<16;++J){const ge=J*16;for(let Ee=0;Ee<16;++Ee)Z[ge+Ee]=le[J]+le[Ee]}return Z})();function wt(le){return typeof BigInt>"u"?bt:le}function bt(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer=buffer$1.Buffer,Buffer$1=buffer$1.Buffer;function getDefaultExportFromCjs$1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(r){if(cachedSetTimeout===setTimeout)return setTimeout(r,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(r,0);try{return cachedSetTimeout(r,0)}catch{try{return cachedSetTimeout.call(null,r,0)}catch{return cachedSetTimeout.call(this,r,0)}}}function runClearTimeout(r){if(cachedClearTimeout===clearTimeout)return clearTimeout(r);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(r);try{return cachedClearTimeout(r)}catch{try{return cachedClearTimeout.call(null,r)}catch{return cachedClearTimeout.call(this,r)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var r=runTimeout(cleanUpNextTick);draining=!0;for(var f=queue.length;f;){for(currentQueue=queue,queue=[];++queueIndex<f;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,f=queue.length}currentQueue=null,draining=!1,runClearTimeout(r)}}process.nextTick=function(r){var f=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)f[d-1]=arguments[d];queue.push(new Item(r,f)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(r,f){this.fun=r,this.array=f}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$1(){}process.on=noop$1,process.addListener=noop$1,process.once=noop$1,process.off=noop$1,process.removeListener=noop$1,process.removeAllListeners=noop$1,process.emit=noop$1,process.prependListener=noop$1,process.prependOnceListener=noop$1,process.listeners=function(r){return[]},process.binding=function(r){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(r){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs$1(browserExports),global$1=globalThis||void 0||self;function bind(r,f){return function(){return r.apply(f,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(r=>f=>{const d=toString.call(f);return r[d]||(r[d]=d.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=r=>(r=r.toLowerCase(),f=>kindOf(f)===r),typeOfTest=r=>f=>typeof f===r,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(r){return r!==null&&!isUndefined(r)&&r.constructor!==null&&!isUndefined(r.constructor)&&isFunction(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(r){let f;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?f=ArrayBuffer.isView(r):f=r&&r.buffer&&isArrayBuffer(r.buffer),f}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$1=r=>r!==null&&typeof r=="object",isBoolean=r=>r===!0||r===!1,isPlainObject$1=r=>{if(kindOf(r)!=="object")return!1;const f=getPrototypeOf(r);return(f===null||f===Object.prototype||Object.getPrototypeOf(f)===null)&&!(toStringTag in r)&&!(iterator in r)},isEmptyObject=r=>{if(!isObject$1(r)||isBuffer(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=r=>isObject$1(r)&&isFunction(r.pipe),isFormData=r=>{let f;return r&&(typeof FormData=="function"&&r instanceof FormData||isFunction(r.append)&&((f=kindOf(r))==="formdata"||f==="object"&&isFunction(r.toString)&&r.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$1(r,f,{allOwnKeys:d=!1}={}){if(r===null||typeof r>"u")return;let g,v;if(typeof r!="object"&&(r=[r]),isArray(r))for(g=0,v=r.length;g<v;g++)f.call(null,r[g],g,r);else{if(isBuffer(r))return;const m=d?Object.getOwnPropertyNames(r):Object.keys(r),w=m.length;let _;for(g=0;g<w;g++)_=m[g],f.call(null,r[_],_,r)}}function findKey(r,f){if(isBuffer(r))return null;f=f.toLowerCase();const d=Object.keys(r);let g=d.length,v;for(;g-- >0;)if(v=d[g],f===v.toLowerCase())return v;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=r=>!isUndefined(r)&&r!==_global;function merge(){const{caseless:r}=isContextDefined(this)&&this||{},f={},d=(g,v)=>{const m=r&&findKey(f,v)||v;isPlainObject$1(f[m])&&isPlainObject$1(g)?f[m]=merge(f[m],g):isPlainObject$1(g)?f[m]=merge({},g):isArray(g)?f[m]=g.slice():f[m]=g};for(let g=0,v=arguments.length;g<v;g++)arguments[g]&&forEach$1(arguments[g],d);return f}const extend=(r,f,d,{allOwnKeys:g}={})=>(forEach$1(f,(v,m)=>{d&&isFunction(v)?r[m]=bind(v,d):r[m]=v},{allOwnKeys:g}),r),stripBOM=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),inherits=(r,f,d,g)=>{r.prototype=Object.create(f.prototype,g),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:f.prototype}),d&&Object.assign(r.prototype,d)},toFlatObject=(r,f,d,g)=>{let v,m,w;const _={};if(f=f||{},r==null)return f;do{for(v=Object.getOwnPropertyNames(r),m=v.length;m-- >0;)w=v[m],(!g||g(w,r,f))&&!_[w]&&(f[w]=r[w],_[w]=!0);r=d!==!1&&getPrototypeOf(r)}while(r&&(!d||d(r,f))&&r!==Object.prototype);return f},endsWith=(r,f,d)=>{r=String(r),(d===void 0||d>r.length)&&(d=r.length),d-=f.length;const g=r.indexOf(f,d);return g!==-1&&g===d},toArray=r=>{if(!r)return null;if(isArray(r))return r;let f=r.length;if(!isNumber(f))return null;const d=new Array(f);for(;f-- >0;)d[f]=r[f];return d},isTypedArray$1=(r=>f=>r&&f instanceof r)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(r,f)=>{const g=(r&&r[iterator]).call(r);let v;for(;(v=g.next())&&!v.done;){const m=v.value;f.call(r,m[0],m[1])}},matchAll=(r,f)=>{let d;const g=[];for(;(d=r.exec(f))!==null;)g.push(d);return g},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(d,g,v){return g.toUpperCase()+v}),hasOwnProperty=(({hasOwnProperty:r})=>(f,d)=>r.call(f,d))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(r,f)=>{const d=Object.getOwnPropertyDescriptors(r),g={};forEach$1(d,(v,m)=>{let w;(w=f(v,m,r))!==!1&&(g[m]=w||v)}),Object.defineProperties(r,g)},freezeMethods=r=>{reduceDescriptors(r,(f,d)=>{if(isFunction(r)&&["arguments","caller","callee"].indexOf(d)!==-1)return!1;const g=r[d];if(isFunction(g)){if(f.enumerable=!1,"writable"in f){f.writable=!1;return}f.set||(f.set=()=>{throw Error("Can not rewrite read-only method '"+d+"'")})}})},toObjectSet=(r,f)=>{const d={},g=v=>{v.forEach(m=>{d[m]=!0})};return isArray(r)?g(r):g(String(r).split(f)),d},noop=()=>{},toFiniteNumber=(r,f)=>r!=null&&Number.isFinite(r=+r)?r:f;function isSpecCompliantForm(r){return!!(r&&isFunction(r.append)&&r[toStringTag]==="FormData"&&r[iterator])}const toJSONObject=r=>{const f=new Array(10),d=(g,v)=>{if(isObject$1(g)){if(f.indexOf(g)>=0)return;if(isBuffer(g))return g;if(!("toJSON"in g)){f[v]=g;const m=isArray(g)?[]:{};return forEach$1(g,(w,_)=>{const S=d(w,v+1);!isUndefined(S)&&(m[_]=S)}),f[v]=void 0,m}}return g};return d(r,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=r=>r&&(isObject$1(r)||isFunction(r))&&isFunction(r.then)&&isFunction(r.catch),_setImmediate=((r,f)=>r?setImmediate:f?((d,g)=>(_global.addEventListener("message",({source:v,data:m})=>{v===_global&&m===d&&g.length&&g.shift()()},!1),v=>{g.push(v),_global.postMessage(d,"*")}))(`axios@${Math.random()}`,[]):d=>setTimeout(d))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process$1<"u"&&process$1.nextTick||_setImmediate,isIterable=r=>r!=null&&isFunction(r[iterator]),utils$5={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject:isObject$1,isPlainObject:isPlainObject$1,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray:isTypedArray$1,isFileList,forEach:forEach$1,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(r,f,d,g,v){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",f&&(this.code=f),d&&(this.config=d),g&&(this.request=g),v&&(this.response=v,this.status=v.status?v.status:null)}utils$5.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$5.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{descriptors[r]={value:r}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(r,f,d,g,v,m)=>{const w=Object.create(prototype$1);return utils$5.toFlatObject(r,w,function(S){return S!==Error.prototype},_=>_!=="isAxiosError"),AxiosError$1.call(w,r.message,f,d,g,v),w.cause=r,w.name=r.name,m&&Object.assign(w,m),w};const httpAdapter=null;function isVisitable(r){return utils$5.isPlainObject(r)||utils$5.isArray(r)}function removeBrackets(r){return utils$5.endsWith(r,"[]")?r.slice(0,-2):r}function renderKey(r,f,d){return r?r.concat(f).map(function(v,m){return v=removeBrackets(v),!d&&m?"["+v+"]":v}).join(d?".":""):f}function isFlatArray(r){return utils$5.isArray(r)&&!r.some(isVisitable)}const predicates=utils$5.toFlatObject(utils$5,{},null,function(f){return/^is[A-Z]/.test(f)});function toFormData$1(r,f,d){if(!utils$5.isObject(r))throw new TypeError("target must be an object");f=f||new FormData,d=utils$5.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,L){return!utils$5.isUndefined(L[T])});const g=d.metaTokens,v=d.visitor||b,m=d.dots,w=d.indexes,S=(d.Blob||typeof Blob<"u"&&Blob)&&utils$5.isSpecCompliantForm(f);if(!utils$5.isFunction(v))throw new TypeError("visitor must be a function");function x(A){if(A===null)return"";if(utils$5.isDate(A))return A.toISOString();if(utils$5.isBoolean(A))return A.toString();if(!S&&utils$5.isBlob(A))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$5.isArrayBuffer(A)||utils$5.isTypedArray(A)?S&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function b(A,T,L){let O=A;if(A&&!L&&typeof A=="object"){if(utils$5.endsWith(T,"{}"))T=g?T:T.slice(0,-2),A=JSON.stringify(A);else if(utils$5.isArray(A)&&isFlatArray(A)||(utils$5.isFileList(A)||utils$5.endsWith(T,"[]"))&&(O=utils$5.toArray(A)))return T=removeBrackets(T),O.forEach(function(H,V){!(utils$5.isUndefined(H)||H===null)&&f.append(w===!0?renderKey([T],V,m):w===null?T:T+"[]",x(H))}),!1}return isVisitable(A)?!0:(f.append(renderKey(L,T,m),x(A)),!1)}const C=[],E=Object.assign(predicates,{defaultVisitor:b,convertValue:x,isVisitable});function M(A,T){if(!utils$5.isUndefined(A)){if(C.indexOf(A)!==-1)throw Error("Circular reference detected in "+T.join("."));C.push(A),utils$5.forEach(A,function(O,N){(!(utils$5.isUndefined(O)||O===null)&&v.call(f,O,utils$5.isString(N)?N.trim():N,T,E))===!0&&M(O,T?T.concat(N):[N])}),C.pop()}}if(!utils$5.isObject(r))throw new TypeError("data must be an object");return M(r),f}function encode$2(r){const f={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(g){return f[g]})}function AxiosURLSearchParams(r,f){this._pairs=[],r&&toFormData$1(r,this,f)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(f,d){this._pairs.push([f,d])},prototype.toString=function(f){const d=f?function(g){return f.call(this,g,encode$2)}:encode$2;return this._pairs.map(function(v){return d(v[0])+"="+d(v[1])},"").join("&")};function encode$1(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(r,f,d){if(!f)return r;const g=d&&d.encode||encode$1;utils$5.isFunction(d)&&(d={serialize:d});const v=d&&d.serialize;let m;if(v?m=v(f,d):m=utils$5.isURLSearchParams(f)?f.toString():new AxiosURLSearchParams(f,d).toString(g),m){const w=r.indexOf("#");w!==-1&&(r=r.slice(0,w)),r+=(r.indexOf("?")===-1?"?":"&")+m}return r}class InterceptorManager{constructor(){this.handlers=[]}use(f,d,g){return this.handlers.push({fulfilled:f,rejected:d,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(f){this.handlers[f]&&(this.handlers[f]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(f){utils$5.forEach(this.handlers,function(g){g!==null&&f(g)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$2={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform$1={...utils$4,...platform$2};function toURLEncodedForm(r,f){return toFormData$1(r,new platform$1.classes.URLSearchParams,{visitor:function(d,g,v,m){return platform$1.isNode&&utils$5.isBuffer(d)?(this.append(g,d.toString("base64")),!1):m.defaultVisitor.apply(this,arguments)},...f})}function parsePropPath(r){return utils$5.matchAll(/\w+|\[(\w*)]/g,r).map(f=>f[0]==="[]"?"":f[1]||f[0])}function arrayToObject(r){const f={},d=Object.keys(r);let g;const v=d.length;let m;for(g=0;g<v;g++)m=d[g],f[m]=r[m];return f}function formDataToJSON(r){function f(d,g,v,m){let w=d[m++];if(w==="__proto__")return!0;const _=Number.isFinite(+w),S=m>=d.length;return w=!w&&utils$5.isArray(v)?v.length:w,S?(utils$5.hasOwnProp(v,w)?v[w]=[v[w],g]:v[w]=g,!_):((!v[w]||!utils$5.isObject(v[w]))&&(v[w]=[]),f(d,g,v[w],m)&&utils$5.isArray(v[w])&&(v[w]=arrayToObject(v[w])),!_)}if(utils$5.isFormData(r)&&utils$5.isFunction(r.entries)){const d={};return utils$5.forEachEntry(r,(g,v)=>{f(parsePropPath(g),v,d,0)}),d}return null}function stringifySafely(r,f,d){if(utils$5.isString(r))try{return(f||JSON.parse)(r),utils$5.trim(r)}catch(g){if(g.name!=="SyntaxError")throw g}return(d||JSON.stringify)(r)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(f,d){const g=d.getContentType()||"",v=g.indexOf("application/json")>-1,m=utils$5.isObject(f);if(m&&utils$5.isHTMLForm(f)&&(f=new FormData(f)),utils$5.isFormData(f))return v?JSON.stringify(formDataToJSON(f)):f;if(utils$5.isArrayBuffer(f)||utils$5.isBuffer(f)||utils$5.isStream(f)||utils$5.isFile(f)||utils$5.isBlob(f)||utils$5.isReadableStream(f))return f;if(utils$5.isArrayBufferView(f))return f.buffer;if(utils$5.isURLSearchParams(f))return d.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),f.toString();let _;if(m){if(g.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(f,this.formSerializer).toString();if((_=utils$5.isFileList(f))||g.indexOf("multipart/form-data")>-1){const S=this.env&&this.env.FormData;return toFormData$1(_?{"files[]":f}:f,S&&new S,this.formSerializer)}}return m||v?(d.setContentType("application/json",!1),stringifySafely(f)):f}],transformResponse:[function(f){const d=this.transitional||defaults.transitional,g=d&&d.forcedJSONParsing,v=this.responseType==="json";if(utils$5.isResponse(f)||utils$5.isReadableStream(f))return f;if(f&&utils$5.isString(f)&&(g&&!this.responseType||v)){const w=!(d&&d.silentJSONParsing)&&v;try{return JSON.parse(f)}catch(_){if(w)throw _.name==="SyntaxError"?AxiosError$1.from(_,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):_}}return f}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$1.classes.FormData,Blob:platform$1.classes.Blob},validateStatus:function(f){return f>=200&&f<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$5.forEach(["delete","get","head","post","put","patch"],r=>{defaults.headers[r]={}});const ignoreDuplicateOf=utils$5.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=r=>{const f={};let d,g,v;return r&&r.split(`
7
+ `).forEach(function(w){v=w.indexOf(":"),d=w.substring(0,v).trim().toLowerCase(),g=w.substring(v+1).trim(),!(!d||f[d]&&ignoreDuplicateOf[d])&&(d==="set-cookie"?f[d]?f[d].push(g):f[d]=[g]:f[d]=f[d]?f[d]+", "+g:g)}),f},$internals=Symbol("internals");function normalizeHeader(r){return r&&String(r).trim().toLowerCase()}function normalizeValue(r){return r===!1||r==null?r:utils$5.isArray(r)?r.map(normalizeValue):String(r)}function parseTokens(r){const f=Object.create(null),d=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let g;for(;g=d.exec(r);)f[g[1]]=g[2];return f}const isValidHeaderName=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function matchHeaderValue(r,f,d,g,v){if(utils$5.isFunction(g))return g.call(this,f,d);if(v&&(f=d),!!utils$5.isString(f)){if(utils$5.isString(g))return f.indexOf(g)!==-1;if(utils$5.isRegExp(g))return g.test(f)}}function formatHeader(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(f,d,g)=>d.toUpperCase()+g)}function buildAccessors(r,f){const d=utils$5.toCamelCase(" "+f);["get","set","has"].forEach(g=>{Object.defineProperty(r,g+d,{value:function(v,m,w){return this[g].call(this,f,v,m,w)},configurable:!0})})}let AxiosHeaders$1=class{constructor(f){f&&this.set(f)}set(f,d,g){const v=this;function m(_,S,x){const b=normalizeHeader(S);if(!b)throw new Error("header name must be a non-empty string");const C=utils$5.findKey(v,b);(!C||v[C]===void 0||x===!0||x===void 0&&v[C]!==!1)&&(v[C||S]=normalizeValue(_))}const w=(_,S)=>utils$5.forEach(_,(x,b)=>m(x,b,S));if(utils$5.isPlainObject(f)||f instanceof this.constructor)w(f,d);else if(utils$5.isString(f)&&(f=f.trim())&&!isValidHeaderName(f))w(parseHeaders(f),d);else if(utils$5.isObject(f)&&utils$5.isIterable(f)){let _={},S,x;for(const b of f){if(!utils$5.isArray(b))throw TypeError("Object iterator must return a key-value pair");_[x=b[0]]=(S=_[x])?utils$5.isArray(S)?[...S,b[1]]:[S,b[1]]:b[1]}w(_,d)}else f!=null&&m(d,f,g);return this}get(f,d){if(f=normalizeHeader(f),f){const g=utils$5.findKey(this,f);if(g){const v=this[g];if(!d)return v;if(d===!0)return parseTokens(v);if(utils$5.isFunction(d))return d.call(this,v,g);if(utils$5.isRegExp(d))return d.exec(v);throw new TypeError("parser must be boolean|regexp|function")}}}has(f,d){if(f=normalizeHeader(f),f){const g=utils$5.findKey(this,f);return!!(g&&this[g]!==void 0&&(!d||matchHeaderValue(this,this[g],g,d)))}return!1}delete(f,d){const g=this;let v=!1;function m(w){if(w=normalizeHeader(w),w){const _=utils$5.findKey(g,w);_&&(!d||matchHeaderValue(g,g[_],_,d))&&(delete g[_],v=!0)}}return utils$5.isArray(f)?f.forEach(m):m(f),v}clear(f){const d=Object.keys(this);let g=d.length,v=!1;for(;g--;){const m=d[g];(!f||matchHeaderValue(this,this[m],m,f,!0))&&(delete this[m],v=!0)}return v}normalize(f){const d=this,g={};return utils$5.forEach(this,(v,m)=>{const w=utils$5.findKey(g,m);if(w){d[w]=normalizeValue(v),delete d[m];return}const _=f?formatHeader(m):String(m).trim();_!==m&&delete d[m],d[_]=normalizeValue(v),g[_]=!0}),this}concat(...f){return this.constructor.concat(this,...f)}toJSON(f){const d=Object.create(null);return utils$5.forEach(this,(g,v)=>{g!=null&&g!==!1&&(d[v]=f&&utils$5.isArray(g)?g.join(", "):g)}),d}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([f,d])=>f+": "+d).join(`
8
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(f){return f instanceof this?f:new this(f)}static concat(f,...d){const g=new this(f);return d.forEach(v=>g.set(v)),g}static accessor(f){const g=(this[$internals]=this[$internals]={accessors:{}}).accessors,v=this.prototype;function m(w){const _=normalizeHeader(w);g[_]||(buildAccessors(v,w),g[_]=!0)}return utils$5.isArray(f)?f.forEach(m):m(f),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$5.reduceDescriptors(AxiosHeaders$1.prototype,({value:r},f)=>{let d=f[0].toUpperCase()+f.slice(1);return{get:()=>r,set(g){this[d]=g}}}),utils$5.freezeMethods(AxiosHeaders$1);function transformData(r,f){const d=this||defaults,g=f||d,v=AxiosHeaders$1.from(g.headers);let m=g.data;return utils$5.forEach(r,function(_){m=_.call(d,m,v.normalize(),f?f.status:void 0)}),v.normalize(),m}function isCancel$1(r){return!!(r&&r.__CANCEL__)}function CanceledError$1(r,f,d){AxiosError$1.call(this,r??"canceled",AxiosError$1.ERR_CANCELED,f,d),this.name="CanceledError"}utils$5.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(r,f,d){const g=d.config.validateStatus;!d.status||!g||g(d.status)?r(d):f(new AxiosError$1("Request failed with status code "+d.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(d.status/100)-4],d.config,d.request,d))}function parseProtocol(r){const f=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return f&&f[1]||""}function speedometer(r,f){r=r||10;const d=new Array(r),g=new Array(r);let v=0,m=0,w;return f=f!==void 0?f:1e3,function(S){const x=Date.now(),b=g[m];w||(w=x),d[v]=S,g[v]=x;let C=m,E=0;for(;C!==v;)E+=d[C++],C=C%r;if(v=(v+1)%r,v===m&&(m=(m+1)%r),x-w<f)return;const M=b&&x-b;return M?Math.round(E*1e3/M):void 0}}function throttle(r,f){let d=0,g=1e3/f,v,m;const w=(x,b=Date.now())=>{d=b,v=null,m&&(clearTimeout(m),m=null),r(...x)};return[(...x)=>{const b=Date.now(),C=b-d;C>=g?w(x,b):(v=x,m||(m=setTimeout(()=>{m=null,w(v)},g-C)))},()=>v&&w(v)]}const progressEventReducer=(r,f,d=3)=>{let g=0;const v=speedometer(50,250);return throttle(m=>{const w=m.loaded,_=m.lengthComputable?m.total:void 0,S=w-g,x=v(S),b=w<=_;g=w;const C={loaded:w,total:_,progress:_?w/_:void 0,bytes:S,rate:x||void 0,estimated:x&&_&&b?(_-w)/x:void 0,event:m,lengthComputable:_!=null,[f?"download":"upload"]:!0};r(C)},d)},progressEventDecorator=(r,f)=>{const d=r!=null;return[g=>f[0]({lengthComputable:d,total:r,loaded:g}),f[1]]},asyncDecorator=r=>(...f)=>utils$5.asap(()=>r(...f)),isURLSameOrigin=platform$1.hasStandardBrowserEnv?((r,f)=>d=>(d=new URL(d,platform$1.origin),r.protocol===d.protocol&&r.host===d.host&&(f||r.port===d.port)))(new URL(platform$1.origin),platform$1.navigator&&/(msie|trident)/i.test(platform$1.navigator.userAgent)):()=>!0,cookies=platform$1.hasStandardBrowserEnv?{write(r,f,d,g,v,m){const w=[r+"="+encodeURIComponent(f)];utils$5.isNumber(d)&&w.push("expires="+new Date(d).toGMTString()),utils$5.isString(g)&&w.push("path="+g),utils$5.isString(v)&&w.push("domain="+v),m===!0&&w.push("secure"),document.cookie=w.join("; ")},read(r){const f=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function combineURLs(r,f){return f?r.replace(/\/?\/$/,"")+"/"+f.replace(/^\/+/,""):r}function buildFullPath(r,f,d){let g=!isAbsoluteURL(f);return r&&(g||d==!1)?combineURLs(r,f):f}const headersToObject=r=>r instanceof AxiosHeaders$1?{...r}:r;function mergeConfig$1(r,f){f=f||{};const d={};function g(x,b,C,E){return utils$5.isPlainObject(x)&&utils$5.isPlainObject(b)?utils$5.merge.call({caseless:E},x,b):utils$5.isPlainObject(b)?utils$5.merge({},b):utils$5.isArray(b)?b.slice():b}function v(x,b,C,E){if(utils$5.isUndefined(b)){if(!utils$5.isUndefined(x))return g(void 0,x,C,E)}else return g(x,b,C,E)}function m(x,b){if(!utils$5.isUndefined(b))return g(void 0,b)}function w(x,b){if(utils$5.isUndefined(b)){if(!utils$5.isUndefined(x))return g(void 0,x)}else return g(void 0,b)}function _(x,b,C){if(C in f)return g(x,b);if(C in r)return g(void 0,x)}const S={url:m,method:m,data:m,baseURL:w,transformRequest:w,transformResponse:w,paramsSerializer:w,timeout:w,timeoutMessage:w,withCredentials:w,withXSRFToken:w,adapter:w,responseType:w,xsrfCookieName:w,xsrfHeaderName:w,onUploadProgress:w,onDownloadProgress:w,decompress:w,maxContentLength:w,maxBodyLength:w,beforeRedirect:w,transport:w,httpAgent:w,httpsAgent:w,cancelToken:w,socketPath:w,responseEncoding:w,validateStatus:_,headers:(x,b,C)=>v(headersToObject(x),headersToObject(b),C,!0)};return utils$5.forEach(Object.keys({...r,...f}),function(b){const C=S[b]||v,E=C(r[b],f[b],b);utils$5.isUndefined(E)&&C!==_||(d[b]=E)}),d}const resolveConfig=r=>{const f=mergeConfig$1({},r);let{data:d,withXSRFToken:g,xsrfHeaderName:v,xsrfCookieName:m,headers:w,auth:_}=f;f.headers=w=AxiosHeaders$1.from(w),f.url=buildURL(buildFullPath(f.baseURL,f.url,f.allowAbsoluteUrls),r.params,r.paramsSerializer),_&&w.set("Authorization","Basic "+btoa((_.username||"")+":"+(_.password?unescape(encodeURIComponent(_.password)):"")));let S;if(utils$5.isFormData(d)){if(platform$1.hasStandardBrowserEnv||platform$1.hasStandardBrowserWebWorkerEnv)w.setContentType(void 0);else if((S=w.getContentType())!==!1){const[x,...b]=S?S.split(";").map(C=>C.trim()).filter(Boolean):[];w.setContentType([x||"multipart/form-data",...b].join("; "))}}if(platform$1.hasStandardBrowserEnv&&(g&&utils$5.isFunction(g)&&(g=g(f)),g||g!==!1&&isURLSameOrigin(f.url))){const x=v&&m&&cookies.read(m);x&&w.set(v,x)}return f},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(r){return new Promise(function(d,g){const v=resolveConfig(r);let m=v.data;const w=AxiosHeaders$1.from(v.headers).normalize();let{responseType:_,onUploadProgress:S,onDownloadProgress:x}=v,b,C,E,M,A;function T(){M&&M(),A&&A(),v.cancelToken&&v.cancelToken.unsubscribe(b),v.signal&&v.signal.removeEventListener("abort",b)}let L=new XMLHttpRequest;L.open(v.method.toUpperCase(),v.url,!0),L.timeout=v.timeout;function O(){if(!L)return;const H=AxiosHeaders$1.from("getAllResponseHeaders"in L&&L.getAllResponseHeaders()),X={data:!_||_==="text"||_==="json"?L.responseText:L.response,status:L.status,statusText:L.statusText,headers:H,config:r,request:L};settle(function(se){d(se),T()},function(se){g(se),T()},X),L=null}"onloadend"in L?L.onloadend=O:L.onreadystatechange=function(){!L||L.readyState!==4||L.status===0&&!(L.responseURL&&L.responseURL.indexOf("file:")===0)||setTimeout(O)},L.onabort=function(){L&&(g(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,r,L)),L=null)},L.onerror=function(){g(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,r,L)),L=null},L.ontimeout=function(){let V=v.timeout?"timeout of "+v.timeout+"ms exceeded":"timeout exceeded";const X=v.transitional||transitionalDefaults;v.timeoutErrorMessage&&(V=v.timeoutErrorMessage),g(new AxiosError$1(V,X.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,r,L)),L=null},m===void 0&&w.setContentType(null),"setRequestHeader"in L&&utils$5.forEach(w.toJSON(),function(V,X){L.setRequestHeader(X,V)}),utils$5.isUndefined(v.withCredentials)||(L.withCredentials=!!v.withCredentials),_&&_!=="json"&&(L.responseType=v.responseType),x&&([E,A]=progressEventReducer(x,!0),L.addEventListener("progress",E)),S&&L.upload&&([C,M]=progressEventReducer(S),L.upload.addEventListener("progress",C),L.upload.addEventListener("loadend",M)),(v.cancelToken||v.signal)&&(b=H=>{L&&(g(!H||H.type?new CanceledError$1(null,r,L):H),L.abort(),L=null)},v.cancelToken&&v.cancelToken.subscribe(b),v.signal&&(v.signal.aborted?b():v.signal.addEventListener("abort",b)));const N=parseProtocol(v.url);if(N&&platform$1.protocols.indexOf(N)===-1){g(new AxiosError$1("Unsupported protocol "+N+":",AxiosError$1.ERR_BAD_REQUEST,r));return}L.send(m||null)})},composeSignals=(r,f)=>{const{length:d}=r=r?r.filter(Boolean):[];if(f||d){let g=new AbortController,v;const m=function(x){if(!v){v=!0,_();const b=x instanceof Error?x:this.reason;g.abort(b instanceof AxiosError$1?b:new CanceledError$1(b instanceof Error?b.message:b))}};let w=f&&setTimeout(()=>{w=null,m(new AxiosError$1(`timeout ${f} of ms exceeded`,AxiosError$1.ETIMEDOUT))},f);const _=()=>{r&&(w&&clearTimeout(w),w=null,r.forEach(x=>{x.unsubscribe?x.unsubscribe(m):x.removeEventListener("abort",m)}),r=null)};r.forEach(x=>x.addEventListener("abort",m));const{signal:S}=g;return S.unsubscribe=()=>utils$5.asap(_),S}},streamChunk=function*(r,f){let d=r.byteLength;if(d<f){yield r;return}let g=0,v;for(;g<d;)v=g+f,yield r.slice(g,v),g=v},readBytes=async function*(r,f){for await(const d of readStream(r))yield*streamChunk(d,f)},readStream=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const f=r.getReader();try{for(;;){const{done:d,value:g}=await f.read();if(d)break;yield g}}finally{await f.cancel()}},trackStream=(r,f,d,g)=>{const v=readBytes(r,f);let m=0,w,_=S=>{w||(w=!0,g&&g(S))};return new ReadableStream({async pull(S){try{const{done:x,value:b}=await v.next();if(x){_(),S.close();return}let C=b.byteLength;if(d){let E=m+=C;d(E)}S.enqueue(new Uint8Array(b))}catch(x){throw _(x),x}},cancel(S){return _(S),v.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(r=>f=>r.encode(f))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),test=(r,...f)=>{try{return!!r(...f)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let r=!1;const f=new Request(platform$1.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!f}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$5.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(r=>r.body)};isFetchSupported&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!resolvers[f]&&(resolvers[f]=utils$5.isFunction(r[f])?d=>d[f]():(d,g)=>{throw new AxiosError$1(`Response type '${f}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,g)})})})(new Response);const getBodyLength=async r=>{if(r==null)return 0;if(utils$5.isBlob(r))return r.size;if(utils$5.isSpecCompliantForm(r))return(await new Request(platform$1.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(utils$5.isArrayBufferView(r)||utils$5.isArrayBuffer(r))return r.byteLength;if(utils$5.isURLSearchParams(r)&&(r=r+""),utils$5.isString(r))return(await encodeText(r)).byteLength},resolveBodyLength=async(r,f)=>{const d=utils$5.toFiniteNumber(r.getContentLength());return d??getBodyLength(f)},fetchAdapter=isFetchSupported&&(async r=>{let{url:f,method:d,data:g,signal:v,cancelToken:m,timeout:w,onDownloadProgress:_,onUploadProgress:S,responseType:x,headers:b,withCredentials:C="same-origin",fetchOptions:E}=resolveConfig(r);x=x?(x+"").toLowerCase():"text";let M=composeSignals([v,m&&m.toAbortSignal()],w),A;const T=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let L;try{if(S&&supportsRequestStream&&d!=="get"&&d!=="head"&&(L=await resolveBodyLength(b,g))!==0){let X=new Request(f,{method:"POST",body:g,duplex:"half"}),oe;if(utils$5.isFormData(g)&&(oe=X.headers.get("content-type"))&&b.setContentType(oe),X.body){const[se,de]=progressEventDecorator(L,progressEventReducer(asyncDecorator(S)));g=trackStream(X.body,DEFAULT_CHUNK_SIZE,se,de)}}utils$5.isString(C)||(C=C?"include":"omit");const O="credentials"in Request.prototype;A=new Request(f,{...E,signal:M,method:d.toUpperCase(),headers:b.normalize().toJSON(),body:g,duplex:"half",credentials:O?C:void 0});let N=await fetch(A,E);const H=supportsResponseStream&&(x==="stream"||x==="response");if(supportsResponseStream&&(_||H&&T)){const X={};["status","statusText","headers"].forEach(he=>{X[he]=N[he]});const oe=utils$5.toFiniteNumber(N.headers.get("content-length")),[se,de]=_&&progressEventDecorator(oe,progressEventReducer(asyncDecorator(_),!0))||[];N=new Response(trackStream(N.body,DEFAULT_CHUNK_SIZE,se,()=>{de&&de(),T&&T()}),X)}x=x||"text";let V=await resolvers[utils$5.findKey(resolvers,x)||"text"](N,r);return!H&&T&&T(),await new Promise((X,oe)=>{settle(X,oe,{data:V,headers:AxiosHeaders$1.from(N.headers),status:N.status,statusText:N.statusText,config:r,request:A})})}catch(O){throw T&&T(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,r,A),{cause:O.cause||O}):AxiosError$1.from(O,O&&O.code,r,A)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$5.forEach(knownAdapters,(r,f)=>{if(r){try{Object.defineProperty(r,"name",{value:f})}catch{}Object.defineProperty(r,"adapterName",{value:f})}});const renderReason=r=>`- ${r}`,isResolvedHandle=r=>utils$5.isFunction(r)||r===null||r===!1,adapters={getAdapter:r=>{r=utils$5.isArray(r)?r:[r];const{length:f}=r;let d,g;const v={};for(let m=0;m<f;m++){d=r[m];let w;if(g=d,!isResolvedHandle(d)&&(g=knownAdapters[(w=String(d)).toLowerCase()],g===void 0))throw new AxiosError$1(`Unknown adapter '${w}'`);if(g)break;v[w||"#"+m]=g}if(!g){const m=Object.entries(v).map(([_,S])=>`adapter ${_} `+(S===!1?"is not supported by the environment":"is not available in the build"));let w=f?m.length>1?`since :
9
+ `+m.map(renderReason).join(`
10
+ `):" "+renderReason(m[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+w,"ERR_NOT_SUPPORT")}return g},adapters:knownAdapters};function throwIfCancellationRequested(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new CanceledError$1(null,r)}function dispatchRequest(r){return throwIfCancellationRequested(r),r.headers=AxiosHeaders$1.from(r.headers),r.data=transformData.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(r.adapter||defaults.adapter)(r).then(function(g){return throwIfCancellationRequested(r),g.data=transformData.call(r,r.transformResponse,g),g.headers=AxiosHeaders$1.from(g.headers),g},function(g){return isCancel$1(g)||(throwIfCancellationRequested(r),g&&g.response&&(g.response.data=transformData.call(r,r.transformResponse,g.response),g.response.headers=AxiosHeaders$1.from(g.response.headers))),Promise.reject(g)})}const VERSION$1="1.11.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((r,f)=>{validators$1[r]=function(g){return typeof g===r||"a"+(f<1?"n ":" ")+r}});const deprecatedWarnings={};validators$1.transitional=function(f,d,g){function v(m,w){return"[Axios v"+VERSION$1+"] Transitional option '"+m+"'"+w+(g?". "+g:"")}return(m,w,_)=>{if(f===!1)throw new AxiosError$1(v(w," has been removed"+(d?" in "+d:"")),AxiosError$1.ERR_DEPRECATED);return d&&!deprecatedWarnings[w]&&(deprecatedWarnings[w]=!0),f?f(m,w,_):!0}},validators$1.spelling=function(f){return(d,g)=>!0};function assertOptions(r,f,d){if(typeof r!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const g=Object.keys(r);let v=g.length;for(;v-- >0;){const m=g[v],w=f[m];if(w){const _=r[m],S=_===void 0||w(_,m,r);if(S!==!0)throw new AxiosError$1("option "+m+" must be "+S,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(d!==!0)throw new AxiosError$1("Unknown option "+m,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(f){this.defaults=f||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(f,d){try{return await this._request(f,d)}catch(g){if(g instanceof Error){let v={};Error.captureStackTrace?Error.captureStackTrace(v):v=new Error;const m=v.stack?v.stack.replace(/^.+\n/,""):"";try{g.stack?m&&!String(g.stack).endsWith(m.replace(/^.+\n.+\n/,""))&&(g.stack+=`
11
+ `+m):g.stack=m}catch{}}throw g}}_request(f,d){typeof f=="string"?(d=d||{},d.url=f):d=f||{},d=mergeConfig$1(this.defaults,d);const{transitional:g,paramsSerializer:v,headers:m}=d;g!==void 0&&validator.assertOptions(g,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),v!=null&&(utils$5.isFunction(v)?d.paramsSerializer={serialize:v}:validator.assertOptions(v,{encode:validators.function,serialize:validators.function},!0)),d.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?d.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:d.allowAbsoluteUrls=!0),validator.assertOptions(d,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),d.method=(d.method||this.defaults.method||"get").toLowerCase();let w=m&&utils$5.merge(m.common,m[d.method]);m&&utils$5.forEach(["delete","get","head","post","put","patch","common"],A=>{delete m[A]}),d.headers=AxiosHeaders$1.concat(w,m);const _=[];let S=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(d)===!1||(S=S&&T.synchronous,_.unshift(T.fulfilled,T.rejected))});const x=[];this.interceptors.response.forEach(function(T){x.push(T.fulfilled,T.rejected)});let b,C=0,E;if(!S){const A=[dispatchRequest.bind(this),void 0];for(A.unshift(..._),A.push(...x),E=A.length,b=Promise.resolve(d);C<E;)b=b.then(A[C++],A[C++]);return b}E=_.length;let M=d;for(C=0;C<E;){const A=_[C++],T=_[C++];try{M=A(M)}catch(L){T.call(this,L);break}}try{b=dispatchRequest.call(this,M)}catch(A){return Promise.reject(A)}for(C=0,E=x.length;C<E;)b=b.then(x[C++],x[C++]);return b}getUri(f){f=mergeConfig$1(this.defaults,f);const d=buildFullPath(f.baseURL,f.url,f.allowAbsoluteUrls);return buildURL(d,f.params,f.paramsSerializer)}};utils$5.forEach(["delete","get","head","options"],function(f){Axios$1.prototype[f]=function(d,g){return this.request(mergeConfig$1(g||{},{method:f,url:d,data:(g||{}).data}))}}),utils$5.forEach(["post","put","patch"],function(f){function d(g){return function(m,w,_){return this.request(mergeConfig$1(_||{},{method:f,headers:g?{"Content-Type":"multipart/form-data"}:{},url:m,data:w}))}}Axios$1.prototype[f]=d(),Axios$1.prototype[f+"Form"]=d(!0)});let CancelToken$1=class Gt{constructor(f){if(typeof f!="function")throw new TypeError("executor must be a function.");let d;this.promise=new Promise(function(m){d=m});const g=this;this.promise.then(v=>{if(!g._listeners)return;let m=g._listeners.length;for(;m-- >0;)g._listeners[m](v);g._listeners=null}),this.promise.then=v=>{let m;const w=new Promise(_=>{g.subscribe(_),m=_}).then(v);return w.cancel=function(){g.unsubscribe(m)},w},f(function(m,w,_){g.reason||(g.reason=new CanceledError$1(m,w,_),d(g.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(f){if(this.reason){f(this.reason);return}this._listeners?this._listeners.push(f):this._listeners=[f]}unsubscribe(f){if(!this._listeners)return;const d=this._listeners.indexOf(f);d!==-1&&this._listeners.splice(d,1)}toAbortSignal(){const f=new AbortController,d=g=>{f.abort(g)};return this.subscribe(d),f.signal.unsubscribe=()=>this.unsubscribe(d),f.signal}static source(){let f;return{token:new Gt(function(v){f=v}),cancel:f}}};function spread$2(r){return function(d){return r.apply(null,d)}}function isAxiosError$1(r){return utils$5.isObject(r)&&r.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([r,f])=>{HttpStatusCode$1[f]=r});function createInstance(r){const f=new Axios$1(r),d=bind(Axios$1.prototype.request,f);return utils$5.extend(d,Axios$1.prototype,f,{allOwnKeys:!0}),utils$5.extend(d,f,null,{allOwnKeys:!0}),d.create=function(v){return createInstance(mergeConfig$1(r,v))},d}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(f){return Promise.all(f)},axios.spread=spread$2,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=r=>formDataToJSON(utils$5.isHTMLForm(r)?new FormData(r):r),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread:spread$1,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,PROD_BASE_URL="https://miniapp.spinfi.me";class HttpClient{constructor(f){this.options=f;const d=f.baseURL;this.instance=axios.create({baseURL:d,timeout:3e4}),this.instance.interceptors.request.use(g=>{const v=this.options.getToken();if(v){g.headers=g.headers||{};const m=`Bearer ${v}`;g.headers.Authorization=m}return g}),this.instance.interceptors.response.use(g=>g,g=>(g.response&&g.response.status===401&&this.options.onAuthError&&this.options.onAuthError(),Promise.reject(g)))}request(f){return this.instance.request(f)}get(f,d){return this.instance.get(f,d)}post(f,d,g){return this.instance.post(f,d,g)}}class NamespacedStorage{constructor(f="tg_tracking_sdk"){this.prefix=f}k(f){return`${this.prefix}:${f}`}set(f,d){try{localStorage.setItem(this.k(f),JSON.stringify(d))}catch{}}get(f){try{const d=localStorage.getItem(this.k(f));return d?JSON.parse(d):null}catch{return null}}remove(f){try{localStorage.removeItem(this.k(f))}catch{}}}class APIService{constructor(f){this.http=f}auth(f){return this.http.post("/api/user/auth",f).then(d=>d.data)}getAdPositionConfig(f){return this.http.post("/api/ad/adPositionDisplayAd",{adPositionName:f}).then(d=>d.data)}createAd(f){return this.http.post("/api/v2/ad/create",f).then(d=>d.data)}adMonitor(f){return this.http.get("/api/v2/ad/monitor",{params:f}).then(d=>d.data)}bindWalletReq(f){return this.http.post("/api/user/bindWallet",f).then(d=>d.data)}merchantPayModeList(){return this.http.get("/api/v2/merchant/pay/modeList").then(f=>f.data)}merchantPayCreate(f){return this.http.post("/api/v2/merchant/pay/create",f).then(d=>d.data)}merchantPayFinish(f){return this.http.post("/api/v2/merchant/pay/finish",f).then(d=>d.data)}merchantPayQueryResult(f){return this.http.post("/api/v2/merchant/pay/queryResult",f).then(d=>d.data)}merchantPayNotify(f){return this.http.post("/api/v2/merchant/pay/notify",f).then(d=>d.data)}}class HmAdManager{constructor(f={}){this.options=f,this.initialized=!1}async init(){this.initialized||(this.options.autoInjectScript!==!1&&this.sdkZone&&this.sdkFunc&&await this.ensureScriptInjected(),this.initialized=!0)}async setSpace(f){if(!f)return;const d=String(f),g=`show_${f}`,v=this.sdkZone!==d||this.sdkFunc!==g;this.sdkZone=d,this.sdkFunc=g,this.options.autoInjectScript!==!1&&await this.ensureScriptInjected(v)}findExistingScript(){return typeof document>"u"?null:document.querySelector("script[src*='//libtl.com/sdk.js']")}async ensureScriptInjected(f=!1){var m;if(typeof document>"u")return;const d=this.findExistingScript(),g=this.sdkZone||"",v=this.sdkFunc||"";if(d){const w=d.getAttribute("data-zone")||"",_=d.getAttribute("data-sdk")||"";if(w===g&&_===v&&!f)return;(m=d.parentElement)==null||m.removeChild(d)}!g||!v||await this.injectScript(g,v)}injectScript(f,d){return new Promise((g,v)=>{if(typeof document>"u")return g();const m=document.createElement("script");m.src="//libtl.com/sdk.js",m.setAttribute("data-zone",f),m.setAttribute("data-sdk",d),m.async=!0,m.onload=()=>g(),m.onerror=()=>v(new Error("Hm 脚本加载失败")),document.head.appendChild(m)})}async callSDK(f){if(!this.sdkFunc)throw new Error("Hm 未设置 spaceId");const d=window[this.sdkFunc];if(typeof d!="function")throw new Error("Hm SDK 未正确加载");await d(f)}async show(){try{await this.callSDK()}catch(f){throw f}}async showPopup(){try{await this.callSDK("pop")}catch(f){throw f}}async showInApp(f){try{await this.callSDK({type:"inApp",inAppSettings:f})}catch(d){throw d}}}class AdMonitor{constructor(f){this.getMonitor=f}extractParamsFromUrl(f){if(!f)return null;try{return{param:new URL(f).searchParams.get("param")||""}}catch{return null}}async send(f,d){if(!f)return;const g=Array.isArray(f)?f:[f];if(g.length===0)return;const v=g[0],m=this.extractParamsFromUrl(v);let w;if(m&&this.getMonitor)try{const _=Math.floor(Date.now()/1e3).toString(),S=CryptoJS.MD5(d+_).toString(),x={param:m.param,request_code:S,timestamp:_};w=await this.getMonitor(x)}catch{}return await Promise.allSettled(g.slice(1).map(_=>{try{return fetch(_,{method:"GET"})}catch{return Promise.resolve()}})),w}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dist$1={},sdk={},telegramWebApps={},hasRequiredTelegramWebApps;function requireTelegramWebApps(){return hasRequiredTelegramWebApps||(hasRequiredTelegramWebApps=1,(function(){var r={},f="";try{f=location.hash.toString()}catch{}var d=S(f),g=O("initParams");if(g)for(var v in g)typeof d[v]>"u"&&(d[v]=g[v]);L("initParams",d);var m=!1,w;try{if(m=window.parent!=null&&window!=window.parent,m){window.addEventListener("message",function(N){if(N.source===window.parent){try{var H=JSON.parse(N.data)}catch{return}if(!(!H||!H.eventType))if(H.eventType=="set_custom_style")N.origin==="https://web.telegram.org"&&(w.innerHTML=H.eventData);else if(H.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else E(H.eventType,H.eventData)}}),w=document.createElement("style"),document.head.appendChild(w);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function _(N){try{return N=N.replace(/\+/g,"%20"),decodeURIComponent(N)}catch{return N}}function S(N){N=N.replace(/^#/,"");var H={};if(!N.length)return H;if(N.indexOf("=")<0&&N.indexOf("?")<0)return H._path=_(N),H;var V=N.indexOf("?");if(V>=0){var X=N.substr(0,V);H._path=_(X),N=N.substr(V+1)}var oe=x(N);for(var se in oe)H[se]=oe[se];return H}function x(N){var H={};if(!N.length)return H;var V=N.split("&"),X,oe,se,de;for(X=0;X<V.length;X++)oe=V[X].split("="),se=_(oe[0]),de=oe[1]==null?null:_(oe[1]),H[se]=de;return H}function b(N,H){var V=N.indexOf("#");if(V<0)return N+"#"+H;var X=N.substr(V+1);return X.indexOf("=")>=0||X.indexOf("?")>=0?N+"&"+H:X.length>0?N+"?"+H:N+H}function C(N,H,V){if(H||(H=function(){}),V===void 0&&(V=""),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(N,JSON.stringify(V)),H();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:N,eventData:V})),H();else if(m)try{var X="https://web.telegram.org";X="*",window.parent.postMessage(JSON.stringify({eventType:N,eventData:V}),X),H()}catch(oe){H(oe)}else H({notAvailable:!0})}function E(N,H){M(N,function(V){V(N,H)})}function M(N,H){var V=r[N];if(!(V===void 0||!V.length))for(var X=0;X<V.length;X++)try{H(V[X])}catch{}}function A(N,H){r[N]===void 0&&(r[N]=[]);var V=r[N].indexOf(H);V===-1&&r[N].push(H)}function T(N,H){if(r[N]!==void 0){var V=r[N].indexOf(H);V!==-1&&r[N].splice(V,1)}}function L(N,H){try{return window.sessionStorage.setItem("__telegram__"+N,JSON.stringify(H)),!0}catch{}return!1}function O(N){try{return JSON.parse(window.sessionStorage.getItem("__telegram__"+N))}catch{}return null}window.Telegram||(window.Telegram={}),window.Telegram.WebView={initParams:d,isIframe:m,onEvent:A,offEvent:T,postEvent:C,receiveEvent:E,callEventCallbacks:M},window.Telegram.Utils={urlSafeDecode:_,urlParseQueryString:x,urlParseHashParams:S,urlAppendHashParams:b,sessionStorageSet:L,sessionStorageGet:O},window.TelegramGameProxy_receiveEvent=E,window.TelegramGameProxy={receiveEvent:E}})(),(function(){var r=window.Telegram.Utils,f=window.Telegram.WebView,d=f.initParams,g=f.isIframe,v={},m="",w={},_={},S="light",x="6.0",b="unknown";if(d.tgWebAppData&&d.tgWebAppData.length){m=d.tgWebAppData,w=r.urlParseQueryString(m);for(var C in w){var E=w[C];try{(E.substr(0,1)=="{"&&E.substr(-1)=="}"||E.substr(0,1)=="["&&E.substr(-1)=="]")&&(w[C]=JSON.parse(E))}catch{}}}if(d.tgWebAppThemeParams&&d.tgWebAppThemeParams.length){var M=d.tgWebAppThemeParams;try{var A=JSON.parse(M);A&&he(A)}catch{}}var A=r.sessionStorageGet("themeParams");A&&he(A),d.tgWebAppVersion&&(x=d.tgWebAppVersion),d.tgWebAppPlatform&&(b=d.tgWebAppPlatform);function T(fe,U){U.theme_params&&(he(U.theme_params),window.Telegram.WebApp.MainButton.setParams({}),window.Telegram.WebApp.SecondaryButton.setParams({}),me(),ae(),Oe(),X("themeChanged"))}var L=window.innerHeight;function O(fe,U){U.height&&(window.removeEventListener("resize",N),B(U))}function N(fe){L!=window.innerHeight&&(L=window.innerHeight,X("viewportChanged",{isStateStable:!0}))}function H(fe){if(!(fe.metaKey||fe.ctrlKey)){for(var U=fe.target;U.tagName!="A"&&U.parentNode;)U=U.parentNode;U.tagName=="A"&&U.target!="_blank"&&(U.protocol=="http:"||U.protocol=="https:")&&U.hostname=="t.me"&&(v.openTgLink(U.href),fe.preventDefault())}}function V(fe){return fe.toString().replace(/^\s+|\s+$/g,"")}function X(fe){var U=Array.prototype.slice.call(arguments);fe=U.shift(),f.callEventCallbacks("webview:"+fe,function(G){G.apply(v,U)})}function oe(fe,U){f.onEvent("webview:"+fe,U)}function se(fe,U){f.offEvent("webview:"+fe,U)}function de(fe,U){var G=document.documentElement;G&&G.style&&G.style.setProperty&&G.style.setProperty("--tg-"+fe,U)}function he(fe){fe.bg_color=="#1c1c1d"&&fe.bg_color==fe.secondary_bg_color&&(fe.secondary_bg_color="#2c2c2e");var U;for(var G in fe)(U=Ue(fe[G]))&&(_[G]=U,G=="bg_color"&&(S=De(U)?"dark":"light",de("color-scheme",S)),G="theme-"+G.split("_").join("-"),de(G,U));r.sessionStorageSet("themeParams",_)}var we={};function te(fe){for(var U=100;--U;){for(var G="",re="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",K=re.length,ue=0;ue<fe;ue++)G+=re[Math.floor(Math.random()*K)];if(!we[G])return we[G]={},G}throw Error("WebAppCallbackIdGenerateFailed")}var q=!1,k=!1,y=!0;function B(fe){typeof fe<"u"&&(y=!!fe.is_expanded,q=fe.height,fe.is_state_stable&&(k=fe.height),X("viewportChanged",{isStateStable:!!fe.is_state_stable}));var U,G;q!==!1?U=q-ut+"px":U=ut?"calc(100vh - "+ut+"px)":"100vh",k!==!1?G=k-ut+"px":G=ut?"calc(100vh - "+ut+"px)":"100vh",de("viewport-height",U),de("viewport-stable-height",G)}var $=!1;function I(fe){je("6.2")&&($=!!fe,f.postEvent("web_app_setup_closing_behavior",!1,{need_confirmation:$}))}var F=!0;function j(fe){je("7.7")&&(F=!!fe,f.postEvent("web_app_setup_swipe_behavior",!1,{allow_vertical_swipe:F}))}var D="bg_color",W=null;function R(){return D=="secondary_bg_color"?_.secondary_bg_color:D=="bg_color"?_.bg_color:W}function z(fe){if(je("6.1")){je("6.9")||(_.bg_color&&_.bg_color==fe?fe="bg_color":_.secondary_bg_color&&_.secondary_bg_color==fe&&(fe="secondary_bg_color"));var U=null,G=null;if(fe=="bg_color"||fe=="secondary_bg_color")G=fe;else if(je("6.9")&&(U=Ue(fe),!U))throw Error("WebAppHeaderColorInvalid");if(!je("6.9")&&G!="bg_color"&&G!="secondary_bg_color")throw Error("WebAppHeaderColorKeyInvalid");D=G,W=U,me()}}var ye=null,Ce=null;function me(){(ye!=D||Ce!=W)&&(ye=D,Ce=W,Ce?f.postEvent("web_app_set_header_color",!1,{color:W}):f.postEvent("web_app_set_header_color",!1,{color_key:D}))}var ie="bg_color";function ee(){return ie=="secondary_bg_color"?_.secondary_bg_color:ie=="bg_color"?_.bg_color:ie}function pe(fe){if(je("6.1")){var U;if(fe=="bg_color"||fe=="secondary_bg_color")U=fe;else if(U=Ue(fe),!U)throw Error("WebAppBackgroundColorInvalid");ie=U,ae()}}var be=null;function ae(){var fe=ee();be!=fe&&(be=fe,f.postEvent("web_app_set_background_color",!1,{color:fe}))}var ne="bottom_bar_bg_color";function Se(){return ne=="bottom_bar_bg_color"?_.bottom_bar_bg_color||_.secondary_bg_color||"#ffffff":ne=="secondary_bg_color"?_.secondary_bg_color:ne=="bg_color"?_.bg_color:ne}function ke(fe){if(je("7.10")){var U;if(fe=="bg_color"||fe=="secondary_bg_color"||fe=="bottom_bar_bg_color")U=fe;else if(U=Ue(fe),!U)throw Error("WebAppBottomBarColorInvalid");ne=U,Oe(),window.Telegram.WebApp.SecondaryButton.setParams({})}}var Ie=null;function Oe(){var fe=Se();Ie!=fe&&(Ie=fe,f.postEvent("web_app_set_bottom_bar_color",!1,{color:fe})),d.tgWebAppDebug&&bt()}function Ue(fe){fe+="";var U;if(U=/^\s*#([0-9a-f]{6})\s*$/i.exec(fe))return"#"+U[1].toLowerCase();if(U=/^\s*#([0-9a-f])([0-9a-f])([0-9a-f])\s*$/i.exec(fe))return("#"+U[1]+U[1]+U[2]+U[2]+U[3]+U[3]).toLowerCase();if(U=/^\s*rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)\s*$/.exec(fe)){var G=parseInt(U[1]),re=parseInt(U[2]),K=parseInt(U[3]);return G=(G<16?"0":"")+G.toString(16),re=(re<16?"0":"")+re.toString(16),K=(K<16?"0":"")+K.toString(16),"#"+G+re+K}return!1}function De(fe){fe=fe.replace(/[\s#]/g,""),fe.length==3&&(fe=fe[0]+fe[0]+fe[1]+fe[1]+fe[2]+fe[2]);var U=parseInt(fe.substr(0,2),16),G=parseInt(fe.substr(2,2),16),re=parseInt(fe.substr(4,2),16),K=Math.sqrt(.299*(U*U)+.587*(G*G)+.114*(re*re));return K<120}function $e(fe,U){typeof fe!="string"&&(fe=""),typeof U!="string"&&(U=""),fe=fe.replace(/^\s+|\s+$/g,"").split("."),U=U.replace(/^\s+|\s+$/g,"").split(".");var G=Math.max(fe.length,U.length),re,K,ue;for(re=0;re<G;re++)if(K=parseInt(fe[re])||0,ue=parseInt(U[re])||0,K!=ue)return K>ue?1:-1;return 0}function je(fe){return $e(x,fe)>=0}function Ye(fe){if(window.Blob)try{return new Blob([fe]).size}catch{}for(var U=fe.length,G=fe.length-1;G>=0;G--){var re=fe.charCodeAt(G);re>127&&re<=2047?U++:re>2047&&re<=65535&&(U+=2),re>=56320&&re<=57343&&G--}return U}var st=(function(){var fe=!1,U={};Object.defineProperty(U,"isVisible",{set:function(Pe){Te({is_visible:Pe})},get:function(){return fe},enumerable:!0});var G=null;f.onEvent("back_button_pressed",re);function re(){X("backButtonClicked")}function K(){return{is_visible:fe}}function ue(Pe){return typeof Pe>"u"&&(Pe=K()),JSON.stringify(Pe)}function Ae(){return!!je("6.1")}function xe(){var Pe=K(),Fe=ue(Pe);G!==Fe&&(G=Fe,f.postEvent("web_app_setup_back_button",!1,Pe))}function Te(Pe){return Ae()&&(typeof Pe.is_visible<"u"&&(fe=!!Pe.is_visible),xe()),U}return U.onClick=function(Pe){return Ae()&&oe("backButtonClicked",Pe),U},U.offClick=function(Pe){return Ae()&&se("backButtonClicked",Pe),U},U.show=function(){return Te({is_visible:!0})},U.hide=function(){return Te({is_visible:!1})},U})(),Je=null,Ge={},ut=0;if(d.tgWebAppDebug){Je=document.createElement("tg-bottom-bar");var gt={display:"flex",gap:"7px",font:"600 14px/18px sans-serif",width:"100%",background:Se(),position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"7px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var rt in gt)Je.style[rt]=gt[rt];document.addEventListener("DOMContentLoaded",function fe(U){document.removeEventListener("DOMContentLoaded",fe),document.body.appendChild(Je)});var wt=document.createElement("style");wt.innerHTML='tg-bottom-button.shine { position: relative; overflow: hidden; } tg-bottom-button.shine:before { content:""; position: absolute; top: 0; width: 100%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .2), transparent); animation: tg-bottom-button-shine 5s ease-in-out infinite; } @-webkit-keyframes tg-bottom-button-shine { 0% {left: -100%;} 12%,100% {left: 100%}} @keyframes tg-bottom-button-shine { 0% {left: -100%;} 12%,100% {left: 100%}}',Je.appendChild(wt)}function bt(){var fe=Ge.main._bottomButton,U=Ge.secondary._bottomButton;fe.isVisible||U.isVisible?(Je.style.display="flex",ut=58,fe.isVisible&&U.isVisible&&(U.position=="top"?(Je.style.flexDirection="column-reverse",ut+=51):U.position=="bottom"?(Je.style.flexDirection="column",ut+=51):U.position=="left"?Je.style.flexDirection="row-reverse":U.position=="right"&&(Je.style.flexDirection="row"))):(Je.style.display="none",ut=0),Je.style.background=Se(),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=ut+"px"),B()}var le=function(fe){var U=fe=="main";if(U)var G="web_app_setup_main_button",re="main_button_pressed",K="mainButtonClicked",ue="Continue",Ae=function(){return _.button_color||"#2481cc"},xe=function(){return _.button_text_color||"#ffffff"};else var G="web_app_setup_secondary_button",re="secondary_button_pressed",K="secondaryButtonClicked",ue="Cancel",Ae=function(){return Se()},xe=function(){return _.button_color||"#2481cc"};var Te=!1,Pe=!0,Fe=!1,Ne=!1,At=fe,ot=ue,yt=!1,vt=!1,xt="left",Ve={};Object.defineProperty(Ve,"type",{get:function(){return At},enumerable:!0}),Object.defineProperty(Ve,"text",{set:function(Be){Ve.setParams({text:Be})},get:function(){return ot},enumerable:!0}),Object.defineProperty(Ve,"color",{set:function(Be){Ve.setParams({color:Be})},get:function(){return yt||Ae()},enumerable:!0}),Object.defineProperty(Ve,"textColor",{set:function(Be){Ve.setParams({text_color:Be})},get:function(){return vt||xe()},enumerable:!0}),Object.defineProperty(Ve,"isVisible",{set:function(Be){Ve.setParams({is_visible:Be})},get:function(){return Te},enumerable:!0}),Object.defineProperty(Ve,"isProgressVisible",{get:function(){return Ne},enumerable:!0}),Object.defineProperty(Ve,"isActive",{set:function(Be){Ve.setParams({is_active:Be})},get:function(){return Pe},enumerable:!0}),Object.defineProperty(Ve,"hasShineEffect",{set:function(Be){Ve.setParams({has_shine_effect:Be})},get:function(){return Fe},enumerable:!0}),U||Object.defineProperty(Ve,"position",{set:function(Be){Ve.setParams({position:Be})},get:function(){return xt},enumerable:!0});var ft=null;f.onEvent(re,pt);var et=null;if(d.tgWebAppDebug){et=document.createElement("tg-bottom-button");var ht={display:"none",width:"100%",height:"44px",borderRadius:"0",background:"no-repeat right center",padding:"13px 15px",textAlign:"center",boxSizing:"border-box"};for(var it in ht)et.style[it]=ht[it];Je.appendChild(et),et.addEventListener("click",pt,!1),et._bottomButton=Ve,Ge[fe]=et}function pt(){Pe&&X(K)}function at(){var Be=Ve.color,Ke=Ve.textColor;if(Te){var We={is_visible:!0,is_active:Pe,is_progress_visible:Ne,text:ot,color:Be,text_color:Ke,has_shine_effect:Fe&&Pe&&!Ne};U||(We.position=xt)}else var We={is_visible:!1};return We}function ct(Be){return typeof Be>"u"&&(Be=at()),JSON.stringify(Be)}function dt(){var Be=at(),Ke=ct(Be);ft!==Ke&&(ft=Ke,f.postEvent(G,!1,Be),d.tgWebAppDebug&&nt(Be))}function nt(Be){Be.is_visible?(et.style.display="block",et.style.opacity=Be.is_active?"1":"0.8",et.style.cursor=Be.is_active?"pointer":"auto",et.disabled=!Be.is_active,et.innerText=Be.text,et.className=Be.has_shine_effect?"shine":"",et.style.backgroundImage=Be.is_progress_visible?"url('data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewport="0 0 48 48" width="48px" height="48px"><circle cx="50%" cy="50%" stroke="'+Be.text_color+'" stroke-width="2.25" stroke-linecap="round" fill="none" stroke-dashoffset="106" r="9" stroke-dasharray="56.52" rotate="-90"><animate attributeName="stroke-dashoffset" attributeType="XML" dur="360s" from="0" to="12500" repeatCount="indefinite"></animate><animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="1s" from="-90 24 24" to="630 24 24" repeatCount="indefinite"></animateTransform></circle></svg>')+"')":"none",et.style.backgroundColor=Be.color,et.style.color=Be.text_color):et.style.display="none",bt()}function Le(Be){if(typeof Be.text<"u"){var Ke=V(Be.text);if(!Ke.length||Ke.length>64)throw Error("WebAppBottomButtonParamInvalid");ot=Ke}if(typeof Be.color<"u")if(Be.color===!1||Be.color===null)yt=!1;else{var We=Ue(Be.color);if(!We)throw Error("WebAppBottomButtonParamInvalid");yt=We}if(typeof Be.text_color<"u")if(Be.text_color===!1||Be.text_color===null)vt=!1;else{var ze=Ue(Be.text_color);if(!ze)throw Error("WebAppBottomButtonParamInvalid");vt=ze}if(typeof Be.is_visible<"u"){if(Be.is_visible&&!Ve.text.length)throw Error("WebAppBottomButtonParamInvalid");Te=!!Be.is_visible}if(typeof Be.has_shine_effect<"u"&&(Fe=!!Be.has_shine_effect),!U&&typeof Be.position<"u"){if(Be.position!="left"&&Be.position!="right"&&Be.position!="top"&&Be.position!="bottom")throw Error("WebAppBottomButtonParamInvalid");xt=Be.position}return typeof Be.is_active<"u"&&(Pe=!!Be.is_active),dt(),Ve}return Ve.setText=function(Be){return Ve.setParams({text:Be})},Ve.onClick=function(Be){return oe(K,Be),Ve},Ve.offClick=function(Be){return se(K,Be),Ve},Ve.show=function(){return Ve.setParams({is_visible:!0})},Ve.hide=function(){return Ve.setParams({is_visible:!1})},Ve.enable=function(){return Ve.setParams({is_active:!0})},Ve.disable=function(){return Ve.setParams({is_active:!1})},Ve.showProgress=function(Be){return Pe=!!Be,Ne=!0,dt(),Ve},Ve.hideProgress=function(){return Ve.isActive||(Pe=!0),Ne=!1,dt(),Ve},Ve.setParams=Le,Ve},Z=le("main"),J=le("secondary"),ge=(function(){var fe=!1,U={};Object.defineProperty(U,"isVisible",{set:function(Pe){Te({is_visible:Pe})},get:function(){return fe},enumerable:!0});var G=null;f.onEvent("settings_button_pressed",re);function re(){X("settingsButtonClicked")}function K(){return{is_visible:fe}}function ue(Pe){return typeof Pe>"u"&&(Pe=K()),JSON.stringify(Pe)}function Ae(){return!!je("6.10")}function xe(){var Pe=K(),Fe=ue(Pe);G!==Fe&&(G=Fe,f.postEvent("web_app_setup_settings_button",!1,Pe))}function Te(Pe){return Ae()&&(typeof Pe.is_visible<"u"&&(fe=!!Pe.is_visible),xe()),U}return U.onClick=function(Pe){return Ae()&&oe("settingsButtonClicked",Pe),U},U.offClick=function(Pe){return Ae()&&se("settingsButtonClicked",Pe),U},U.show=function(){return Te({is_visible:!0})},U.hide=function(){return Te({is_visible:!1})},U})(),Ee=(function(){var fe={};function U(G){if(!je("6.1"))return fe;if(G.type=="impact"){if(G.impact_style!="light"&&G.impact_style!="medium"&&G.impact_style!="heavy"&&G.impact_style!="rigid"&&G.impact_style!="soft")throw Error("WebAppHapticImpactStyleInvalid")}else if(G.type=="notification"){if(G.notification_type!="error"&&G.notification_type!="success"&&G.notification_type!="warning")throw Error("WebAppHapticNotificationTypeInvalid")}else if(G.type!="selection_change")throw Error("WebAppHapticFeedbackTypeInvalid");return f.postEvent("web_app_trigger_haptic_feedback",!1,G),fe}return fe.impactOccurred=function(G){return U({type:"impact",impact_style:G})},fe.notificationOccurred=function(G){return U({type:"notification",notification_type:G})},fe.selectionChanged=function(){return U({type:"selection_change"})},fe})(),Re=(function(){var fe={};function U(G,re,K){if(!je("6.9"))throw Error("WebAppMethodUnsupported");return ve(G,re,K),fe}return fe.setItem=function(G,re,K){return U("saveStorageValue",{key:G,value:re},K)},fe.getItem=function(G,re){return fe.getItems([G],re?function(K,ue){K?re(K):re(null,ue[G])}:null)},fe.getItems=function(G,re){return U("getStorageValues",{keys:G},re)},fe.removeItem=function(G,re){return fe.removeItems([G],re)},fe.removeItems=function(G,re){return U("deleteStorageValues",{keys:G},re)},fe.getKeys=function(G){return U("getStorageKeys",{},G)},fe})(),qe=(function(){var fe=!1,U=!1,G="unknown",re=!1,K=!1,ue=!1,Ae="",xe={};Object.defineProperty(xe,"isInited",{get:function(){return fe},enumerable:!0}),Object.defineProperty(xe,"isBiometricAvailable",{get:function(){return fe&&U},enumerable:!0}),Object.defineProperty(xe,"biometricType",{get:function(){return G||"unknown"},enumerable:!0}),Object.defineProperty(xe,"isAccessRequested",{get:function(){return re},enumerable:!0}),Object.defineProperty(xe,"isAccessGranted",{get:function(){return re&&K},enumerable:!0}),Object.defineProperty(xe,"isBiometricTokenSaved",{get:function(){return ue},enumerable:!0}),Object.defineProperty(xe,"deviceId",{get:function(){return Ae||""},enumerable:!0});var Te={callbacks:[]},Pe=!1,Fe=!1,Ne=!1;f.onEvent("biometry_info_received",At),f.onEvent("biometry_auth_requested",ot),f.onEvent("biometry_token_updated",yt);function At(Ve,ft){if(fe=!0,ft.available?(U=!0,G=ft.type||"unknown",ft.access_requested?(re=!0,K=!!ft.access_granted,ue=!!ft.token_saved):(re=!1,K=!1,ue=!1)):(U=!1,G="unknown",re=!1,K=!1,ue=!1),Ae=ft.device_id||"",Te.callbacks.length>0)for(var et=0;et<Te.callbacks.length;et++){var ht=Te.callbacks[et];ht()}if(Pe){var it=Pe;Pe=!1,it.callback&&it.callback(K)}X("biometricManagerUpdated")}function ot(Ve,ft){var et=ft.status=="authorized",ht=ft.token||"";if(Fe){var it=Fe;Fe=!1,it.callback&&it.callback(et,et?ht:null)}X("biometricAuthRequested",et?{isAuthenticated:!0,biometricToken:ht}:{isAuthenticated:!1})}function yt(Ve,ft){var et=!1;if(U&&re&&(ft.status=="updated"?(ue=!0,et=!0):ft.status=="removed"&&(ue=!1,et=!0)),Ne){var ht=Ne;Ne=!1,ht.callback&&ht.callback(et)}X("biometricTokenUpdated",{isUpdated:et})}function vt(){return!!je("7.2")}function xt(){if(!fe)throw Error("WebAppBiometricManagerNotInited");return!0}return xe.init=function(Ve){return!vt()||fe||(Ve&&Te.callbacks.push(Ve),f.postEvent("web_app_biometry_get_info",!1)),xe},xe.requestAccess=function(Ve,ft){if(!vt())return xe;if(xt(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(Pe)throw Error("WebAppBiometricManagerAccessRequested");var et={};if(typeof Ve.reason<"u"){var ht=V(Ve.reason);if(ht.length>128)throw Error("WebAppBiometricRequestAccessParamInvalid");ht.length>0&&(et.reason=ht)}return Pe={callback:ft},f.postEvent("web_app_biometry_request_access",!1,et),xe},xe.authenticate=function(Ve,ft){if(!vt())return xe;if(xt(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!K)throw Error("WebAppBiometricManagerBiometricAccessNotGranted");if(Fe)throw Error("WebAppBiometricManagerAuthenticationRequested");var et={};if(typeof Ve.reason<"u"){var ht=V(Ve.reason);if(ht.length>128)throw Error("WebAppBiometricRequestAccessParamInvalid");ht.length>0&&(et.reason=ht)}return Fe={callback:ft},f.postEvent("web_app_biometry_request_auth",!1,et),xe},xe.updateBiometricToken=function(Ve,ft){if(!vt())return xe;if(Ve=Ve||"",Ve.length>1024)throw Error("WebAppBiometricManagerTokenInvalid");if(xt(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!K)throw Error("WebAppBiometricManagerBiometricAccessNotGranted");if(Ne)throw Error("WebAppBiometricManagerTokenUpdateRequested");return Ne={callback:ft},f.postEvent("web_app_biometry_update_token",!1,{token:Ve}),xe},xe.openSettings=function(){if(!vt())return xe;if(xt(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!re)throw Error("WebAppBiometricManagerBiometricsAccessNotRequested");return K||f.postEvent("web_app_biometry_open_settings",!1),xe},xe})(),Xe={};function He(fe,U){if(U.slug&&Xe[U.slug]){var G=Xe[U.slug];delete Xe[U.slug],G.callback&&G.callback(U.status),X("invoiceClosed",{url:G.url,status:U.status})}}var Ze=!1;function _t(fe,U){if(Ze){var G=Ze;Ze=!1;var re=null;typeof U.button_id<"u"&&(re=U.button_id),G.callback&&G.callback(re),X("popupClosed",{button_id:re})}}var tt=!1;function mt(fe,U){if(tt){var G=tt,re=null;typeof U.data<"u"&&(re=U.data),G.callback&&G.callback(re)&&(tt=!1,f.postEvent("web_app_close_scan_qr_popup",!1)),X("qrTextReceived",{data:re})}}function Tt(fe,U){tt=!1,X("scanQrPopupClosed")}function St(fe,U){if(U.req_id&&we[U.req_id]){var G=we[U.req_id];delete we[U.req_id];var re=null;typeof U.data<"u"&&(re=U.data),G.callback&&G.callback(re),X("clipboardTextReceived",{data:re})}}var lt=!1;function Mt(fe,U){if(lt){var G=lt;lt=!1,G.callback&&G.callback(U.status=="allowed"),X("writeAccessRequested",{status:U.status})}}function Ct(fe,U){var G,re,K=0,ue=function(){ve("getRequestedContact",{},function(xe,Te){Te&&Te.length?(clearTimeout(re),fe(Te)):(K+=50,G=setTimeout(ue,K))})},Ae=function(){clearTimeout(G),fe("")};re=setTimeout(Ae,U),ue()}var ce=!1;function Y(fe,U){if(ce){var G=ce;ce=!1;var re=U.status=="sent",K={status:U.status};re?Ct(function(ue){if(ue&&ue.length){K.response=ue,K.responseUnsafe=r.urlParseQueryString(ue);for(var Ae in K.responseUnsafe){var xe=K.responseUnsafe[Ae];try{(xe.substr(0,1)=="{"&&xe.substr(-1)=="}"||xe.substr(0,1)=="["&&xe.substr(-1)=="]")&&(K.responseUnsafe[Ae]=JSON.parse(xe))}catch{}}}G.callback&&G.callback(re,K),X("contactRequested",K)},3e3):(G.callback&&G.callback(re,K),X("contactRequested",K))}}function Q(fe,U){if(U.req_id&&we[U.req_id]){var G=we[U.req_id];delete we[U.req_id];var re=null,K=null;typeof U.result<"u"&&(re=U.result),typeof U.error<"u"&&(K=U.error),G.callback&&G.callback(K,re)}}function ve(fe,U,G){if(!je("6.9"))throw Error("WebAppMethodUnsupported");var re=te(16),K={req_id:re,method:fe,params:U||{}};we[re]={callback:G},f.postEvent("web_app_invoke_custom_method",!1,K)}window.Telegram||(window.Telegram={}),Object.defineProperty(v,"initData",{get:function(){return m},enumerable:!0}),Object.defineProperty(v,"initDataUnsafe",{get:function(){return w},enumerable:!0}),Object.defineProperty(v,"version",{get:function(){return x},enumerable:!0}),Object.defineProperty(v,"platform",{get:function(){return b},enumerable:!0}),Object.defineProperty(v,"colorScheme",{get:function(){return S},enumerable:!0}),Object.defineProperty(v,"themeParams",{get:function(){return _},enumerable:!0}),Object.defineProperty(v,"isExpanded",{get:function(){return y},enumerable:!0}),Object.defineProperty(v,"viewportHeight",{get:function(){return(q===!1?window.innerHeight:q)-ut},enumerable:!0}),Object.defineProperty(v,"viewportStableHeight",{get:function(){return(k===!1?window.innerHeight:k)-ut},enumerable:!0}),Object.defineProperty(v,"isClosingConfirmationEnabled",{set:function(fe){I(fe)},get:function(){return $},enumerable:!0}),Object.defineProperty(v,"isVerticalSwipesEnabled",{set:function(fe){j(fe)},get:function(){return F},enumerable:!0}),Object.defineProperty(v,"headerColor",{set:function(fe){z(fe)},get:function(){return R()},enumerable:!0}),Object.defineProperty(v,"backgroundColor",{set:function(fe){pe(fe)},get:function(){return ee()},enumerable:!0}),Object.defineProperty(v,"bottomBarColor",{set:function(fe){ke(fe)},get:function(){return Se()},enumerable:!0}),Object.defineProperty(v,"BackButton",{value:st,enumerable:!0}),Object.defineProperty(v,"MainButton",{value:Z,enumerable:!0}),Object.defineProperty(v,"SecondaryButton",{value:J,enumerable:!0}),Object.defineProperty(v,"SettingsButton",{value:ge,enumerable:!0}),Object.defineProperty(v,"HapticFeedback",{value:Ee,enumerable:!0}),Object.defineProperty(v,"CloudStorage",{value:Re,enumerable:!0}),Object.defineProperty(v,"BiometricManager",{value:qe,enumerable:!0}),v.setHeaderColor=function(fe){v.headerColor=fe},v.setBackgroundColor=function(fe){v.backgroundColor=fe},v.setBottomBarColor=function(fe){v.bottomBarColor=fe},v.enableClosingConfirmation=function(){v.isClosingConfirmationEnabled=!0},v.disableClosingConfirmation=function(){v.isClosingConfirmationEnabled=!1},v.enableVerticalSwipes=function(){v.isVerticalSwipesEnabled=!0},v.disableVerticalSwipes=function(){v.isVerticalSwipesEnabled=!1},v.isVersionAtLeast=function(fe){return je(fe)},v.onEvent=function(fe,U){oe(fe,U)},v.offEvent=function(fe,U){se(fe,U)},v.sendData=function(fe){if(!fe||!fe.length||Ye(fe)>4096)throw Error("WebAppDataInvalid");f.postEvent("web_app_data_send",!1,{data:fe})},v.switchInlineQuery=function(fe,U){if(!je("6.6"))throw Error("WebAppMethodUnsupported");if(!d.tgWebAppBotInline)throw Error("WebAppInlineModeDisabled");if(fe=fe||"",fe.length>256)throw Error("WebAppInlineQueryInvalid");var G=[];if(U){if(!Array.isArray(U))throw Error("WebAppInlineChooseChatTypesInvalid");for(var re={users:1,bots:1,groups:1,channels:1},K=0;K<U.length;K++){var ue=U[K];if(!re[ue])throw Error("WebAppInlineChooseChatTypeInvalid");re[ue]!=2&&(re[ue]=2,G.push(ue))}}f.postEvent("web_app_switch_inline_query",!1,{query:fe,chat_types:G})},v.openLink=function(re,U){var G=document.createElement("A");if(G.href=re,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppTgUrlInvalid");var re=G.href;if(U=U||{},je("6.1")){var K={url:re};je("6.4")&&U.try_instant_view&&(K.try_instant_view=!0),je("7.6")&&U.try_browser&&(K.try_browser=U.try_browser),f.postEvent("web_app_open_link",!1,K)}else window.open(re,"_blank")},v.openTelegramLink=function(fe){var U=document.createElement("A");if(U.href=fe,U.protocol!="http:"&&U.protocol!="https:"||U.hostname!="t.me")throw Error("WebAppTgUrlInvalid");var G=U.pathname+U.search;g||je("6.1")?f.postEvent("web_app_open_tg_link",!1,{path_full:G}):location.href="https://t.me"+G},v.openInvoice=function(fe,U){var G=document.createElement("A"),re,K;if(G.href=fe,G.protocol!="http:"&&G.protocol!="https:"||G.hostname!="t.me"||!(re=G.pathname.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/))||!(K=re[2]))throw Error("WebAppInvoiceUrlInvalid");if(!je("6.1"))throw Error("WebAppMethodUnsupported");if(Xe[K])throw Error("WebAppInvoiceOpened");Xe[K]={url:fe,callback:U},f.postEvent("web_app_open_invoice",!1,{slug:K})},v.showPopup=function(fe,U){if(!je("6.2"))throw Error("WebAppMethodUnsupported");if(Ze)throw Error("WebAppPopupOpened");var G="",re="",K=[],ue={};if(typeof fe.title<"u"){if(G=V(fe.title),G.length>64)throw Error("WebAppPopupParamInvalid");G.length>0&&(ue.title=G)}if(typeof fe.message<"u"&&(re=V(fe.message)),!re.length||re.length>256)throw Error("WebAppPopupParamInvalid");if(ue.message=re,typeof fe.buttons<"u"){if(!Array.isArray(fe.buttons))throw Error("WebAppPopupParamInvalid");for(var Ae=0;Ae<fe.buttons.length;Ae++){var xe=fe.buttons[Ae],Te={},Pe="";if(typeof xe.id<"u"&&(Pe=xe.id.toString(),Pe.length>64))throw Error("WebAppPopupParamInvalid");Te.id=Pe;var Fe=xe.type;if(typeof Fe>"u"&&(Fe="default"),Te.type=Fe,!(Fe=="ok"||Fe=="close"||Fe=="cancel"))if(Fe=="default"||Fe=="destructive"){var Ne="";if(typeof xe.text<"u"&&(Ne=V(xe.text)),!Ne.length||Ne.length>64)throw Error("WebAppPopupParamInvalid");Te.text=Ne}else throw Error("WebAppPopupParamInvalid");K.push(Te)}}else K.push({id:"",type:"close"});if(K.length<1||K.length>3)throw Error("WebAppPopupParamInvalid");ue.buttons=K,Ze={callback:U},f.postEvent("web_app_open_popup",!1,ue)},v.showAlert=function(fe,U){v.showPopup({message:fe},U?function(){U()}:null)},v.showConfirm=function(fe,U){v.showPopup({message:fe,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},U?function(G){U(G=="ok")}:null)},v.showScanQrPopup=function(fe,U){if(!je("6.4"))throw Error("WebAppMethodUnsupported");if(tt)throw Error("WebAppScanQrPopupOpened");var G="",re={};if(typeof fe.text<"u"){if(G=V(fe.text),G.length>64)throw Error("WebAppScanQrPopupParamInvalid");G.length>0&&(re.text=G)}tt={callback:U},f.postEvent("web_app_open_scan_qr_popup",!1,re)},v.closeScanQrPopup=function(){if(!je("6.4"))throw Error("WebAppMethodUnsupported");tt=!1,f.postEvent("web_app_close_scan_qr_popup",!1)},v.readTextFromClipboard=function(fe){if(!je("6.4"))throw Error("WebAppMethodUnsupported");var U=te(16),G={req_id:U};we[U]={callback:fe},f.postEvent("web_app_read_text_from_clipboard",!1,G)},v.requestWriteAccess=function(fe){if(!je("6.9"))throw Error("WebAppMethodUnsupported");if(lt)throw Error("WebAppWriteAccessRequested");lt={callback:fe},f.postEvent("web_app_request_write_access")},v.requestContact=function(fe){if(!je("6.9"))throw Error("WebAppMethodUnsupported");if(ce)throw Error("WebAppContactRequested");ce={callback:fe},f.postEvent("web_app_request_phone")},v.shareToStory=function(fe,U){if(U=U||{},!je("7.8"))throw Error("WebAppMethodUnsupported");var G=document.createElement("A");if(G.href=fe,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppMediaUrlInvalid");var re={};if(re.media_url=G.href,typeof U.text<"u"){var K=V(U.text);if(K.length>2048)throw Error("WebAppShareToStoryParamInvalid");K.length>0&&(re.text=K)}if(typeof U.widget_link<"u"){if(U.widget_link=U.widget_link||{},G.href=U.widget_link.url,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppShareToStoryParamInvalid");var ue={url:G.href};if(typeof U.widget_link.name<"u"){var Ae=V(U.widget_link.name);if(Ae.length>48)throw Error("WebAppShareToStoryParamInvalid");Ae.length>0&&(ue.name=Ae)}re.widget_link=ue}f.postEvent("web_app_share_to_story",!1,re)},v.invokeCustomMethod=function(fe,U,G){ve(fe,U,G)},v.ready=function(){f.postEvent("web_app_ready")},v.expand=function(){f.postEvent("web_app_expand")},v.close=function(fe){fe=fe||{};var U={};je("7.6")&&fe.return_back&&(U.return_back=!0),f.postEvent("web_app_close",!1,U)},window.Telegram.WebApp=v,me(),ae(),Oe(),B(),d.tgWebAppShowSettings&&ge.show(),window.addEventListener("resize",N),g&&document.addEventListener("click",H),f.onEvent("theme_changed",T),f.onEvent("viewport_changed",O),f.onEvent("invoice_closed",He),f.onEvent("popup_closed",_t),f.onEvent("qr_text_received",mt),f.onEvent("scan_qr_popup_closed",Tt),f.onEvent("clipboard_text_received",St),f.onEvent("write_access_requested",Mt),f.onEvent("phone_requested",Y),f.onEvent("custom_method_invoked",Q),f.postEvent("web_app_request_theme"),f.postEvent("web_app_request_viewport")})()),telegramWebApps}var hasRequiredSdk;function requireSdk(){if(hasRequiredSdk)return sdk;hasRequiredSdk=1,Object.defineProperty(sdk,"__esModule",{value:!0}),sdk.WebApp=void 0,requireTelegramWebApps();var r=window;return sdk.WebApp=r.Telegram.WebApp,sdk}var hasRequiredDist$1;function requireDist$1(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1,Object.defineProperty(dist$1,"__esModule",{value:!0});var r=requireSdk();return dist$1.default=r.WebApp,dist$1}var distExports=requireDist$1();const WebApp=getDefaultExportFromCjs(distExports);function retrieveLaunchParams(){if(!WebApp.initData||WebApp.initData==="")throw new Error("未能提取启动参数,不在 Telegram 环境中");return WebApp.initData}function isTelegramEnv(){try{return typeof window<"u"&&window.Telegram&&window.Telegram.WebApp?(retrieveLaunchParams(),!0):!1}catch{return!1}}function getTelegramUserUnsafe(){try{if(!WebApp||!WebApp.initDataUnsafe)return null;const r=WebApp.initDataUnsafe;return!r.user||!r.user.id?null:{user:{id:r.user.id,firstName:r.user.first_name||"",lastName:r.user.last_name||"",username:r.user.username,languageCode:r.user.language_code,isPremium:r.user.is_premium||!1,allowsWriteToPm:r.user.allows_write_to_pm||!1},authDate:new Date().toISOString(),hash:r.hash||"",startParam:r.start_param,chatType:r.chat_type,chatInstance:r.chat_instance}}catch{return null}}function readCookie(r){if(typeof document>"u")return null;const f=document.cookie.match(new RegExp("(?:^|; )"+r.replace(/([.$?*|{}()\[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return f?decodeURIComponent(f[1]):null}function writeCookie(r,f,d=365*2){if(typeof document>"u")return;const g=new Date;g.setTime(g.getTime()+d*24*60*60*1e3);const v="; expires="+g.toUTCString();document.cookie=`${encodeURIComponent(r)}=${encodeURIComponent(f)}${v}; path=/`}function generateNumericId(){const r=Math.floor(Math.random()*1e9),f=Date.now()%1e9;return Number(String(f).padStart(9,"0")+String(r).padStart(9,"0"))}function getAnonymousBrowserUser(r="tg_tracking_uid"){let f=readCookie(r);if(!f){const v=generateNumericId();f=String(v),writeCookie(r,f)}const d=Number(f.replace(/\D/g,"").slice(0,15))||generateNumericId(),g=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en";return{user:{id:d,firstName:"Guest",lastName:"",username:`guest_${f.slice(-6)}`,languageCode:g.toLowerCase(),isPremium:!1,allowsWriteToPm:!1},authDate:new Date().toISOString(),hash:"anonymous_cookie_user",startParam:"browser_guest",chatType:"sender",chatInstance:""}}function getDefaultMockUser(){return{user:{id:2077220643,firstName:"Mock",lastName:"User",username:"mock_user_demo",languageCode:"zh-hans",isPremium:!0,allowsWriteToPm:!0},authDate:new Date().toISOString(),hash:"mock_hash_for_demo_purpose",startParam:"demo_start_param",chatType:"sender",chatInstance:"-245769840322609948"}}var naclUtil$1={exports:{}},naclUtil=naclUtil$1.exports,hasRequiredNaclUtil;function requireNaclUtil(){return hasRequiredNaclUtil||(hasRequiredNaclUtil=1,(function(r){(function(f,d){r.exports?r.exports=d():(f.nacl||(f.nacl={}),f.nacl.util=d())})(naclUtil,function(){var f={};function d(g){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(g))throw new TypeError("invalid encoding")}return f.decodeUTF8=function(g){if(typeof g!="string")throw new TypeError("expected string");var v,m=unescape(encodeURIComponent(g)),w=new Uint8Array(m.length);for(v=0;v<m.length;v++)w[v]=m.charCodeAt(v);return w},f.encodeUTF8=function(g){var v,m=[];for(v=0;v<g.length;v++)m.push(String.fromCharCode(g[v]));return decodeURIComponent(escape(m.join("")))},typeof atob>"u"?typeof Buffer.from<"u"?(f.encodeBase64=function(g){return Buffer.from(g).toString("base64")},f.decodeBase64=function(g){return d(g),new Uint8Array(Array.prototype.slice.call(Buffer.from(g,"base64"),0))}):(f.encodeBase64=function(g){return new Buffer(g).toString("base64")},f.decodeBase64=function(g){return d(g),new Uint8Array(Array.prototype.slice.call(new Buffer(g,"base64"),0))}):(f.encodeBase64=function(g){var v,m=[],w=g.length;for(v=0;v<w;v++)m.push(String.fromCharCode(g[v]));return btoa(m.join(""))},f.decodeBase64=function(g){d(g);var v,m=atob(g),w=new Uint8Array(m.length);for(v=0;v<m.length;v++)w[v]=m.charCodeAt(v);return w}),f})})(naclUtil$1)),naclUtil$1.exports}var naclUtilExports=requireNaclUtil();const nacl=getDefaultExportFromCjs(naclUtilExports);function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var naclFast={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}},dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,(function(r){Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var f={},d={};d.byteLength=b,d.toByteArray=E,d.fromByteArray=T;for(var g=[],v=[],m=typeof Uint8Array<"u"?Uint8Array:Array,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0,S=w.length;_<S;++_)g[_]=w[_],v[w.charCodeAt(_)]=_;v[45]=62,v[95]=63;function x(N){var H=N.length;if(H%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var V=N.indexOf("=");V===-1&&(V=H);var X=V===H?0:4-V%4;return[V,X]}function b(N){var H=x(N),V=H[0],X=H[1];return(V+X)*3/4-X}function C(N,H,V){return(H+V)*3/4-V}function E(N){var H,V=x(N),X=V[0],oe=V[1],se=new m(C(N,X,oe)),de=0,he=oe>0?X-4:X,we;for(we=0;we<he;we+=4)H=v[N.charCodeAt(we)]<<18|v[N.charCodeAt(we+1)]<<12|v[N.charCodeAt(we+2)]<<6|v[N.charCodeAt(we+3)],se[de++]=H>>16&255,se[de++]=H>>8&255,se[de++]=H&255;return oe===2&&(H=v[N.charCodeAt(we)]<<2|v[N.charCodeAt(we+1)]>>4,se[de++]=H&255),oe===1&&(H=v[N.charCodeAt(we)]<<10|v[N.charCodeAt(we+1)]<<4|v[N.charCodeAt(we+2)]>>2,se[de++]=H>>8&255,se[de++]=H&255),se}function M(N){return g[N>>18&63]+g[N>>12&63]+g[N>>6&63]+g[N&63]}function A(N,H,V){for(var X,oe=[],se=H;se<V;se+=3)X=(N[se]<<16&16711680)+(N[se+1]<<8&65280)+(N[se+2]&255),oe.push(M(X));return oe.join("")}function T(N){for(var H,V=N.length,X=V%3,oe=[],se=16383,de=0,he=V-X;de<he;de+=se)oe.push(A(N,de,de+se>he?he:de+se));return X===1?(H=N[V-1],oe.push(g[H>>2]+g[H<<4&63]+"==")):X===2&&(H=(N[V-2]<<8)+N[V-1],oe.push(g[H>>10]+g[H>>4&63]+g[H<<2&63]+"=")),oe.join("")}var L={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */L.read=function(N,H,V,X,oe){var se,de,he=oe*8-X-1,we=(1<<he)-1,te=we>>1,q=-7,k=V?oe-1:0,y=V?-1:1,B=N[H+k];for(k+=y,se=B&(1<<-q)-1,B>>=-q,q+=he;q>0;se=se*256+N[H+k],k+=y,q-=8);for(de=se&(1<<-q)-1,se>>=-q,q+=X;q>0;de=de*256+N[H+k],k+=y,q-=8);if(se===0)se=1-te;else{if(se===we)return de?NaN:(B?-1:1)*(1/0);de=de+Math.pow(2,X),se=se-te}return(B?-1:1)*de*Math.pow(2,se-X)},L.write=function(N,H,V,X,oe,se){var de,he,we,te=se*8-oe-1,q=(1<<te)-1,k=q>>1,y=oe===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=X?0:se-1,$=X?1:-1,I=H<0||H===0&&1/H<0?1:0;for(H=Math.abs(H),isNaN(H)||H===1/0?(he=isNaN(H)?1:0,de=q):(de=Math.floor(Math.log(H)/Math.LN2),H*(we=Math.pow(2,-de))<1&&(de--,we*=2),de+k>=1?H+=y/we:H+=y*Math.pow(2,1-k),H*we>=2&&(de++,we/=2),de+k>=q?(he=0,de=q):de+k>=1?(he=(H*we-1)*Math.pow(2,oe),de=de+k):(he=H*Math.pow(2,k-1)*Math.pow(2,oe),de=0));oe>=8;N[V+B]=he&255,B+=$,he/=256,oe-=8);for(de=de<<oe|he,te+=oe;te>0;N[V+B]=de&255,B+=$,de/=256,te-=8);N[V+B-$]|=I*128};/*!
12
+ * The buffer module from node.js, for the browser.
13
+ *
14
+ * @author Feross Aboukhadijeh <https://feross.org>
15
+ * @license MIT
16
+ */(function(N){const H=d,V=L,X=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=q,N.SlowBuffer=z,N.INSPECT_MAX_BYTES=50;const oe=2147483647;N.kMaxLength=oe;const{Uint8Array:se,ArrayBuffer:de,SharedArrayBuffer:he}=globalThis;q.TYPED_ARRAY_SUPPORT=we(),!q.TYPED_ARRAY_SUPPORT&&typeof console<"u";function we(){try{const ce=new se(1),Y={foo:function(){return 42}};return Object.setPrototypeOf(Y,se.prototype),Object.setPrototypeOf(ce,Y),ce.foo()===42}catch{return!1}}Object.defineProperty(q.prototype,"parent",{enumerable:!0,get:function(){if(q.isBuffer(this))return this.buffer}}),Object.defineProperty(q.prototype,"offset",{enumerable:!0,get:function(){if(q.isBuffer(this))return this.byteOffset}});function te(ce){if(ce>oe)throw new RangeError('The value "'+ce+'" is invalid for option "size"');const Y=new se(ce);return Object.setPrototypeOf(Y,q.prototype),Y}function q(ce,Y,Q){if(typeof ce=="number"){if(typeof Y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return $(ce)}return k(ce,Y,Q)}q.poolSize=8192;function k(ce,Y,Q){if(typeof ce=="string")return I(ce,Y);if(de.isView(ce))return j(ce);if(ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce);if(Tt(ce,de)||ce&&Tt(ce.buffer,de)||typeof he<"u"&&(Tt(ce,he)||ce&&Tt(ce.buffer,he)))return D(ce,Y,Q);if(typeof ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ve=ce.valueOf&&ce.valueOf();if(ve!=null&&ve!==ce)return q.from(ve,Y,Q);const fe=W(ce);if(fe)return fe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ce[Symbol.toPrimitive]=="function")return q.from(ce[Symbol.toPrimitive]("string"),Y,Q);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce)}q.from=function(ce,Y,Q){return k(ce,Y,Q)},Object.setPrototypeOf(q.prototype,se.prototype),Object.setPrototypeOf(q,se);function y(ce){if(typeof ce!="number")throw new TypeError('"size" argument must be of type number');if(ce<0)throw new RangeError('The value "'+ce+'" is invalid for option "size"')}function B(ce,Y,Q){return y(ce),ce<=0?te(ce):Y!==void 0?typeof Q=="string"?te(ce).fill(Y,Q):te(ce).fill(Y):te(ce)}q.alloc=function(ce,Y,Q){return B(ce,Y,Q)};function $(ce){return y(ce),te(ce<0?0:R(ce)|0)}q.allocUnsafe=function(ce){return $(ce)},q.allocUnsafeSlow=function(ce){return $(ce)};function I(ce,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!q.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);const Q=ye(ce,Y)|0;let ve=te(Q);const fe=ve.write(ce,Y);return fe!==Q&&(ve=ve.slice(0,fe)),ve}function F(ce){const Y=ce.length<0?0:R(ce.length)|0,Q=te(Y);for(let ve=0;ve<Y;ve+=1)Q[ve]=ce[ve]&255;return Q}function j(ce){if(Tt(ce,se)){const Y=new se(ce);return D(Y.buffer,Y.byteOffset,Y.byteLength)}return F(ce)}function D(ce,Y,Q){if(Y<0||ce.byteLength<Y)throw new RangeError('"offset" is outside of buffer bounds');if(ce.byteLength<Y+(Q||0))throw new RangeError('"length" is outside of buffer bounds');let ve;return Y===void 0&&Q===void 0?ve=new se(ce):Q===void 0?ve=new se(ce,Y):ve=new se(ce,Y,Q),Object.setPrototypeOf(ve,q.prototype),ve}function W(ce){if(q.isBuffer(ce)){const Y=R(ce.length)|0,Q=te(Y);return Q.length===0||ce.copy(Q,0,0,Y),Q}if(ce.length!==void 0)return typeof ce.length!="number"||St(ce.length)?te(0):F(ce);if(ce.type==="Buffer"&&Array.isArray(ce.data))return F(ce.data)}function R(ce){if(ce>=oe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe.toString(16)+" bytes");return ce|0}function z(ce){return+ce!=ce&&(ce=0),q.alloc(+ce)}q.isBuffer=function(Y){return Y!=null&&Y._isBuffer===!0&&Y!==q.prototype},q.compare=function(Y,Q){if(Tt(Y,se)&&(Y=q.from(Y,Y.offset,Y.byteLength)),Tt(Q,se)&&(Q=q.from(Q,Q.offset,Q.byteLength)),!q.isBuffer(Y)||!q.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Y===Q)return 0;let ve=Y.length,fe=Q.length;for(let U=0,G=Math.min(ve,fe);U<G;++U)if(Y[U]!==Q[U]){ve=Y[U],fe=Q[U];break}return ve<fe?-1:fe<ve?1:0},q.isEncoding=function(Y){switch(String(Y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},q.concat=function(Y,Q){if(!Array.isArray(Y))throw new TypeError('"list" argument must be an Array of Buffers');if(Y.length===0)return q.alloc(0);let ve;if(Q===void 0)for(Q=0,ve=0;ve<Y.length;++ve)Q+=Y[ve].length;const fe=q.allocUnsafe(Q);let U=0;for(ve=0;ve<Y.length;++ve){let G=Y[ve];if(Tt(G,se))U+G.length>fe.length?(q.isBuffer(G)||(G=q.from(G)),G.copy(fe,U)):se.prototype.set.call(fe,G,U);else if(q.isBuffer(G))G.copy(fe,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=G.length}return fe};function ye(ce,Y){if(q.isBuffer(ce))return ce.length;if(de.isView(ce)||Tt(ce,de))return ce.byteLength;if(typeof ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ce);const Q=ce.length,ve=arguments.length>2&&arguments[2]===!0;if(!ve&&Q===0)return 0;let fe=!1;for(;;)switch(Y){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return He(ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return tt(ce).length;default:if(fe)return ve?-1:He(ce).length;Y=(""+Y).toLowerCase(),fe=!0}}q.byteLength=ye;function Ce(ce,Y,Q){let ve=!1;if((Y===void 0||Y<0)&&(Y=0),Y>this.length||((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)||(Q>>>=0,Y>>>=0,Q<=Y))return"";for(ce||(ce="utf8");;)switch(ce){case"hex":return je(this,Y,Q);case"utf8":case"utf-8":return Ie(this,Y,Q);case"ascii":return De(this,Y,Q);case"latin1":case"binary":return $e(this,Y,Q);case"base64":return ke(this,Y,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,Y,Q);default:if(ve)throw new TypeError("Unknown encoding: "+ce);ce=(ce+"").toLowerCase(),ve=!0}}q.prototype._isBuffer=!0;function me(ce,Y,Q){const ve=ce[Y];ce[Y]=ce[Q],ce[Q]=ve}q.prototype.swap16=function(){const Y=this.length;if(Y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Q=0;Q<Y;Q+=2)me(this,Q,Q+1);return this},q.prototype.swap32=function(){const Y=this.length;if(Y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Q=0;Q<Y;Q+=4)me(this,Q,Q+3),me(this,Q+1,Q+2);return this},q.prototype.swap64=function(){const Y=this.length;if(Y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Q=0;Q<Y;Q+=8)me(this,Q,Q+7),me(this,Q+1,Q+6),me(this,Q+2,Q+5),me(this,Q+3,Q+4);return this},q.prototype.toString=function(){const Y=this.length;return Y===0?"":arguments.length===0?Ie(this,0,Y):Ce.apply(this,arguments)},q.prototype.toLocaleString=q.prototype.toString,q.prototype.equals=function(Y){if(!q.isBuffer(Y))throw new TypeError("Argument must be a Buffer");return this===Y?!0:q.compare(this,Y)===0},q.prototype.inspect=function(){let Y="";const Q=N.INSPECT_MAX_BYTES;return Y=this.toString("hex",0,Q).replace(/(.{2})/g,"$1 ").trim(),this.length>Q&&(Y+=" ... "),"<Buffer "+Y+">"},X&&(q.prototype[X]=q.prototype.inspect),q.prototype.compare=function(Y,Q,ve,fe,U){if(Tt(Y,se)&&(Y=q.from(Y,Y.offset,Y.byteLength)),!q.isBuffer(Y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Y);if(Q===void 0&&(Q=0),ve===void 0&&(ve=Y?Y.length:0),fe===void 0&&(fe=0),U===void 0&&(U=this.length),Q<0||ve>Y.length||fe<0||U>this.length)throw new RangeError("out of range index");if(fe>=U&&Q>=ve)return 0;if(fe>=U)return-1;if(Q>=ve)return 1;if(Q>>>=0,ve>>>=0,fe>>>=0,U>>>=0,this===Y)return 0;let G=U-fe,re=ve-Q;const K=Math.min(G,re),ue=this.slice(fe,U),Ae=Y.slice(Q,ve);for(let xe=0;xe<K;++xe)if(ue[xe]!==Ae[xe]){G=ue[xe],re=Ae[xe];break}return G<re?-1:re<G?1:0};function ie(ce,Y,Q,ve,fe){if(ce.length===0)return-1;if(typeof Q=="string"?(ve=Q,Q=0):Q>2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,St(Q)&&(Q=fe?0:ce.length-1),Q<0&&(Q=ce.length+Q),Q>=ce.length){if(fe)return-1;Q=ce.length-1}else if(Q<0)if(fe)Q=0;else return-1;if(typeof Y=="string"&&(Y=q.from(Y,ve)),q.isBuffer(Y))return Y.length===0?-1:ee(ce,Y,Q,ve,fe);if(typeof Y=="number")return Y=Y&255,typeof se.prototype.indexOf=="function"?fe?se.prototype.indexOf.call(ce,Y,Q):se.prototype.lastIndexOf.call(ce,Y,Q):ee(ce,[Y],Q,ve,fe);throw new TypeError("val must be string, number or Buffer")}function ee(ce,Y,Q,ve,fe){let U=1,G=ce.length,re=Y.length;if(ve!==void 0&&(ve=String(ve).toLowerCase(),ve==="ucs2"||ve==="ucs-2"||ve==="utf16le"||ve==="utf-16le")){if(ce.length<2||Y.length<2)return-1;U=2,G/=2,re/=2,Q/=2}function K(Ae,xe){return U===1?Ae[xe]:Ae.readUInt16BE(xe*U)}let ue;if(fe){let Ae=-1;for(ue=Q;ue<G;ue++)if(K(ce,ue)===K(Y,Ae===-1?0:ue-Ae)){if(Ae===-1&&(Ae=ue),ue-Ae+1===re)return Ae*U}else Ae!==-1&&(ue-=ue-Ae),Ae=-1}else for(Q+re>G&&(Q=G-re),ue=Q;ue>=0;ue--){let Ae=!0;for(let xe=0;xe<re;xe++)if(K(ce,ue+xe)!==K(Y,xe)){Ae=!1;break}if(Ae)return ue}return-1}q.prototype.includes=function(Y,Q,ve){return this.indexOf(Y,Q,ve)!==-1},q.prototype.indexOf=function(Y,Q,ve){return ie(this,Y,Q,ve,!0)},q.prototype.lastIndexOf=function(Y,Q,ve){return ie(this,Y,Q,ve,!1)};function pe(ce,Y,Q,ve){Q=Number(Q)||0;const fe=ce.length-Q;ve?(ve=Number(ve),ve>fe&&(ve=fe)):ve=fe;const U=Y.length;ve>U/2&&(ve=U/2);let G;for(G=0;G<ve;++G){const re=parseInt(Y.substr(G*2,2),16);if(St(re))return G;ce[Q+G]=re}return G}function be(ce,Y,Q,ve){return mt(He(Y,ce.length-Q),ce,Q,ve)}function ae(ce,Y,Q,ve){return mt(Ze(Y),ce,Q,ve)}function ne(ce,Y,Q,ve){return mt(tt(Y),ce,Q,ve)}function Se(ce,Y,Q,ve){return mt(_t(Y,ce.length-Q),ce,Q,ve)}q.prototype.write=function(Y,Q,ve,fe){if(Q===void 0)fe="utf8",ve=this.length,Q=0;else if(ve===void 0&&typeof Q=="string")fe=Q,ve=this.length,Q=0;else if(isFinite(Q))Q=Q>>>0,isFinite(ve)?(ve=ve>>>0,fe===void 0&&(fe="utf8")):(fe=ve,ve=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-Q;if((ve===void 0||ve>U)&&(ve=U),Y.length>0&&(ve<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");fe||(fe="utf8");let G=!1;for(;;)switch(fe){case"hex":return pe(this,Y,Q,ve);case"utf8":case"utf-8":return be(this,Y,Q,ve);case"ascii":case"latin1":case"binary":return ae(this,Y,Q,ve);case"base64":return ne(this,Y,Q,ve);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,Y,Q,ve);default:if(G)throw new TypeError("Unknown encoding: "+fe);fe=(""+fe).toLowerCase(),G=!0}},q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ke(ce,Y,Q){return Y===0&&Q===ce.length?H.fromByteArray(ce):H.fromByteArray(ce.slice(Y,Q))}function Ie(ce,Y,Q){Q=Math.min(ce.length,Q);const ve=[];let fe=Y;for(;fe<Q;){const U=ce[fe];let G=null,re=U>239?4:U>223?3:U>191?2:1;if(fe+re<=Q){let K,ue,Ae,xe;switch(re){case 1:U<128&&(G=U);break;case 2:K=ce[fe+1],(K&192)===128&&(xe=(U&31)<<6|K&63,xe>127&&(G=xe));break;case 3:K=ce[fe+1],ue=ce[fe+2],(K&192)===128&&(ue&192)===128&&(xe=(U&15)<<12|(K&63)<<6|ue&63,xe>2047&&(xe<55296||xe>57343)&&(G=xe));break;case 4:K=ce[fe+1],ue=ce[fe+2],Ae=ce[fe+3],(K&192)===128&&(ue&192)===128&&(Ae&192)===128&&(xe=(U&15)<<18|(K&63)<<12|(ue&63)<<6|Ae&63,xe>65535&&xe<1114112&&(G=xe))}}G===null?(G=65533,re=1):G>65535&&(G-=65536,ve.push(G>>>10&1023|55296),G=56320|G&1023),ve.push(G),fe+=re}return Ue(ve)}const Oe=4096;function Ue(ce){const Y=ce.length;if(Y<=Oe)return String.fromCharCode.apply(String,ce);let Q="",ve=0;for(;ve<Y;)Q+=String.fromCharCode.apply(String,ce.slice(ve,ve+=Oe));return Q}function De(ce,Y,Q){let ve="";Q=Math.min(ce.length,Q);for(let fe=Y;fe<Q;++fe)ve+=String.fromCharCode(ce[fe]&127);return ve}function $e(ce,Y,Q){let ve="";Q=Math.min(ce.length,Q);for(let fe=Y;fe<Q;++fe)ve+=String.fromCharCode(ce[fe]);return ve}function je(ce,Y,Q){const ve=ce.length;(!Y||Y<0)&&(Y=0),(!Q||Q<0||Q>ve)&&(Q=ve);let fe="";for(let U=Y;U<Q;++U)fe+=lt[ce[U]];return fe}function Ye(ce,Y,Q){const ve=ce.slice(Y,Q);let fe="";for(let U=0;U<ve.length-1;U+=2)fe+=String.fromCharCode(ve[U]+ve[U+1]*256);return fe}q.prototype.slice=function(Y,Q){const ve=this.length;Y=~~Y,Q=Q===void 0?ve:~~Q,Y<0?(Y+=ve,Y<0&&(Y=0)):Y>ve&&(Y=ve),Q<0?(Q+=ve,Q<0&&(Q=0)):Q>ve&&(Q=ve),Q<Y&&(Q=Y);const fe=this.subarray(Y,Q);return Object.setPrototypeOf(fe,q.prototype),fe};function st(ce,Y,Q){if(ce%1!==0||ce<0)throw new RangeError("offset is not uint");if(ce+Y>Q)throw new RangeError("Trying to access beyond buffer length")}q.prototype.readUintLE=q.prototype.readUIntLE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y],U=1,G=0;for(;++G<Q&&(U*=256);)fe+=this[Y+G]*U;return fe},q.prototype.readUintBE=q.prototype.readUIntBE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y+--Q],U=1;for(;Q>0&&(U*=256);)fe+=this[Y+--Q]*U;return fe},q.prototype.readUint8=q.prototype.readUInt8=function(Y,Q){return Y=Y>>>0,Q||st(Y,1,this.length),this[Y]},q.prototype.readUint16LE=q.prototype.readUInt16LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,2,this.length),this[Y]|this[Y+1]<<8},q.prototype.readUint16BE=q.prototype.readUInt16BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,2,this.length),this[Y]<<8|this[Y+1]},q.prototype.readUint32LE=q.prototype.readUInt32LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),(this[Y]|this[Y+1]<<8|this[Y+2]<<16)+this[Y+3]*16777216},q.prototype.readUint32BE=q.prototype.readUInt32BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]*16777216+(this[Y+1]<<16|this[Y+2]<<8|this[Y+3])},q.prototype.readBigUInt64LE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=Q+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24,U=this[++Y]+this[++Y]*2**8+this[++Y]*2**16+ve*2**24;return BigInt(fe)+(BigInt(U)<<BigInt(32))}),q.prototype.readBigUInt64BE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=Q*2**24+this[++Y]*2**16+this[++Y]*2**8+this[++Y],U=this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ve;return(BigInt(fe)<<BigInt(32))+BigInt(U)}),q.prototype.readIntLE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y],U=1,G=0;for(;++G<Q&&(U*=256);)fe+=this[Y+G]*U;return U*=128,fe>=U&&(fe-=Math.pow(2,8*Q)),fe},q.prototype.readIntBE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=Q,U=1,G=this[Y+--fe];for(;fe>0&&(U*=256);)G+=this[Y+--fe]*U;return U*=128,G>=U&&(G-=Math.pow(2,8*Q)),G},q.prototype.readInt8=function(Y,Q){return Y=Y>>>0,Q||st(Y,1,this.length),this[Y]&128?(255-this[Y]+1)*-1:this[Y]},q.prototype.readInt16LE=function(Y,Q){Y=Y>>>0,Q||st(Y,2,this.length);const ve=this[Y]|this[Y+1]<<8;return ve&32768?ve|4294901760:ve},q.prototype.readInt16BE=function(Y,Q){Y=Y>>>0,Q||st(Y,2,this.length);const ve=this[Y+1]|this[Y]<<8;return ve&32768?ve|4294901760:ve},q.prototype.readInt32LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]|this[Y+1]<<8|this[Y+2]<<16|this[Y+3]<<24},q.prototype.readInt32BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]<<24|this[Y+1]<<16|this[Y+2]<<8|this[Y+3]},q.prototype.readBigInt64LE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=this[Y+4]+this[Y+5]*2**8+this[Y+6]*2**16+(ve<<24);return(BigInt(fe)<<BigInt(32))+BigInt(Q+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24)}),q.prototype.readBigInt64BE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=(Q<<24)+this[++Y]*2**16+this[++Y]*2**8+this[++Y];return(BigInt(fe)<<BigInt(32))+BigInt(this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ve)}),q.prototype.readFloatLE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),V.read(this,Y,!0,23,4)},q.prototype.readFloatBE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),V.read(this,Y,!1,23,4)},q.prototype.readDoubleLE=function(Y,Q){return Y=Y>>>0,Q||st(Y,8,this.length),V.read(this,Y,!0,52,8)},q.prototype.readDoubleBE=function(Y,Q){return Y=Y>>>0,Q||st(Y,8,this.length),V.read(this,Y,!1,52,8)};function Je(ce,Y,Q,ve,fe,U){if(!q.isBuffer(ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Y>fe||Y<U)throw new RangeError('"value" argument is out of bounds');if(Q+ve>ce.length)throw new RangeError("Index out of range")}q.prototype.writeUintLE=q.prototype.writeUIntLE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,ve=ve>>>0,!fe){const re=Math.pow(2,8*ve)-1;Je(this,Y,Q,ve,re,0)}let U=1,G=0;for(this[Q]=Y&255;++G<ve&&(U*=256);)this[Q+G]=Y/U&255;return Q+ve},q.prototype.writeUintBE=q.prototype.writeUIntBE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,ve=ve>>>0,!fe){const re=Math.pow(2,8*ve)-1;Je(this,Y,Q,ve,re,0)}let U=ve-1,G=1;for(this[Q+U]=Y&255;--U>=0&&(G*=256);)this[Q+U]=Y/G&255;return Q+ve},q.prototype.writeUint8=q.prototype.writeUInt8=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,1,255,0),this[Q]=Y&255,Q+1},q.prototype.writeUint16LE=q.prototype.writeUInt16LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,65535,0),this[Q]=Y&255,this[Q+1]=Y>>>8,Q+2},q.prototype.writeUint16BE=q.prototype.writeUInt16BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,65535,0),this[Q]=Y>>>8,this[Q+1]=Y&255,Q+2},q.prototype.writeUint32LE=q.prototype.writeUInt32LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,4294967295,0),this[Q+3]=Y>>>24,this[Q+2]=Y>>>16,this[Q+1]=Y>>>8,this[Q]=Y&255,Q+4},q.prototype.writeUint32BE=q.prototype.writeUInt32BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,4294967295,0),this[Q]=Y>>>24,this[Q+1]=Y>>>16,this[Q+2]=Y>>>8,this[Q+3]=Y&255,Q+4};function Ge(ce,Y,Q,ve,fe){ge(Y,ve,fe,ce,Q,7);let U=Number(Y&BigInt(4294967295));ce[Q++]=U,U=U>>8,ce[Q++]=U,U=U>>8,ce[Q++]=U,U=U>>8,ce[Q++]=U;let G=Number(Y>>BigInt(32)&BigInt(4294967295));return ce[Q++]=G,G=G>>8,ce[Q++]=G,G=G>>8,ce[Q++]=G,G=G>>8,ce[Q++]=G,Q}function ut(ce,Y,Q,ve,fe){ge(Y,ve,fe,ce,Q,7);let U=Number(Y&BigInt(4294967295));ce[Q+7]=U,U=U>>8,ce[Q+6]=U,U=U>>8,ce[Q+5]=U,U=U>>8,ce[Q+4]=U;let G=Number(Y>>BigInt(32)&BigInt(4294967295));return ce[Q+3]=G,G=G>>8,ce[Q+2]=G,G=G>>8,ce[Q+1]=G,G=G>>8,ce[Q]=G,Q+8}q.prototype.writeBigUInt64LE=Mt(function(Y,Q=0){return Ge(this,Y,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeBigUInt64BE=Mt(function(Y,Q=0){return ut(this,Y,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeIntLE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,!fe){const K=Math.pow(2,8*ve-1);Je(this,Y,Q,ve,K-1,-K)}let U=0,G=1,re=0;for(this[Q]=Y&255;++U<ve&&(G*=256);)Y<0&&re===0&&this[Q+U-1]!==0&&(re=1),this[Q+U]=(Y/G>>0)-re&255;return Q+ve},q.prototype.writeIntBE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,!fe){const K=Math.pow(2,8*ve-1);Je(this,Y,Q,ve,K-1,-K)}let U=ve-1,G=1,re=0;for(this[Q+U]=Y&255;--U>=0&&(G*=256);)Y<0&&re===0&&this[Q+U+1]!==0&&(re=1),this[Q+U]=(Y/G>>0)-re&255;return Q+ve},q.prototype.writeInt8=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,1,127,-128),Y<0&&(Y=255+Y+1),this[Q]=Y&255,Q+1},q.prototype.writeInt16LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,32767,-32768),this[Q]=Y&255,this[Q+1]=Y>>>8,Q+2},q.prototype.writeInt16BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,32767,-32768),this[Q]=Y>>>8,this[Q+1]=Y&255,Q+2},q.prototype.writeInt32LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,2147483647,-2147483648),this[Q]=Y&255,this[Q+1]=Y>>>8,this[Q+2]=Y>>>16,this[Q+3]=Y>>>24,Q+4},q.prototype.writeInt32BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,2147483647,-2147483648),Y<0&&(Y=4294967295+Y+1),this[Q]=Y>>>24,this[Q+1]=Y>>>16,this[Q+2]=Y>>>8,this[Q+3]=Y&255,Q+4},q.prototype.writeBigInt64LE=Mt(function(Y,Q=0){return Ge(this,Y,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),q.prototype.writeBigInt64BE=Mt(function(Y,Q=0){return ut(this,Y,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function gt(ce,Y,Q,ve,fe,U){if(Q+ve>ce.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function rt(ce,Y,Q,ve,fe){return Y=+Y,Q=Q>>>0,fe||gt(ce,Y,Q,4),V.write(ce,Y,Q,ve,23,4),Q+4}q.prototype.writeFloatLE=function(Y,Q,ve){return rt(this,Y,Q,!0,ve)},q.prototype.writeFloatBE=function(Y,Q,ve){return rt(this,Y,Q,!1,ve)};function wt(ce,Y,Q,ve,fe){return Y=+Y,Q=Q>>>0,fe||gt(ce,Y,Q,8),V.write(ce,Y,Q,ve,52,8),Q+8}q.prototype.writeDoubleLE=function(Y,Q,ve){return wt(this,Y,Q,!0,ve)},q.prototype.writeDoubleBE=function(Y,Q,ve){return wt(this,Y,Q,!1,ve)},q.prototype.copy=function(Y,Q,ve,fe){if(!q.isBuffer(Y))throw new TypeError("argument should be a Buffer");if(ve||(ve=0),!fe&&fe!==0&&(fe=this.length),Q>=Y.length&&(Q=Y.length),Q||(Q=0),fe>0&&fe<ve&&(fe=ve),fe===ve||Y.length===0||this.length===0)return 0;if(Q<0)throw new RangeError("targetStart out of bounds");if(ve<0||ve>=this.length)throw new RangeError("Index out of range");if(fe<0)throw new RangeError("sourceEnd out of bounds");fe>this.length&&(fe=this.length),Y.length-Q<fe-ve&&(fe=Y.length-Q+ve);const U=fe-ve;return this===Y&&typeof se.prototype.copyWithin=="function"?this.copyWithin(Q,ve,fe):se.prototype.set.call(Y,this.subarray(ve,fe),Q),U},q.prototype.fill=function(Y,Q,ve,fe){if(typeof Y=="string"){if(typeof Q=="string"?(fe=Q,Q=0,ve=this.length):typeof ve=="string"&&(fe=ve,ve=this.length),fe!==void 0&&typeof fe!="string")throw new TypeError("encoding must be a string");if(typeof fe=="string"&&!q.isEncoding(fe))throw new TypeError("Unknown encoding: "+fe);if(Y.length===1){const G=Y.charCodeAt(0);(fe==="utf8"&&G<128||fe==="latin1")&&(Y=G)}}else typeof Y=="number"?Y=Y&255:typeof Y=="boolean"&&(Y=Number(Y));if(Q<0||this.length<Q||this.length<ve)throw new RangeError("Out of range index");if(ve<=Q)return this;Q=Q>>>0,ve=ve===void 0?this.length:ve>>>0,Y||(Y=0);let U;if(typeof Y=="number")for(U=Q;U<ve;++U)this[U]=Y;else{const G=q.isBuffer(Y)?Y:q.from(Y,fe),re=G.length;if(re===0)throw new TypeError('The value "'+Y+'" is invalid for argument "value"');for(U=0;U<ve-Q;++U)this[U+Q]=G[U%re]}return this};const bt={};function le(ce,Y,Q){bt[ce]=class extends Q{constructor(){super(),Object.defineProperty(this,"message",{value:Y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ce}]`,this.stack,delete this.name}get code(){return ce}set code(fe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:fe,writable:!0})}toString(){return`${this.name} [${ce}]: ${this.message}`}}}le("ERR_BUFFER_OUT_OF_BOUNDS",function(ce){return ce?`${ce} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),le("ERR_INVALID_ARG_TYPE",function(ce,Y){return`The "${ce}" argument must be of type number. Received type ${typeof Y}`},TypeError),le("ERR_OUT_OF_RANGE",function(ce,Y,Q){let ve=`The value of "${ce}" is out of range.`,fe=Q;return Number.isInteger(Q)&&Math.abs(Q)>2**32?fe=Z(String(Q)):typeof Q=="bigint"&&(fe=String(Q),(Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))&&(fe=Z(fe)),fe+="n"),ve+=` It must be ${Y}. Received ${fe}`,ve},RangeError);function Z(ce){let Y="",Q=ce.length;const ve=ce[0]==="-"?1:0;for(;Q>=ve+4;Q-=3)Y=`_${ce.slice(Q-3,Q)}${Y}`;return`${ce.slice(0,Q)}${Y}`}function J(ce,Y,Q){Ee(Y,"offset"),(ce[Y]===void 0||ce[Y+Q]===void 0)&&Re(Y,ce.length-(Q+1))}function ge(ce,Y,Q,ve,fe,U){if(ce>Q||ce<Y){const G=typeof Y=="bigint"?"n":"";let re;throw Y===0||Y===BigInt(0)?re=`>= 0${G} and < 2${G} ** ${(U+1)*8}${G}`:re=`>= -(2${G} ** ${(U+1)*8-1}${G}) and < 2 ** ${(U+1)*8-1}${G}`,new bt.ERR_OUT_OF_RANGE("value",re,ce)}J(ve,fe,U)}function Ee(ce,Y){if(typeof ce!="number")throw new bt.ERR_INVALID_ARG_TYPE(Y,"number",ce)}function Re(ce,Y,Q){throw Math.floor(ce)!==ce?(Ee(ce,Q),new bt.ERR_OUT_OF_RANGE("offset","an integer",ce)):Y<0?new bt.ERR_BUFFER_OUT_OF_BOUNDS:new bt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Y}`,ce)}const qe=/[^+/0-9A-Za-z-_]/g;function Xe(ce){if(ce=ce.split("=")[0],ce=ce.trim().replace(qe,""),ce.length<2)return"";for(;ce.length%4!==0;)ce=ce+"=";return ce}function He(ce,Y){Y=Y||1/0;let Q;const ve=ce.length;let fe=null;const U=[];for(let G=0;G<ve;++G){if(Q=ce.charCodeAt(G),Q>55295&&Q<57344){if(!fe){if(Q>56319){(Y-=3)>-1&&U.push(239,191,189);continue}else if(G+1===ve){(Y-=3)>-1&&U.push(239,191,189);continue}fe=Q;continue}if(Q<56320){(Y-=3)>-1&&U.push(239,191,189),fe=Q;continue}Q=(fe-55296<<10|Q-56320)+65536}else fe&&(Y-=3)>-1&&U.push(239,191,189);if(fe=null,Q<128){if((Y-=1)<0)break;U.push(Q)}else if(Q<2048){if((Y-=2)<0)break;U.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((Y-=3)<0)break;U.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((Y-=4)<0)break;U.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return U}function Ze(ce){const Y=[];for(let Q=0;Q<ce.length;++Q)Y.push(ce.charCodeAt(Q)&255);return Y}function _t(ce,Y){let Q,ve,fe;const U=[];for(let G=0;G<ce.length&&!((Y-=2)<0);++G)Q=ce.charCodeAt(G),ve=Q>>8,fe=Q%256,U.push(fe),U.push(ve);return U}function tt(ce){return H.toByteArray(Xe(ce))}function mt(ce,Y,Q,ve){let fe;for(fe=0;fe<ve&&!(fe+Q>=Y.length||fe>=ce.length);++fe)Y[fe+Q]=ce[fe];return fe}function Tt(ce,Y){return ce instanceof Y||ce!=null&&ce.constructor!=null&&ce.constructor.name!=null&&ce.constructor.name===Y.name}function St(ce){return ce!==ce}const lt=(function(){const ce="0123456789abcdef",Y=new Array(256);for(let Q=0;Q<16;++Q){const ve=Q*16;for(let fe=0;fe<16;++fe)Y[ve+fe]=ce[Q]+ce[fe]}return Y})();function Mt(ce){return typeof BigInt>"u"?Ct:ce}function Ct(){throw new Error("BigInt not supported")}})(f);const O=f.Buffer;r.Blob=f.Blob,r.BlobOptions=f.BlobOptions,r.Buffer=f.Buffer,r.File=f.File,r.FileOptions=f.FileOptions,r.INSPECT_MAX_BYTES=f.INSPECT_MAX_BYTES,r.SlowBuffer=f.SlowBuffer,r.TranscodeEncoding=f.TranscodeEncoding,r.atob=f.atob,r.btoa=f.btoa,r.constants=f.constants,r.default=O,r.isAscii=f.isAscii,r.isUtf8=f.isUtf8,r.kMaxLength=f.kMaxLength,r.kStringMaxLength=f.kStringMaxLength,r.resolveObjectURL=f.resolveObjectURL,r.transcode=f.transcode})(dist)),dist}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(r,f){var d=requireDist(),g=d.Buffer;function v(w,_){for(var S in w)_[S]=w[S]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?r.exports=d:(v(d,f),f.Buffer=m);function m(w,_,S){return g(w,_,S)}m.prototype=Object.create(g.prototype),v(g,m),m.from=function(w,_,S){if(typeof w=="number")throw new TypeError("Argument must not be a number");return g(w,_,S)},m.alloc=function(w,_,S){if(typeof w!="number")throw new TypeError("Argument must be a number");var x=g(w);return _!==void 0?typeof S=="string"?x.fill(_,S):x.fill(_):x.fill(0),x},m.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return g(w)},m.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(w)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var r=65536,f=4294967295;function d(){throw new Error(`Secure random number generation is not supported by this browser.
17
+ Use Chrome, Firefox or Internet Explorer 11`)}var g=requireSafeBuffer$1().Buffer,v=commonjsGlobal.crypto||commonjsGlobal.msCrypto;v&&v.getRandomValues?browser$b.exports=m:browser$b.exports=d;function m(w,_){if(w>f)throw new RangeError("requested too many random bytes");var S=g.allocUnsafe(w);if(w>0)if(w>r)for(var x=0;x<w;x+=r)v.getRandomValues(S.slice(x,x+r));else v.getRandomValues(S);return typeof _=="function"?process$1.nextTick(function(){_(null,S)}):S}return browser$b.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(f,d){d&&(f.super_=d,f.prototype=Object.create(d.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(f,d){if(d){f.super_=d;var g=function(){};g.prototype=d.prototype,f.prototype=new g,f.prototype.constructor=f}}),inherits_browser.exports}var readableBrowser$1={exports:{}},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var r=typeof Reflect=="object"?Reflect:null,f=r&&typeof r.apply=="function"?r.apply:function(X,oe,se){return Function.prototype.apply.call(X,oe,se)},d;r&&typeof r.ownKeys=="function"?d=r.ownKeys:Object.getOwnPropertySymbols?d=function(X){return Object.getOwnPropertyNames(X).concat(Object.getOwnPropertySymbols(X))}:d=function(X){return Object.getOwnPropertyNames(X)};function g(V){}var v=Number.isNaN||function(X){return X!==X};function m(){m.init.call(this)}events.exports=m,events.exports.once=O,m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var w=10;function _(V){if(typeof V!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof V)}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return w},set:function(V){if(typeof V!="number"||V<0||v(V))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+V+".");w=V}}),m.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},m.prototype.setMaxListeners=function(X){if(typeof X!="number"||X<0||v(X))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+X+".");return this._maxListeners=X,this};function S(V){return V._maxListeners===void 0?m.defaultMaxListeners:V._maxListeners}m.prototype.getMaxListeners=function(){return S(this)},m.prototype.emit=function(X){for(var oe=[],se=1;se<arguments.length;se++)oe.push(arguments[se]);var de=X==="error",he=this._events;if(he!==void 0)de=de&&he.error===void 0;else if(!de)return!1;if(de){var we;if(oe.length>0&&(we=oe[0]),we instanceof Error)throw we;var te=new Error("Unhandled error."+(we?" ("+we.message+")":""));throw te.context=we,te}var q=he[X];if(q===void 0)return!1;if(typeof q=="function")f(q,this,oe);else for(var k=q.length,y=A(q,k),se=0;se<k;++se)f(y[se],this,oe);return!0};function x(V,X,oe,se){var de,he,we;if(_(oe),he=V._events,he===void 0?(he=V._events=Object.create(null),V._eventsCount=0):(he.newListener!==void 0&&(V.emit("newListener",X,oe.listener?oe.listener:oe),he=V._events),we=he[X]),we===void 0)we=he[X]=oe,++V._eventsCount;else if(typeof we=="function"?we=he[X]=se?[oe,we]:[we,oe]:se?we.unshift(oe):we.push(oe),de=S(V),de>0&&we.length>de&&!we.warned){we.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(X)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=V,te.type=X,te.count=we.length}return V}m.prototype.addListener=function(X,oe){return x(this,X,oe,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(X,oe){return x(this,X,oe,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(V,X,oe){var se={fired:!1,wrapFn:void 0,target:V,type:X,listener:oe},de=b.bind(se);return de.listener=oe,se.wrapFn=de,de}m.prototype.once=function(X,oe){return _(oe),this.on(X,C(this,X,oe)),this},m.prototype.prependOnceListener=function(X,oe){return _(oe),this.prependListener(X,C(this,X,oe)),this},m.prototype.removeListener=function(X,oe){var se,de,he,we,te;if(_(oe),de=this._events,de===void 0)return this;if(se=de[X],se===void 0)return this;if(se===oe||se.listener===oe)--this._eventsCount===0?this._events=Object.create(null):(delete de[X],de.removeListener&&this.emit("removeListener",X,se.listener||oe));else if(typeof se!="function"){for(he=-1,we=se.length-1;we>=0;we--)if(se[we]===oe||se[we].listener===oe){te=se[we].listener,he=we;break}if(he<0)return this;he===0?se.shift():T(se,he),se.length===1&&(de[X]=se[0]),de.removeListener!==void 0&&this.emit("removeListener",X,te||oe)}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(X){var oe,se,de;if(se=this._events,se===void 0)return this;if(se.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):se[X]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete se[X]),this;if(arguments.length===0){var he=Object.keys(se),we;for(de=0;de<he.length;++de)we=he[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(oe=se[X],typeof oe=="function")this.removeListener(X,oe);else if(oe!==void 0)for(de=oe.length-1;de>=0;de--)this.removeListener(X,oe[de]);return this};function E(V,X,oe){var se=V._events;if(se===void 0)return[];var de=se[X];return de===void 0?[]:typeof de=="function"?oe?[de.listener||de]:[de]:oe?L(de):A(de,de.length)}m.prototype.listeners=function(X){return E(this,X,!0)},m.prototype.rawListeners=function(X){return E(this,X,!1)},m.listenerCount=function(V,X){return typeof V.listenerCount=="function"?V.listenerCount(X):M.call(V,X)},m.prototype.listenerCount=M;function M(V){var X=this._events;if(X!==void 0){var oe=X[V];if(typeof oe=="function")return 1;if(oe!==void 0)return oe.length}return 0}m.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function A(V,X){for(var oe=new Array(X),se=0;se<X;++se)oe[se]=V[se];return oe}function T(V,X){for(;X+1<V.length;X++)V[X]=V[X+1];V.pop()}function L(V){for(var X=new Array(V.length),oe=0;oe<X.length;++oe)X[oe]=V[oe].listener||V[oe];return X}function O(V,X){return new Promise(function(oe,se){function de(we){V.removeListener(X,he),se(we)}function he(){typeof V.removeListener=="function"&&V.removeListener("error",de),oe([].slice.call(arguments))}H(V,X,he,{once:!0}),X!=="error"&&N(V,de,{once:!0})})}function N(V,X,oe){typeof V.on=="function"&&H(V,"error",X,oe)}function H(V,X,oe,se){if(typeof V.on=="function")se.once?V.once(X,oe):V.on(X,oe);else if(typeof V.addEventListener=="function")V.addEventListener(X,function de(he){se.once&&V.removeEventListener(X,de),oe(he)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof V)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$1={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var f={},d=Symbol("test"),g=Object(d);if(typeof d=="string"||Object.prototype.toString.call(d)!=="[object Symbol]"||Object.prototype.toString.call(g)!=="[object Symbol]")return!1;var v=42;f[d]=v;for(var m in f)return!1;if(typeof Object.keys=="function"&&Object.keys(f).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(f).length!==0)return!1;var w=Object.getOwnPropertySymbols(f);if(w.length!==1||w[0]!==d||!Object.prototype.propertyIsEnumerable.call(f,d))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var _=Object.getOwnPropertyDescriptor(f,d);if(_.value!==v||_.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var r=requireShams$1();return shams=function(){return r()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max$1,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max$1=Math.max),max$1}var min$1,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min$1=Math.min),min$1}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round$1,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round$1=Math.round),round$1}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(f){return f!==f}),_isNaN}var sign$1,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var r=require_isNaN();return sign$1=function(d){return r(d)||d===0?d:d<0?-1:1},sign$1}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var r=requireGOPD();if(r)try{r([],"length")}catch{r=null}return gopd=r,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return esDefineProperty=r,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var r=typeof Symbol<"u"&&Symbol,f=requireShams$1();return hasSymbols=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:f()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var r=requireEsObjectAtoms();return Object_getPrototypeOf=r.getPrototypeOf||null,Object_getPrototypeOf}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var r="Function.prototype.bind called on incompatible ",f=Object.prototype.toString,d=Math.max,g="[object Function]",v=function(S,x){for(var b=[],C=0;C<S.length;C+=1)b[C]=S[C];for(var E=0;E<x.length;E+=1)b[E+S.length]=x[E];return b},m=function(S,x){for(var b=[],C=x,E=0;C<S.length;C+=1,E+=1)b[E]=S[C];return b},w=function(_,S){for(var x="",b=0;b<_.length;b+=1)x+=_[b],b+1<_.length&&(x+=S);return x};return implementation=function(S){var x=this;if(typeof x!="function"||f.apply(x)!==g)throw new TypeError(r+x);for(var b=m(arguments,1),C,E=function(){if(this instanceof C){var O=x.apply(this,v(b,arguments));return Object(O)===O?O:this}return x.apply(S,v(b,arguments))},M=d(0,x.length-b.length),A=[],T=0;T<M;T++)A[T]="$"+T;if(C=Function("binder","return function ("+w(A,",")+"){ return binder.apply(this,arguments); }")(E),x.prototype){var L=function(){};L.prototype=x.prototype,C.prototype=new L,L.prototype=null}return C},implementation}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var r=requireImplementation();return functionBind=Function.prototype.bind||r,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var r=requireFunctionBind(),f=requireFunctionApply(),d=requireFunctionCall(),g=requireReflectApply();return actualApply=g||r.call(d,f),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var r=requireFunctionBind(),f=requireType(),d=requireFunctionCall(),g=requireActualApply();return callBindApplyHelpers=function(m){if(m.length<1||typeof m[0]!="function")throw new f("a function is required");return g(r,d,m)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var r=requireCallBindApplyHelpers(),f=requireGopd(),d;try{d=[].__proto__===Array.prototype}catch(w){if(!w||typeof w!="object"||!("code"in w)||w.code!=="ERR_PROTO_ACCESS")throw w}var g=!!d&&f&&f(Object.prototype,"__proto__"),v=Object,m=v.getPrototypeOf;return get=g&&typeof g.get=="function"?r([g.get]):typeof m=="function"?function(_){return m(_==null?_:v(_))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var r=requireReflect_getPrototypeOf(),f=requireObject_getPrototypeOf(),d=requireGet();return getProto=r?function(v){return r(v)}:f?function(v){if(!v||typeof v!="object"&&typeof v!="function")throw new TypeError("getProto: not an object");return f(v)}:d?function(v){return d(v)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var r=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=requireFunctionBind();return hasown=d.call(r,f),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var r,f=requireEsObjectAtoms(),d=requireEsErrors(),g=require_eval(),v=requireRange(),m=requireRef(),w=requireSyntax(),_=requireType(),S=requireUri(),x=requireAbs(),b=requireFloor(),C=requireMax(),E=requireMin(),M=requirePow(),A=requireRound(),T=requireSign$1(),L=Function,O=function(pe){try{return L('"use strict"; return ('+pe+").constructor;")()}catch{}},N=requireGopd(),H=requireEsDefineProperty(),V=function(){throw new _},X=N?(function(){try{return arguments.callee,V}catch{try{return N(arguments,"callee").get}catch{return V}}})():V,oe=requireHasSymbols()(),se=requireGetProto(),de=requireObject_getPrototypeOf(),he=requireReflect_getPrototypeOf(),we=requireFunctionApply(),te=requireFunctionCall(),q={},k=typeof Uint8Array>"u"||!se?r:se(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":oe&&se?se([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":q,"%AsyncGenerator%":q,"%AsyncGeneratorFunction%":q,"%AsyncIteratorPrototype%":q,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":g,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":L,"%GeneratorFunction%":q,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":oe&&se?se(se([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!oe||!se?r:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":f,"%Object.getOwnPropertyDescriptor%":N,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":v,"%ReferenceError%":m,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!oe||!se?r:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":oe&&se?se(""[Symbol.iterator]()):r,"%Symbol%":oe?Symbol:r,"%SyntaxError%":w,"%ThrowTypeError%":X,"%TypedArray%":k,"%TypeError%":_,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":S,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":te,"%Function.prototype.apply%":we,"%Object.defineProperty%":H,"%Object.getPrototypeOf%":de,"%Math.abs%":x,"%Math.floor%":b,"%Math.max%":C,"%Math.min%":E,"%Math.pow%":M,"%Math.round%":A,"%Math.sign%":T,"%Reflect.getPrototypeOf%":he};if(se)try{null.error}catch(pe){var B=se(se(pe));y["%Error.prototype%"]=B}var $=function pe(be){var ae;if(be==="%AsyncFunction%")ae=O("async function () {}");else if(be==="%GeneratorFunction%")ae=O("function* () {}");else if(be==="%AsyncGeneratorFunction%")ae=O("async function* () {}");else if(be==="%AsyncGenerator%"){var ne=pe("%AsyncGeneratorFunction%");ne&&(ae=ne.prototype)}else if(be==="%AsyncIteratorPrototype%"){var Se=pe("%AsyncGenerator%");Se&&se&&(ae=se(Se.prototype))}return y[be]=ae,ae},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=requireFunctionBind(),j=requireHasown(),D=F.call(te,Array.prototype.concat),W=F.call(we,Array.prototype.splice),R=F.call(te,String.prototype.replace),z=F.call(te,String.prototype.slice),ye=F.call(te,RegExp.prototype.exec),Ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,me=/\\(\\)?/g,ie=function(be){var ae=z(be,0,1),ne=z(be,-1);if(ae==="%"&&ne!=="%")throw new w("invalid intrinsic syntax, expected closing `%`");if(ne==="%"&&ae!=="%")throw new w("invalid intrinsic syntax, expected opening `%`");var Se=[];return R(be,Ce,function(ke,Ie,Oe,Ue){Se[Se.length]=Oe?R(Ue,me,"$1"):Ie||ke}),Se},ee=function(be,ae){var ne=be,Se;if(j(I,ne)&&(Se=I[ne],ne="%"+Se[0]+"%"),j(y,ne)){var ke=y[ne];if(ke===q&&(ke=$(ne)),typeof ke>"u"&&!ae)throw new _("intrinsic "+be+" exists, but is not available. Please file an issue!");return{alias:Se,name:ne,value:ke}}throw new w("intrinsic "+be+" does not exist!")};return getIntrinsic=function(be,ae){if(typeof be!="string"||be.length===0)throw new _("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ae!="boolean")throw new _('"allowMissing" argument must be a boolean');if(ye(/^%?[^%]*%?$/,be)===null)throw new w("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ne=ie(be),Se=ne.length>0?ne[0]:"",ke=ee("%"+Se+"%",ae),Ie=ke.name,Oe=ke.value,Ue=!1,De=ke.alias;De&&(Se=De[0],W(ne,D([0,1],De)));for(var $e=1,je=!0;$e<ne.length;$e+=1){var Ye=ne[$e],st=z(Ye,0,1),Je=z(Ye,-1);if((st==='"'||st==="'"||st==="`"||Je==='"'||Je==="'"||Je==="`")&&st!==Je)throw new w("property names with quotes must have matching quotes");if((Ye==="constructor"||!je)&&(Ue=!0),Se+="."+Ye,Ie="%"+Se+"%",j(y,Ie))Oe=y[Ie];else if(Oe!=null){if(!(Ye in Oe)){if(!ae)throw new _("base intrinsic for "+be+" exists, but the property is not available.");return}if(N&&$e+1>=ne.length){var Ge=N(Oe,Ye);je=!!Ge,je&&"get"in Ge&&!("originalValue"in Ge.get)?Oe=Ge.get:Oe=Oe[Ye]}else je=j(Oe,Ye),Oe=Oe[Ye];je&&!Ue&&(y[Ie]=Oe)}}return Oe},getIntrinsic}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var r=requireGetIntrinsic(),f=requireCallBindApplyHelpers(),d=f([r("%String.prototype.indexOf%")]);return callBound=function(v,m){var w=r(v,!!m);return typeof w=="function"&&d(v,".prototype.")>-1?f([w]):w},callBound}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var r=requireShams()(),f=requireCallBound(),d=f("Object.prototype.toString"),g=function(_){return r&&_&&typeof _=="object"&&Symbol.toStringTag in _?!1:d(_)==="[object Arguments]"},v=function(_){return g(_)?!0:_!==null&&typeof _=="object"&&"length"in _&&typeof _.length=="number"&&_.length>=0&&d(_)!=="[object Array]"&&"callee"in _&&d(_.callee)==="[object Function]"},m=(function(){return g(arguments)})();return g.isLegacyArguments=v,isArguments=m?g:v,isArguments}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var r=requireCallBound(),f=requireShams()(),d=requireHasown(),g=requireGopd(),v;if(f){var m=r("RegExp.prototype.exec"),w={},_=function(){throw w},S={toString:_,valueOf:_};typeof Symbol.toPrimitive=="symbol"&&(S[Symbol.toPrimitive]=_),v=function(E){if(!E||typeof E!="object")return!1;var M=g(E,"lastIndex"),A=M&&d(M,"value");if(!A)return!1;try{m(E,S)}catch(T){return T===w}}}else{var x=r("Object.prototype.toString"),b="[object RegExp]";v=function(E){return!E||typeof E!="object"&&typeof E!="function"?!1:x(E)===b}}return isRegex=v,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var r=requireCallBound(),f=requireIsRegex(),d=r("RegExp.prototype.exec"),g=requireType();return safeRegexTest=function(m){if(!f(m))throw new g("`regex` must be a RegExp");return function(_){return d(m,_)!==null}},safeRegexTest}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var r=requireCallBound(),f=requireSafeRegexTest(),d=f(/^\s*(?:function)?\*/),g=requireShams()(),v=requireGetProto(),m=r("Object.prototype.toString"),w=r("Function.prototype.toString"),_=function(){if(!g)return!1;try{return Function("return function*() {}")()}catch{}},S;return isGeneratorFunction=function(b){if(typeof b!="function")return!1;if(d(w(b)))return!0;if(!g){var C=m(b);return C==="[object GeneratorFunction]"}if(!v)return!1;if(typeof S>"u"){var E=_();S=E?v(E):!1}return v(b)===S},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var r=Function.prototype.toString,f=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,d,g;if(typeof f=="function"&&typeof Object.defineProperty=="function")try{d=Object.defineProperty({},"length",{get:function(){throw g}}),g={},f(function(){throw 42},null,d)}catch(N){N!==g&&(f=null)}else f=null;var v=/^\s*class\b/,m=function(H){try{var V=r.call(H);return v.test(V)}catch{return!1}},w=function(H){try{return m(H)?!1:(r.call(H),!0)}catch{return!1}},_=Object.prototype.toString,S="[object Object]",x="[object Function]",b="[object GeneratorFunction]",C="[object HTMLAllCollection]",E="[object HTML document.all class]",M="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,T=!(0 in[,]),L=function(){return!1};if(typeof document=="object"){var O=document.all;_.call(O)===_.call(document.all)&&(L=function(H){if((T||!H)&&(typeof H>"u"||typeof H=="object"))try{var V=_.call(H);return(V===C||V===E||V===M||V===S)&&H("")==null}catch{}return!1})}return isCallable=f?function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;try{f(H,null,d)}catch(V){if(V!==g)return!1}return!m(H)&&w(H)}:function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;if(A)return w(H);if(m(H))return!1;var V=_.call(H);return V!==x&&V!==b&&!/^\[object HTML/.test(V)?!1:w(H)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var r=requireIsCallable(),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty,g=function(S,x,b){for(var C=0,E=S.length;C<E;C++)d.call(S,C)&&(b==null?x(S[C],C,S):x.call(b,S[C],C,S))},v=function(S,x,b){for(var C=0,E=S.length;C<E;C++)b==null?x(S.charAt(C),C,S):x.call(b,S.charAt(C),C,S)},m=function(S,x,b){for(var C in S)d.call(S,C)&&(b==null?x(S[C],C,S):x.call(b,S[C],C,S))};function w(_){return f.call(_)==="[object Array]"}return forEach=function(S,x,b){if(!r(x))throw new TypeError("iterator must be a function");var C;arguments.length>=3&&(C=b),w(S)?g(S,x,C):typeof S=="string"?v(S,x,C):m(S,x,C)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var r=requirePossibleTypedArrayNames(),f=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var g=[],v=0;v<r.length;v++)typeof f[r[v]]=="function"&&(g[g.length]=r[v]);return g},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var r=requireEsDefineProperty(),f=requireSyntax(),d=requireType(),g=requireGopd();return defineDataProperty=function(m,w,_){if(!m||typeof m!="object"&&typeof m!="function")throw new d("`obj` must be an object or a function`");if(typeof w!="string"&&typeof w!="symbol")throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new d("`loose`, if provided, must be a boolean");var S=arguments.length>3?arguments[3]:null,x=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,C=arguments.length>6?arguments[6]:!1,E=!!g&&g(m,w);if(r)r(m,w,{configurable:b===null&&E?E.configurable:!b,enumerable:S===null&&E?E.enumerable:!S,value:_,writable:x===null&&E?E.writable:!x});else if(C||!S&&!x&&!b)m[w]=_;else throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var r=requireEsDefineProperty(),f=function(){return!!r};return f.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=f,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var r=requireGetIntrinsic(),f=requireDefineDataProperty(),d=requireHasPropertyDescriptors()(),g=requireGopd(),v=requireType(),m=r("%Math.floor%");return setFunctionLength=function(_,S){if(typeof _!="function")throw new v("`fn` is not a function");if(typeof S!="number"||S<0||S>4294967295||m(S)!==S)throw new v("`length` must be a positive 32-bit integer");var x=arguments.length>2&&!!arguments[2],b=!0,C=!0;if("length"in _&&g){var E=g(_,"length");E&&!E.configurable&&(b=!1),E&&!E.writable&&(C=!1)}return(b||C||!x)&&(d?f(_,"length",S,!0,!0):f(_,"length",S)),_},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var r=requireFunctionBind(),f=requireFunctionApply(),d=requireActualApply();return applyBind=function(){return d(r,f,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(r){var f=requireSetFunctionLength(),d=requireEsDefineProperty(),g=requireCallBindApplyHelpers(),v=requireApplyBind();r.exports=function(w){var _=g(arguments),S=w.length-(arguments.length-1);return f(_,1+(S>0?S:0),!0)},d?d(r.exports,"apply",{value:v}):r.exports.apply=v})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var r=requireForEach(),f=requireAvailableTypedArrays(),d=requireCallBind(),g=requireCallBound(),v=requireGopd(),m=requireGetProto(),w=g("Object.prototype.toString"),_=requireShams()(),S=typeof globalThis>"u"?commonjsGlobal:globalThis,x=f(),b=g("String.prototype.slice"),C=g("Array.prototype.indexOf",!0)||function(L,O){for(var N=0;N<L.length;N+=1)if(L[N]===O)return N;return-1},E={__proto__:null};_&&v&&m?r(x,function(T){var L=new S[T];if(Symbol.toStringTag in L&&m){var O=m(L),N=v(O,Symbol.toStringTag);if(!N&&O){var H=m(O);N=v(H,Symbol.toStringTag)}E["$"+T]=d(N.get)}}):r(x,function(T){var L=new S[T],O=L.slice||L.set;O&&(E["$"+T]=d(O))});var M=function(L){var O=!1;return r(E,function(N,H){if(!O)try{"$"+N(L)===H&&(O=b(H,1))}catch{}}),O},A=function(L){var O=!1;return r(E,function(N,H){if(!O)try{N(L),O=b(H,1)}catch{}}),O};return whichTypedArray=function(L){if(!L||typeof L!="object")return!1;if(!_){var O=b(w(L),8,-1);return C(x,O)>-1?O:O!=="Object"?!1:A(L)}return v?M(L):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var r=requireWhichTypedArray();return isTypedArray=function(d){return!!r(d)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,(function(r){var f=requireIsArguments(),d=requireIsGeneratorFunction(),g=requireWhichTypedArray(),v=requireIsTypedArray();function m($e){return $e.call.bind($e)}var w=typeof BigInt<"u",_=typeof Symbol<"u",S=m(Object.prototype.toString),x=m(Number.prototype.valueOf),b=m(String.prototype.valueOf),C=m(Boolean.prototype.valueOf);if(w)var E=m(BigInt.prototype.valueOf);if(_)var M=m(Symbol.prototype.valueOf);function A($e,je){if(typeof $e!="object")return!1;try{return je($e),!0}catch{return!1}}r.isArgumentsObject=f,r.isGeneratorFunction=d,r.isTypedArray=v;function T($e){return typeof Promise<"u"&&$e instanceof Promise||$e!==null&&typeof $e=="object"&&typeof $e.then=="function"&&typeof $e.catch=="function"}r.isPromise=T;function L($e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView($e):v($e)||z($e)}r.isArrayBufferView=L;function O($e){return g($e)==="Uint8Array"}r.isUint8Array=O;function N($e){return g($e)==="Uint8ClampedArray"}r.isUint8ClampedArray=N;function H($e){return g($e)==="Uint16Array"}r.isUint16Array=H;function V($e){return g($e)==="Uint32Array"}r.isUint32Array=V;function X($e){return g($e)==="Int8Array"}r.isInt8Array=X;function oe($e){return g($e)==="Int16Array"}r.isInt16Array=oe;function se($e){return g($e)==="Int32Array"}r.isInt32Array=se;function de($e){return g($e)==="Float32Array"}r.isFloat32Array=de;function he($e){return g($e)==="Float64Array"}r.isFloat64Array=he;function we($e){return g($e)==="BigInt64Array"}r.isBigInt64Array=we;function te($e){return g($e)==="BigUint64Array"}r.isBigUint64Array=te;function q($e){return S($e)==="[object Map]"}q.working=typeof Map<"u"&&q(new Map);function k($e){return typeof Map>"u"?!1:q.working?q($e):$e instanceof Map}r.isMap=k;function y($e){return S($e)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function B($e){return typeof Set>"u"?!1:y.working?y($e):$e instanceof Set}r.isSet=B;function $($e){return S($e)==="[object WeakMap]"}$.working=typeof WeakMap<"u"&&$(new WeakMap);function I($e){return typeof WeakMap>"u"?!1:$.working?$($e):$e instanceof WeakMap}r.isWeakMap=I;function F($e){return S($e)==="[object WeakSet]"}F.working=typeof WeakSet<"u"&&F(new WeakSet);function j($e){return F($e)}r.isWeakSet=j;function D($e){return S($e)==="[object ArrayBuffer]"}D.working=typeof ArrayBuffer<"u"&&D(new ArrayBuffer);function W($e){return typeof ArrayBuffer>"u"?!1:D.working?D($e):$e instanceof ArrayBuffer}r.isArrayBuffer=W;function R($e){return S($e)==="[object DataView]"}R.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&R(new DataView(new ArrayBuffer(1),0,1));function z($e){return typeof DataView>"u"?!1:R.working?R($e):$e instanceof DataView}r.isDataView=z;var ye=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ce($e){return S($e)==="[object SharedArrayBuffer]"}function me($e){return typeof ye>"u"?!1:(typeof Ce.working>"u"&&(Ce.working=Ce(new ye)),Ce.working?Ce($e):$e instanceof ye)}r.isSharedArrayBuffer=me;function ie($e){return S($e)==="[object AsyncFunction]"}r.isAsyncFunction=ie;function ee($e){return S($e)==="[object Map Iterator]"}r.isMapIterator=ee;function pe($e){return S($e)==="[object Set Iterator]"}r.isSetIterator=pe;function be($e){return S($e)==="[object Generator]"}r.isGeneratorObject=be;function ae($e){return S($e)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=ae;function ne($e){return A($e,x)}r.isNumberObject=ne;function Se($e){return A($e,b)}r.isStringObject=Se;function ke($e){return A($e,C)}r.isBooleanObject=ke;function Ie($e){return w&&A($e,E)}r.isBigIntObject=Ie;function Oe($e){return _&&A($e,M)}r.isSymbolObject=Oe;function Ue($e){return ne($e)||Se($e)||ke($e)||Ie($e)||Oe($e)}r.isBoxedPrimitive=Ue;function De($e){return typeof Uint8Array<"u"&&(W($e)||me($e))}r.isAnyArrayBuffer=De,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function($e){Object.defineProperty(r,$e,{enumerable:!1,value:function(){throw new Error($e+" is not supported in userland")}})})})(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(f){return f&&typeof f=="object"&&typeof f.copy=="function"&&typeof f.fill=="function"&&typeof f.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(r){var f=Object.getOwnPropertyDescriptors||function(z){for(var ye=Object.keys(z),Ce={},me=0;me<ye.length;me++)Ce[ye[me]]=Object.getOwnPropertyDescriptor(z,ye[me]);return Ce},d=/%[sdj%]/g;r.format=function(R){if(!X(R)){for(var z=[],ye=0;ye<arguments.length;ye++)z.push(w(arguments[ye]));return z.join(" ")}for(var ye=1,Ce=arguments,me=Ce.length,ie=String(R).replace(d,function(pe){if(pe==="%%")return"%";if(ye>=me)return pe;switch(pe){case"%s":return String(Ce[ye++]);case"%d":return Number(Ce[ye++]);case"%j":try{return JSON.stringify(Ce[ye++])}catch{return"[Circular]"}default:return pe}}),ee=Ce[ye];ye<me;ee=Ce[++ye])N(ee)||!he(ee)?ie+=" "+ee:ie+=" "+w(ee);return ie},r.deprecate=function(R,z){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return R;if(typeof process$1>"u")return function(){return r.deprecate(R,z).apply(this,arguments)};var ye=!1;function Ce(){if(!ye){if(process$1.throwDeprecation)throw new Error(z);process$1.traceDeprecation,ye=!0}return R.apply(this,arguments)}return Ce};var g={},v=/^$/;if(process$1.env.NODE_DEBUG){var m=process$1.env.NODE_DEBUG;m=m.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),v=new RegExp("^"+m+"$","i")}r.debuglog=function(R){if(R=R.toUpperCase(),!g[R])if(v.test(R)){var z=process$1.pid;g[R]=function(){var ye=r.format.apply(r,arguments)}}else g[R]=function(){};return g[R]};function w(R,z){var ye={seen:[],stylize:S};return arguments.length>=3&&(ye.depth=arguments[2]),arguments.length>=4&&(ye.colors=arguments[3]),O(z)?ye.showHidden=z:z&&r._extend(ye,z),se(ye.showHidden)&&(ye.showHidden=!1),se(ye.depth)&&(ye.depth=2),se(ye.colors)&&(ye.colors=!1),se(ye.customInspect)&&(ye.customInspect=!0),ye.colors&&(ye.stylize=_),b(ye,R,ye.depth)}r.inspect=w,w.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},w.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function _(R,z){var ye=w.styles[z];return ye?"\x1B["+w.colors[ye][0]+"m"+R+"\x1B["+w.colors[ye][1]+"m":R}function S(R,z){return R}function x(R){var z={};return R.forEach(function(ye,Ce){z[ye]=!0}),z}function b(R,z,ye){if(R.customInspect&&z&&q(z.inspect)&&z.inspect!==r.inspect&&!(z.constructor&&z.constructor.prototype===z)){var Ce=z.inspect(ye,R);return X(Ce)||(Ce=b(R,Ce,ye)),Ce}var me=C(R,z);if(me)return me;var ie=Object.keys(z),ee=x(ie);if(R.showHidden&&(ie=Object.getOwnPropertyNames(z)),te(z)&&(ie.indexOf("message")>=0||ie.indexOf("description")>=0))return E(z);if(ie.length===0){if(q(z)){var pe=z.name?": "+z.name:"";return R.stylize("[Function"+pe+"]","special")}if(de(z))return R.stylize(RegExp.prototype.toString.call(z),"regexp");if(we(z))return R.stylize(Date.prototype.toString.call(z),"date");if(te(z))return E(z)}var be="",ae=!1,ne=["{","}"];if(L(z)&&(ae=!0,ne=["[","]"]),q(z)){var Se=z.name?": "+z.name:"";be=" [Function"+Se+"]"}if(de(z)&&(be=" "+RegExp.prototype.toString.call(z)),we(z)&&(be=" "+Date.prototype.toUTCString.call(z)),te(z)&&(be=" "+E(z)),ie.length===0&&(!ae||z.length==0))return ne[0]+be+ne[1];if(ye<0)return de(z)?R.stylize(RegExp.prototype.toString.call(z),"regexp"):R.stylize("[Object]","special");R.seen.push(z);var ke;return ae?ke=M(R,z,ye,ee,ie):ke=ie.map(function(Ie){return A(R,z,ye,ee,Ie,ae)}),R.seen.pop(),T(ke,be,ne)}function C(R,z){if(se(z))return R.stylize("undefined","undefined");if(X(z)){var ye="'"+JSON.stringify(z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return R.stylize(ye,"string")}if(V(z))return R.stylize(""+z,"number");if(O(z))return R.stylize(""+z,"boolean");if(N(z))return R.stylize("null","null")}function E(R){return"["+Error.prototype.toString.call(R)+"]"}function M(R,z,ye,Ce,me){for(var ie=[],ee=0,pe=z.length;ee<pe;++ee)F(z,String(ee))?ie.push(A(R,z,ye,Ce,String(ee),!0)):ie.push("");return me.forEach(function(be){be.match(/^\d+$/)||ie.push(A(R,z,ye,Ce,be,!0))}),ie}function A(R,z,ye,Ce,me,ie){var ee,pe,be;if(be=Object.getOwnPropertyDescriptor(z,me)||{value:z[me]},be.get?be.set?pe=R.stylize("[Getter/Setter]","special"):pe=R.stylize("[Getter]","special"):be.set&&(pe=R.stylize("[Setter]","special")),F(Ce,me)||(ee="["+me+"]"),pe||(R.seen.indexOf(be.value)<0?(N(ye)?pe=b(R,be.value,null):pe=b(R,be.value,ye-1),pe.indexOf(`
18
+ `)>-1&&(ie?pe=pe.split(`
19
+ `).map(function(ae){return" "+ae}).join(`
20
+ `).slice(2):pe=`
21
+ `+pe.split(`
22
+ `).map(function(ae){return" "+ae}).join(`
23
+ `))):pe=R.stylize("[Circular]","special")),se(ee)){if(ie&&me.match(/^\d+$/))return pe;ee=JSON.stringify(""+me),ee.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ee=ee.slice(1,-1),ee=R.stylize(ee,"name")):(ee=ee.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ee=R.stylize(ee,"string"))}return ee+": "+pe}function T(R,z,ye){var Ce=R.reduce(function(me,ie){return ie.indexOf(`
24
+ `)>=0,me+ie.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ce>60?ye[0]+(z===""?"":z+`
25
+ `)+" "+R.join(`,
26
+ `)+" "+ye[1]:ye[0]+z+" "+R.join(", ")+" "+ye[1]}r.types=requireTypes();function L(R){return Array.isArray(R)}r.isArray=L;function O(R){return typeof R=="boolean"}r.isBoolean=O;function N(R){return R===null}r.isNull=N;function H(R){return R==null}r.isNullOrUndefined=H;function V(R){return typeof R=="number"}r.isNumber=V;function X(R){return typeof R=="string"}r.isString=X;function oe(R){return typeof R=="symbol"}r.isSymbol=oe;function se(R){return R===void 0}r.isUndefined=se;function de(R){return he(R)&&y(R)==="[object RegExp]"}r.isRegExp=de,r.types.isRegExp=de;function he(R){return typeof R=="object"&&R!==null}r.isObject=he;function we(R){return he(R)&&y(R)==="[object Date]"}r.isDate=we,r.types.isDate=we;function te(R){return he(R)&&(y(R)==="[object Error]"||R instanceof Error)}r.isError=te,r.types.isNativeError=te;function q(R){return typeof R=="function"}r.isFunction=q;function k(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}r.isPrimitive=k,r.isBuffer=requireIsBufferBrowser();function y(R){return Object.prototype.toString.call(R)}function B(R){return R<10?"0"+R.toString(10):R.toString(10)}var $=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var R=new Date,z=[B(R.getHours()),B(R.getMinutes()),B(R.getSeconds())].join(":");return[R.getDate(),$[R.getMonth()],z].join(" ")}r.log=function(){},r.inherits=requireInherits_browser(),r._extend=function(R,z){if(!z||!he(z))return R;for(var ye=Object.keys(z),Ce=ye.length;Ce--;)R[ye[Ce]]=z[ye[Ce]];return R};function F(R,z){return Object.prototype.hasOwnProperty.call(R,z)}var j=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;r.promisify=function(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');if(j&&z[j]){var ye=z[j];if(typeof ye!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ye,j,{value:ye,enumerable:!1,writable:!1,configurable:!0}),ye}function ye(){for(var Ce,me,ie=new Promise(function(be,ae){Ce=be,me=ae}),ee=[],pe=0;pe<arguments.length;pe++)ee.push(arguments[pe]);ee.push(function(be,ae){be?me(be):Ce(ae)});try{z.apply(this,ee)}catch(be){me(be)}return ie}return Object.setPrototypeOf(ye,Object.getPrototypeOf(z)),j&&Object.defineProperty(ye,j,{value:ye,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ye,f(z))},r.promisify.custom=j;function D(R,z){if(!R){var ye=new Error("Promise was rejected with a falsy value");ye.reason=R,R=ye}return z(R)}function W(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');function z(){for(var ye=[],Ce=0;Ce<arguments.length;Ce++)ye.push(arguments[Ce]);var me=ye.pop();if(typeof me!="function")throw new TypeError("The last argument must be of type Function");var ie=this,ee=function(){return me.apply(ie,arguments)};R.apply(this,ye).then(function(pe){process$1.nextTick(ee.bind(null,null,pe))},function(pe){process$1.nextTick(D.bind(null,pe,ee))})}return Object.setPrototypeOf(z,Object.getPrototypeOf(R)),Object.defineProperties(z,f(R)),z}r.callbackify=W})(util$1)),util$1}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function r(A,T){var L=Object.keys(A);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(A);T&&(O=O.filter(function(N){return Object.getOwnPropertyDescriptor(A,N).enumerable})),L.push.apply(L,O)}return L}function f(A){for(var T=1;T<arguments.length;T++){var L=arguments[T]!=null?arguments[T]:{};T%2?r(Object(L),!0).forEach(function(O){d(A,O,L[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(L)):r(Object(L)).forEach(function(O){Object.defineProperty(A,O,Object.getOwnPropertyDescriptor(L,O))})}return A}function d(A,T,L){return T=w(T),T in A?Object.defineProperty(A,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):A[T]=L,A}function g(A,T){if(!(A instanceof T))throw new TypeError("Cannot call a class as a function")}function v(A,T){for(var L=0;L<T.length;L++){var O=T[L];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(A,w(O.key),O)}}function m(A,T,L){return T&&v(A.prototype,T),Object.defineProperty(A,"prototype",{writable:!1}),A}function w(A){var T=_(A,"string");return typeof T=="symbol"?T:String(T)}function _(A,T){if(typeof A!="object"||A===null)return A;var L=A[Symbol.toPrimitive];if(L!==void 0){var O=L.call(A,T);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}var S=requireDist(),x=S.Buffer,b=requireUtil$1(),C=b.inspect,E=C&&C.custom||"inspect";function M(A,T,L){x.prototype.copy.call(A,T,L)}return buffer_list=(function(){function A(){g(this,A),this.head=null,this.tail=null,this.length=0}return m(A,[{key:"push",value:function(L){var O={data:L,next:null};this.length>0?this.tail.next=O:this.head=O,this.tail=O,++this.length}},{key:"unshift",value:function(L){var O={data:L,next:this.head};this.length===0&&(this.tail=O),this.head=O,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var O=this.head,N=""+O.data;O=O.next;)N+=L+O.data;return N}},{key:"concat",value:function(L){if(this.length===0)return x.alloc(0);for(var O=x.allocUnsafe(L>>>0),N=this.head,H=0;N;)M(N.data,O,H),H+=N.data.length,N=N.next;return O}},{key:"consume",value:function(L,O){var N;return L<this.head.data.length?(N=this.head.data.slice(0,L),this.head.data=this.head.data.slice(L)):L===this.head.data.length?N=this.shift():N=O?this._getString(L):this._getBuffer(L),N}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(L){var O=this.head,N=1,H=O.data;for(L-=H.length;O=O.next;){var V=O.data,X=L>V.length?V.length:L;if(X===V.length?H+=V:H+=V.slice(0,L),L-=X,L===0){X===V.length?(++N,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=V.slice(X));break}++N}return this.length-=N,H}},{key:"_getBuffer",value:function(L){var O=x.allocUnsafe(L),N=this.head,H=1;for(N.data.copy(O),L-=N.data.length;N=N.next;){var V=N.data,X=L>V.length?V.length:L;if(V.copy(O,O.length-L,0,X),L-=X,L===0){X===V.length?(++H,N.next?this.head=N.next:this.head=this.tail=null):(this.head=N,N.data=V.slice(X));break}++H}return this.length-=H,O}},{key:E,value:function(L,O){return C(this,f(f({},O),{},{depth:0,customInspect:!1}))}}]),A})(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function r(w,_){var S=this,x=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return x||b?(_?_(w):w&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(v,this,w)):process$1.nextTick(v,this,w)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(w||null,function(C){!_&&C?S._writableState?S._writableState.errorEmitted?process$1.nextTick(d,S):(S._writableState.errorEmitted=!0,process$1.nextTick(f,S,C)):process$1.nextTick(f,S,C):_?(process$1.nextTick(d,S),_(C)):process$1.nextTick(d,S)}),this)}function f(w,_){v(w,_),d(w)}function d(w){w._writableState&&!w._writableState.emitClose||w._readableState&&!w._readableState.emitClose||w.emit("close")}function g(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(w,_){w.emit("error",_)}function m(w,_){var S=w._readableState,x=w._writableState;S&&S.autoDestroy||x&&x.autoDestroy?w.destroy(_):w.emit("error",_)}return destroy_1$1={destroy:r,undestroy:g,errorOrDestroy:m},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function r(_,S){_.prototype=Object.create(S.prototype),_.prototype.constructor=_,_.__proto__=S}var f={};function d(_,S,x){x||(x=Error);function b(E,M,A){return typeof S=="string"?S:S(E,M,A)}var C=(function(E){r(M,E);function M(A,T,L){return E.call(this,b(A,T,L))||this}return M})(x);C.prototype.name=x.name,C.prototype.code=_,f[_]=C}function g(_,S){if(Array.isArray(_)){var x=_.length;return _=_.map(function(b){return String(b)}),x>2?"one of ".concat(S," ").concat(_.slice(0,x-1).join(", "),", or ")+_[x-1]:x===2?"one of ".concat(S," ").concat(_[0]," or ").concat(_[1]):"of ".concat(S," ").concat(_[0])}else return"of ".concat(S," ").concat(String(_))}function v(_,S,x){return _.substr(0,S.length)===S}function m(_,S,x){return(x===void 0||x>_.length)&&(x=_.length),_.substring(x-S.length,x)===S}function w(_,S,x){return typeof x!="number"&&(x=0),x+S.length>_.length?!1:_.indexOf(S,x)!==-1}return d("ERR_INVALID_OPT_VALUE",function(_,S){return'The value "'+S+'" is invalid for option "'+_+'"'},TypeError),d("ERR_INVALID_ARG_TYPE",function(_,S,x){var b;typeof S=="string"&&v(S,"not ")?(b="must not be",S=S.replace(/^not /,"")):b="must be";var C;if(m(_," argument"))C="The ".concat(_," ").concat(b," ").concat(g(S,"type"));else{var E=w(_,".")?"property":"argument";C='The "'.concat(_,'" ').concat(E," ").concat(b," ").concat(g(S,"type"))}return C+=". Received type ".concat(typeof x),C},TypeError),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),d("ERR_METHOD_NOT_IMPLEMENTED",function(_){return"The "+_+" method is not implemented"}),d("ERR_STREAM_PREMATURE_CLOSE","Premature close"),d("ERR_STREAM_DESTROYED",function(_){return"Cannot call "+_+" after a stream was destroyed"}),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),d("ERR_STREAM_WRITE_AFTER_END","write after end"),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_UNKNOWN_ENCODING",function(_){return"Unknown encoding: "+_},TypeError),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=f,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var r=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function f(g,v,m){return g.highWaterMark!=null?g.highWaterMark:v?g[m]:null}function d(g,v,m,w){var _=f(v,w,m);if(_!=null){if(!(isFinite(_)&&Math.floor(_)===_)||_<0){var S=w?m:"highWaterMark";throw new r(S,_)}return Math.floor(_)}return g.objectMode?16:16*1024}return state={getHighWaterMark:d},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=r;function r(d,g){if(f("noDeprecation"))return d;var v=!1;function m(){if(!v){if(f("throwDeprecation"))throw new Error(g);f("traceDeprecation"),v=!0}return d.apply(this,arguments)}return m}function f(d){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var g=commonjsGlobal.localStorage[d];return g==null?!1:String(g).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=de;function r(me){var ie=this;this.next=null,this.entry=null,this.finish=function(){Ce(ie,me)}}var f;de.WritableState=oe;var d={deprecate:requireBrowser$a()},g=requireStreamBrowser$1(),v=requireDist().Buffer,m=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function w(me){return v.from(me)}function _(me){return v.isBuffer(me)||me instanceof m}var S=requireDestroy$1(),x=requireState(),b=x.getHighWaterMark,C=requireErrorsBrowser().codes,E=C.ERR_INVALID_ARG_TYPE,M=C.ERR_METHOD_NOT_IMPLEMENTED,A=C.ERR_MULTIPLE_CALLBACK,T=C.ERR_STREAM_CANNOT_PIPE,L=C.ERR_STREAM_DESTROYED,O=C.ERR_STREAM_NULL_VALUES,N=C.ERR_STREAM_WRITE_AFTER_END,H=C.ERR_UNKNOWN_ENCODING,V=S.errorOrDestroy;requireInherits_browser()(de,g);function X(){}function oe(me,ie,ee){f=f||require_stream_duplex$1(),me=me||{},typeof ee!="boolean"&&(ee=ie instanceof f),this.objectMode=!!me.objectMode,ee&&(this.objectMode=this.objectMode||!!me.writableObjectMode),this.highWaterMark=b(this,me,"writableHighWaterMark",ee),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var pe=me.decodeStrings===!1;this.decodeStrings=!pe,this.defaultEncoding=me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(be){$(ie,be)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=me.emitClose!==!1,this.autoDestroy=!!me.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}oe.prototype.getBuffer=function(){for(var ie=this.bufferedRequest,ee=[];ie;)ee.push(ie),ie=ie.next;return ee},(function(){try{Object.defineProperty(oe.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var se;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(se=Function.prototype[Symbol.hasInstance],Object.defineProperty(de,Symbol.hasInstance,{value:function(ie){return se.call(this,ie)?!0:this!==de?!1:ie&&ie._writableState instanceof oe}})):se=function(ie){return ie instanceof this};function de(me){f=f||require_stream_duplex$1();var ie=this instanceof f;if(!ie&&!se.call(de,this))return new de(me);this._writableState=new oe(me,this,ie),this.writable=!0,me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final)),g.call(this)}de.prototype.pipe=function(){V(this,new T)};function he(me,ie){var ee=new N;V(me,ee),process$1.nextTick(ie,ee)}function we(me,ie,ee,pe){var be;return ee===null?be=new O:typeof ee!="string"&&!ie.objectMode&&(be=new E("chunk",["string","Buffer"],ee)),be?(V(me,be),process$1.nextTick(pe,be),!1):!0}de.prototype.write=function(me,ie,ee){var pe=this._writableState,be=!1,ae=!pe.objectMode&&_(me);return ae&&!v.isBuffer(me)&&(me=w(me)),typeof ie=="function"&&(ee=ie,ie=null),ae?ie="buffer":ie||(ie=pe.defaultEncoding),typeof ee!="function"&&(ee=X),pe.ending?he(this,ee):(ae||we(this,pe,me,ee))&&(pe.pendingcb++,be=q(this,pe,ae,me,ie,ee)),be},de.prototype.cork=function(){this._writableState.corked++},de.prototype.uncork=function(){var me=this._writableState;me.corked&&(me.corked--,!me.writing&&!me.corked&&!me.bufferProcessing&&me.bufferedRequest&&j(this,me))},de.prototype.setDefaultEncoding=function(ie){if(typeof ie=="string"&&(ie=ie.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ie+"").toLowerCase())>-1))throw new H(ie);return this._writableState.defaultEncoding=ie,this},Object.defineProperty(de.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function te(me,ie,ee){return!me.objectMode&&me.decodeStrings!==!1&&typeof ie=="string"&&(ie=v.from(ie,ee)),ie}Object.defineProperty(de.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function q(me,ie,ee,pe,be,ae){if(!ee){var ne=te(ie,pe,be);pe!==ne&&(ee=!0,be="buffer",pe=ne)}var Se=ie.objectMode?1:pe.length;ie.length+=Se;var ke=ie.length<ie.highWaterMark;if(ke||(ie.needDrain=!0),ie.writing||ie.corked){var Ie=ie.lastBufferedRequest;ie.lastBufferedRequest={chunk:pe,encoding:be,isBuf:ee,callback:ae,next:null},Ie?Ie.next=ie.lastBufferedRequest:ie.bufferedRequest=ie.lastBufferedRequest,ie.bufferedRequestCount+=1}else k(me,ie,!1,Se,pe,be,ae);return ke}function k(me,ie,ee,pe,be,ae,ne){ie.writelen=pe,ie.writecb=ne,ie.writing=!0,ie.sync=!0,ie.destroyed?ie.onwrite(new L("write")):ee?me._writev(be,ie.onwrite):me._write(be,ae,ie.onwrite),ie.sync=!1}function y(me,ie,ee,pe,be){--ie.pendingcb,ee?(process$1.nextTick(be,pe),process$1.nextTick(z,me,ie),me._writableState.errorEmitted=!0,V(me,pe)):(be(pe),me._writableState.errorEmitted=!0,V(me,pe),z(me,ie))}function B(me){me.writing=!1,me.writecb=null,me.length-=me.writelen,me.writelen=0}function $(me,ie){var ee=me._writableState,pe=ee.sync,be=ee.writecb;if(typeof be!="function")throw new A;if(B(ee),ie)y(me,ee,pe,ie,be);else{var ae=D(ee)||me.destroyed;!ae&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&j(me,ee),pe?process$1.nextTick(I,me,ee,ae,be):I(me,ee,ae,be)}}function I(me,ie,ee,pe){ee||F(me,ie),ie.pendingcb--,pe(),z(me,ie)}function F(me,ie){ie.length===0&&ie.needDrain&&(ie.needDrain=!1,me.emit("drain"))}function j(me,ie){ie.bufferProcessing=!0;var ee=ie.bufferedRequest;if(me._writev&&ee&&ee.next){var pe=ie.bufferedRequestCount,be=new Array(pe),ae=ie.corkedRequestsFree;ae.entry=ee;for(var ne=0,Se=!0;ee;)be[ne]=ee,ee.isBuf||(Se=!1),ee=ee.next,ne+=1;be.allBuffers=Se,k(me,ie,!0,ie.length,be,"",ae.finish),ie.pendingcb++,ie.lastBufferedRequest=null,ae.next?(ie.corkedRequestsFree=ae.next,ae.next=null):ie.corkedRequestsFree=new r(ie),ie.bufferedRequestCount=0}else{for(;ee;){var ke=ee.chunk,Ie=ee.encoding,Oe=ee.callback,Ue=ie.objectMode?1:ke.length;if(k(me,ie,!1,Ue,ke,Ie,Oe),ee=ee.next,ie.bufferedRequestCount--,ie.writing)break}ee===null&&(ie.lastBufferedRequest=null)}ie.bufferedRequest=ee,ie.bufferProcessing=!1}de.prototype._write=function(me,ie,ee){ee(new M("_write()"))},de.prototype._writev=null,de.prototype.end=function(me,ie,ee){var pe=this._writableState;return typeof me=="function"?(ee=me,me=null,ie=null):typeof ie=="function"&&(ee=ie,ie=null),me!=null&&this.write(me,ie),pe.corked&&(pe.corked=1,this.uncork()),pe.ending||ye(this,pe,ee),this},Object.defineProperty(de.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function D(me){return me.ending&&me.length===0&&me.bufferedRequest===null&&!me.finished&&!me.writing}function W(me,ie){me._final(function(ee){ie.pendingcb--,ee&&V(me,ee),ie.prefinished=!0,me.emit("prefinish"),z(me,ie)})}function R(me,ie){!ie.prefinished&&!ie.finalCalled&&(typeof me._final=="function"&&!ie.destroyed?(ie.pendingcb++,ie.finalCalled=!0,process$1.nextTick(W,me,ie)):(ie.prefinished=!0,me.emit("prefinish")))}function z(me,ie){var ee=D(ie);if(ee&&(R(me,ie),ie.pendingcb===0&&(ie.finished=!0,me.emit("finish"),ie.autoDestroy))){var pe=me._readableState;(!pe||pe.autoDestroy&&pe.endEmitted)&&me.destroy()}return ee}function ye(me,ie,ee){ie.ending=!0,z(me,ie),ee&&(ie.finished?process$1.nextTick(ee):me.once("finish",ee)),ie.ended=!0,me.writable=!1}function Ce(me,ie,ee){var pe=me.entry;for(me.entry=null;pe;){var be=pe.callback;ie.pendingcb--,be(ee),pe=pe.next}ie.corkedRequestsFree.next=me}return Object.defineProperty(de.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ie){this._writableState&&(this._writableState.destroyed=ie)}}),de.prototype.destroy=S.destroy,de.prototype._undestroy=S.undestroy,de.prototype._destroy=function(me,ie){ie(me)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var r=Object.keys||function(x){var b=[];for(var C in x)b.push(C);return b};_stream_duplex$1=w;var f=require_stream_readable$1(),d=require_stream_writable$1();requireInherits_browser()(w,f);for(var g=r(d.prototype),v=0;v<g.length;v++){var m=g[v];w.prototype[m]||(w.prototype[m]=d.prototype[m])}function w(x){if(!(this instanceof w))return new w(x);f.call(this,x),d.call(this,x),this.allowHalfOpen=!0,x&&(x.readable===!1&&(this.readable=!1),x.writable===!1&&(this.writable=!1),x.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",_)))}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function _(){this._writableState.ended||process$1.nextTick(S,this)}function S(x){x.end()}return Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var r=requireSafeBuffer$1().Buffer,f=r.isEncoding||function(O){switch(O=""+O,O&&O.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function d(O){if(!O)return"utf8";for(var N;;)switch(O){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return O;default:if(N)return;O=(""+O).toLowerCase(),N=!0}}function g(O){var N=d(O);if(typeof N!="string"&&(r.isEncoding===f||!f(O)))throw new Error("Unknown encoding: "+O);return N||O}string_decoder.StringDecoder=v;function v(O){this.encoding=g(O);var N;switch(this.encoding){case"utf16le":this.text=C,this.end=E,N=4;break;case"utf8":this.fillLast=S,N=4;break;case"base64":this.text=M,this.end=A,N=3;break;default:this.write=T,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(N)}v.prototype.write=function(O){if(O.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(O),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;return H<O.length?N?N+this.text(O,H):this.text(O,H):N||""},v.prototype.end=b,v.prototype.text=x,v.prototype.fillLast=function(O){if(this.lastNeed<=O.length)return O.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);O.copy(this.lastChar,this.lastTotal-this.lastNeed,0,O.length),this.lastNeed-=O.length};function m(O){return O<=127?0:O>>5===6?2:O>>4===14?3:O>>3===30?4:O>>6===2?-1:-2}function w(O,N,H){var V=N.length-1;if(V<H)return 0;var X=m(N[V]);return X>=0?(X>0&&(O.lastNeed=X-1),X):--V<H||X===-2?0:(X=m(N[V]),X>=0?(X>0&&(O.lastNeed=X-2),X):--V<H||X===-2?0:(X=m(N[V]),X>=0?(X>0&&(X===2?X=0:O.lastNeed=X-3),X):0))}function _(O,N,H){if((N[0]&192)!==128)return O.lastNeed=0,"�";if(O.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return O.lastNeed=1,"�";if(O.lastNeed>2&&N.length>2&&(N[2]&192)!==128)return O.lastNeed=2,"�"}}function S(O){var N=this.lastTotal-this.lastNeed,H=_(this,O);if(H!==void 0)return H;if(this.lastNeed<=O.length)return O.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);O.copy(this.lastChar,N,0,O.length),this.lastNeed-=O.length}function x(O,N){var H=w(this,O,N);if(!this.lastNeed)return O.toString("utf8",N);this.lastTotal=H;var V=O.length-(H-this.lastNeed);return O.copy(this.lastChar,0,V),O.toString("utf8",N,V)}function b(O){var N=O&&O.length?this.write(O):"";return this.lastNeed?N+"�":N}function C(O,N){if((O.length-N)%2===0){var H=O.toString("utf16le",N);if(H){var V=H.charCodeAt(H.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=O[O.length-2],this.lastChar[1]=O[O.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=O[O.length-1],O.toString("utf16le",N,O.length-1)}function E(O){var N=O&&O.length?this.write(O):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function M(O,N){var H=(O.length-N)%3;return H===0?O.toString("base64",N):(this.lastNeed=3-H,this.lastTotal=3,H===1?this.lastChar[0]=O[O.length-1]:(this.lastChar[0]=O[O.length-2],this.lastChar[1]=O[O.length-1]),O.toString("base64",N,O.length-H))}function A(O){var N=O&&O.length?this.write(O):"";return this.lastNeed?N+this.lastChar.toString("base64",0,3-this.lastNeed):N}function T(O){return O.toString(this.encoding)}function L(O){return O&&O.length?this.write(O):""}return string_decoder}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var r=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function f(m){var w=!1;return function(){if(!w){w=!0;for(var _=arguments.length,S=new Array(_),x=0;x<_;x++)S[x]=arguments[x];m.apply(this,S)}}}function d(){}function g(m){return m.setHeader&&typeof m.abort=="function"}function v(m,w,_){if(typeof w=="function")return v(m,null,w);w||(w={}),_=f(_||d);var S=w.readable||w.readable!==!1&&m.readable,x=w.writable||w.writable!==!1&&m.writable,b=function(){m.writable||E()},C=m._writableState&&m._writableState.finished,E=function(){x=!1,C=!0,S||_.call(m)},M=m._readableState&&m._readableState.endEmitted,A=function(){S=!1,M=!0,x||_.call(m)},T=function(H){_.call(m,H)},L=function(){var H;if(S&&!M)return(!m._readableState||!m._readableState.ended)&&(H=new r),_.call(m,H);if(x&&!C)return(!m._writableState||!m._writableState.ended)&&(H=new r),_.call(m,H)},O=function(){m.req.on("finish",E)};return g(m)?(m.on("complete",E),m.on("abort",L),m.req?O():m.on("request",O)):x&&!m._writableState&&(m.on("end",b),m.on("close",b)),m.on("end",A),m.on("finish",E),w.error!==!1&&m.on("error",T),m.on("close",L),function(){m.removeListener("complete",E),m.removeListener("abort",L),m.removeListener("request",O),m.req&&m.req.removeListener("finish",E),m.removeListener("end",b),m.removeListener("close",b),m.removeListener("finish",E),m.removeListener("end",A),m.removeListener("error",T),m.removeListener("close",L)}}return endOfStream=v,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var r;function f(H,V,X){return V=d(V),V in H?Object.defineProperty(H,V,{value:X,enumerable:!0,configurable:!0,writable:!0}):H[V]=X,H}function d(H){var V=g(H,"string");return typeof V=="symbol"?V:String(V)}function g(H,V){if(typeof H!="object"||H===null)return H;var X=H[Symbol.toPrimitive];if(X!==void 0){var oe=X.call(H,V);if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(H)}var v=requireEndOfStream(),m=Symbol("lastResolve"),w=Symbol("lastReject"),_=Symbol("error"),S=Symbol("ended"),x=Symbol("lastPromise"),b=Symbol("handlePromise"),C=Symbol("stream");function E(H,V){return{value:H,done:V}}function M(H){var V=H[m];if(V!==null){var X=H[C].read();X!==null&&(H[x]=null,H[m]=null,H[w]=null,V(E(X,!1)))}}function A(H){process$1.nextTick(M,H)}function T(H,V){return function(X,oe){H.then(function(){if(V[S]){X(E(void 0,!0));return}V[b](X,oe)},oe)}}var L=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((r={get stream(){return this[C]},next:function(){var V=this,X=this[_];if(X!==null)return Promise.reject(X);if(this[S])return Promise.resolve(E(void 0,!0));if(this[C].destroyed)return new Promise(function(he,we){process$1.nextTick(function(){V[_]?we(V[_]):he(E(void 0,!0))})});var oe=this[x],se;if(oe)se=new Promise(T(oe,this));else{var de=this[C].read();if(de!==null)return Promise.resolve(E(de,!1));se=new Promise(this[b])}return this[x]=se,se}},f(r,Symbol.asyncIterator,function(){return this}),f(r,"return",function(){var V=this;return new Promise(function(X,oe){V[C].destroy(null,function(se){if(se){oe(se);return}X(E(void 0,!0))})})}),r),L),N=function(V){var X,oe=Object.create(O,(X={},f(X,C,{value:V,writable:!0}),f(X,m,{value:null,writable:!0}),f(X,w,{value:null,writable:!0}),f(X,_,{value:null,writable:!0}),f(X,S,{value:V._readableState.endEmitted,writable:!0}),f(X,b,{value:function(de,he){var we=oe[C].read();we?(oe[x]=null,oe[m]=null,oe[w]=null,de(E(we,!1))):(oe[m]=de,oe[w]=he)},writable:!0}),X));return oe[x]=null,v(V,function(se){if(se&&se.code!=="ERR_STREAM_PREMATURE_CLOSE"){var de=oe[w];de!==null&&(oe[x]=null,oe[m]=null,oe[w]=null,de(se)),oe[_]=se;return}var he=oe[m];he!==null&&(oe[x]=null,oe[m]=null,oe[w]=null,he(E(void 0,!0))),oe[S]=!0}),V.on("readable",A.bind(null,oe)),oe};return async_iterator=N,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=he;var r;he.ReadableState=de,requireEvents().EventEmitter;var f=function(ne,Se){return ne.listeners(Se).length},d=requireStreamBrowser$1(),g=requireDist().Buffer,v=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function m(ae){return g.from(ae)}function w(ae){return g.isBuffer(ae)||ae instanceof v}var _=requireUtil$1(),S;_&&_.debuglog?S=_.debuglog("stream"):S=function(){};var x=requireBuffer_list(),b=requireDestroy$1(),C=requireState(),E=C.getHighWaterMark,M=requireErrorsBrowser().codes,A=M.ERR_INVALID_ARG_TYPE,T=M.ERR_STREAM_PUSH_AFTER_EOF,L=M.ERR_METHOD_NOT_IMPLEMENTED,O=M.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,N,H,V;requireInherits_browser()(he,d);var X=b.errorOrDestroy,oe=["error","close","destroy","pause","resume"];function se(ae,ne,Se){if(typeof ae.prependListener=="function")return ae.prependListener(ne,Se);!ae._events||!ae._events[ne]?ae.on(ne,Se):Array.isArray(ae._events[ne])?ae._events[ne].unshift(Se):ae._events[ne]=[Se,ae._events[ne]]}function de(ae,ne,Se){r=r||require_stream_duplex$1(),ae=ae||{},typeof Se!="boolean"&&(Se=ne instanceof r),this.objectMode=!!ae.objectMode,Se&&(this.objectMode=this.objectMode||!!ae.readableObjectMode),this.highWaterMark=E(this,ae,"readableHighWaterMark",Se),this.buffer=new x,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ae.emitClose!==!1,this.autoDestroy=!!ae.autoDestroy,this.destroyed=!1,this.defaultEncoding=ae.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ae.encoding&&(N||(N=requireString_decoder().StringDecoder),this.decoder=new N(ae.encoding),this.encoding=ae.encoding)}function he(ae){if(r=r||require_stream_duplex$1(),!(this instanceof he))return new he(ae);var ne=this instanceof r;this._readableState=new de(ae,this,ne),this.readable=!0,ae&&(typeof ae.read=="function"&&(this._read=ae.read),typeof ae.destroy=="function"&&(this._destroy=ae.destroy)),d.call(this)}Object.defineProperty(he.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ne){this._readableState&&(this._readableState.destroyed=ne)}}),he.prototype.destroy=b.destroy,he.prototype._undestroy=b.undestroy,he.prototype._destroy=function(ae,ne){ne(ae)},he.prototype.push=function(ae,ne){var Se=this._readableState,ke;return Se.objectMode?ke=!0:typeof ae=="string"&&(ne=ne||Se.defaultEncoding,ne!==Se.encoding&&(ae=g.from(ae,ne),ne=""),ke=!0),we(this,ae,ne,!1,ke)},he.prototype.unshift=function(ae){return we(this,ae,null,!0,!1)};function we(ae,ne,Se,ke,Ie){S("readableAddChunk",ne);var Oe=ae._readableState;if(ne===null)Oe.reading=!1,$(ae,Oe);else{var Ue;if(Ie||(Ue=q(Oe,ne)),Ue)X(ae,Ue);else if(Oe.objectMode||ne&&ne.length>0)if(typeof ne!="string"&&!Oe.objectMode&&Object.getPrototypeOf(ne)!==g.prototype&&(ne=m(ne)),ke)Oe.endEmitted?X(ae,new O):te(ae,Oe,ne,!0);else if(Oe.ended)X(ae,new T);else{if(Oe.destroyed)return!1;Oe.reading=!1,Oe.decoder&&!Se?(ne=Oe.decoder.write(ne),Oe.objectMode||ne.length!==0?te(ae,Oe,ne,!1):j(ae,Oe)):te(ae,Oe,ne,!1)}else ke||(Oe.reading=!1,j(ae,Oe))}return!Oe.ended&&(Oe.length<Oe.highWaterMark||Oe.length===0)}function te(ae,ne,Se,ke){ne.flowing&&ne.length===0&&!ne.sync?(ne.awaitDrain=0,ae.emit("data",Se)):(ne.length+=ne.objectMode?1:Se.length,ke?ne.buffer.unshift(Se):ne.buffer.push(Se),ne.needReadable&&I(ae)),j(ae,ne)}function q(ae,ne){var Se;return!w(ne)&&typeof ne!="string"&&ne!==void 0&&!ae.objectMode&&(Se=new A("chunk",["string","Buffer","Uint8Array"],ne)),Se}he.prototype.isPaused=function(){return this._readableState.flowing===!1},he.prototype.setEncoding=function(ae){N||(N=requireString_decoder().StringDecoder);var ne=new N(ae);this._readableState.decoder=ne,this._readableState.encoding=this._readableState.decoder.encoding;for(var Se=this._readableState.buffer.head,ke="";Se!==null;)ke+=ne.write(Se.data),Se=Se.next;return this._readableState.buffer.clear(),ke!==""&&this._readableState.buffer.push(ke),this._readableState.length=ke.length,this};var k=1073741824;function y(ae){return ae>=k?ae=k:(ae--,ae|=ae>>>1,ae|=ae>>>2,ae|=ae>>>4,ae|=ae>>>8,ae|=ae>>>16,ae++),ae}function B(ae,ne){return ae<=0||ne.length===0&&ne.ended?0:ne.objectMode?1:ae!==ae?ne.flowing&&ne.length?ne.buffer.head.data.length:ne.length:(ae>ne.highWaterMark&&(ne.highWaterMark=y(ae)),ae<=ne.length?ae:ne.ended?ne.length:(ne.needReadable=!0,0))}he.prototype.read=function(ae){S("read",ae),ae=parseInt(ae,10);var ne=this._readableState,Se=ae;if(ae!==0&&(ne.emittedReadable=!1),ae===0&&ne.needReadable&&((ne.highWaterMark!==0?ne.length>=ne.highWaterMark:ne.length>0)||ne.ended))return S("read: emitReadable",ne.length,ne.ended),ne.length===0&&ne.ended?ee(this):I(this),null;if(ae=B(ae,ne),ae===0&&ne.ended)return ne.length===0&&ee(this),null;var ke=ne.needReadable;S("need readable",ke),(ne.length===0||ne.length-ae<ne.highWaterMark)&&(ke=!0,S("length less than watermark",ke)),ne.ended||ne.reading?(ke=!1,S("reading or ended",ke)):ke&&(S("do read"),ne.reading=!0,ne.sync=!0,ne.length===0&&(ne.needReadable=!0),this._read(ne.highWaterMark),ne.sync=!1,ne.reading||(ae=B(Se,ne)));var Ie;return ae>0?Ie=ie(ae,ne):Ie=null,Ie===null?(ne.needReadable=ne.length<=ne.highWaterMark,ae=0):(ne.length-=ae,ne.awaitDrain=0),ne.length===0&&(ne.ended||(ne.needReadable=!0),Se!==ae&&ne.ended&&ee(this)),Ie!==null&&this.emit("data",Ie),Ie};function $(ae,ne){if(S("onEofChunk"),!ne.ended){if(ne.decoder){var Se=ne.decoder.end();Se&&Se.length&&(ne.buffer.push(Se),ne.length+=ne.objectMode?1:Se.length)}ne.ended=!0,ne.sync?I(ae):(ne.needReadable=!1,ne.emittedReadable||(ne.emittedReadable=!0,F(ae)))}}function I(ae){var ne=ae._readableState;S("emitReadable",ne.needReadable,ne.emittedReadable),ne.needReadable=!1,ne.emittedReadable||(S("emitReadable",ne.flowing),ne.emittedReadable=!0,process$1.nextTick(F,ae))}function F(ae){var ne=ae._readableState;S("emitReadable_",ne.destroyed,ne.length,ne.ended),!ne.destroyed&&(ne.length||ne.ended)&&(ae.emit("readable"),ne.emittedReadable=!1),ne.needReadable=!ne.flowing&&!ne.ended&&ne.length<=ne.highWaterMark,me(ae)}function j(ae,ne){ne.readingMore||(ne.readingMore=!0,process$1.nextTick(D,ae,ne))}function D(ae,ne){for(;!ne.reading&&!ne.ended&&(ne.length<ne.highWaterMark||ne.flowing&&ne.length===0);){var Se=ne.length;if(S("maybeReadMore read 0"),ae.read(0),Se===ne.length)break}ne.readingMore=!1}he.prototype._read=function(ae){X(this,new L("_read()"))},he.prototype.pipe=function(ae,ne){var Se=this,ke=this._readableState;switch(ke.pipesCount){case 0:ke.pipes=ae;break;case 1:ke.pipes=[ke.pipes,ae];break;default:ke.pipes.push(ae);break}ke.pipesCount+=1,S("pipe count=%d opts=%j",ke.pipesCount,ne);var Ie=(!ne||ne.end!==!1)&&ae!==process$1.stdout&&ae!==process$1.stderr,Oe=Ie?De:gt;ke.endEmitted?process$1.nextTick(Oe):Se.once("end",Oe),ae.on("unpipe",Ue);function Ue(rt,wt){S("onunpipe"),rt===Se&&wt&&wt.hasUnpiped===!1&&(wt.hasUnpiped=!0,Ye())}function De(){S("onend"),ae.end()}var $e=W(Se);ae.on("drain",$e);var je=!1;function Ye(){S("cleanup"),ae.removeListener("close",Ge),ae.removeListener("finish",ut),ae.removeListener("drain",$e),ae.removeListener("error",Je),ae.removeListener("unpipe",Ue),Se.removeListener("end",De),Se.removeListener("end",gt),Se.removeListener("data",st),je=!0,ke.awaitDrain&&(!ae._writableState||ae._writableState.needDrain)&&$e()}Se.on("data",st);function st(rt){S("ondata");var wt=ae.write(rt);S("dest.write",wt),wt===!1&&((ke.pipesCount===1&&ke.pipes===ae||ke.pipesCount>1&&be(ke.pipes,ae)!==-1)&&!je&&(S("false write response, pause",ke.awaitDrain),ke.awaitDrain++),Se.pause())}function Je(rt){S("onerror",rt),gt(),ae.removeListener("error",Je),f(ae,"error")===0&&X(ae,rt)}se(ae,"error",Je);function Ge(){ae.removeListener("finish",ut),gt()}ae.once("close",Ge);function ut(){S("onfinish"),ae.removeListener("close",Ge),gt()}ae.once("finish",ut);function gt(){S("unpipe"),Se.unpipe(ae)}return ae.emit("pipe",Se),ke.flowing||(S("pipe resume"),Se.resume()),ae};function W(ae){return function(){var Se=ae._readableState;S("pipeOnDrain",Se.awaitDrain),Se.awaitDrain&&Se.awaitDrain--,Se.awaitDrain===0&&f(ae,"data")&&(Se.flowing=!0,me(ae))}}he.prototype.unpipe=function(ae){var ne=this._readableState,Se={hasUnpiped:!1};if(ne.pipesCount===0)return this;if(ne.pipesCount===1)return ae&&ae!==ne.pipes?this:(ae||(ae=ne.pipes),ne.pipes=null,ne.pipesCount=0,ne.flowing=!1,ae&&ae.emit("unpipe",this,Se),this);if(!ae){var ke=ne.pipes,Ie=ne.pipesCount;ne.pipes=null,ne.pipesCount=0,ne.flowing=!1;for(var Oe=0;Oe<Ie;Oe++)ke[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}var Ue=be(ne.pipes,ae);return Ue===-1?this:(ne.pipes.splice(Ue,1),ne.pipesCount-=1,ne.pipesCount===1&&(ne.pipes=ne.pipes[0]),ae.emit("unpipe",this,Se),this)},he.prototype.on=function(ae,ne){var Se=d.prototype.on.call(this,ae,ne),ke=this._readableState;return ae==="data"?(ke.readableListening=this.listenerCount("readable")>0,ke.flowing!==!1&&this.resume()):ae==="readable"&&!ke.endEmitted&&!ke.readableListening&&(ke.readableListening=ke.needReadable=!0,ke.flowing=!1,ke.emittedReadable=!1,S("on readable",ke.length,ke.reading),ke.length?I(this):ke.reading||process$1.nextTick(z,this)),Se},he.prototype.addListener=he.prototype.on,he.prototype.removeListener=function(ae,ne){var Se=d.prototype.removeListener.call(this,ae,ne);return ae==="readable"&&process$1.nextTick(R,this),Se},he.prototype.removeAllListeners=function(ae){var ne=d.prototype.removeAllListeners.apply(this,arguments);return(ae==="readable"||ae===void 0)&&process$1.nextTick(R,this),ne};function R(ae){var ne=ae._readableState;ne.readableListening=ae.listenerCount("readable")>0,ne.resumeScheduled&&!ne.paused?ne.flowing=!0:ae.listenerCount("data")>0&&ae.resume()}function z(ae){S("readable nexttick read 0"),ae.read(0)}he.prototype.resume=function(){var ae=this._readableState;return ae.flowing||(S("resume"),ae.flowing=!ae.readableListening,ye(this,ae)),ae.paused=!1,this};function ye(ae,ne){ne.resumeScheduled||(ne.resumeScheduled=!0,process$1.nextTick(Ce,ae,ne))}function Ce(ae,ne){S("resume",ne.reading),ne.reading||ae.read(0),ne.resumeScheduled=!1,ae.emit("resume"),me(ae),ne.flowing&&!ne.reading&&ae.read(0)}he.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function me(ae){var ne=ae._readableState;for(S("flow",ne.flowing);ne.flowing&&ae.read()!==null;);}he.prototype.wrap=function(ae){var ne=this,Se=this._readableState,ke=!1;ae.on("end",function(){if(S("wrapped end"),Se.decoder&&!Se.ended){var Ue=Se.decoder.end();Ue&&Ue.length&&ne.push(Ue)}ne.push(null)}),ae.on("data",function(Ue){if(S("wrapped data"),Se.decoder&&(Ue=Se.decoder.write(Ue)),!(Se.objectMode&&Ue==null)&&!(!Se.objectMode&&(!Ue||!Ue.length))){var De=ne.push(Ue);De||(ke=!0,ae.pause())}});for(var Ie in ae)this[Ie]===void 0&&typeof ae[Ie]=="function"&&(this[Ie]=(function(De){return function(){return ae[De].apply(ae,arguments)}})(Ie));for(var Oe=0;Oe<oe.length;Oe++)ae.on(oe[Oe],this.emit.bind(this,oe[Oe]));return this._read=function(Ue){S("wrapped _read",Ue),ke&&(ke=!1,ae.resume())},this},typeof Symbol=="function"&&(he.prototype[Symbol.asyncIterator]=function(){return H===void 0&&(H=requireAsync_iterator()),H(this)}),Object.defineProperty(he.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(he.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(he.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ne){this._readableState&&(this._readableState.flowing=ne)}}),he._fromList=ie,Object.defineProperty(he.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ie(ae,ne){if(ne.length===0)return null;var Se;return ne.objectMode?Se=ne.buffer.shift():!ae||ae>=ne.length?(ne.decoder?Se=ne.buffer.join(""):ne.buffer.length===1?Se=ne.buffer.first():Se=ne.buffer.concat(ne.length),ne.buffer.clear()):Se=ne.buffer.consume(ae,ne.decoder),Se}function ee(ae){var ne=ae._readableState;S("endReadable",ne.endEmitted),ne.endEmitted||(ne.ended=!0,process$1.nextTick(pe,ne,ae))}function pe(ae,ne){if(S("endReadableNT",ae.endEmitted,ae.length),!ae.endEmitted&&ae.length===0&&(ae.endEmitted=!0,ne.readable=!1,ne.emit("end"),ae.autoDestroy)){var Se=ne._writableState;(!Se||Se.autoDestroy&&Se.finished)&&ne.destroy()}}typeof Symbol=="function"&&(he.from=function(ae,ne){return V===void 0&&(V=requireFromBrowser()),V(he,ae,ne)});function be(ae,ne){for(var Se=0,ke=ae.length;Se<ke;Se++)if(ae[Se]===ne)return Se;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=_;var r=requireErrorsBrowser().codes,f=r.ERR_METHOD_NOT_IMPLEMENTED,d=r.ERR_MULTIPLE_CALLBACK,g=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,v=r.ERR_TRANSFORM_WITH_LENGTH_0,m=require_stream_duplex$1();requireInherits_browser()(_,m);function w(b,C){var E=this._transformState;E.transforming=!1;var M=E.writecb;if(M===null)return this.emit("error",new d);E.writechunk=null,E.writecb=null,C!=null&&this.push(C),M(b);var A=this._readableState;A.reading=!1,(A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}function _(b){if(!(this instanceof _))return new _(b);m.call(this,b),this._transformState={afterTransform:w.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",S)}function S(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(C,E){x(b,C,E)}):x(this,null,null)}_.prototype.push=function(b,C){return this._transformState.needTransform=!1,m.prototype.push.call(this,b,C)},_.prototype._transform=function(b,C,E){E(new f("_transform()"))},_.prototype._write=function(b,C,E){var M=this._transformState;if(M.writecb=E,M.writechunk=b,M.writeencoding=C,!M.transforming){var A=this._readableState;(M.needTransform||A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}},_.prototype._read=function(b){var C=this._transformState;C.writechunk!==null&&!C.transforming?(C.transforming=!0,this._transform(C.writechunk,C.writeencoding,C.afterTransform)):C.needTransform=!0},_.prototype._destroy=function(b,C){m.prototype._destroy.call(this,b,function(E){C(E)})};function x(b,C,E){if(C)return b.emit("error",C);if(E!=null&&b.push(E),b._writableState.length)throw new v;if(b._transformState.transforming)throw new g;return b.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=f;var r=require_stream_transform$1();requireInherits_browser()(f,r);function f(d){if(!(this instanceof f))return new f(d);r.call(this,d)}return f.prototype._transform=function(d,g,v){v(null,d)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var r;function f(E){var M=!1;return function(){M||(M=!0,E.apply(void 0,arguments))}}var d=requireErrorsBrowser().codes,g=d.ERR_MISSING_ARGS,v=d.ERR_STREAM_DESTROYED;function m(E){if(E)throw E}function w(E){return E.setHeader&&typeof E.abort=="function"}function _(E,M,A,T){T=f(T);var L=!1;E.on("close",function(){L=!0}),r===void 0&&(r=requireEndOfStream()),r(E,{readable:M,writable:A},function(N){if(N)return T(N);L=!0,T()});var O=!1;return function(N){if(!L&&!O){if(O=!0,w(E))return E.abort();if(typeof E.destroy=="function")return E.destroy();T(N||new v("pipe"))}}}function S(E){E()}function x(E,M){return E.pipe(M)}function b(E){return!E.length||typeof E[E.length-1]!="function"?m:E.pop()}function C(){for(var E=arguments.length,M=new Array(E),A=0;A<E;A++)M[A]=arguments[A];var T=b(M);if(Array.isArray(M[0])&&(M=M[0]),M.length<2)throw new g("streams");var L,O=M.map(function(N,H){var V=H<M.length-1,X=H>0;return _(N,V,X,function(oe){L||(L=oe),oe&&O.forEach(S),!V&&(O.forEach(S),T(L))})});return M.reduce(x)}return pipeline_1=C,pipeline_1}var hasRequiredReadableBrowser$1;function requireReadableBrowser$1(){return hasRequiredReadableBrowser$1||(hasRequiredReadableBrowser$1=1,(function(r,f){f=r.exports=require_stream_readable$1(),f.Stream=f,f.Readable=f,f.Writable=require_stream_writable$1(),f.Duplex=require_stream_duplex$1(),f.Transform=require_stream_transform$1(),f.PassThrough=require_stream_passthrough$1(),f.finished=requireEndOfStream(),f.pipeline=requirePipeline()})(readableBrowser$1,readableBrowser$1.exports)),readableBrowser$1.exports}var hashBase$2,hasRequiredHashBase$2;function requireHashBase$2(){if(hasRequiredHashBase$2)return hashBase$2;hasRequiredHashBase$2=1;var r=requireSafeBuffer$1().Buffer,f=requireReadableBrowser$1().Transform,d=requireInherits_browser();function g(m,w){if(!r.isBuffer(m)&&typeof m!="string")throw new TypeError(w+" must be a string or a buffer")}function v(m){f.call(this),this._block=r.allocUnsafe(m),this._blockSize=m,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return d(v,f),v.prototype._transform=function(m,w,_){var S=null;try{this.update(m,w)}catch(x){S=x}_(S)},v.prototype._flush=function(m){var w=null;try{this.push(this.digest())}catch(_){w=_}m(w)},v.prototype.update=function(m,w){if(g(m,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(m)||(m=r.from(m,w));for(var _=this._block,S=0;this._blockOffset+m.length-S>=this._blockSize;){for(var x=this._blockOffset;x<this._blockSize;)_[x++]=m[S++];this._update(),this._blockOffset=0}for(;S<m.length;)_[this._blockOffset++]=m[S++];for(var b=0,C=m.length*8;C>0;++b)this._length[b]+=C,C=this._length[b]/4294967296|0,C>0&&(this._length[b]-=4294967296*C);return this},v.prototype._update=function(){throw new Error("_update is not implemented")},v.prototype.digest=function(m){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var w=this._digest();m!==void 0&&(w=w.toString(m)),this._block.fill(0),this._blockOffset=0;for(var _=0;_<4;++_)this._length[_]=0;return w},v.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$2=v,hashBase$2}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var r=requireInherits_browser(),f=requireHashBase$2(),d=requireSafeBuffer$1().Buffer,g=new Array(16);function v(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}r(v,f),v.prototype._update=function(){for(var b=g,C=0;C<16;++C)b[C]=this._block.readInt32LE(C*4);var E=this._a,M=this._b,A=this._c,T=this._d;E=w(E,M,A,T,b[0],3614090360,7),T=w(T,E,M,A,b[1],3905402710,12),A=w(A,T,E,M,b[2],606105819,17),M=w(M,A,T,E,b[3],3250441966,22),E=w(E,M,A,T,b[4],4118548399,7),T=w(T,E,M,A,b[5],1200080426,12),A=w(A,T,E,M,b[6],2821735955,17),M=w(M,A,T,E,b[7],4249261313,22),E=w(E,M,A,T,b[8],1770035416,7),T=w(T,E,M,A,b[9],2336552879,12),A=w(A,T,E,M,b[10],4294925233,17),M=w(M,A,T,E,b[11],2304563134,22),E=w(E,M,A,T,b[12],1804603682,7),T=w(T,E,M,A,b[13],4254626195,12),A=w(A,T,E,M,b[14],2792965006,17),M=w(M,A,T,E,b[15],1236535329,22),E=_(E,M,A,T,b[1],4129170786,5),T=_(T,E,M,A,b[6],3225465664,9),A=_(A,T,E,M,b[11],643717713,14),M=_(M,A,T,E,b[0],3921069994,20),E=_(E,M,A,T,b[5],3593408605,5),T=_(T,E,M,A,b[10],38016083,9),A=_(A,T,E,M,b[15],3634488961,14),M=_(M,A,T,E,b[4],3889429448,20),E=_(E,M,A,T,b[9],568446438,5),T=_(T,E,M,A,b[14],3275163606,9),A=_(A,T,E,M,b[3],4107603335,14),M=_(M,A,T,E,b[8],1163531501,20),E=_(E,M,A,T,b[13],2850285829,5),T=_(T,E,M,A,b[2],4243563512,9),A=_(A,T,E,M,b[7],1735328473,14),M=_(M,A,T,E,b[12],2368359562,20),E=S(E,M,A,T,b[5],4294588738,4),T=S(T,E,M,A,b[8],2272392833,11),A=S(A,T,E,M,b[11],1839030562,16),M=S(M,A,T,E,b[14],4259657740,23),E=S(E,M,A,T,b[1],2763975236,4),T=S(T,E,M,A,b[4],1272893353,11),A=S(A,T,E,M,b[7],4139469664,16),M=S(M,A,T,E,b[10],3200236656,23),E=S(E,M,A,T,b[13],681279174,4),T=S(T,E,M,A,b[0],3936430074,11),A=S(A,T,E,M,b[3],3572445317,16),M=S(M,A,T,E,b[6],76029189,23),E=S(E,M,A,T,b[9],3654602809,4),T=S(T,E,M,A,b[12],3873151461,11),A=S(A,T,E,M,b[15],530742520,16),M=S(M,A,T,E,b[2],3299628645,23),E=x(E,M,A,T,b[0],4096336452,6),T=x(T,E,M,A,b[7],1126891415,10),A=x(A,T,E,M,b[14],2878612391,15),M=x(M,A,T,E,b[5],4237533241,21),E=x(E,M,A,T,b[12],1700485571,6),T=x(T,E,M,A,b[3],2399980690,10),A=x(A,T,E,M,b[10],4293915773,15),M=x(M,A,T,E,b[1],2240044497,21),E=x(E,M,A,T,b[8],1873313359,6),T=x(T,E,M,A,b[15],4264355552,10),A=x(A,T,E,M,b[6],2734768916,15),M=x(M,A,T,E,b[13],1309151649,21),E=x(E,M,A,T,b[4],4149444226,6),T=x(T,E,M,A,b[11],3174756917,10),A=x(A,T,E,M,b[2],718787259,15),M=x(M,A,T,E,b[9],3951481745,21),this._a=this._a+E|0,this._b=this._b+M|0,this._c=this._c+A|0,this._d=this._d+T|0},v.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var b=d.allocUnsafe(16);return b.writeInt32LE(this._a,0),b.writeInt32LE(this._b,4),b.writeInt32LE(this._c,8),b.writeInt32LE(this._d,12),b};function m(b,C){return b<<C|b>>>32-C}function w(b,C,E,M,A,T,L){return m(b+(C&E|~C&M)+A+T|0,L)+C|0}function _(b,C,E,M,A,T,L){return m(b+(C&M|E&~M)+A+T|0,L)+C|0}function S(b,C,E,M,A,T,L){return m(b+(C^E^M)+A+T|0,L)+C|0}function x(b,C,E,M,A,T,L){return m(b+(E^(C|~M))+A+T|0,L)+C|0}return md5_js=v,md5_js}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var r=requireSafeBuffer$1().Buffer,f=requireReadableBrowser$1().Transform,d=requireInherits_browser();function g(m,w){if(!r.isBuffer(m)&&typeof m!="string")throw new TypeError(w+" must be a string or a buffer")}function v(m){f.call(this),this._block=r.allocUnsafe(m),this._blockSize=m,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return d(v,f),v.prototype._transform=function(m,w,_){var S=null;try{this.update(m,w)}catch(x){S=x}_(S)},v.prototype._flush=function(m){var w=null;try{this.push(this.digest())}catch(_){w=_}m(w)},v.prototype.update=function(m,w){if(g(m,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(m)||(m=r.from(m,w));for(var _=this._block,S=0;this._blockOffset+m.length-S>=this._blockSize;){for(var x=this._blockOffset;x<this._blockSize;)_[x++]=m[S++];this._update(),this._blockOffset=0}for(;S<m.length;)_[this._blockOffset++]=m[S++];for(var b=0,C=m.length*8;C>0;++b)this._length[b]+=C,C=this._length[b]/4294967296|0,C>0&&(this._length[b]-=4294967296*C);return this},v.prototype._update=function(){throw new Error("_update is not implemented")},v.prototype.digest=function(m){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var w=this._digest();m!==void 0&&(w=w.toString(m)),this._block.fill(0),this._blockOffset=0;for(var _=0;_<4;++_)this._length[_]=0;return w},v.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=v,hashBase$1}var ripemd160$1,hasRequiredRipemd160$1;function requireRipemd160$1(){if(hasRequiredRipemd160$1)return ripemd160$1;hasRequiredRipemd160$1=1;var r=requireDist().Buffer,f=requireInherits_browser(),d=requireHashBase$1(),g=new Array(16),v=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],w=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],S=[0,1518500249,1859775393,2400959708,2840853838],x=[1352829926,1548603684,1836072691,2053994217,0];function b(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}f(b,d),b.prototype._update=function(){for(var O=g,N=0;N<16;++N)O[N]=this._block.readInt32LE(N*4);for(var H=this._a|0,V=this._b|0,X=this._c|0,oe=this._d|0,se=this._e|0,de=this._a|0,he=this._b|0,we=this._c|0,te=this._d|0,q=this._e|0,k=0;k<80;k+=1){var y,B;k<16?(y=E(H,V,X,oe,se,O[v[k]],S[0],w[k]),B=L(de,he,we,te,q,O[m[k]],x[0],_[k])):k<32?(y=M(H,V,X,oe,se,O[v[k]],S[1],w[k]),B=T(de,he,we,te,q,O[m[k]],x[1],_[k])):k<48?(y=A(H,V,X,oe,se,O[v[k]],S[2],w[k]),B=A(de,he,we,te,q,O[m[k]],x[2],_[k])):k<64?(y=T(H,V,X,oe,se,O[v[k]],S[3],w[k]),B=M(de,he,we,te,q,O[m[k]],x[3],_[k])):(y=L(H,V,X,oe,se,O[v[k]],S[4],w[k]),B=E(de,he,we,te,q,O[m[k]],x[4],_[k])),H=se,se=oe,oe=C(X,10),X=V,V=y,de=q,q=te,te=C(we,10),we=he,he=B}var $=this._b+X+te|0;this._b=this._c+oe+q|0,this._c=this._d+se+de|0,this._d=this._e+H+he|0,this._e=this._a+V+we|0,this._a=$},b.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var O=r.alloc?r.alloc(20):new r(20);return O.writeInt32LE(this._a,0),O.writeInt32LE(this._b,4),O.writeInt32LE(this._c,8),O.writeInt32LE(this._d,12),O.writeInt32LE(this._e,16),O};function C(O,N){return O<<N|O>>>32-N}function E(O,N,H,V,X,oe,se,de){return C(O+(N^H^V)+oe+se|0,de)+X|0}function M(O,N,H,V,X,oe,se,de){return C(O+(N&H|~N&V)+oe+se|0,de)+X|0}function A(O,N,H,V,X,oe,se,de){return C(O+((N|~H)^V)+oe+se|0,de)+X|0}function T(O,N,H,V,X,oe,se,de){return C(O+(N&V|H&~V)+oe+se|0,de)+X|0}function L(O,N,H,V,X,oe,se,de){return C(O+(N^(H|~V))+oe+se|0,de)+X|0}return ripemd160$1=b,ripemd160$1}var sha_js={exports:{}},isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var r={}.toString;return isarray$1=Array.isArray||function(f){return r.call(f)=="[object Array]"},isarray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var r=requireType(),f=requireCallBound(),d=f("TypedArray.prototype.buffer",!0),g=requireIsTypedArray();return typedArrayBuffer=d||function(m){if(!g(m))throw new r("Not a Typed Array");return m.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer;hasRequiredToBuffer$1=1;var r=requireSafeBuffer$1().Buffer,f=requireIsarray$1(),d=requireTypedArrayBuffer(),g=ArrayBuffer.isView||function(S){try{return d(S),!0}catch{return!1}},v=typeof Uint8Array<"u",m=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",w=m&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);return toBuffer=function(S,x){if(S instanceof r)return S;if(typeof S=="string")return r.from(S,x);if(m&&g(S)){if(S.byteLength===0)return r.alloc(0);if(w){var b=r.from(S.buffer,S.byteOffset,S.byteLength);if(b.byteLength===S.byteLength)return b}var C=S instanceof Uint8Array?S:new Uint8Array(S.buffer,S.byteOffset,S.byteLength),E=r.from(C);if(E.length===S.byteLength)return E}if(v&&S instanceof Uint8Array)return r.from(S);var M=f(S);if(M)for(var A=0;A<S.length;A+=1){var T=S[A];if(typeof T!="number"||T<0||T>255||~~T!==T)throw new RangeError("Array items must be numbers in the range 0-255.")}if(M||r.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S))return r.from(S);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var r=requireSafeBuffer$1().Buffer,f=requireToBuffer$1();function d(g,v){this._block=r.alloc(g),this._finalSize=v,this._blockSize=g,this._len=0}return d.prototype.update=function(g,v){g=f(g,v||"utf8");for(var m=this._block,w=this._blockSize,_=g.length,S=this._len,x=0;x<_;){for(var b=S%w,C=Math.min(_-x,w-b),E=0;E<C;E++)m[b+E]=g[x+E];S+=C,x+=C,S%w===0&&this._update(m)}return this._len+=_,this},d.prototype.digest=function(g){var v=this._len%this._blockSize;this._block[v]=128,this._block.fill(0,v+1),v>=this._finalSize&&(this._update(this._block),this._block.fill(0));var m=this._len*8;if(m<=4294967295)this._block.writeUInt32BE(m,this._blockSize-4);else{var w=(m&4294967295)>>>0,_=(m-w)/4294967296;this._block.writeUInt32BE(_,this._blockSize-8),this._block.writeUInt32BE(w,this._blockSize-4)}this._update(this._block);var S=this._hash();return g?S.toString(g):S},d.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=d,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,g=[1518500249,1859775393,-1894007588,-899497514],v=new Array(80);function m(){this.init(),this._w=v,f.call(this,64,56)}r(m,f),m.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function w(x){return x<<5|x>>>27}function _(x){return x<<30|x>>>2}function S(x,b,C,E){return x===0?b&C|~b&E:x===2?b&C|b&E|C&E:b^C^E}return m.prototype._update=function(x){for(var b=this._w,C=this._a|0,E=this._b|0,M=this._c|0,A=this._d|0,T=this._e|0,L=0;L<16;++L)b[L]=x.readInt32BE(L*4);for(;L<80;++L)b[L]=b[L-3]^b[L-8]^b[L-14]^b[L-16];for(var O=0;O<80;++O){var N=~~(O/20),H=w(C)+S(N,E,M,A)+T+b[O]+g[N]|0;T=A,A=M,M=_(E),E=C,C=H}this._a=C+this._a|0,this._b=E+this._b|0,this._c=M+this._c|0,this._d=A+this._d|0,this._e=T+this._e|0},m.prototype._hash=function(){var x=d.allocUnsafe(20);return x.writeInt32BE(this._a|0,0),x.writeInt32BE(this._b|0,4),x.writeInt32BE(this._c|0,8),x.writeInt32BE(this._d|0,12),x.writeInt32BE(this._e|0,16),x},sha$1=m,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,g=[1518500249,1859775393,-1894007588,-899497514],v=new Array(80);function m(){this.init(),this._w=v,f.call(this,64,56)}r(m,f),m.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function w(b){return b<<1|b>>>31}function _(b){return b<<5|b>>>27}function S(b){return b<<30|b>>>2}function x(b,C,E,M){return b===0?C&E|~C&M:b===2?C&E|C&M|E&M:C^E^M}return m.prototype._update=function(b){for(var C=this._w,E=this._a|0,M=this._b|0,A=this._c|0,T=this._d|0,L=this._e|0,O=0;O<16;++O)C[O]=b.readInt32BE(O*4);for(;O<80;++O)C[O]=w(C[O-3]^C[O-8]^C[O-14]^C[O-16]);for(var N=0;N<80;++N){var H=~~(N/20),V=_(E)+x(H,M,A,T)+L+C[N]+g[H]|0;L=T,T=A,A=S(M),M=E,E=V}this._a=E+this._a|0,this._b=M+this._b|0,this._c=A+this._c|0,this._d=T+this._d|0,this._e=L+this._e|0},m.prototype._hash=function(){var b=d.allocUnsafe(20);return b.writeInt32BE(this._a|0,0),b.writeInt32BE(this._b|0,4),b.writeInt32BE(this._c|0,8),b.writeInt32BE(this._d|0,12),b.writeInt32BE(this._e|0,16),b},sha1=m,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],v=new Array(64);function m(){this.init(),this._w=v,f.call(this,64,56)}r(m,f),m.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function w(E,M,A){return A^E&(M^A)}function _(E,M,A){return E&M|A&(E|M)}function S(E){return(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10)}function x(E){return(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7)}function b(E){return(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3}function C(E){return(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10}return m.prototype._update=function(E){for(var M=this._w,A=this._a|0,T=this._b|0,L=this._c|0,O=this._d|0,N=this._e|0,H=this._f|0,V=this._g|0,X=this._h|0,oe=0;oe<16;++oe)M[oe]=E.readInt32BE(oe*4);for(;oe<64;++oe)M[oe]=C(M[oe-2])+M[oe-7]+b(M[oe-15])+M[oe-16]|0;for(var se=0;se<64;++se){var de=X+x(N)+w(N,H,V)+g[se]+M[se]|0,he=S(A)+_(A,T,L)|0;X=V,V=H,H=N,N=O+de|0,O=L,L=T,T=A,A=de+he|0}this._a=A+this._a|0,this._b=T+this._b|0,this._c=L+this._c|0,this._d=O+this._d|0,this._e=N+this._e|0,this._f=H+this._f|0,this._g=V+this._g|0,this._h=X+this._h|0},m.prototype._hash=function(){var E=d.allocUnsafe(32);return E.writeInt32BE(this._a,0),E.writeInt32BE(this._b,4),E.writeInt32BE(this._c,8),E.writeInt32BE(this._d,12),E.writeInt32BE(this._e,16),E.writeInt32BE(this._f,20),E.writeInt32BE(this._g,24),E.writeInt32BE(this._h,28),E},sha256$1=m,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var r=requireInherits_browser(),f=requireSha256(),d=requireHash$1(),g=requireSafeBuffer$1().Buffer,v=new Array(64);function m(){this.init(),this._w=v,d.call(this,64,56)}return r(m,f),m.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},m.prototype._hash=function(){var w=g.allocUnsafe(28);return w.writeInt32BE(this._a,0),w.writeInt32BE(this._b,4),w.writeInt32BE(this._c,8),w.writeInt32BE(this._d,12),w.writeInt32BE(this._e,16),w.writeInt32BE(this._f,20),w.writeInt32BE(this._g,24),w},sha224$1=m,sha224$1}var sha512$1,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],v=new Array(160);function m(){this.init(),this._w=v,f.call(this,128,112)}r(m,f),m.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function w(T,L,O){return O^T&(L^O)}function _(T,L,O){return T&L|O&(T|L)}function S(T,L){return(T>>>28|L<<4)^(L>>>2|T<<30)^(L>>>7|T<<25)}function x(T,L){return(T>>>14|L<<18)^(T>>>18|L<<14)^(L>>>9|T<<23)}function b(T,L){return(T>>>1|L<<31)^(T>>>8|L<<24)^T>>>7}function C(T,L){return(T>>>1|L<<31)^(T>>>8|L<<24)^(T>>>7|L<<25)}function E(T,L){return(T>>>19|L<<13)^(L>>>29|T<<3)^T>>>6}function M(T,L){return(T>>>19|L<<13)^(L>>>29|T<<3)^(T>>>6|L<<26)}function A(T,L){return T>>>0<L>>>0?1:0}return m.prototype._update=function(T){for(var L=this._w,O=this._ah|0,N=this._bh|0,H=this._ch|0,V=this._dh|0,X=this._eh|0,oe=this._fh|0,se=this._gh|0,de=this._hh|0,he=this._al|0,we=this._bl|0,te=this._cl|0,q=this._dl|0,k=this._el|0,y=this._fl|0,B=this._gl|0,$=this._hl|0,I=0;I<32;I+=2)L[I]=T.readInt32BE(I*4),L[I+1]=T.readInt32BE(I*4+4);for(;I<160;I+=2){var F=L[I-30],j=L[I-30+1],D=b(F,j),W=C(j,F);F=L[I-4],j=L[I-4+1];var R=E(F,j),z=M(j,F),ye=L[I-14],Ce=L[I-14+1],me=L[I-32],ie=L[I-32+1],ee=W+Ce|0,pe=D+ye+A(ee,W)|0;ee=ee+z|0,pe=pe+R+A(ee,z)|0,ee=ee+ie|0,pe=pe+me+A(ee,ie)|0,L[I]=pe,L[I+1]=ee}for(var be=0;be<160;be+=2){pe=L[be],ee=L[be+1];var ae=_(O,N,H),ne=_(he,we,te),Se=S(O,he),ke=S(he,O),Ie=x(X,k),Oe=x(k,X),Ue=g[be],De=g[be+1],$e=w(X,oe,se),je=w(k,y,B),Ye=$+Oe|0,st=de+Ie+A(Ye,$)|0;Ye=Ye+je|0,st=st+$e+A(Ye,je)|0,Ye=Ye+De|0,st=st+Ue+A(Ye,De)|0,Ye=Ye+ee|0,st=st+pe+A(Ye,ee)|0;var Je=ke+ne|0,Ge=Se+ae+A(Je,ke)|0;de=se,$=B,se=oe,B=y,oe=X,y=k,k=q+Ye|0,X=V+st+A(k,q)|0,V=H,q=te,H=N,te=we,N=O,we=he,he=Ye+Je|0,O=st+Ge+A(he,Ye)|0}this._al=this._al+he|0,this._bl=this._bl+we|0,this._cl=this._cl+te|0,this._dl=this._dl+q|0,this._el=this._el+k|0,this._fl=this._fl+y|0,this._gl=this._gl+B|0,this._hl=this._hl+$|0,this._ah=this._ah+O+A(this._al,he)|0,this._bh=this._bh+N+A(this._bl,we)|0,this._ch=this._ch+H+A(this._cl,te)|0,this._dh=this._dh+V+A(this._dl,q)|0,this._eh=this._eh+X+A(this._el,k)|0,this._fh=this._fh+oe+A(this._fl,y)|0,this._gh=this._gh+se+A(this._gl,B)|0,this._hh=this._hh+de+A(this._hl,$)|0},m.prototype._hash=function(){var T=d.allocUnsafe(64);function L(O,N,H){T.writeInt32BE(O,H),T.writeInt32BE(N,H+4)}return L(this._ah,this._al,0),L(this._bh,this._bl,8),L(this._ch,this._cl,16),L(this._dh,this._dl,24),L(this._eh,this._el,32),L(this._fh,this._fl,40),L(this._gh,this._gl,48),L(this._hh,this._hl,56),T},sha512$1=m,sha512$1}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var r=requireInherits_browser(),f=requireSha512(),d=requireHash$1(),g=requireSafeBuffer$1().Buffer,v=new Array(160);function m(){this.init(),this._w=v,d.call(this,128,112)}return r(m,f),m.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},m.prototype._hash=function(){var w=g.allocUnsafe(48);function _(S,x,b){w.writeInt32BE(S,b),w.writeInt32BE(x,b+4)}return _(this._ah,this._al,0),_(this._bh,this._bl,8),_(this._ch,this._cl,16),_(this._dh,this._dl,24),_(this._eh,this._el,32),_(this._fh,this._fl,40),w},sha384$1=m,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(function(r){r.exports=function(d){var g=d.toLowerCase(),v=r.exports[g];if(!v)throw new Error(g+" is not supported (we accept pull requests)");return new v},r.exports.sha=requireSha$1(),r.exports.sha1=requireSha1(),r.exports.sha224=requireSha224(),r.exports.sha256=requireSha256(),r.exports.sha384=requireSha384(),r.exports.sha512=requireSha512()})(sha_js)),sha_js.exports}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=d;var r=requireEvents().EventEmitter,f=requireInherits_browser();f(d,r),d.Readable=require_stream_readable$1(),d.Writable=require_stream_writable$1(),d.Duplex=require_stream_duplex$1(),d.Transform=require_stream_transform$1(),d.PassThrough=require_stream_passthrough$1(),d.finished=requireEndOfStream(),d.pipeline=requirePipeline(),d.Stream=d;function d(){r.call(this)}return d.prototype.pipe=function(g,v){var m=this;function w(M){g.writable&&g.write(M)===!1&&m.pause&&m.pause()}m.on("data",w);function _(){m.readable&&m.resume&&m.resume()}g.on("drain",_),!g._isStdio&&(!v||v.end!==!1)&&(m.on("end",x),m.on("close",b));var S=!1;function x(){S||(S=!0,g.end())}function b(){S||(S=!0,typeof g.destroy=="function"&&g.destroy())}function C(M){if(E(),r.listenerCount(this,"error")===0)throw M}m.on("error",C),g.on("error",C);function E(){m.removeListener("data",w),g.removeListener("drain",_),m.removeListener("end",x),m.removeListener("close",b),m.removeListener("error",C),g.removeListener("error",C),m.removeListener("end",E),m.removeListener("close",E),g.removeListener("close",E)}return m.on("end",E),m.on("close",E),g.on("close",E),g.emit("pipe",m),g},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var r=requireSafeBuffer$1().Buffer,f=requireStreamBrowserify().Transform,d=requireString_decoder().StringDecoder,g=requireInherits_browser();function v(S){f.call(this),this.hashMode=typeof S=="string",this.hashMode?this[S]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}g(v,f);var m=typeof Uint8Array<"u",w=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);function _(S,x){if(S instanceof r)return S;if(typeof S=="string")return r.from(S,x);if(w&&ArrayBuffer.isView(S)){if(S.byteLength===0)return r.alloc(0);var b=r.from(S.buffer,S.byteOffset,S.byteLength);if(b.byteLength===S.byteLength)return b}if(m&&S instanceof Uint8Array||r.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S))return r.from(S);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return v.prototype.update=function(S,x,b){var C=_(S,x),E=this._update(C);return this.hashMode?this:(b&&(E=this._toString(E,b)),E)},v.prototype.setAutoPadding=function(){},v.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},v.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},v.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},v.prototype._transform=function(S,x,b){var C;try{this.hashMode?this._update(S):this.push(this._update(S))}catch(E){C=E}finally{b(C)}},v.prototype._flush=function(S){var x;try{this.push(this.__final())}catch(b){x=b}S(x)},v.prototype._finalOrDigest=function(S){var x=this.__final()||r.alloc(0);return S&&(x=this._toString(x,S,!0)),x},v.prototype._toString=function(S,x,b){if(this._decoder||(this._decoder=new d(x),this._encoding=x),this._encoding!==x)throw new Error("can’t switch encodings");var C=this._decoder.write(S);return b&&(C+=this._decoder.end()),C},cipherBase=v,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var r=requireInherits_browser(),f=requireMd5_js(),d=requireRipemd160$1(),g=requireSha_js(),v=requireCipherBase();function m(w){v.call(this,"digest"),this._hash=w}return r(m,v),m.prototype._update=function(w){this._hash.update(w)},m.prototype._final=function(){return this._hash.digest()},browser$9=function(_){return _=_.toLowerCase(),_==="md5"?new f:_==="rmd160"||_==="ripemd160"?new d:new m(g(_))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var r=requireInherits_browser(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),g=f.alloc(128),v=64;function m(w,_){d.call(this,"digest"),typeof _=="string"&&(_=f.from(_)),this._alg=w,this._key=_,_.length>v?_=w(_):_.length<v&&(_=f.concat([_,g],v));for(var S=this._ipad=f.allocUnsafe(v),x=this._opad=f.allocUnsafe(v),b=0;b<v;b++)S[b]=_[b]^54,x[b]=_[b]^92;this._hash=[S]}return r(m,d),m.prototype._update=function(w){this._hash.push(w)},m.prototype._final=function(){var w=this._alg(f.concat(this._hash));return this._alg(f.concat([this._opad,w]))},legacy=m,legacy}var md5$1,hasRequiredMd5$1;function requireMd5$1(){if(hasRequiredMd5$1)return md5$1;hasRequiredMd5$1=1;var r=requireMd5_js();return md5$1=function(f){return new r().update(f).digest()},md5$1}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var r=requireInherits_browser(),f=requireLegacy(),d=requireCipherBase(),g=requireSafeBuffer$1().Buffer,v=requireMd5$1(),m=requireRipemd160$1(),w=requireSha_js(),_=g.alloc(128);function S(x,b){d.call(this,"digest"),typeof b=="string"&&(b=g.from(b));var C=x==="sha512"||x==="sha384"?128:64;if(this._alg=x,this._key=b,b.length>C){var E=x==="rmd160"?new m:w(x);b=E.update(b).digest()}else b.length<C&&(b=g.concat([b,_],C));for(var M=this._ipad=g.allocUnsafe(C),A=this._opad=g.allocUnsafe(C),T=0;T<C;T++)M[T]=b[T]^54,A[T]=b[T]^92;this._hash=x==="rmd160"?new m:w(x),this._hash.update(M)}return r(S,d),S.prototype._update=function(x){this._hash.update(x)},S.prototype._final=function(){var x=this._hash.digest(),b=this._alg==="rmd160"?new m:w(this._alg);return b.update(this._opad).update(x).digest()},browser$8=function(b,C){return b=b.toLowerCase(),b==="rmd160"||b==="ripemd160"?new S("rmd160",C):b==="md5"?new f(v,C):new S(b,C)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256={sign:"ecdsa",hash:"sha256",id:""},sha224={sign:"ecdsa",hash:"sha224",id:""},sha384={sign:"ecdsa",hash:"sha384",id:""},sha512={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var r=Math.pow(2,30)-1;return precondition=function(f,d){if(typeof f!="number")throw new TypeError("Iterations not a number");if(f<0)throw new TypeError("Bad iterations");if(typeof d!="number")throw new TypeError("Key length not a number");if(d<0||d>r||d!==d)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var r;if(commonjsGlobal.process&&commonjsGlobal.process.browser)r="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var f=parseInt(process$1.version.split(".")[0].slice(1),10);r=f>=6?"utf-8":"binary"}else r="utf-8";return defaultEncoding_1=r,defaultEncoding_1}var makeHash,hasRequiredMakeHash;function requireMakeHash(){if(hasRequiredMakeHash)return makeHash;hasRequiredMakeHash=1;var r=4,f=new Buffer(r);f.fill(0);var d=8,g=16;function v(m){if(m.length%r!==0){var w=m.length+(r-m.length%r);m=Buffer.concat([m,f],w)}for(var _=new Array(m.length>>>2),S=0,x=0;S<m.length;S+=r,x++)_[x]=m.readInt32LE(S);return _}return makeHash=function(w,_){var S=_(v(w),w.length*d);w=new Buffer(g);for(var x=0;x<S.length;x++)w.writeInt32LE(S[x],x<<2,!0);return w},makeHash}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var r=requireMakeHash();function f(x,b){x[b>>5]|=128<<b%32,x[(b+64>>>9<<4)+14]=b;for(var C=1732584193,E=-271733879,M=-1732584194,A=271733878,T=0;T<x.length;T+=16){var L=C,O=E,N=M,H=A;C=g(C,E,M,A,x[T+0],7,-680876936),A=g(A,C,E,M,x[T+1],12,-389564586),M=g(M,A,C,E,x[T+2],17,606105819),E=g(E,M,A,C,x[T+3],22,-1044525330),C=g(C,E,M,A,x[T+4],7,-176418897),A=g(A,C,E,M,x[T+5],12,1200080426),M=g(M,A,C,E,x[T+6],17,-1473231341),E=g(E,M,A,C,x[T+7],22,-45705983),C=g(C,E,M,A,x[T+8],7,1770035416),A=g(A,C,E,M,x[T+9],12,-1958414417),M=g(M,A,C,E,x[T+10],17,-42063),E=g(E,M,A,C,x[T+11],22,-1990404162),C=g(C,E,M,A,x[T+12],7,1804603682),A=g(A,C,E,M,x[T+13],12,-40341101),M=g(M,A,C,E,x[T+14],17,-1502002290),E=g(E,M,A,C,x[T+15],22,1236535329),C=v(C,E,M,A,x[T+1],5,-165796510),A=v(A,C,E,M,x[T+6],9,-1069501632),M=v(M,A,C,E,x[T+11],14,643717713),E=v(E,M,A,C,x[T+0],20,-373897302),C=v(C,E,M,A,x[T+5],5,-701558691),A=v(A,C,E,M,x[T+10],9,38016083),M=v(M,A,C,E,x[T+15],14,-660478335),E=v(E,M,A,C,x[T+4],20,-405537848),C=v(C,E,M,A,x[T+9],5,568446438),A=v(A,C,E,M,x[T+14],9,-1019803690),M=v(M,A,C,E,x[T+3],14,-187363961),E=v(E,M,A,C,x[T+8],20,1163531501),C=v(C,E,M,A,x[T+13],5,-1444681467),A=v(A,C,E,M,x[T+2],9,-51403784),M=v(M,A,C,E,x[T+7],14,1735328473),E=v(E,M,A,C,x[T+12],20,-1926607734),C=m(C,E,M,A,x[T+5],4,-378558),A=m(A,C,E,M,x[T+8],11,-2022574463),M=m(M,A,C,E,x[T+11],16,1839030562),E=m(E,M,A,C,x[T+14],23,-35309556),C=m(C,E,M,A,x[T+1],4,-1530992060),A=m(A,C,E,M,x[T+4],11,1272893353),M=m(M,A,C,E,x[T+7],16,-155497632),E=m(E,M,A,C,x[T+10],23,-1094730640),C=m(C,E,M,A,x[T+13],4,681279174),A=m(A,C,E,M,x[T+0],11,-358537222),M=m(M,A,C,E,x[T+3],16,-722521979),E=m(E,M,A,C,x[T+6],23,76029189),C=m(C,E,M,A,x[T+9],4,-640364487),A=m(A,C,E,M,x[T+12],11,-421815835),M=m(M,A,C,E,x[T+15],16,530742520),E=m(E,M,A,C,x[T+2],23,-995338651),C=w(C,E,M,A,x[T+0],6,-198630844),A=w(A,C,E,M,x[T+7],10,1126891415),M=w(M,A,C,E,x[T+14],15,-1416354905),E=w(E,M,A,C,x[T+5],21,-57434055),C=w(C,E,M,A,x[T+12],6,1700485571),A=w(A,C,E,M,x[T+3],10,-1894986606),M=w(M,A,C,E,x[T+10],15,-1051523),E=w(E,M,A,C,x[T+1],21,-2054922799),C=w(C,E,M,A,x[T+8],6,1873313359),A=w(A,C,E,M,x[T+15],10,-30611744),M=w(M,A,C,E,x[T+6],15,-1560198380),E=w(E,M,A,C,x[T+13],21,1309151649),C=w(C,E,M,A,x[T+4],6,-145523070),A=w(A,C,E,M,x[T+11],10,-1120210379),M=w(M,A,C,E,x[T+2],15,718787259),E=w(E,M,A,C,x[T+9],21,-343485551),C=_(C,L),E=_(E,O),M=_(M,N),A=_(A,H)}return[C,E,M,A]}function d(x,b,C,E,M,A){return _(S(_(_(b,x),_(E,A)),M),C)}function g(x,b,C,E,M,A,T){return d(b&C|~b&E,x,b,M,A,T)}function v(x,b,C,E,M,A,T){return d(b&E|C&~E,x,b,M,A,T)}function m(x,b,C,E,M,A,T){return d(b^C^E,x,b,M,A,T)}function w(x,b,C,E,M,A,T){return d(C^(b|~E),x,b,M,A,T)}function _(x,b){var C=(x&65535)+(b&65535),E=(x>>16)+(b>>16)+(C>>16);return E<<16|C&65535}function S(x,b){return x<<b|x>>>32-b}return md5=function(b){return r(b,f)},md5}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var r=requireStreamBrowserify().Transform,f=requireInherits_browser();function d(g){r.call(this),this._block=new Buffer(g),this._blockSize=g,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return f(d,r),d.prototype._transform=function(g,v,m){var w=null;try{v!=="buffer"&&(g=new Buffer(g,v)),this.update(g)}catch(_){w=_}m(w)},d.prototype._flush=function(g){var v=null;try{this.push(this._digest())}catch(m){v=m}g(v)},d.prototype.update=function(g,v){if(!Buffer.isBuffer(g)&&typeof g!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(g)||(g=new Buffer(g,v||"binary"));for(var m=this._block,w=0;this._blockOffset+g.length-w>=this._blockSize;){for(var _=this._blockOffset;_<this._blockSize;)m[_++]=g[w++];this._update(),this._blockOffset=0}for(;w<g.length;)m[this._blockOffset++]=g[w++];for(var S=0,x=g.length*8;x>0;++S)this._length[S]+=x,x=this._length[S]/4294967296|0,x>0&&(this._length[S]-=4294967296*x);return this},d.prototype._update=function(g){throw new Error("_update is not implemented")},d.prototype.digest=function(g){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var v=this._digest();return g!==void 0&&(v=v.toString(g)),v},d.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=d,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var r=requireInherits_browser(),f=requireHashBase();function d(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}r(d,f),d.prototype._update=function(){for(var x=new Array(16),b=0;b<16;++b)x[b]=this._block.readInt32LE(b*4);var C=this._a,E=this._b,M=this._c,A=this._d,T=this._e;C=v(C,E,M,A,T,x[0],0,11),M=g(M,10),T=v(T,C,E,M,A,x[1],0,14),E=g(E,10),A=v(A,T,C,E,M,x[2],0,15),C=g(C,10),M=v(M,A,T,C,E,x[3],0,12),T=g(T,10),E=v(E,M,A,T,C,x[4],0,5),A=g(A,10),C=v(C,E,M,A,T,x[5],0,8),M=g(M,10),T=v(T,C,E,M,A,x[6],0,7),E=g(E,10),A=v(A,T,C,E,M,x[7],0,9),C=g(C,10),M=v(M,A,T,C,E,x[8],0,11),T=g(T,10),E=v(E,M,A,T,C,x[9],0,13),A=g(A,10),C=v(C,E,M,A,T,x[10],0,14),M=g(M,10),T=v(T,C,E,M,A,x[11],0,15),E=g(E,10),A=v(A,T,C,E,M,x[12],0,6),C=g(C,10),M=v(M,A,T,C,E,x[13],0,7),T=g(T,10),E=v(E,M,A,T,C,x[14],0,9),A=g(A,10),C=v(C,E,M,A,T,x[15],0,8),M=g(M,10),T=m(T,C,E,M,A,x[7],1518500249,7),E=g(E,10),A=m(A,T,C,E,M,x[4],1518500249,6),C=g(C,10),M=m(M,A,T,C,E,x[13],1518500249,8),T=g(T,10),E=m(E,M,A,T,C,x[1],1518500249,13),A=g(A,10),C=m(C,E,M,A,T,x[10],1518500249,11),M=g(M,10),T=m(T,C,E,M,A,x[6],1518500249,9),E=g(E,10),A=m(A,T,C,E,M,x[15],1518500249,7),C=g(C,10),M=m(M,A,T,C,E,x[3],1518500249,15),T=g(T,10),E=m(E,M,A,T,C,x[12],1518500249,7),A=g(A,10),C=m(C,E,M,A,T,x[0],1518500249,12),M=g(M,10),T=m(T,C,E,M,A,x[9],1518500249,15),E=g(E,10),A=m(A,T,C,E,M,x[5],1518500249,9),C=g(C,10),M=m(M,A,T,C,E,x[2],1518500249,11),T=g(T,10),E=m(E,M,A,T,C,x[14],1518500249,7),A=g(A,10),C=m(C,E,M,A,T,x[11],1518500249,13),M=g(M,10),T=m(T,C,E,M,A,x[8],1518500249,12),E=g(E,10),A=w(A,T,C,E,M,x[3],1859775393,11),C=g(C,10),M=w(M,A,T,C,E,x[10],1859775393,13),T=g(T,10),E=w(E,M,A,T,C,x[14],1859775393,6),A=g(A,10),C=w(C,E,M,A,T,x[4],1859775393,7),M=g(M,10),T=w(T,C,E,M,A,x[9],1859775393,14),E=g(E,10),A=w(A,T,C,E,M,x[15],1859775393,9),C=g(C,10),M=w(M,A,T,C,E,x[8],1859775393,13),T=g(T,10),E=w(E,M,A,T,C,x[1],1859775393,15),A=g(A,10),C=w(C,E,M,A,T,x[2],1859775393,14),M=g(M,10),T=w(T,C,E,M,A,x[7],1859775393,8),E=g(E,10),A=w(A,T,C,E,M,x[0],1859775393,13),C=g(C,10),M=w(M,A,T,C,E,x[6],1859775393,6),T=g(T,10),E=w(E,M,A,T,C,x[13],1859775393,5),A=g(A,10),C=w(C,E,M,A,T,x[11],1859775393,12),M=g(M,10),T=w(T,C,E,M,A,x[5],1859775393,7),E=g(E,10),A=w(A,T,C,E,M,x[12],1859775393,5),C=g(C,10),M=_(M,A,T,C,E,x[1],2400959708,11),T=g(T,10),E=_(E,M,A,T,C,x[9],2400959708,12),A=g(A,10),C=_(C,E,M,A,T,x[11],2400959708,14),M=g(M,10),T=_(T,C,E,M,A,x[10],2400959708,15),E=g(E,10),A=_(A,T,C,E,M,x[0],2400959708,14),C=g(C,10),M=_(M,A,T,C,E,x[8],2400959708,15),T=g(T,10),E=_(E,M,A,T,C,x[12],2400959708,9),A=g(A,10),C=_(C,E,M,A,T,x[4],2400959708,8),M=g(M,10),T=_(T,C,E,M,A,x[13],2400959708,9),E=g(E,10),A=_(A,T,C,E,M,x[3],2400959708,14),C=g(C,10),M=_(M,A,T,C,E,x[7],2400959708,5),T=g(T,10),E=_(E,M,A,T,C,x[15],2400959708,6),A=g(A,10),C=_(C,E,M,A,T,x[14],2400959708,8),M=g(M,10),T=_(T,C,E,M,A,x[5],2400959708,6),E=g(E,10),A=_(A,T,C,E,M,x[6],2400959708,5),C=g(C,10),M=_(M,A,T,C,E,x[2],2400959708,12),T=g(T,10),E=S(E,M,A,T,C,x[4],2840853838,9),A=g(A,10),C=S(C,E,M,A,T,x[0],2840853838,15),M=g(M,10),T=S(T,C,E,M,A,x[5],2840853838,5),E=g(E,10),A=S(A,T,C,E,M,x[9],2840853838,11),C=g(C,10),M=S(M,A,T,C,E,x[7],2840853838,6),T=g(T,10),E=S(E,M,A,T,C,x[12],2840853838,8),A=g(A,10),C=S(C,E,M,A,T,x[2],2840853838,13),M=g(M,10),T=S(T,C,E,M,A,x[10],2840853838,12),E=g(E,10),A=S(A,T,C,E,M,x[14],2840853838,5),C=g(C,10),M=S(M,A,T,C,E,x[1],2840853838,12),T=g(T,10),E=S(E,M,A,T,C,x[3],2840853838,13),A=g(A,10),C=S(C,E,M,A,T,x[8],2840853838,14),M=g(M,10),T=S(T,C,E,M,A,x[11],2840853838,11),E=g(E,10),A=S(A,T,C,E,M,x[6],2840853838,8),C=g(C,10),M=S(M,A,T,C,E,x[15],2840853838,5),T=g(T,10),E=S(E,M,A,T,C,x[13],2840853838,6),A=g(A,10);var L=this._a,O=this._b,N=this._c,H=this._d,V=this._e;L=S(L,O,N,H,V,x[5],1352829926,8),N=g(N,10),V=S(V,L,O,N,H,x[14],1352829926,9),O=g(O,10),H=S(H,V,L,O,N,x[7],1352829926,9),L=g(L,10),N=S(N,H,V,L,O,x[0],1352829926,11),V=g(V,10),O=S(O,N,H,V,L,x[9],1352829926,13),H=g(H,10),L=S(L,O,N,H,V,x[2],1352829926,15),N=g(N,10),V=S(V,L,O,N,H,x[11],1352829926,15),O=g(O,10),H=S(H,V,L,O,N,x[4],1352829926,5),L=g(L,10),N=S(N,H,V,L,O,x[13],1352829926,7),V=g(V,10),O=S(O,N,H,V,L,x[6],1352829926,7),H=g(H,10),L=S(L,O,N,H,V,x[15],1352829926,8),N=g(N,10),V=S(V,L,O,N,H,x[8],1352829926,11),O=g(O,10),H=S(H,V,L,O,N,x[1],1352829926,14),L=g(L,10),N=S(N,H,V,L,O,x[10],1352829926,14),V=g(V,10),O=S(O,N,H,V,L,x[3],1352829926,12),H=g(H,10),L=S(L,O,N,H,V,x[12],1352829926,6),N=g(N,10),V=_(V,L,O,N,H,x[6],1548603684,9),O=g(O,10),H=_(H,V,L,O,N,x[11],1548603684,13),L=g(L,10),N=_(N,H,V,L,O,x[3],1548603684,15),V=g(V,10),O=_(O,N,H,V,L,x[7],1548603684,7),H=g(H,10),L=_(L,O,N,H,V,x[0],1548603684,12),N=g(N,10),V=_(V,L,O,N,H,x[13],1548603684,8),O=g(O,10),H=_(H,V,L,O,N,x[5],1548603684,9),L=g(L,10),N=_(N,H,V,L,O,x[10],1548603684,11),V=g(V,10),O=_(O,N,H,V,L,x[14],1548603684,7),H=g(H,10),L=_(L,O,N,H,V,x[15],1548603684,7),N=g(N,10),V=_(V,L,O,N,H,x[8],1548603684,12),O=g(O,10),H=_(H,V,L,O,N,x[12],1548603684,7),L=g(L,10),N=_(N,H,V,L,O,x[4],1548603684,6),V=g(V,10),O=_(O,N,H,V,L,x[9],1548603684,15),H=g(H,10),L=_(L,O,N,H,V,x[1],1548603684,13),N=g(N,10),V=_(V,L,O,N,H,x[2],1548603684,11),O=g(O,10),H=w(H,V,L,O,N,x[15],1836072691,9),L=g(L,10),N=w(N,H,V,L,O,x[5],1836072691,7),V=g(V,10),O=w(O,N,H,V,L,x[1],1836072691,15),H=g(H,10),L=w(L,O,N,H,V,x[3],1836072691,11),N=g(N,10),V=w(V,L,O,N,H,x[7],1836072691,8),O=g(O,10),H=w(H,V,L,O,N,x[14],1836072691,6),L=g(L,10),N=w(N,H,V,L,O,x[6],1836072691,6),V=g(V,10),O=w(O,N,H,V,L,x[9],1836072691,14),H=g(H,10),L=w(L,O,N,H,V,x[11],1836072691,12),N=g(N,10),V=w(V,L,O,N,H,x[8],1836072691,13),O=g(O,10),H=w(H,V,L,O,N,x[12],1836072691,5),L=g(L,10),N=w(N,H,V,L,O,x[2],1836072691,14),V=g(V,10),O=w(O,N,H,V,L,x[10],1836072691,13),H=g(H,10),L=w(L,O,N,H,V,x[0],1836072691,13),N=g(N,10),V=w(V,L,O,N,H,x[4],1836072691,7),O=g(O,10),H=w(H,V,L,O,N,x[13],1836072691,5),L=g(L,10),N=m(N,H,V,L,O,x[8],2053994217,15),V=g(V,10),O=m(O,N,H,V,L,x[6],2053994217,5),H=g(H,10),L=m(L,O,N,H,V,x[4],2053994217,8),N=g(N,10),V=m(V,L,O,N,H,x[1],2053994217,11),O=g(O,10),H=m(H,V,L,O,N,x[3],2053994217,14),L=g(L,10),N=m(N,H,V,L,O,x[11],2053994217,14),V=g(V,10),O=m(O,N,H,V,L,x[15],2053994217,6),H=g(H,10),L=m(L,O,N,H,V,x[0],2053994217,14),N=g(N,10),V=m(V,L,O,N,H,x[5],2053994217,6),O=g(O,10),H=m(H,V,L,O,N,x[12],2053994217,9),L=g(L,10),N=m(N,H,V,L,O,x[2],2053994217,12),V=g(V,10),O=m(O,N,H,V,L,x[13],2053994217,9),H=g(H,10),L=m(L,O,N,H,V,x[9],2053994217,12),N=g(N,10),V=m(V,L,O,N,H,x[7],2053994217,5),O=g(O,10),H=m(H,V,L,O,N,x[10],2053994217,15),L=g(L,10),N=m(N,H,V,L,O,x[14],2053994217,8),V=g(V,10),O=v(O,N,H,V,L,x[12],0,8),H=g(H,10),L=v(L,O,N,H,V,x[15],0,5),N=g(N,10),V=v(V,L,O,N,H,x[10],0,12),O=g(O,10),H=v(H,V,L,O,N,x[4],0,9),L=g(L,10),N=v(N,H,V,L,O,x[1],0,12),V=g(V,10),O=v(O,N,H,V,L,x[5],0,5),H=g(H,10),L=v(L,O,N,H,V,x[8],0,14),N=g(N,10),V=v(V,L,O,N,H,x[7],0,6),O=g(O,10),H=v(H,V,L,O,N,x[6],0,8),L=g(L,10),N=v(N,H,V,L,O,x[2],0,13),V=g(V,10),O=v(O,N,H,V,L,x[13],0,6),H=g(H,10),L=v(L,O,N,H,V,x[14],0,5),N=g(N,10),V=v(V,L,O,N,H,x[0],0,15),O=g(O,10),H=v(H,V,L,O,N,x[3],0,13),L=g(L,10),N=v(N,H,V,L,O,x[9],0,11),V=g(V,10),O=v(O,N,H,V,L,x[11],0,11),H=g(H,10);var X=this._b+M+H|0;this._b=this._c+A+V|0,this._c=this._d+T+L|0,this._d=this._e+C+O|0,this._e=this._a+E+N|0,this._a=X},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var x=new Buffer(20);return x.writeInt32LE(this._a,0),x.writeInt32LE(this._b,4),x.writeInt32LE(this._c,8),x.writeInt32LE(this._d,12),x.writeInt32LE(this._e,16),x};function g(x,b){return x<<b|x>>>32-b}function v(x,b,C,E,M,A,T,L){return g(x+(b^C^E)+A+T|0,L)+M|0}function m(x,b,C,E,M,A,T,L){return g(x+(b&C|~b&E)+A+T|0,L)+M|0}function w(x,b,C,E,M,A,T,L){return g(x+((b|~C)^E)+A+T|0,L)+M|0}function _(x,b,C,E,M,A,T,L){return g(x+(b&E|C&~E)+A+T|0,L)+M|0}function S(x,b,C,E,M,A,T,L){return g(x+(b^(C|~E))+A+T|0,L)+M|0}return ripemd160=d,ripemd160}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var r=requireSafeBuffer$1().Buffer,f=requireToBuffer$1(),d=typeof Uint8Array<"u",g=d&&typeof ArrayBuffer<"u",v=g&&ArrayBuffer.isView;return toBuffer_1=function(m,w,_){if(typeof m=="string"||r.isBuffer(m)||d&&m instanceof Uint8Array||v&&v(m))return f(m,w);throw new TypeError(_+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var r=requireMd5(),f=requireRipemd160(),d=requireSha_js(),g=requireSafeBuffer$1().Buffer,v=requirePrecondition(),m=requireDefaultEncoding(),w=requireToBuffer(),_=g.alloc(128),S={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},x={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function b(A){return new f().update(A).digest()}function C(A){function T(L){return d(A).update(L).digest()}return A==="rmd160"||A==="ripemd160"?b:A==="md5"?r:T}function E(A,T,L){var O=C(A),N=A==="sha512"||A==="sha384"?128:64;T.length>N?T=O(T):T.length<N&&(T=g.concat([T,_],N));for(var H=g.allocUnsafe(N+S[A]),V=g.allocUnsafe(N+S[A]),X=0;X<N;X++)H[X]=T[X]^54,V[X]=T[X]^92;var oe=g.allocUnsafe(N+L+4);H.copy(oe,0,0,N),this.ipad1=oe,this.ipad2=H,this.opad=V,this.alg=A,this.blocksize=N,this.hash=O,this.size=S[A]}E.prototype.run=function(A,T){A.copy(T,this.blocksize);var L=this.hash(T);return L.copy(this.opad,this.blocksize),this.hash(this.opad)};function M(A,T,L,O,N){v(L,O),A=w(A,m,"Password"),T=w(T,m,"Salt");var H=(N||"sha1").toLowerCase(),V=x[H]||H,X=S[V];if(typeof X!="number"||!X)throw new TypeError("Digest algorithm not supported: "+N);var oe=new E(V,A,T.length),se=g.allocUnsafe(O),de=g.allocUnsafe(T.length+4);T.copy(de,0,0,T.length);for(var he=0,we=X,te=Math.ceil(O/we),q=1;q<=te;q++){de.writeUInt32BE(q,T.length);for(var k=oe.run(de,oe.ipad1),y=k,B=1;B<L;B++){y=oe.run(y,oe.ipad2);for(var $=0;$<we;$++)k[$]^=y[$]}k.copy(se,he),he+=we}return se}return syncBrowser=M,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var r=requireSafeBuffer$1().Buffer,f=requirePrecondition(),d=requireDefaultEncoding(),g=requireSyncBrowser(),v=requireToBuffer(),m,w=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,_={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},S=[],x;function b(){return x||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?x=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?x=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?x=commonjsGlobal.setImmediate:x=commonjsGlobal.setTimeout,x)}function C(A,T,L,O,N){return w.importKey("raw",A,{name:"PBKDF2"},!1,["deriveBits"]).then(function(H){return w.deriveBits({name:"PBKDF2",salt:T,iterations:L,hash:{name:N}},H,O<<3)}).then(function(H){return r.from(H)})}function E(A){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!w||!w.importKey||!w.deriveBits)return Promise.resolve(!1);if(S[A]!==void 0)return S[A];m=m||r.alloc(8);var T=C(m,m,10,128,A).then(function(){return!0},function(){return!1});return S[A]=T,T}function M(A,T){A.then(function(L){b()(function(){T(null,L)})},function(L){b()(function(){T(L)})})}return async=function(A,T,L,O,N,H){typeof N=="function"&&(H=N,N=void 0),N=N||"sha1";var V=_[N.toLowerCase()];if(!V||typeof commonjsGlobal.Promise!="function"){b()(function(){var X;try{X=g(A,T,L,O,N)}catch(oe){H(oe);return}H(null,X)});return}if(f(L,O),A=v(A,d,"Password"),T=v(T,d,"Salt"),typeof H!="function")throw new Error("No callback provided to pbkdf2");M(E(V).then(function(X){return X?C(A,T,L,O,V):g(A,T,L,O,N)}),H)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$3={},hasRequiredUtils$3;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(v,m){var w=v[0+m]<<24|v[1+m]<<16|v[2+m]<<8|v[3+m];return w>>>0},utils$3.writeUInt32BE=function(v,m,w){v[0+w]=m>>>24,v[1+w]=m>>>16&255,v[2+w]=m>>>8&255,v[3+w]=m&255},utils$3.ip=function(v,m,w,_){for(var S=0,x=0,b=6;b>=0;b-=2){for(var C=0;C<=24;C+=8)S<<=1,S|=m>>>C+b&1;for(var C=0;C<=24;C+=8)S<<=1,S|=v>>>C+b&1}for(var b=6;b>=0;b-=2){for(var C=1;C<=25;C+=8)x<<=1,x|=m>>>C+b&1;for(var C=1;C<=25;C+=8)x<<=1,x|=v>>>C+b&1}w[_+0]=S>>>0,w[_+1]=x>>>0},utils$3.rip=function(v,m,w,_){for(var S=0,x=0,b=0;b<4;b++)for(var C=24;C>=0;C-=8)S<<=1,S|=m>>>C+b&1,S<<=1,S|=v>>>C+b&1;for(var b=4;b<8;b++)for(var C=24;C>=0;C-=8)x<<=1,x|=m>>>C+b&1,x<<=1,x|=v>>>C+b&1;w[_+0]=S>>>0,w[_+1]=x>>>0},utils$3.pc1=function(v,m,w,_){for(var S=0,x=0,b=7;b>=5;b--){for(var C=0;C<=24;C+=8)S<<=1,S|=m>>C+b&1;for(var C=0;C<=24;C+=8)S<<=1,S|=v>>C+b&1}for(var C=0;C<=24;C+=8)S<<=1,S|=m>>C+b&1;for(var b=1;b<=3;b++){for(var C=0;C<=24;C+=8)x<<=1,x|=m>>C+b&1;for(var C=0;C<=24;C+=8)x<<=1,x|=v>>C+b&1}for(var C=0;C<=24;C+=8)x<<=1,x|=v>>C+b&1;w[_+0]=S>>>0,w[_+1]=x>>>0},utils$3.r28shl=function(v,m){return v<<m&268435455|v>>>28-m};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$3.pc2=function(v,m,w,_){for(var S=0,x=0,b=r.length>>>1,C=0;C<b;C++)S<<=1,S|=v>>>r[C]&1;for(var C=b;C<r.length;C++)x<<=1,x|=m>>>r[C]&1;w[_+0]=S>>>0,w[_+1]=x>>>0},utils$3.expand=function(v,m,w){var _=0,S=0;_=(v&1)<<5|v>>>27;for(var x=23;x>=15;x-=4)_<<=6,_|=v>>>x&63;for(var x=11;x>=3;x-=4)S|=v>>>x&63,S<<=6;S|=(v&31)<<1|v>>>31,m[w+0]=_>>>0,m[w+1]=S>>>0};var f=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$3.substitute=function(v,m){for(var w=0,_=0;_<4;_++){var S=v>>>18-_*6&63,x=f[_*64+S];w<<=4,w|=x}for(var _=0;_<4;_++){var S=m>>>18-_*6&63,x=f[256+_*64+S];w<<=4,w|=x}return w>>>0};var d=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$3.permute=function(v){for(var m=0,w=0;w<d.length;w++)m<<=1,m|=v>>>d[w]&1;return m>>>0},utils$3.padSplit=function(v,m,w){for(var _=v.toString(2);_.length<m;)_="0"+_;for(var S=[],x=0;x<m;x+=w)S.push(_.slice(x,x+w));return S.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=r;function r(f,d){if(!f)throw new Error(d||"Assertion failed")}return r.equal=function(d,g,v){if(d!=g)throw new Error(v||"Assertion failed: "+d+" != "+g)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var r=requireMinimalisticAssert();function f(d){this.options=d,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=d.padding!==!1}return cipher=f,f.prototype._init=function(){},f.prototype.update=function(g){return g.length===0?[]:this.type==="decrypt"?this._updateDecrypt(g):this._updateEncrypt(g)},f.prototype._buffer=function(g,v){for(var m=Math.min(this.buffer.length-this.bufferOff,g.length-v),w=0;w<m;w++)this.buffer[this.bufferOff+w]=g[v+w];return this.bufferOff+=m,m},f.prototype._flushBuffer=function(g,v){return this._update(this.buffer,0,g,v),this.bufferOff=0,this.blockSize},f.prototype._updateEncrypt=function(g){var v=0,m=0,w=(this.bufferOff+g.length)/this.blockSize|0,_=new Array(w*this.blockSize);this.bufferOff!==0&&(v+=this._buffer(g,v),this.bufferOff===this.buffer.length&&(m+=this._flushBuffer(_,m)));for(var S=g.length-(g.length-v)%this.blockSize;v<S;v+=this.blockSize)this._update(g,v,_,m),m+=this.blockSize;for(;v<g.length;v++,this.bufferOff++)this.buffer[this.bufferOff]=g[v];return _},f.prototype._updateDecrypt=function(g){for(var v=0,m=0,w=Math.ceil((this.bufferOff+g.length)/this.blockSize)-1,_=new Array(w*this.blockSize);w>0;w--)v+=this._buffer(g,v),m+=this._flushBuffer(_,m);return v+=this._buffer(g,v),_},f.prototype.final=function(g){var v;g&&(v=this.update(g));var m;return this.type==="encrypt"?m=this._finalEncrypt():m=this._finalDecrypt(),v?v.concat(m):m},f.prototype._pad=function(g,v){if(v===0)return!1;for(;v<g.length;)g[v++]=0;return!0},f.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var g=new Array(this.blockSize);return this._update(this.buffer,0,g,0),g},f.prototype._unpad=function(g){return g},f.prototype._finalDecrypt=function(){r.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var g=new Array(this.blockSize);return this._flushBuffer(g,0),this._unpad(g)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d=requireUtils$3(),g=requireCipher();function v(){this.tmp=new Array(2),this.keys=null}function m(_){g.call(this,_);var S=new v;this._desState=S,this.deriveKeys(S,_.key)}f(m,g),des=m,m.create=function(S){return new m(S)};var w=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return m.prototype.deriveKeys=function(S,x){S.keys=new Array(32),r.equal(x.length,this.blockSize,"Invalid key length");var b=d.readUInt32BE(x,0),C=d.readUInt32BE(x,4);d.pc1(b,C,S.tmp,0),b=S.tmp[0],C=S.tmp[1];for(var E=0;E<S.keys.length;E+=2){var M=w[E>>>1];b=d.r28shl(b,M),C=d.r28shl(C,M),d.pc2(b,C,S.keys,E)}},m.prototype._update=function(S,x,b,C){var E=this._desState,M=d.readUInt32BE(S,x),A=d.readUInt32BE(S,x+4);d.ip(M,A,E.tmp,0),M=E.tmp[0],A=E.tmp[1],this.type==="encrypt"?this._encrypt(E,M,A,E.tmp,0):this._decrypt(E,M,A,E.tmp,0),M=E.tmp[0],A=E.tmp[1],d.writeUInt32BE(b,M,C),d.writeUInt32BE(b,A,C+4)},m.prototype._pad=function(S,x){if(this.padding===!1)return!1;for(var b=S.length-x,C=x;C<S.length;C++)S[C]=b;return!0},m.prototype._unpad=function(S){if(this.padding===!1)return S;for(var x=S[S.length-1],b=S.length-x;b<S.length;b++)r.equal(S[b],x);return S.slice(0,S.length-x)},m.prototype._encrypt=function(S,x,b,C,E){for(var M=x,A=b,T=0;T<S.keys.length;T+=2){var L=S.keys[T],O=S.keys[T+1];d.expand(A,S.tmp,0),L^=S.tmp[0],O^=S.tmp[1];var N=d.substitute(L,O),H=d.permute(N),V=A;A=(M^H)>>>0,M=V}d.rip(A,M,C,E)},m.prototype._decrypt=function(S,x,b,C,E){for(var M=b,A=x,T=S.keys.length-2;T>=0;T-=2){var L=S.keys[T],O=S.keys[T+1];d.expand(M,S.tmp,0),L^=S.tmp[0],O^=S.tmp[1];var N=d.substitute(L,O),H=d.permute(N),V=M;M=(A^H)>>>0,A=V}d.rip(M,A,C,E)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d={};function g(m){r.equal(m.length,8,"Invalid IV length"),this.iv=new Array(8);for(var w=0;w<this.iv.length;w++)this.iv[w]=m[w]}function v(m){function w(b){m.call(this,b),this._cbcInit()}f(w,m);for(var _=Object.keys(d),S=0;S<_.length;S++){var x=_[S];w.prototype[x]=d[x]}return w.create=function(C){return new w(C)},w}return cbc$1.instantiate=v,d._cbcInit=function(){var w=new g(this.options.iv);this._cbcState=w},d._update=function(w,_,S,x){var b=this._cbcState,C=this.constructor.super_.prototype,E=b.iv;if(this.type==="encrypt"){for(var M=0;M<this.blockSize;M++)E[M]^=w[_+M];C._update.call(this,E,0,S,x);for(var M=0;M<this.blockSize;M++)E[M]=S[x+M]}else{C._update.call(this,w,_,S,x);for(var M=0;M<this.blockSize;M++)S[x+M]^=E[M];for(var M=0;M<this.blockSize;M++)E[M]=w[_+M]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d=requireCipher(),g=requireDes$1();function v(w,_){r.equal(_.length,24,"Invalid key length");var S=_.slice(0,8),x=_.slice(8,16),b=_.slice(16,24);w==="encrypt"?this.ciphers=[g.create({type:"encrypt",key:S}),g.create({type:"decrypt",key:x}),g.create({type:"encrypt",key:b})]:this.ciphers=[g.create({type:"decrypt",key:b}),g.create({type:"encrypt",key:x}),g.create({type:"decrypt",key:S})]}function m(w){d.call(this,w);var _=new v(this.type,this.options.key);this._edeState=_}return f(m,d),ede=m,m.create=function(_){return new m(_)},m.prototype._update=function(_,S,x,b){var C=this._edeState;C.ciphers[0]._update(_,S,x,b),C.ciphers[1]._update(x,b,x,b),C.ciphers[2]._update(x,b,x,b)},m.prototype._pad=g.prototype._pad,m.prototype._unpad=g.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var r=requireCipherBase(),f=requireDes(),d=requireInherits_browser(),g=requireSafeBuffer$1().Buffer,v={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};v.des=v["des-cbc"],v.des3=v["des-ede3-cbc"],browserifyDes=m,d(m,r);function m(w){r.call(this);var _=w.mode.toLowerCase(),S=v[_],x;w.decrypt?x="decrypt":x="encrypt";var b=w.key;g.isBuffer(b)||(b=g.from(b)),(_==="des-ede"||_==="des-ede-cbc")&&(b=g.concat([b,b.slice(0,8)]));var C=w.iv;g.isBuffer(C)||(C=g.from(C)),this._des=S.create({key:b,iv:C,type:x})}return m.prototype._update=function(w){return g.from(this._des.update(w))},m.prototype._final=function(){return g.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(r,f){return r._cipher.encryptBlock(f)},ecb.decrypt=function(r,f){return r._cipher.decryptBlock(f)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(f,d){for(var g=Math.min(f.length,d.length),v=new Buffer(g),m=0;m<g;++m)v[m]=f[m]^d[m];return v}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var r=requireBufferXor();return cbc.encrypt=function(f,d){var g=r(d,f._prev);return f._prev=f._cipher.encryptBlock(g),f._prev},cbc.decrypt=function(f,d){var g=f._prev;f._prev=d;var v=f._cipher.decryptBlock(d);return r(v,g)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var r=requireSafeBuffer$1().Buffer,f=requireBufferXor();function d(g,v,m){var w=v.length,_=f(v,g._cache);return g._cache=g._cache.slice(w),g._prev=r.concat([g._prev,m?v:_]),_}return cfb.encrypt=function(g,v,m){for(var w=r.allocUnsafe(0),_;v.length;)if(g._cache.length===0&&(g._cache=g._cipher.encryptBlock(g._prev),g._prev=r.allocUnsafe(0)),g._cache.length<=v.length)_=g._cache.length,w=r.concat([w,d(g,v.slice(0,_),m)]),v=v.slice(_);else{w=r.concat([w,d(g,v,m)]);break}return w},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var r=requireSafeBuffer$1().Buffer;function f(d,g,v){var m=d._cipher.encryptBlock(d._prev),w=m[0]^g;return d._prev=r.concat([d._prev.slice(1),r.from([v?g:w])]),w}return cfb8.encrypt=function(d,g,v){for(var m=g.length,w=r.allocUnsafe(m),_=-1;++_<m;)w[_]=f(d,g[_],v);return w},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var r=requireSafeBuffer$1().Buffer;function f(g,v,m){for(var w,_=-1,S=8,x=0,b,C;++_<S;)w=g._cipher.encryptBlock(g._prev),b=v&1<<7-_?128:0,C=w[0]^b,x+=(C&128)>>_%8,g._prev=d(g._prev,m?b:C);return x}function d(g,v){var m=g.length,w=-1,_=r.allocUnsafe(g.length);for(g=r.concat([g,r.from([v])]);++w<m;)_[w]=g[w]<<1|g[w+1]>>7;return _}return cfb1.encrypt=function(g,v,m){for(var w=v.length,_=r.allocUnsafe(w),S=-1;++S<w;)_[S]=f(g,v[S],m);return _},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var r=requireBufferXor();function f(d){return d._prev=d._cipher.encryptBlock(d._prev),d._prev}return ofb.encrypt=function(d,g){for(;d._cache.length<g.length;)d._cache=Buffer.concat([d._cache,f(d)]);var v=d._cache.slice(0,g.length);return d._cache=d._cache.slice(g.length),r(g,v)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function r(f){for(var d=f.length,g;d--;)if(g=f.readUInt8(d),g===255)f.writeUInt8(0,d);else{g++,f.writeUInt8(g,d);break}}return incr32_1=r,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var r=requireBufferXor(),f=requireSafeBuffer$1().Buffer,d=requireIncr32();function g(m){var w=m._cipher.encryptBlockRaw(m._prev);return d(m._prev),w}var v=16;return ctr.encrypt=function(m,w){var _=Math.ceil(w.length/v),S=m._cache.length;m._cache=f.concat([m._cache,f.allocUnsafe(_*v)]);for(var x=0;x<_;x++){var b=g(m),C=S+x*v;m._cache.writeUInt32BE(b[0],C+0),m._cache.writeUInt32BE(b[1],C+4),m._cache.writeUInt32BE(b[2],C+8),m._cache.writeUInt32BE(b[3],C+12)}var E=m._cache.slice(0,w.length);return m._cache=m._cache.slice(w.length),r(w,E)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var r={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},f=require$$2;for(var d in f)f[d].module=r[f[d].mode];return modes_1=f,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var r=requireSafeBuffer$1().Buffer;function f(_){r.isBuffer(_)||(_=r.from(_));for(var S=_.length/4|0,x=new Array(S),b=0;b<S;b++)x[b]=_.readUInt32BE(b*4);return x}function d(_){for(var S=0;S<_.length;_++)_[S]=0}function g(_,S,x,b,C){for(var E=x[0],M=x[1],A=x[2],T=x[3],L=_[0]^S[0],O=_[1]^S[1],N=_[2]^S[2],H=_[3]^S[3],V,X,oe,se,de=4,he=1;he<C;he++)V=E[L>>>24]^M[O>>>16&255]^A[N>>>8&255]^T[H&255]^S[de++],X=E[O>>>24]^M[N>>>16&255]^A[H>>>8&255]^T[L&255]^S[de++],oe=E[N>>>24]^M[H>>>16&255]^A[L>>>8&255]^T[O&255]^S[de++],se=E[H>>>24]^M[L>>>16&255]^A[O>>>8&255]^T[N&255]^S[de++],L=V,O=X,N=oe,H=se;return V=(b[L>>>24]<<24|b[O>>>16&255]<<16|b[N>>>8&255]<<8|b[H&255])^S[de++],X=(b[O>>>24]<<24|b[N>>>16&255]<<16|b[H>>>8&255]<<8|b[L&255])^S[de++],oe=(b[N>>>24]<<24|b[H>>>16&255]<<16|b[L>>>8&255]<<8|b[O&255])^S[de++],se=(b[H>>>24]<<24|b[L>>>16&255]<<16|b[O>>>8&255]<<8|b[N&255])^S[de++],V=V>>>0,X=X>>>0,oe=oe>>>0,se=se>>>0,[V,X,oe,se]}var v=[0,1,2,4,8,16,32,64,128,27,54],m=(function(){for(var _=new Array(256),S=0;S<256;S++)S<128?_[S]=S<<1:_[S]=S<<1^283;for(var x=[],b=[],C=[[],[],[],[]],E=[[],[],[],[]],M=0,A=0,T=0;T<256;++T){var L=A^A<<1^A<<2^A<<3^A<<4;L=L>>>8^L&255^99,x[M]=L,b[L]=M;var O=_[M],N=_[O],H=_[N],V=_[L]*257^L*16843008;C[0][M]=V<<24|V>>>8,C[1][M]=V<<16|V>>>16,C[2][M]=V<<8|V>>>24,C[3][M]=V,V=H*16843009^N*65537^O*257^M*16843008,E[0][L]=V<<24|V>>>8,E[1][L]=V<<16|V>>>16,E[2][L]=V<<8|V>>>24,E[3][L]=V,M===0?M=A=1:(M=O^_[_[_[H^O]]],A^=_[_[A]])}return{SBOX:x,INV_SBOX:b,SUB_MIX:C,INV_SUB_MIX:E}})();function w(_){this._key=f(_),this._reset()}return w.blockSize=16,w.keySize=256/8,w.prototype.blockSize=w.blockSize,w.prototype.keySize=w.keySize,w.prototype._reset=function(){for(var _=this._key,S=_.length,x=S+6,b=(x+1)*4,C=[],E=0;E<S;E++)C[E]=_[E];for(E=S;E<b;E++){var M=C[E-1];E%S===0?(M=M<<8|M>>>24,M=m.SBOX[M>>>24]<<24|m.SBOX[M>>>16&255]<<16|m.SBOX[M>>>8&255]<<8|m.SBOX[M&255],M^=v[E/S|0]<<24):S>6&&E%S===4&&(M=m.SBOX[M>>>24]<<24|m.SBOX[M>>>16&255]<<16|m.SBOX[M>>>8&255]<<8|m.SBOX[M&255]),C[E]=C[E-S]^M}for(var A=[],T=0;T<b;T++){var L=b-T,O=C[L-(T%4?0:4)];T<4||L<=4?A[T]=O:A[T]=m.INV_SUB_MIX[0][m.SBOX[O>>>24]]^m.INV_SUB_MIX[1][m.SBOX[O>>>16&255]]^m.INV_SUB_MIX[2][m.SBOX[O>>>8&255]]^m.INV_SUB_MIX[3][m.SBOX[O&255]]}this._nRounds=x,this._keySchedule=C,this._invKeySchedule=A},w.prototype.encryptBlockRaw=function(_){return _=f(_),g(_,this._keySchedule,m.SUB_MIX,m.SBOX,this._nRounds)},w.prototype.encryptBlock=function(_){var S=this.encryptBlockRaw(_),x=r.allocUnsafe(16);return x.writeUInt32BE(S[0],0),x.writeUInt32BE(S[1],4),x.writeUInt32BE(S[2],8),x.writeUInt32BE(S[3],12),x},w.prototype.decryptBlock=function(_){_=f(_);var S=_[1];_[1]=_[3],_[3]=S;var x=g(_,this._invKeySchedule,m.INV_SUB_MIX,m.INV_SBOX,this._nRounds),b=r.allocUnsafe(16);return b.writeUInt32BE(x[0],0),b.writeUInt32BE(x[3],4),b.writeUInt32BE(x[2],8),b.writeUInt32BE(x[1],12),b},w.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},aes.AES=w,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var r=requireSafeBuffer$1().Buffer,f=r.alloc(16,0);function d(m){return[m.readUInt32BE(0),m.readUInt32BE(4),m.readUInt32BE(8),m.readUInt32BE(12)]}function g(m){var w=r.allocUnsafe(16);return w.writeUInt32BE(m[0]>>>0,0),w.writeUInt32BE(m[1]>>>0,4),w.writeUInt32BE(m[2]>>>0,8),w.writeUInt32BE(m[3]>>>0,12),w}function v(m){this.h=m,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}return v.prototype.ghash=function(m){for(var w=-1;++w<m.length;)this.state[w]^=m[w];this._multiply()},v.prototype._multiply=function(){for(var m=d(this.h),w=[0,0,0,0],_,S,x,b=-1;++b<128;){for(S=(this.state[~~(b/8)]&1<<7-b%8)!==0,S&&(w[0]^=m[0],w[1]^=m[1],w[2]^=m[2],w[3]^=m[3]),x=(m[3]&1)!==0,_=3;_>0;_--)m[_]=m[_]>>>1|(m[_-1]&1)<<31;m[0]=m[0]>>>1,x&&(m[0]=m[0]^225<<24)}this.state=g(w)},v.prototype.update=function(m){this.cache=r.concat([this.cache,m]);for(var w;this.cache.length>=16;)w=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(w)},v.prototype.final=function(m,w){return this.cache.length&&this.ghash(r.concat([this.cache,f],16)),this.ghash(g([0,m,0,w])),this.state},ghash=v,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var r=requireAes(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),g=requireInherits_browser(),v=requireGhash(),m=requireBufferXor(),w=requireIncr32();function _(b,C){var E=0;b.length!==C.length&&E++;for(var M=Math.min(b.length,C.length),A=0;A<M;++A)E+=b[A]^C[A];return E}function S(b,C,E){if(C.length===12)return b._finID=f.concat([C,f.from([0,0,0,1])]),f.concat([C,f.from([0,0,0,2])]);var M=new v(E),A=C.length,T=A%16;M.update(C),T&&(T=16-T,M.update(f.alloc(T,0))),M.update(f.alloc(8,0));var L=A*8,O=f.alloc(8);O.writeUIntBE(L,0,8),M.update(O),b._finID=M.state;var N=f.from(b._finID);return w(N),N}function x(b,C,E,M){d.call(this);var A=f.alloc(4,0);this._cipher=new r.AES(C);var T=this._cipher.encryptBlock(A);this._ghash=new v(T),E=S(this,E,T),this._prev=f.from(E),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=M,this._alen=0,this._len=0,this._mode=b,this._authTag=null,this._called=!1}return g(x,d),x.prototype._update=function(b){if(!this._called&&this._alen){var C=16-this._alen%16;C<16&&(C=f.alloc(C,0),this._ghash.update(C))}this._called=!0;var E=this._mode.encrypt(this,b);return this._decrypt?this._ghash.update(b):this._ghash.update(E),this._len+=b.length,E},x.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var b=m(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&_(b,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=b,this._cipher.scrub()},x.prototype.getAuthTag=function(){if(this._decrypt||!f.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},x.prototype.setAuthTag=function(C){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=C},x.prototype.setAAD=function(C){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(C),this._alen+=C.length},authCipher=x,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var r=requireAes(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),g=requireInherits_browser();function v(m,w,_,S){d.call(this),this._cipher=new r.AES(w),this._prev=f.from(_),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=S,this._mode=m}return g(v,d),v.prototype._update=function(m){return this._mode.encrypt(this,m,this._decrypt)},v.prototype._final=function(){this._cipher.scrub()},streamCipher=v,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var r=requireSafeBuffer$1().Buffer,f=requireMd5_js();function d(g,v,m,w){if(r.isBuffer(g)||(g=r.from(g,"binary")),v&&(r.isBuffer(v)||(v=r.from(v,"binary")),v.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var _=m/8,S=r.alloc(_),x=r.alloc(w||0),b=r.alloc(0);_>0||w>0;){var C=new f;C.update(b),C.update(g),v&&C.update(v),b=C.digest();var E=0;if(_>0){var M=S.length-_;E=Math.min(_,b.length),b.copy(S,M,0,E),_-=E}if(E<b.length&&w>0){var A=x.length-w,T=Math.min(w,b.length-E);b.copy(x,A,E,E+T),w-=T}}return b.fill(0),{key:S,iv:x}}return evp_bytestokey=d,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var r=requireModes$1(),f=requireAuthCipher(),d=requireSafeBuffer$1().Buffer,g=requireStreamCipher(),v=requireCipherBase(),m=requireAes(),w=requireEvp_bytestokey(),_=requireInherits_browser();function S(M,A,T){v.call(this),this._cache=new b,this._cipher=new m.AES(A),this._prev=d.from(T),this._mode=M,this._autopadding=!0}_(S,v),S.prototype._update=function(M){this._cache.add(M);for(var A,T,L=[];A=this._cache.get();)T=this._mode.encrypt(this,A),L.push(T);return d.concat(L)};var x=d.alloc(16,16);S.prototype._final=function(){var M=this._cache.flush();if(this._autopadding)return M=this._mode.encrypt(this,M),this._cipher.scrub(),M;if(!M.equals(x))throw this._cipher.scrub(),new Error("data not multiple of block length")},S.prototype.setAutoPadding=function(M){return this._autopadding=!!M,this};function b(){this.cache=d.allocUnsafe(0)}b.prototype.add=function(M){this.cache=d.concat([this.cache,M])},b.prototype.get=function(){if(this.cache.length>15){var M=this.cache.slice(0,16);return this.cache=this.cache.slice(16),M}return null},b.prototype.flush=function(){for(var M=16-this.cache.length,A=d.allocUnsafe(M),T=-1;++T<M;)A.writeUInt8(M,T);return d.concat([this.cache,A])};function C(M,A,T){var L=r[M.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if(typeof A=="string"&&(A=d.from(A)),A.length!==L.key/8)throw new TypeError("invalid key length "+A.length);if(typeof T=="string"&&(T=d.from(T)),L.mode!=="GCM"&&T.length!==L.iv)throw new TypeError("invalid iv length "+T.length);return L.type==="stream"?new g(L.module,A,T):L.type==="auth"?new f(L.module,A,T):new S(L.module,A,T)}function E(M,A){var T=r[M.toLowerCase()];if(!T)throw new TypeError("invalid suite type");var L=w(A,!1,T.key,T.iv);return C(M,L.key,L.iv)}return encrypter.createCipheriv=C,encrypter.createCipher=E,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var r=requireAuthCipher(),f=requireSafeBuffer$1().Buffer,d=requireModes$1(),g=requireStreamCipher(),v=requireCipherBase(),m=requireAes(),w=requireEvp_bytestokey(),_=requireInherits_browser();function S(M,A,T){v.call(this),this._cache=new x,this._last=void 0,this._cipher=new m.AES(A),this._prev=f.from(T),this._mode=M,this._autopadding=!0}_(S,v),S.prototype._update=function(M){this._cache.add(M);for(var A,T,L=[];A=this._cache.get(this._autopadding);)T=this._mode.decrypt(this,A),L.push(T);return f.concat(L)},S.prototype._final=function(){var M=this._cache.flush();if(this._autopadding)return b(this._mode.decrypt(this,M));if(M)throw new Error("data not multiple of block length")},S.prototype.setAutoPadding=function(M){return this._autopadding=!!M,this};function x(){this.cache=f.allocUnsafe(0)}x.prototype.add=function(M){this.cache=f.concat([this.cache,M])},x.prototype.get=function(M){var A;if(M){if(this.cache.length>16)return A=this.cache.slice(0,16),this.cache=this.cache.slice(16),A}else if(this.cache.length>=16)return A=this.cache.slice(0,16),this.cache=this.cache.slice(16),A;return null},x.prototype.flush=function(){if(this.cache.length)return this.cache};function b(M){var A=M[15];if(A<1||A>16)throw new Error("unable to decrypt data");for(var T=-1;++T<A;)if(M[T+(16-A)]!==A)throw new Error("unable to decrypt data");if(A!==16)return M.slice(0,16-A)}function C(M,A,T){var L=d[M.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if(typeof T=="string"&&(T=f.from(T)),L.mode!=="GCM"&&T.length!==L.iv)throw new TypeError("invalid iv length "+T.length);if(typeof A=="string"&&(A=f.from(A)),A.length!==L.key/8)throw new TypeError("invalid key length "+A.length);return L.type==="stream"?new g(L.module,A,T,!0):L.type==="auth"?new r(L.module,A,T,!0):new S(L.module,A,T)}function E(M,A){var T=d[M.toLowerCase()];if(!T)throw new TypeError("invalid suite type");var L=w(A,!1,T.key,T.iv);return C(M,L.key,L.iv)}return decrypter.createDecipher=E,decrypter.createDecipheriv=C,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var r=requireEncrypter(),f=requireDecrypter(),d=require$$2;function g(){return Object.keys(d)}return browser$5.createCipher=browser$5.Cipher=r.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=r.createCipheriv,browser$5.createDecipher=browser$5.Decipher=f.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=f.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=g,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(function(r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}})(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var r=requireBrowserifyDes(),f=requireBrowser$6(),d=requireModes$1(),g=requireModes(),v=requireEvp_bytestokey();function m(b,C){b=b.toLowerCase();var E,M;if(d[b])E=d[b].key,M=d[b].iv;else if(g[b])E=g[b].key*8,M=g[b].iv;else throw new TypeError("invalid suite type");var A=v(C,!1,E,M);return _(b,A.key,A.iv)}function w(b,C){b=b.toLowerCase();var E,M;if(d[b])E=d[b].key,M=d[b].iv;else if(g[b])E=g[b].key*8,M=g[b].iv;else throw new TypeError("invalid suite type");var A=v(C,!1,E,M);return S(b,A.key,A.iv)}function _(b,C,E){if(b=b.toLowerCase(),d[b])return f.createCipheriv(b,C,E);if(g[b])return new r({key:C,iv:E,mode:b});throw new TypeError("invalid suite type")}function S(b,C,E){if(b=b.toLowerCase(),d[b])return f.createDecipheriv(b,C,E);if(g[b])return new r({key:C,iv:E,mode:b,decrypt:!0});throw new TypeError("invalid suite type")}function x(){return Object.keys(g).concat(f.getCiphers())}return browser$6.createCipher=browser$6.Cipher=m,browser$6.createCipheriv=browser$6.Cipheriv=_,browser$6.createDecipher=browser$6.Decipher=w,browser$6.createDecipheriv=browser$6.Decipheriv=S,browser$6.listCiphers=browser$6.getCiphers=x,browser$6}var browser$4={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,(function(r){(function(f,d){function g(te,q){if(!te)throw new Error(q||"Assertion failed")}function v(te,q){te.super_=q;var k=function(){};k.prototype=q.prototype,te.prototype=new k,te.prototype.constructor=te}function m(te,q,k){if(m.isBN(te))return te;this.negative=0,this.words=null,this.length=0,this.red=null,te!==null&&((q==="le"||q==="be")&&(k=q,q=10),this._init(te||0,q||10,k||"be"))}typeof f=="object"?f.exports=m:d.BN=m,m.BN=m,m.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}m.isBN=function(q){return q instanceof m?!0:q!==null&&typeof q=="object"&&q.constructor.wordSize===m.wordSize&&Array.isArray(q.words)},m.max=function(q,k){return q.cmp(k)>0?q:k},m.min=function(q,k){return q.cmp(k)<0?q:k},m.prototype._init=function(q,k,y){if(typeof q=="number")return this._initNumber(q,k,y);if(typeof q=="object")return this._initArray(q,k,y);k==="hex"&&(k=16),g(k===(k|0)&&k>=2&&k<=36),q=q.toString().replace(/\s+/g,"");var B=0;q[0]==="-"&&(B++,this.negative=1),B<q.length&&(k===16?this._parseHex(q,B,y):(this._parseBase(q,k,B),y==="le"&&this._initArray(this.toArray(),k,y)))},m.prototype._initNumber=function(q,k,y){q<0&&(this.negative=1,q=-q),q<67108864?(this.words=[q&67108863],this.length=1):q<4503599627370496?(this.words=[q&67108863,q/67108864&67108863],this.length=2):(g(q<9007199254740992),this.words=[q&67108863,q/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),k,y)},m.prototype._initArray=function(q,k,y){if(g(typeof q.length=="number"),q.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(q.length/3),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var $,I,F=0;if(y==="be")for(B=q.length-1,$=0;B>=0;B-=3)I=q[B]|q[B-1]<<8|q[B-2]<<16,this.words[$]|=I<<F&67108863,this.words[$+1]=I>>>26-F&67108863,F+=24,F>=26&&(F-=26,$++);else if(y==="le")for(B=0,$=0;B<q.length;B+=3)I=q[B]|q[B+1]<<8|q[B+2]<<16,this.words[$]|=I<<F&67108863,this.words[$+1]=I>>>26-F&67108863,F+=24,F>=26&&(F-=26,$++);return this.strip()};function _(te,q){var k=te.charCodeAt(q);return k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:k-48&15}function S(te,q,k){var y=_(te,k);return k-1>=q&&(y|=_(te,k-1)<<4),y}m.prototype._parseHex=function(q,k,y){this.length=Math.ceil((q.length-k)/6),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var $=0,I=0,F;if(y==="be")for(B=q.length-1;B>=k;B-=2)F=S(q,k,B)<<$,this.words[I]|=F&67108863,$>=18?($-=18,I+=1,this.words[I]|=F>>>26):$+=8;else{var j=q.length-k;for(B=j%2===0?k+1:k;B<q.length;B+=2)F=S(q,k,B)<<$,this.words[I]|=F&67108863,$>=18?($-=18,I+=1,this.words[I]|=F>>>26):$+=8}this.strip()};function x(te,q,k,y){for(var B=0,$=Math.min(te.length,k),I=q;I<$;I++){var F=te.charCodeAt(I)-48;B*=y,F>=49?B+=F-49+10:F>=17?B+=F-17+10:B+=F}return B}m.prototype._parseBase=function(q,k,y){this.words=[0],this.length=1;for(var B=0,$=1;$<=67108863;$*=k)B++;B--,$=$/k|0;for(var I=q.length-y,F=I%B,j=Math.min(I,I-F)+y,D=0,W=y;W<j;W+=B)D=x(q,W,W+B,k),this.imuln($),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D);if(F!==0){var R=1;for(D=x(q,W,q.length,k),W=0;W<F;W++)R*=k;this.imuln(R),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D)}this.strip()},m.prototype.copy=function(q){q.words=new Array(this.length);for(var k=0;k<this.length;k++)q.words[k]=this.words[k];q.length=this.length,q.negative=this.negative,q.red=this.red},m.prototype.clone=function(){var q=new m(null);return this.copy(q),q},m.prototype._expand=function(q){for(;this.length<q;)this.words[this.length++]=0;return this},m.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},m.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},m.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];m.prototype.toString=function(q,k){q=q||10,k=k|0||1;var y;if(q===16||q==="hex"){y="";for(var B=0,$=0,I=0;I<this.length;I++){var F=this.words[I],j=((F<<B|$)&16777215).toString(16);$=F>>>24-B&16777215,B+=2,B>=26&&(B-=26,I--),$!==0||I!==this.length-1?y=b[6-j.length]+j+y:y=j+y}for($!==0&&(y=$.toString(16)+y);y.length%k!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(q===(q|0)&&q>=2&&q<=36){var D=C[q],W=E[q];y="";var R=this.clone();for(R.negative=0;!R.isZero();){var z=R.modn(W).toString(q);R=R.idivn(W),R.isZero()?y=z+y:y=b[D-z.length]+z+y}for(this.isZero()&&(y="0"+y);y.length%k!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}g(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var q=this.words[0];return this.length===2?q+=this.words[1]*67108864:this.length===3&&this.words[2]===1?q+=4503599627370496+this.words[1]*67108864:this.length>2&&g(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-q:q},m.prototype.toJSON=function(){return this.toString(16)},m.prototype.toBuffer=function(q,k){return g(typeof w<"u"),this.toArrayLike(w,q,k)},m.prototype.toArray=function(q,k){return this.toArrayLike(Array,q,k)},m.prototype.toArrayLike=function(q,k,y){var B=this.byteLength(),$=y||Math.max(1,B);g(B<=$,"byte array longer than desired length"),g($>0,"Requested array length <= 0"),this.strip();var I=k==="le",F=new q($),j,D,W=this.clone();if(I){for(D=0;!W.isZero();D++)j=W.andln(255),W.iushrn(8),F[D]=j;for(;D<$;D++)F[D]=0}else{for(D=0;D<$-B;D++)F[D]=0;for(D=0;!W.isZero();D++)j=W.andln(255),W.iushrn(8),F[$-D-1]=j}return F},Math.clz32?m.prototype._countBits=function(q){return 32-Math.clz32(q)}:m.prototype._countBits=function(q){var k=q,y=0;return k>=4096&&(y+=13,k>>>=13),k>=64&&(y+=7,k>>>=7),k>=8&&(y+=4,k>>>=4),k>=2&&(y+=2,k>>>=2),y+k},m.prototype._zeroBits=function(q){if(q===0)return 26;var k=q,y=0;return(k&8191)===0&&(y+=13,k>>>=13),(k&127)===0&&(y+=7,k>>>=7),(k&15)===0&&(y+=4,k>>>=4),(k&3)===0&&(y+=2,k>>>=2),(k&1)===0&&y++,y},m.prototype.bitLength=function(){var q=this.words[this.length-1],k=this._countBits(q);return(this.length-1)*26+k};function M(te){for(var q=new Array(te.bitLength()),k=0;k<q.length;k++){var y=k/26|0,B=k%26;q[k]=(te.words[y]&1<<B)>>>B}return q}m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var q=0,k=0;k<this.length;k++){var y=this._zeroBits(this.words[k]);if(q+=y,y!==26)break}return q},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(q){return this.negative!==0?this.abs().inotn(q).iaddn(1):this.clone()},m.prototype.fromTwos=function(q){return this.testn(q-1)?this.notn(q).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return this.negative!==0},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(q){for(;this.length<q.length;)this.words[this.length++]=0;for(var k=0;k<q.length;k++)this.words[k]=this.words[k]|q.words[k];return this.strip()},m.prototype.ior=function(q){return g((this.negative|q.negative)===0),this.iuor(q)},m.prototype.or=function(q){return this.length>q.length?this.clone().ior(q):q.clone().ior(this)},m.prototype.uor=function(q){return this.length>q.length?this.clone().iuor(q):q.clone().iuor(this)},m.prototype.iuand=function(q){var k;this.length>q.length?k=q:k=this;for(var y=0;y<k.length;y++)this.words[y]=this.words[y]&q.words[y];return this.length=k.length,this.strip()},m.prototype.iand=function(q){return g((this.negative|q.negative)===0),this.iuand(q)},m.prototype.and=function(q){return this.length>q.length?this.clone().iand(q):q.clone().iand(this)},m.prototype.uand=function(q){return this.length>q.length?this.clone().iuand(q):q.clone().iuand(this)},m.prototype.iuxor=function(q){var k,y;this.length>q.length?(k=this,y=q):(k=q,y=this);for(var B=0;B<y.length;B++)this.words[B]=k.words[B]^y.words[B];if(this!==k)for(;B<k.length;B++)this.words[B]=k.words[B];return this.length=k.length,this.strip()},m.prototype.ixor=function(q){return g((this.negative|q.negative)===0),this.iuxor(q)},m.prototype.xor=function(q){return this.length>q.length?this.clone().ixor(q):q.clone().ixor(this)},m.prototype.uxor=function(q){return this.length>q.length?this.clone().iuxor(q):q.clone().iuxor(this)},m.prototype.inotn=function(q){g(typeof q=="number"&&q>=0);var k=Math.ceil(q/26)|0,y=q%26;this._expand(k),y>0&&k--;for(var B=0;B<k;B++)this.words[B]=~this.words[B]&67108863;return y>0&&(this.words[B]=~this.words[B]&67108863>>26-y),this.strip()},m.prototype.notn=function(q){return this.clone().inotn(q)},m.prototype.setn=function(q,k){g(typeof q=="number"&&q>=0);var y=q/26|0,B=q%26;return this._expand(y+1),k?this.words[y]=this.words[y]|1<<B:this.words[y]=this.words[y]&~(1<<B),this.strip()},m.prototype.iadd=function(q){var k;if(this.negative!==0&&q.negative===0)return this.negative=0,k=this.isub(q),this.negative^=1,this._normSign();if(this.negative===0&&q.negative!==0)return q.negative=0,k=this.isub(q),q.negative=1,k._normSign();var y,B;this.length>q.length?(y=this,B=q):(y=q,B=this);for(var $=0,I=0;I<B.length;I++)k=(y.words[I]|0)+(B.words[I]|0)+$,this.words[I]=k&67108863,$=k>>>26;for(;$!==0&&I<y.length;I++)k=(y.words[I]|0)+$,this.words[I]=k&67108863,$=k>>>26;if(this.length=y.length,$!==0)this.words[this.length]=$,this.length++;else if(y!==this)for(;I<y.length;I++)this.words[I]=y.words[I];return this},m.prototype.add=function(q){var k;return q.negative!==0&&this.negative===0?(q.negative=0,k=this.sub(q),q.negative^=1,k):q.negative===0&&this.negative!==0?(this.negative=0,k=q.sub(this),this.negative=1,k):this.length>q.length?this.clone().iadd(q):q.clone().iadd(this)},m.prototype.isub=function(q){if(q.negative!==0){q.negative=0;var k=this.iadd(q);return q.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(q),this.negative=1,this._normSign();var y=this.cmp(q);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,$;y>0?(B=this,$=q):(B=q,$=this);for(var I=0,F=0;F<$.length;F++)k=(B.words[F]|0)-($.words[F]|0)+I,I=k>>26,this.words[F]=k&67108863;for(;I!==0&&F<B.length;F++)k=(B.words[F]|0)+I,I=k>>26,this.words[F]=k&67108863;if(I===0&&F<B.length&&B!==this)for(;F<B.length;F++)this.words[F]=B.words[F];return this.length=Math.max(this.length,F),B!==this&&(this.negative=1),this.strip()},m.prototype.sub=function(q){return this.clone().isub(q)};function A(te,q,k){k.negative=q.negative^te.negative;var y=te.length+q.length|0;k.length=y,y=y-1|0;var B=te.words[0]|0,$=q.words[0]|0,I=B*$,F=I&67108863,j=I/67108864|0;k.words[0]=F;for(var D=1;D<y;D++){for(var W=j>>>26,R=j&67108863,z=Math.min(D,q.length-1),ye=Math.max(0,D-te.length+1);ye<=z;ye++){var Ce=D-ye|0;B=te.words[Ce]|0,$=q.words[ye]|0,I=B*$+R,W+=I/67108864|0,R=I&67108863}k.words[D]=R|0,j=W|0}return j!==0?k.words[D]=j|0:k.length--,k.strip()}var T=function(q,k,y){var B=q.words,$=k.words,I=y.words,F=0,j,D,W,R=B[0]|0,z=R&8191,ye=R>>>13,Ce=B[1]|0,me=Ce&8191,ie=Ce>>>13,ee=B[2]|0,pe=ee&8191,be=ee>>>13,ae=B[3]|0,ne=ae&8191,Se=ae>>>13,ke=B[4]|0,Ie=ke&8191,Oe=ke>>>13,Ue=B[5]|0,De=Ue&8191,$e=Ue>>>13,je=B[6]|0,Ye=je&8191,st=je>>>13,Je=B[7]|0,Ge=Je&8191,ut=Je>>>13,gt=B[8]|0,rt=gt&8191,wt=gt>>>13,bt=B[9]|0,le=bt&8191,Z=bt>>>13,J=$[0]|0,ge=J&8191,Ee=J>>>13,Re=$[1]|0,qe=Re&8191,Xe=Re>>>13,He=$[2]|0,Ze=He&8191,_t=He>>>13,tt=$[3]|0,mt=tt&8191,Tt=tt>>>13,St=$[4]|0,lt=St&8191,Mt=St>>>13,Ct=$[5]|0,ce=Ct&8191,Y=Ct>>>13,Q=$[6]|0,ve=Q&8191,fe=Q>>>13,U=$[7]|0,G=U&8191,re=U>>>13,K=$[8]|0,ue=K&8191,Ae=K>>>13,xe=$[9]|0,Te=xe&8191,Pe=xe>>>13;y.negative=q.negative^k.negative,y.length=19,j=Math.imul(z,ge),D=Math.imul(z,Ee),D=D+Math.imul(ye,ge)|0,W=Math.imul(ye,Ee);var Fe=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,j=Math.imul(me,ge),D=Math.imul(me,Ee),D=D+Math.imul(ie,ge)|0,W=Math.imul(ie,Ee),j=j+Math.imul(z,qe)|0,D=D+Math.imul(z,Xe)|0,D=D+Math.imul(ye,qe)|0,W=W+Math.imul(ye,Xe)|0;var Ne=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,j=Math.imul(pe,ge),D=Math.imul(pe,Ee),D=D+Math.imul(be,ge)|0,W=Math.imul(be,Ee),j=j+Math.imul(me,qe)|0,D=D+Math.imul(me,Xe)|0,D=D+Math.imul(ie,qe)|0,W=W+Math.imul(ie,Xe)|0,j=j+Math.imul(z,Ze)|0,D=D+Math.imul(z,_t)|0,D=D+Math.imul(ye,Ze)|0,W=W+Math.imul(ye,_t)|0;var At=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(At>>>26)|0,At&=67108863,j=Math.imul(ne,ge),D=Math.imul(ne,Ee),D=D+Math.imul(Se,ge)|0,W=Math.imul(Se,Ee),j=j+Math.imul(pe,qe)|0,D=D+Math.imul(pe,Xe)|0,D=D+Math.imul(be,qe)|0,W=W+Math.imul(be,Xe)|0,j=j+Math.imul(me,Ze)|0,D=D+Math.imul(me,_t)|0,D=D+Math.imul(ie,Ze)|0,W=W+Math.imul(ie,_t)|0,j=j+Math.imul(z,mt)|0,D=D+Math.imul(z,Tt)|0,D=D+Math.imul(ye,mt)|0,W=W+Math.imul(ye,Tt)|0;var ot=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ot>>>26)|0,ot&=67108863,j=Math.imul(Ie,ge),D=Math.imul(Ie,Ee),D=D+Math.imul(Oe,ge)|0,W=Math.imul(Oe,Ee),j=j+Math.imul(ne,qe)|0,D=D+Math.imul(ne,Xe)|0,D=D+Math.imul(Se,qe)|0,W=W+Math.imul(Se,Xe)|0,j=j+Math.imul(pe,Ze)|0,D=D+Math.imul(pe,_t)|0,D=D+Math.imul(be,Ze)|0,W=W+Math.imul(be,_t)|0,j=j+Math.imul(me,mt)|0,D=D+Math.imul(me,Tt)|0,D=D+Math.imul(ie,mt)|0,W=W+Math.imul(ie,Tt)|0,j=j+Math.imul(z,lt)|0,D=D+Math.imul(z,Mt)|0,D=D+Math.imul(ye,lt)|0,W=W+Math.imul(ye,Mt)|0;var yt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(yt>>>26)|0,yt&=67108863,j=Math.imul(De,ge),D=Math.imul(De,Ee),D=D+Math.imul($e,ge)|0,W=Math.imul($e,Ee),j=j+Math.imul(Ie,qe)|0,D=D+Math.imul(Ie,Xe)|0,D=D+Math.imul(Oe,qe)|0,W=W+Math.imul(Oe,Xe)|0,j=j+Math.imul(ne,Ze)|0,D=D+Math.imul(ne,_t)|0,D=D+Math.imul(Se,Ze)|0,W=W+Math.imul(Se,_t)|0,j=j+Math.imul(pe,mt)|0,D=D+Math.imul(pe,Tt)|0,D=D+Math.imul(be,mt)|0,W=W+Math.imul(be,Tt)|0,j=j+Math.imul(me,lt)|0,D=D+Math.imul(me,Mt)|0,D=D+Math.imul(ie,lt)|0,W=W+Math.imul(ie,Mt)|0,j=j+Math.imul(z,ce)|0,D=D+Math.imul(z,Y)|0,D=D+Math.imul(ye,ce)|0,W=W+Math.imul(ye,Y)|0;var vt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(vt>>>26)|0,vt&=67108863,j=Math.imul(Ye,ge),D=Math.imul(Ye,Ee),D=D+Math.imul(st,ge)|0,W=Math.imul(st,Ee),j=j+Math.imul(De,qe)|0,D=D+Math.imul(De,Xe)|0,D=D+Math.imul($e,qe)|0,W=W+Math.imul($e,Xe)|0,j=j+Math.imul(Ie,Ze)|0,D=D+Math.imul(Ie,_t)|0,D=D+Math.imul(Oe,Ze)|0,W=W+Math.imul(Oe,_t)|0,j=j+Math.imul(ne,mt)|0,D=D+Math.imul(ne,Tt)|0,D=D+Math.imul(Se,mt)|0,W=W+Math.imul(Se,Tt)|0,j=j+Math.imul(pe,lt)|0,D=D+Math.imul(pe,Mt)|0,D=D+Math.imul(be,lt)|0,W=W+Math.imul(be,Mt)|0,j=j+Math.imul(me,ce)|0,D=D+Math.imul(me,Y)|0,D=D+Math.imul(ie,ce)|0,W=W+Math.imul(ie,Y)|0,j=j+Math.imul(z,ve)|0,D=D+Math.imul(z,fe)|0,D=D+Math.imul(ye,ve)|0,W=W+Math.imul(ye,fe)|0;var xt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(xt>>>26)|0,xt&=67108863,j=Math.imul(Ge,ge),D=Math.imul(Ge,Ee),D=D+Math.imul(ut,ge)|0,W=Math.imul(ut,Ee),j=j+Math.imul(Ye,qe)|0,D=D+Math.imul(Ye,Xe)|0,D=D+Math.imul(st,qe)|0,W=W+Math.imul(st,Xe)|0,j=j+Math.imul(De,Ze)|0,D=D+Math.imul(De,_t)|0,D=D+Math.imul($e,Ze)|0,W=W+Math.imul($e,_t)|0,j=j+Math.imul(Ie,mt)|0,D=D+Math.imul(Ie,Tt)|0,D=D+Math.imul(Oe,mt)|0,W=W+Math.imul(Oe,Tt)|0,j=j+Math.imul(ne,lt)|0,D=D+Math.imul(ne,Mt)|0,D=D+Math.imul(Se,lt)|0,W=W+Math.imul(Se,Mt)|0,j=j+Math.imul(pe,ce)|0,D=D+Math.imul(pe,Y)|0,D=D+Math.imul(be,ce)|0,W=W+Math.imul(be,Y)|0,j=j+Math.imul(me,ve)|0,D=D+Math.imul(me,fe)|0,D=D+Math.imul(ie,ve)|0,W=W+Math.imul(ie,fe)|0,j=j+Math.imul(z,G)|0,D=D+Math.imul(z,re)|0,D=D+Math.imul(ye,G)|0,W=W+Math.imul(ye,re)|0;var Ve=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,j=Math.imul(rt,ge),D=Math.imul(rt,Ee),D=D+Math.imul(wt,ge)|0,W=Math.imul(wt,Ee),j=j+Math.imul(Ge,qe)|0,D=D+Math.imul(Ge,Xe)|0,D=D+Math.imul(ut,qe)|0,W=W+Math.imul(ut,Xe)|0,j=j+Math.imul(Ye,Ze)|0,D=D+Math.imul(Ye,_t)|0,D=D+Math.imul(st,Ze)|0,W=W+Math.imul(st,_t)|0,j=j+Math.imul(De,mt)|0,D=D+Math.imul(De,Tt)|0,D=D+Math.imul($e,mt)|0,W=W+Math.imul($e,Tt)|0,j=j+Math.imul(Ie,lt)|0,D=D+Math.imul(Ie,Mt)|0,D=D+Math.imul(Oe,lt)|0,W=W+Math.imul(Oe,Mt)|0,j=j+Math.imul(ne,ce)|0,D=D+Math.imul(ne,Y)|0,D=D+Math.imul(Se,ce)|0,W=W+Math.imul(Se,Y)|0,j=j+Math.imul(pe,ve)|0,D=D+Math.imul(pe,fe)|0,D=D+Math.imul(be,ve)|0,W=W+Math.imul(be,fe)|0,j=j+Math.imul(me,G)|0,D=D+Math.imul(me,re)|0,D=D+Math.imul(ie,G)|0,W=W+Math.imul(ie,re)|0,j=j+Math.imul(z,ue)|0,D=D+Math.imul(z,Ae)|0,D=D+Math.imul(ye,ue)|0,W=W+Math.imul(ye,Ae)|0;var ft=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ft>>>26)|0,ft&=67108863,j=Math.imul(le,ge),D=Math.imul(le,Ee),D=D+Math.imul(Z,ge)|0,W=Math.imul(Z,Ee),j=j+Math.imul(rt,qe)|0,D=D+Math.imul(rt,Xe)|0,D=D+Math.imul(wt,qe)|0,W=W+Math.imul(wt,Xe)|0,j=j+Math.imul(Ge,Ze)|0,D=D+Math.imul(Ge,_t)|0,D=D+Math.imul(ut,Ze)|0,W=W+Math.imul(ut,_t)|0,j=j+Math.imul(Ye,mt)|0,D=D+Math.imul(Ye,Tt)|0,D=D+Math.imul(st,mt)|0,W=W+Math.imul(st,Tt)|0,j=j+Math.imul(De,lt)|0,D=D+Math.imul(De,Mt)|0,D=D+Math.imul($e,lt)|0,W=W+Math.imul($e,Mt)|0,j=j+Math.imul(Ie,ce)|0,D=D+Math.imul(Ie,Y)|0,D=D+Math.imul(Oe,ce)|0,W=W+Math.imul(Oe,Y)|0,j=j+Math.imul(ne,ve)|0,D=D+Math.imul(ne,fe)|0,D=D+Math.imul(Se,ve)|0,W=W+Math.imul(Se,fe)|0,j=j+Math.imul(pe,G)|0,D=D+Math.imul(pe,re)|0,D=D+Math.imul(be,G)|0,W=W+Math.imul(be,re)|0,j=j+Math.imul(me,ue)|0,D=D+Math.imul(me,Ae)|0,D=D+Math.imul(ie,ue)|0,W=W+Math.imul(ie,Ae)|0,j=j+Math.imul(z,Te)|0,D=D+Math.imul(z,Pe)|0,D=D+Math.imul(ye,Te)|0,W=W+Math.imul(ye,Pe)|0;var et=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(et>>>26)|0,et&=67108863,j=Math.imul(le,qe),D=Math.imul(le,Xe),D=D+Math.imul(Z,qe)|0,W=Math.imul(Z,Xe),j=j+Math.imul(rt,Ze)|0,D=D+Math.imul(rt,_t)|0,D=D+Math.imul(wt,Ze)|0,W=W+Math.imul(wt,_t)|0,j=j+Math.imul(Ge,mt)|0,D=D+Math.imul(Ge,Tt)|0,D=D+Math.imul(ut,mt)|0,W=W+Math.imul(ut,Tt)|0,j=j+Math.imul(Ye,lt)|0,D=D+Math.imul(Ye,Mt)|0,D=D+Math.imul(st,lt)|0,W=W+Math.imul(st,Mt)|0,j=j+Math.imul(De,ce)|0,D=D+Math.imul(De,Y)|0,D=D+Math.imul($e,ce)|0,W=W+Math.imul($e,Y)|0,j=j+Math.imul(Ie,ve)|0,D=D+Math.imul(Ie,fe)|0,D=D+Math.imul(Oe,ve)|0,W=W+Math.imul(Oe,fe)|0,j=j+Math.imul(ne,G)|0,D=D+Math.imul(ne,re)|0,D=D+Math.imul(Se,G)|0,W=W+Math.imul(Se,re)|0,j=j+Math.imul(pe,ue)|0,D=D+Math.imul(pe,Ae)|0,D=D+Math.imul(be,ue)|0,W=W+Math.imul(be,Ae)|0,j=j+Math.imul(me,Te)|0,D=D+Math.imul(me,Pe)|0,D=D+Math.imul(ie,Te)|0,W=W+Math.imul(ie,Pe)|0;var ht=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ht>>>26)|0,ht&=67108863,j=Math.imul(le,Ze),D=Math.imul(le,_t),D=D+Math.imul(Z,Ze)|0,W=Math.imul(Z,_t),j=j+Math.imul(rt,mt)|0,D=D+Math.imul(rt,Tt)|0,D=D+Math.imul(wt,mt)|0,W=W+Math.imul(wt,Tt)|0,j=j+Math.imul(Ge,lt)|0,D=D+Math.imul(Ge,Mt)|0,D=D+Math.imul(ut,lt)|0,W=W+Math.imul(ut,Mt)|0,j=j+Math.imul(Ye,ce)|0,D=D+Math.imul(Ye,Y)|0,D=D+Math.imul(st,ce)|0,W=W+Math.imul(st,Y)|0,j=j+Math.imul(De,ve)|0,D=D+Math.imul(De,fe)|0,D=D+Math.imul($e,ve)|0,W=W+Math.imul($e,fe)|0,j=j+Math.imul(Ie,G)|0,D=D+Math.imul(Ie,re)|0,D=D+Math.imul(Oe,G)|0,W=W+Math.imul(Oe,re)|0,j=j+Math.imul(ne,ue)|0,D=D+Math.imul(ne,Ae)|0,D=D+Math.imul(Se,ue)|0,W=W+Math.imul(Se,Ae)|0,j=j+Math.imul(pe,Te)|0,D=D+Math.imul(pe,Pe)|0,D=D+Math.imul(be,Te)|0,W=W+Math.imul(be,Pe)|0;var it=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(it>>>26)|0,it&=67108863,j=Math.imul(le,mt),D=Math.imul(le,Tt),D=D+Math.imul(Z,mt)|0,W=Math.imul(Z,Tt),j=j+Math.imul(rt,lt)|0,D=D+Math.imul(rt,Mt)|0,D=D+Math.imul(wt,lt)|0,W=W+Math.imul(wt,Mt)|0,j=j+Math.imul(Ge,ce)|0,D=D+Math.imul(Ge,Y)|0,D=D+Math.imul(ut,ce)|0,W=W+Math.imul(ut,Y)|0,j=j+Math.imul(Ye,ve)|0,D=D+Math.imul(Ye,fe)|0,D=D+Math.imul(st,ve)|0,W=W+Math.imul(st,fe)|0,j=j+Math.imul(De,G)|0,D=D+Math.imul(De,re)|0,D=D+Math.imul($e,G)|0,W=W+Math.imul($e,re)|0,j=j+Math.imul(Ie,ue)|0,D=D+Math.imul(Ie,Ae)|0,D=D+Math.imul(Oe,ue)|0,W=W+Math.imul(Oe,Ae)|0,j=j+Math.imul(ne,Te)|0,D=D+Math.imul(ne,Pe)|0,D=D+Math.imul(Se,Te)|0,W=W+Math.imul(Se,Pe)|0;var pt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(pt>>>26)|0,pt&=67108863,j=Math.imul(le,lt),D=Math.imul(le,Mt),D=D+Math.imul(Z,lt)|0,W=Math.imul(Z,Mt),j=j+Math.imul(rt,ce)|0,D=D+Math.imul(rt,Y)|0,D=D+Math.imul(wt,ce)|0,W=W+Math.imul(wt,Y)|0,j=j+Math.imul(Ge,ve)|0,D=D+Math.imul(Ge,fe)|0,D=D+Math.imul(ut,ve)|0,W=W+Math.imul(ut,fe)|0,j=j+Math.imul(Ye,G)|0,D=D+Math.imul(Ye,re)|0,D=D+Math.imul(st,G)|0,W=W+Math.imul(st,re)|0,j=j+Math.imul(De,ue)|0,D=D+Math.imul(De,Ae)|0,D=D+Math.imul($e,ue)|0,W=W+Math.imul($e,Ae)|0,j=j+Math.imul(Ie,Te)|0,D=D+Math.imul(Ie,Pe)|0,D=D+Math.imul(Oe,Te)|0,W=W+Math.imul(Oe,Pe)|0;var at=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(at>>>26)|0,at&=67108863,j=Math.imul(le,ce),D=Math.imul(le,Y),D=D+Math.imul(Z,ce)|0,W=Math.imul(Z,Y),j=j+Math.imul(rt,ve)|0,D=D+Math.imul(rt,fe)|0,D=D+Math.imul(wt,ve)|0,W=W+Math.imul(wt,fe)|0,j=j+Math.imul(Ge,G)|0,D=D+Math.imul(Ge,re)|0,D=D+Math.imul(ut,G)|0,W=W+Math.imul(ut,re)|0,j=j+Math.imul(Ye,ue)|0,D=D+Math.imul(Ye,Ae)|0,D=D+Math.imul(st,ue)|0,W=W+Math.imul(st,Ae)|0,j=j+Math.imul(De,Te)|0,D=D+Math.imul(De,Pe)|0,D=D+Math.imul($e,Te)|0,W=W+Math.imul($e,Pe)|0;var ct=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ct>>>26)|0,ct&=67108863,j=Math.imul(le,ve),D=Math.imul(le,fe),D=D+Math.imul(Z,ve)|0,W=Math.imul(Z,fe),j=j+Math.imul(rt,G)|0,D=D+Math.imul(rt,re)|0,D=D+Math.imul(wt,G)|0,W=W+Math.imul(wt,re)|0,j=j+Math.imul(Ge,ue)|0,D=D+Math.imul(Ge,Ae)|0,D=D+Math.imul(ut,ue)|0,W=W+Math.imul(ut,Ae)|0,j=j+Math.imul(Ye,Te)|0,D=D+Math.imul(Ye,Pe)|0,D=D+Math.imul(st,Te)|0,W=W+Math.imul(st,Pe)|0;var dt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(dt>>>26)|0,dt&=67108863,j=Math.imul(le,G),D=Math.imul(le,re),D=D+Math.imul(Z,G)|0,W=Math.imul(Z,re),j=j+Math.imul(rt,ue)|0,D=D+Math.imul(rt,Ae)|0,D=D+Math.imul(wt,ue)|0,W=W+Math.imul(wt,Ae)|0,j=j+Math.imul(Ge,Te)|0,D=D+Math.imul(Ge,Pe)|0,D=D+Math.imul(ut,Te)|0,W=W+Math.imul(ut,Pe)|0;var nt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(nt>>>26)|0,nt&=67108863,j=Math.imul(le,ue),D=Math.imul(le,Ae),D=D+Math.imul(Z,ue)|0,W=Math.imul(Z,Ae),j=j+Math.imul(rt,Te)|0,D=D+Math.imul(rt,Pe)|0,D=D+Math.imul(wt,Te)|0,W=W+Math.imul(wt,Pe)|0;var Le=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Le>>>26)|0,Le&=67108863,j=Math.imul(le,Te),D=Math.imul(le,Pe),D=D+Math.imul(Z,Te)|0,W=Math.imul(Z,Pe);var Be=(F+j|0)+((D&8191)<<13)|0;return F=(W+(D>>>13)|0)+(Be>>>26)|0,Be&=67108863,I[0]=Fe,I[1]=Ne,I[2]=At,I[3]=ot,I[4]=yt,I[5]=vt,I[6]=xt,I[7]=Ve,I[8]=ft,I[9]=et,I[10]=ht,I[11]=it,I[12]=pt,I[13]=at,I[14]=ct,I[15]=dt,I[16]=nt,I[17]=Le,I[18]=Be,F!==0&&(I[19]=F,y.length++),y};Math.imul||(T=A);function L(te,q,k){k.negative=q.negative^te.negative,k.length=te.length+q.length;for(var y=0,B=0,$=0;$<k.length-1;$++){var I=B;B=0;for(var F=y&67108863,j=Math.min($,q.length-1),D=Math.max(0,$-te.length+1);D<=j;D++){var W=$-D,R=te.words[W]|0,z=q.words[D]|0,ye=R*z,Ce=ye&67108863;I=I+(ye/67108864|0)|0,Ce=Ce+F|0,F=Ce&67108863,I=I+(Ce>>>26)|0,B+=I>>>26,I&=67108863}k.words[$]=F,y=I,I=B}return y!==0?k.words[$]=y:k.length--,k.strip()}function O(te,q,k){var y=new N;return y.mulp(te,q,k)}m.prototype.mulTo=function(q,k){var y,B=this.length+q.length;return this.length===10&&q.length===10?y=T(this,q,k):B<63?y=A(this,q,k):B<1024?y=L(this,q,k):y=O(this,q,k),y};function N(te,q){this.x=te,this.y=q}N.prototype.makeRBT=function(q){for(var k=new Array(q),y=m.prototype._countBits(q)-1,B=0;B<q;B++)k[B]=this.revBin(B,y,q);return k},N.prototype.revBin=function(q,k,y){if(q===0||q===y-1)return q;for(var B=0,$=0;$<k;$++)B|=(q&1)<<k-$-1,q>>=1;return B},N.prototype.permute=function(q,k,y,B,$,I){for(var F=0;F<I;F++)B[F]=k[q[F]],$[F]=y[q[F]]},N.prototype.transform=function(q,k,y,B,$,I){this.permute(I,q,k,y,B,$);for(var F=1;F<$;F<<=1)for(var j=F<<1,D=Math.cos(2*Math.PI/j),W=Math.sin(2*Math.PI/j),R=0;R<$;R+=j)for(var z=D,ye=W,Ce=0;Ce<F;Ce++){var me=y[R+Ce],ie=B[R+Ce],ee=y[R+Ce+F],pe=B[R+Ce+F],be=z*ee-ye*pe;pe=z*pe+ye*ee,ee=be,y[R+Ce]=me+ee,B[R+Ce]=ie+pe,y[R+Ce+F]=me-ee,B[R+Ce+F]=ie-pe,Ce!==j&&(be=D*z-W*ye,ye=D*ye+W*z,z=be)}},N.prototype.guessLen13b=function(q,k){var y=Math.max(k,q)|1,B=y&1,$=0;for(y=y/2|0;y;y=y>>>1)$++;return 1<<$+1+B},N.prototype.conjugate=function(q,k,y){if(!(y<=1))for(var B=0;B<y/2;B++){var $=q[B];q[B]=q[y-B-1],q[y-B-1]=$,$=k[B],k[B]=-k[y-B-1],k[y-B-1]=-$}},N.prototype.normalize13b=function(q,k){for(var y=0,B=0;B<k/2;B++){var $=Math.round(q[2*B+1]/k)*8192+Math.round(q[2*B]/k)+y;q[B]=$&67108863,$<67108864?y=0:y=$/67108864|0}return q},N.prototype.convert13b=function(q,k,y,B){for(var $=0,I=0;I<k;I++)$=$+(q[I]|0),y[2*I]=$&8191,$=$>>>13,y[2*I+1]=$&8191,$=$>>>13;for(I=2*k;I<B;++I)y[I]=0;g($===0),g(($&-8192)===0)},N.prototype.stub=function(q){for(var k=new Array(q),y=0;y<q;y++)k[y]=0;return k},N.prototype.mulp=function(q,k,y){var B=2*this.guessLen13b(q.length,k.length),$=this.makeRBT(B),I=this.stub(B),F=new Array(B),j=new Array(B),D=new Array(B),W=new Array(B),R=new Array(B),z=new Array(B),ye=y.words;ye.length=B,this.convert13b(q.words,q.length,F,B),this.convert13b(k.words,k.length,W,B),this.transform(F,I,j,D,B,$),this.transform(W,I,R,z,B,$);for(var Ce=0;Ce<B;Ce++){var me=j[Ce]*R[Ce]-D[Ce]*z[Ce];D[Ce]=j[Ce]*z[Ce]+D[Ce]*R[Ce],j[Ce]=me}return this.conjugate(j,D,B),this.transform(j,D,ye,I,B,$),this.conjugate(ye,I,B),this.normalize13b(ye,B),y.negative=q.negative^k.negative,y.length=q.length+k.length,y.strip()},m.prototype.mul=function(q){var k=new m(null);return k.words=new Array(this.length+q.length),this.mulTo(q,k)},m.prototype.mulf=function(q){var k=new m(null);return k.words=new Array(this.length+q.length),O(this,q,k)},m.prototype.imul=function(q){return this.clone().mulTo(q,this)},m.prototype.imuln=function(q){g(typeof q=="number"),g(q<67108864);for(var k=0,y=0;y<this.length;y++){var B=(this.words[y]|0)*q,$=(B&67108863)+(k&67108863);k>>=26,k+=B/67108864|0,k+=$>>>26,this.words[y]=$&67108863}return k!==0&&(this.words[y]=k,this.length++),this.length=q===0?1:this.length,this},m.prototype.muln=function(q){return this.clone().imuln(q)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(q){var k=M(q);if(k.length===0)return new m(1);for(var y=this,B=0;B<k.length&&k[B]===0;B++,y=y.sqr());if(++B<k.length)for(var $=y.sqr();B<k.length;B++,$=$.sqr())k[B]!==0&&(y=y.mul($));return y},m.prototype.iushln=function(q){g(typeof q=="number"&&q>=0);var k=q%26,y=(q-k)/26,B=67108863>>>26-k<<26-k,$;if(k!==0){var I=0;for($=0;$<this.length;$++){var F=this.words[$]&B,j=(this.words[$]|0)-F<<k;this.words[$]=j|I,I=F>>>26-k}I&&(this.words[$]=I,this.length++)}if(y!==0){for($=this.length-1;$>=0;$--)this.words[$+y]=this.words[$];for($=0;$<y;$++)this.words[$]=0;this.length+=y}return this.strip()},m.prototype.ishln=function(q){return g(this.negative===0),this.iushln(q)},m.prototype.iushrn=function(q,k,y){g(typeof q=="number"&&q>=0);var B;k?B=(k-k%26)/26:B=0;var $=q%26,I=Math.min((q-$)/26,this.length),F=67108863^67108863>>>$<<$,j=y;if(B-=I,B=Math.max(0,B),j){for(var D=0;D<I;D++)j.words[D]=this.words[D];j.length=I}if(I!==0)if(this.length>I)for(this.length-=I,D=0;D<this.length;D++)this.words[D]=this.words[D+I];else this.words[0]=0,this.length=1;var W=0;for(D=this.length-1;D>=0&&(W!==0||D>=B);D--){var R=this.words[D]|0;this.words[D]=W<<26-$|R>>>$,W=R&F}return j&&W!==0&&(j.words[j.length++]=W),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(q,k,y){return g(this.negative===0),this.iushrn(q,k,y)},m.prototype.shln=function(q){return this.clone().ishln(q)},m.prototype.ushln=function(q){return this.clone().iushln(q)},m.prototype.shrn=function(q){return this.clone().ishrn(q)},m.prototype.ushrn=function(q){return this.clone().iushrn(q)},m.prototype.testn=function(q){g(typeof q=="number"&&q>=0);var k=q%26,y=(q-k)/26,B=1<<k;if(this.length<=y)return!1;var $=this.words[y];return!!($&B)},m.prototype.imaskn=function(q){g(typeof q=="number"&&q>=0);var k=q%26,y=(q-k)/26;if(g(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(k!==0&&y++,this.length=Math.min(y,this.length),k!==0){var B=67108863^67108863>>>k<<k;this.words[this.length-1]&=B}return this.strip()},m.prototype.maskn=function(q){return this.clone().imaskn(q)},m.prototype.iaddn=function(q){return g(typeof q=="number"),g(q<67108864),q<0?this.isubn(-q):this.negative!==0?this.length===1&&(this.words[0]|0)<q?(this.words[0]=q-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(q),this.negative=1,this):this._iaddn(q)},m.prototype._iaddn=function(q){this.words[0]+=q;for(var k=0;k<this.length&&this.words[k]>=67108864;k++)this.words[k]-=67108864,k===this.length-1?this.words[k+1]=1:this.words[k+1]++;return this.length=Math.max(this.length,k+1),this},m.prototype.isubn=function(q){if(g(typeof q=="number"),g(q<67108864),q<0)return this.iaddn(-q);if(this.negative!==0)return this.negative=0,this.iaddn(q),this.negative=1,this;if(this.words[0]-=q,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k<this.length&&this.words[k]<0;k++)this.words[k]+=67108864,this.words[k+1]-=1;return this.strip()},m.prototype.addn=function(q){return this.clone().iaddn(q)},m.prototype.subn=function(q){return this.clone().isubn(q)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(q,k,y){var B=q.length+y,$;this._expand(B);var I,F=0;for($=0;$<q.length;$++){I=(this.words[$+y]|0)+F;var j=(q.words[$]|0)*k;I-=j&67108863,F=(I>>26)-(j/67108864|0),this.words[$+y]=I&67108863}for(;$<this.length-y;$++)I=(this.words[$+y]|0)+F,F=I>>26,this.words[$+y]=I&67108863;if(F===0)return this.strip();for(g(F===-1),F=0,$=0;$<this.length;$++)I=-(this.words[$]|0)+F,F=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},m.prototype._wordDiv=function(q,k){var y=this.length-q.length,B=this.clone(),$=q,I=$.words[$.length-1]|0,F=this._countBits(I);y=26-F,y!==0&&($=$.ushln(y),B.iushln(y),I=$.words[$.length-1]|0);var j=B.length-$.length,D;if(k!=="mod"){D=new m(null),D.length=j+1,D.words=new Array(D.length);for(var W=0;W<D.length;W++)D.words[W]=0}var R=B.clone()._ishlnsubmul($,1,j);R.negative===0&&(B=R,D&&(D.words[j]=1));for(var z=j-1;z>=0;z--){var ye=(B.words[$.length+z]|0)*67108864+(B.words[$.length+z-1]|0);for(ye=Math.min(ye/I|0,67108863),B._ishlnsubmul($,ye,z);B.negative!==0;)ye--,B.negative=0,B._ishlnsubmul($,1,z),B.isZero()||(B.negative^=1);D&&(D.words[z]=ye)}return D&&D.strip(),B.strip(),k!=="div"&&y!==0&&B.iushrn(y),{div:D||null,mod:B}},m.prototype.divmod=function(q,k,y){if(g(!q.isZero()),this.isZero())return{div:new m(0),mod:new m(0)};var B,$,I;return this.negative!==0&&q.negative===0?(I=this.neg().divmod(q,k),k!=="mod"&&(B=I.div.neg()),k!=="div"&&($=I.mod.neg(),y&&$.negative!==0&&$.iadd(q)),{div:B,mod:$}):this.negative===0&&q.negative!==0?(I=this.divmod(q.neg(),k),k!=="mod"&&(B=I.div.neg()),{div:B,mod:I.mod}):(this.negative&q.negative)!==0?(I=this.neg().divmod(q.neg(),k),k!=="div"&&($=I.mod.neg(),y&&$.negative!==0&&$.isub(q)),{div:I.div,mod:$}):q.length>this.length||this.cmp(q)<0?{div:new m(0),mod:this}:q.length===1?k==="div"?{div:this.divn(q.words[0]),mod:null}:k==="mod"?{div:null,mod:new m(this.modn(q.words[0]))}:{div:this.divn(q.words[0]),mod:new m(this.modn(q.words[0]))}:this._wordDiv(q,k)},m.prototype.div=function(q){return this.divmod(q,"div",!1).div},m.prototype.mod=function(q){return this.divmod(q,"mod",!1).mod},m.prototype.umod=function(q){return this.divmod(q,"mod",!0).mod},m.prototype.divRound=function(q){var k=this.divmod(q);if(k.mod.isZero())return k.div;var y=k.div.negative!==0?k.mod.isub(q):k.mod,B=q.ushrn(1),$=q.andln(1),I=y.cmp(B);return I<0||$===1&&I===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},m.prototype.modn=function(q){g(q<=67108863);for(var k=(1<<26)%q,y=0,B=this.length-1;B>=0;B--)y=(k*y+(this.words[B]|0))%q;return y},m.prototype.idivn=function(q){g(q<=67108863);for(var k=0,y=this.length-1;y>=0;y--){var B=(this.words[y]|0)+k*67108864;this.words[y]=B/q|0,k=B%q}return this.strip()},m.prototype.divn=function(q){return this.clone().idivn(q)},m.prototype.egcd=function(q){g(q.negative===0),g(!q.isZero());var k=this,y=q.clone();k.negative!==0?k=k.umod(q):k=k.clone();for(var B=new m(1),$=new m(0),I=new m(0),F=new m(1),j=0;k.isEven()&&y.isEven();)k.iushrn(1),y.iushrn(1),++j;for(var D=y.clone(),W=k.clone();!k.isZero();){for(var R=0,z=1;(k.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for(k.iushrn(R);R-- >0;)(B.isOdd()||$.isOdd())&&(B.iadd(D),$.isub(W)),B.iushrn(1),$.iushrn(1);for(var ye=0,Ce=1;(y.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(y.iushrn(ye);ye-- >0;)(I.isOdd()||F.isOdd())&&(I.iadd(D),F.isub(W)),I.iushrn(1),F.iushrn(1);k.cmp(y)>=0?(k.isub(y),B.isub(I),$.isub(F)):(y.isub(k),I.isub(B),F.isub($))}return{a:I,b:F,gcd:y.iushln(j)}},m.prototype._invmp=function(q){g(q.negative===0),g(!q.isZero());var k=this,y=q.clone();k.negative!==0?k=k.umod(q):k=k.clone();for(var B=new m(1),$=new m(0),I=y.clone();k.cmpn(1)>0&&y.cmpn(1)>0;){for(var F=0,j=1;(k.words[0]&j)===0&&F<26;++F,j<<=1);if(F>0)for(k.iushrn(F);F-- >0;)B.isOdd()&&B.iadd(I),B.iushrn(1);for(var D=0,W=1;(y.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(y.iushrn(D);D-- >0;)$.isOdd()&&$.iadd(I),$.iushrn(1);k.cmp(y)>=0?(k.isub(y),B.isub($)):(y.isub(k),$.isub(B))}var R;return k.cmpn(1)===0?R=B:R=$,R.cmpn(0)<0&&R.iadd(q),R},m.prototype.gcd=function(q){if(this.isZero())return q.abs();if(q.isZero())return this.abs();var k=this.clone(),y=q.clone();k.negative=0,y.negative=0;for(var B=0;k.isEven()&&y.isEven();B++)k.iushrn(1),y.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;y.isEven();)y.iushrn(1);var $=k.cmp(y);if($<0){var I=k;k=y,y=I}else if($===0||y.cmpn(1)===0)break;k.isub(y)}while(!0);return y.iushln(B)},m.prototype.invm=function(q){return this.egcd(q).a.umod(q)},m.prototype.isEven=function(){return(this.words[0]&1)===0},m.prototype.isOdd=function(){return(this.words[0]&1)===1},m.prototype.andln=function(q){return this.words[0]&q},m.prototype.bincn=function(q){g(typeof q=="number");var k=q%26,y=(q-k)/26,B=1<<k;if(this.length<=y)return this._expand(y+1),this.words[y]|=B,this;for(var $=B,I=y;$!==0&&I<this.length;I++){var F=this.words[I]|0;F+=$,$=F>>>26,F&=67108863,this.words[I]=F}return $!==0&&(this.words[I]=$,this.length++),this},m.prototype.isZero=function(){return this.length===1&&this.words[0]===0},m.prototype.cmpn=function(q){var k=q<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this.strip();var y;if(this.length>1)y=1;else{k&&(q=-q),g(q<=67108863,"Number is too big");var B=this.words[0]|0;y=B===q?0:B<q?-1:1}return this.negative!==0?-y|0:y},m.prototype.cmp=function(q){if(this.negative!==0&&q.negative===0)return-1;if(this.negative===0&&q.negative!==0)return 1;var k=this.ucmp(q);return this.negative!==0?-k|0:k},m.prototype.ucmp=function(q){if(this.length>q.length)return 1;if(this.length<q.length)return-1;for(var k=0,y=this.length-1;y>=0;y--){var B=this.words[y]|0,$=q.words[y]|0;if(B!==$){B<$?k=-1:B>$&&(k=1);break}}return k},m.prototype.gtn=function(q){return this.cmpn(q)===1},m.prototype.gt=function(q){return this.cmp(q)===1},m.prototype.gten=function(q){return this.cmpn(q)>=0},m.prototype.gte=function(q){return this.cmp(q)>=0},m.prototype.ltn=function(q){return this.cmpn(q)===-1},m.prototype.lt=function(q){return this.cmp(q)===-1},m.prototype.lten=function(q){return this.cmpn(q)<=0},m.prototype.lte=function(q){return this.cmp(q)<=0},m.prototype.eqn=function(q){return this.cmpn(q)===0},m.prototype.eq=function(q){return this.cmp(q)===0},m.red=function(q){return new he(q)},m.prototype.toRed=function(q){return g(!this.red,"Already a number in reduction context"),g(this.negative===0,"red works only with positives"),q.convertTo(this)._forceRed(q)},m.prototype.fromRed=function(){return g(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(q){return this.red=q,this},m.prototype.forceRed=function(q){return g(!this.red,"Already a number in reduction context"),this._forceRed(q)},m.prototype.redAdd=function(q){return g(this.red,"redAdd works only with red numbers"),this.red.add(this,q)},m.prototype.redIAdd=function(q){return g(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,q)},m.prototype.redSub=function(q){return g(this.red,"redSub works only with red numbers"),this.red.sub(this,q)},m.prototype.redISub=function(q){return g(this.red,"redISub works only with red numbers"),this.red.isub(this,q)},m.prototype.redShl=function(q){return g(this.red,"redShl works only with red numbers"),this.red.shl(this,q)},m.prototype.redMul=function(q){return g(this.red,"redMul works only with red numbers"),this.red._verify2(this,q),this.red.mul(this,q)},m.prototype.redIMul=function(q){return g(this.red,"redMul works only with red numbers"),this.red._verify2(this,q),this.red.imul(this,q)},m.prototype.redSqr=function(){return g(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return g(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return g(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return g(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return g(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(q){return g(this.red&&!q.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,q)};var H={k256:null,p224:null,p192:null,p25519:null};function V(te,q){this.name=te,this.p=new m(q,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var q=new m(null);return q.words=new Array(Math.ceil(this.n/13)),q},V.prototype.ireduce=function(q){var k=q,y;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),y=k.bitLength();while(y>this.n);var B=y<this.n?-1:k.ucmp(this.p);return B===0?(k.words[0]=0,k.length=1):B>0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},V.prototype.split=function(q,k){q.iushrn(this.n,0,k)},V.prototype.imulK=function(q){return q.imul(this.k)};function X(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(X,V),X.prototype.split=function(q,k){for(var y=4194303,B=Math.min(q.length,9),$=0;$<B;$++)k.words[$]=q.words[$];if(k.length=B,q.length<=9){q.words[0]=0,q.length=1;return}var I=q.words[9];for(k.words[k.length++]=I&y,$=10;$<q.length;$++){var F=q.words[$]|0;q.words[$-10]=(F&y)<<4|I>>>22,I=F}I>>>=22,q.words[$-10]=I,I===0&&q.length>10?q.length-=10:q.length-=9},X.prototype.imulK=function(q){q.words[q.length]=0,q.words[q.length+1]=0,q.length+=2;for(var k=0,y=0;y<q.length;y++){var B=q.words[y]|0;k+=B*977,q.words[y]=k&67108863,k=B*64+(k/67108864|0)}return q.words[q.length-1]===0&&(q.length--,q.words[q.length-1]===0&&q.length--),q};function oe(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(oe,V);function se(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(se,V);function de(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(de,V),de.prototype.imulK=function(q){for(var k=0,y=0;y<q.length;y++){var B=(q.words[y]|0)*19+k,$=B&67108863;B>>>=26,q.words[y]=$,k=B}return k!==0&&(q.words[q.length++]=k),q},m._prime=function(q){if(H[q])return H[q];var k;if(q==="k256")k=new X;else if(q==="p224")k=new oe;else if(q==="p192")k=new se;else if(q==="p25519")k=new de;else throw new Error("Unknown prime "+q);return H[q]=k,k};function he(te){if(typeof te=="string"){var q=m._prime(te);this.m=q.p,this.prime=q}else g(te.gtn(1),"modulus must be greater than 1"),this.m=te,this.prime=null}he.prototype._verify1=function(q){g(q.negative===0,"red works only with positives"),g(q.red,"red works only with red numbers")},he.prototype._verify2=function(q,k){g((q.negative|k.negative)===0,"red works only with positives"),g(q.red&&q.red===k.red,"red works only with red numbers")},he.prototype.imod=function(q){return this.prime?this.prime.ireduce(q)._forceRed(this):q.umod(this.m)._forceRed(this)},he.prototype.neg=function(q){return q.isZero()?q.clone():this.m.sub(q)._forceRed(this)},he.prototype.add=function(q,k){this._verify2(q,k);var y=q.add(k);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},he.prototype.iadd=function(q,k){this._verify2(q,k);var y=q.iadd(k);return y.cmp(this.m)>=0&&y.isub(this.m),y},he.prototype.sub=function(q,k){this._verify2(q,k);var y=q.sub(k);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},he.prototype.isub=function(q,k){this._verify2(q,k);var y=q.isub(k);return y.cmpn(0)<0&&y.iadd(this.m),y},he.prototype.shl=function(q,k){return this._verify1(q),this.imod(q.ushln(k))},he.prototype.imul=function(q,k){return this._verify2(q,k),this.imod(q.imul(k))},he.prototype.mul=function(q,k){return this._verify2(q,k),this.imod(q.mul(k))},he.prototype.isqr=function(q){return this.imul(q,q.clone())},he.prototype.sqr=function(q){return this.mul(q,q)},he.prototype.sqrt=function(q){if(q.isZero())return q.clone();var k=this.m.andln(3);if(g(k%2===1),k===3){var y=this.m.add(new m(1)).iushrn(2);return this.pow(q,y)}for(var B=this.m.subn(1),$=0;!B.isZero()&&B.andln(1)===0;)$++,B.iushrn(1);g(!B.isZero());var I=new m(1).toRed(this),F=I.redNeg(),j=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new m(2*D*D).toRed(this);this.pow(D,j).cmp(F)!==0;)D.redIAdd(F);for(var W=this.pow(D,B),R=this.pow(q,B.addn(1).iushrn(1)),z=this.pow(q,B),ye=$;z.cmp(I)!==0;){for(var Ce=z,me=0;Ce.cmp(I)!==0;me++)Ce=Ce.redSqr();g(me<ye);var ie=this.pow(W,new m(1).iushln(ye-me-1));R=R.redMul(ie),W=ie.redSqr(),z=z.redMul(W),ye=me}return R},he.prototype.invm=function(q){var k=q._invmp(this.m);return k.negative!==0?(k.negative=0,this.imod(k).redNeg()):this.imod(k)},he.prototype.pow=function(q,k){if(k.isZero())return new m(1).toRed(this);if(k.cmpn(1)===0)return q.clone();var y=4,B=new Array(1<<y);B[0]=new m(1).toRed(this),B[1]=q;for(var $=2;$<B.length;$++)B[$]=this.mul(B[$-1],q);var I=B[0],F=0,j=0,D=k.bitLength()%26;for(D===0&&(D=26),$=k.length-1;$>=0;$--){for(var W=k.words[$],R=D-1;R>=0;R--){var z=W>>R&1;if(I!==B[0]&&(I=this.sqr(I)),z===0&&F===0){j=0;continue}F<<=1,F|=z,j++,!(j!==y&&($!==0||R!==0))&&(I=this.mul(I,B[F]),j=0,F=0)}D=26}return I},he.prototype.convertTo=function(q){var k=q.umod(this.m);return k===q?k.clone():k},he.prototype.convertFrom=function(q){var k=q.clone();return k.red=null,k},m.mont=function(q){return new we(q)};function we(te){he.call(this,te),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new m(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(we,he),we.prototype.convertTo=function(q){return this.imod(q.ushln(this.shift))},we.prototype.convertFrom=function(q){var k=this.imod(q.mul(this.rinv));return k.red=null,k},we.prototype.imul=function(q,k){if(q.isZero()||k.isZero())return q.words[0]=0,q.length=1,q;var y=q.imul(k),B=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=y.isub(B).iushrn(this.shift),I=$;return $.cmp(this.m)>=0?I=$.isub(this.m):$.cmpn(0)<0&&(I=$.iadd(this.m)),I._forceRed(this)},we.prototype.mul=function(q,k){if(q.isZero()||k.isZero())return new m(0)._forceRed(this);var y=q.mul(k),B=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=y.isub(B).iushrn(this.shift),I=$;return $.cmp(this.m)>=0?I=$.isub(this.m):$.cmpn(0)<0&&(I=$.iadd(this.m)),I._forceRed(this)},we.prototype.invm=function(q){var k=this.imod(q._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(r,bn$4)})(bn$5)),bn$5.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var r;brorand.exports=function(v){return r||(r=new f(null)),r.generate(v)};function f(g){this.rand=g}if(brorand.exports.Rand=f,f.prototype.generate=function(v){return this._rand(v)},f.prototype._rand=function(v){if(this.rand.getBytes)return this.rand.getBytes(v);for(var m=new Uint8Array(v),w=0;w<m.length;w++)m[w]=this.rand.getByte();return m},typeof self=="object")self.crypto&&self.crypto.getRandomValues?f.prototype._rand=function(v){var m=new Uint8Array(v);return self.crypto.getRandomValues(m),m}:self.msCrypto&&self.msCrypto.getRandomValues?f.prototype._rand=function(v){var m=new Uint8Array(v);return self.msCrypto.getRandomValues(m),m}:typeof window=="object"&&(f.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var d=requireCryptoBrowserify();if(typeof d.randomBytes!="function")throw new Error("Not supported");f.prototype._rand=function(v){return d.randomBytes(v)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var r=requireBn$2(),f=requireBrorand();function d(g){this.rand=g||new f.Rand}return mr=d,d.create=function(v){return new d(v)},d.prototype._randbelow=function(v){var m=v.bitLength(),w=Math.ceil(m/8);do var _=new r(this.rand.generate(w));while(_.cmp(v)>=0);return _},d.prototype._randrange=function(v,m){var w=m.sub(v);return v.add(this._randbelow(w))},d.prototype.test=function(v,m,w){var _=v.bitLength(),S=r.mont(v),x=new r(1).toRed(S);m||(m=Math.max(1,_/48|0));for(var b=v.subn(1),C=0;!b.testn(C);C++);for(var E=v.shrn(C),M=b.toRed(S),A=!0;m>0;m--){var T=this._randrange(new r(2),b);w&&w(T);var L=T.toRed(S).redPow(E);if(!(L.cmp(x)===0||L.cmp(M)===0)){for(var O=1;O<C;O++){if(L=L.redSqr(),L.cmp(x)===0)return!1;if(L.cmp(M)===0)break}if(O===C)return!1}}return A},d.prototype.getDivisor=function(v,m){var w=v.bitLength(),_=r.mont(v),S=new r(1).toRed(_);m||(m=Math.max(1,w/48|0));for(var x=v.subn(1),b=0;!x.testn(b);b++);for(var C=v.shrn(b),E=x.toRed(_);m>0;m--){var M=this._randrange(new r(2),x),A=v.gcd(M);if(A.cmpn(1)!==0)return A;var T=M.toRed(_).redPow(C);if(!(T.cmp(S)===0||T.cmp(E)===0)){for(var L=1;L<b;L++){if(T=T.redSqr(),T.cmp(S)===0)return T.fromRed().subn(1).gcd(v);if(T.cmp(E)===0)break}if(L===b)return T=T.redSqr(),T.fromRed().subn(1).gcd(v)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var r=requireBrowser$b();generatePrime=L,L.simpleSieve=A,L.fermatTest=T;var f=requireBn$2(),d=new f(24),g=requireMr(),v=new g,m=new f(1),w=new f(2),_=new f(5);new f(16),new f(8);var S=new f(10),x=new f(3);new f(7);var b=new f(11),C=new f(4);new f(12);var E=null;function M(){if(E!==null)return E;var O=1048576,N=[];N[0]=2;for(var H=1,V=3;V<O;V+=2){for(var X=Math.ceil(Math.sqrt(V)),oe=0;oe<H&&N[oe]<=X&&V%N[oe]!==0;oe++);H!==oe&&N[oe]<=X||(N[H++]=V)}return E=N,N}function A(O){for(var N=M(),H=0;H<N.length;H++)if(O.modn(N[H])===0)return O.cmpn(N[H])===0;return!0}function T(O){var N=f.mont(O);return w.toRed(N).redPow(O.subn(1)).fromRed().cmpn(1)===0}function L(O,N){if(O<16)return N===2||N===5?new f([140,123]):new f([140,39]);N=new f(N);for(var H,V;;){for(H=new f(r(Math.ceil(O/8)));H.bitLength()>O;)H.ishrn(1);if(H.isEven()&&H.iadd(m),H.testn(1)||H.iadd(w),N.cmp(w)){if(!N.cmp(_))for(;H.mod(S).cmp(x);)H.iadd(C)}else for(;H.mod(d).cmp(b);)H.iadd(C);if(V=H.shrn(1),A(V)&&A(H)&&T(V)&&T(H)&&v.test(V)&&v.test(H))return H}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var r=requireBn$2(),f=requireMr(),d=new f,g=new r(24),v=new r(11),m=new r(10),w=new r(3),_=new r(7),S=requireGeneratePrime(),x=requireBrowser$b();dh=A;function b(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this._pub=new r(L),this}function C(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this._priv=new r(L),this}var E={};function M(L,O){var N=O.toString("hex"),H=[N,L.toString(16)].join("_");if(H in E)return E[H];var V=0;if(L.isEven()||!S.simpleSieve||!S.fermatTest(L)||!d.test(L))return V+=1,N==="02"||N==="05"?V+=8:V+=4,E[H]=V,V;d.test(L.shrn(1))||(V+=2);var X;switch(N){case"02":L.mod(g).cmp(v)&&(V+=8);break;case"05":X=L.mod(m),X.cmp(w)&&X.cmp(_)&&(V+=8);break;default:V+=4}return E[H]=V,V}function A(L,O,N){this.setGenerator(O),this.__prime=new r(L),this._prime=r.mont(this.__prime),this._primeLen=L.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,N?(this.setPublicKey=b,this.setPrivateKey=C):this._primeCode=8}Object.defineProperty(A.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=M(this.__prime,this.__gen)),this._primeCode}}),A.prototype.generateKeys=function(){return this._priv||(this._priv=new r(x(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},A.prototype.computeSecret=function(L){L=new r(L),L=L.toRed(this._prime);var O=L.redPow(this._priv).fromRed(),N=new Buffer(O.toArray()),H=this.getPrime();if(N.length<H.length){var V=new Buffer(H.length-N.length);V.fill(0),N=Buffer.concat([V,N])}return N},A.prototype.getPublicKey=function(O){return T(this._pub,O)},A.prototype.getPrivateKey=function(O){return T(this._priv,O)},A.prototype.getPrime=function(L){return T(this.__prime,L)},A.prototype.getGenerator=function(L){return T(this._gen,L)},A.prototype.setGenerator=function(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this.__gen=L,this._gen=new r(L),this};function T(L,O){var N=new Buffer(L.toArray());return O?N.toString(O):N}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var r=requireGeneratePrime(),f=require$$1$1,d=requireDh();function g(w){var _=new Buffer(f[w].prime,"hex"),S=new Buffer(f[w].gen,"hex");return new d(_,S)}var v={binary:!0,hex:!0,base64:!0};function m(w,_,S,x){return Buffer.isBuffer(_)||v[_]===void 0?m(w,"binary",_,S):(_=_||"binary",x=x||"binary",S=S||new Buffer([2]),Buffer.isBuffer(S)||(S=new Buffer(S,x)),typeof w=="number"?new d(r(w,S),S,!0):(Buffer.isBuffer(w)||(w=new Buffer(w,_)),new d(w,S,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=g,browser$4.createDiffieHellman=browser$4.DiffieHellman=m,browser$4}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:r}:processNextickArgs.exports=process$1;function r(f,d,g,v){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var m=arguments.length,w,_;switch(m){case 0:case 1:return process$1.nextTick(f);case 2:return process$1.nextTick(function(){f.call(null,d)});case 3:return process$1.nextTick(function(){f.call(null,d,g)});case 4:return process$1.nextTick(function(){f.call(null,d,g,v)});default:for(w=new Array(m-1),_=0;_<w.length;)w[_++]=arguments[_];return process$1.nextTick(function(){f.apply(null,w)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var r={}.toString;return isarray=Array.isArray||function(f){return r.call(f)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,(function(r,f){var d=requireDist(),g=d.Buffer;function v(w,_){for(var S in w)_[S]=w[S]}g.from&&g.alloc&&g.allocUnsafe&&g.allocUnsafeSlow?r.exports=d:(v(d,f),f.Buffer=m);function m(w,_,S){return g(w,_,S)}v(g,m),m.from=function(w,_,S){if(typeof w=="number")throw new TypeError("Argument must not be a number");return g(w,_,S)},m.alloc=function(w,_,S){if(typeof w!="number")throw new TypeError("Argument must be a number");var x=g(w);return _!==void 0?typeof S=="string"?x.fill(_,S):x.fill(_):x.fill(0),x},m.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return g(w)},m.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(w)}})(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function r(T){return Array.isArray?Array.isArray(T):A(T)==="[object Array]"}util.isArray=r;function f(T){return typeof T=="boolean"}util.isBoolean=f;function d(T){return T===null}util.isNull=d;function g(T){return T==null}util.isNullOrUndefined=g;function v(T){return typeof T=="number"}util.isNumber=v;function m(T){return typeof T=="string"}util.isString=m;function w(T){return typeof T=="symbol"}util.isSymbol=w;function _(T){return T===void 0}util.isUndefined=_;function S(T){return A(T)==="[object RegExp]"}util.isRegExp=S;function x(T){return typeof T=="object"&&T!==null}util.isObject=x;function b(T){return A(T)==="[object Date]"}util.isDate=b;function C(T){return A(T)==="[object Error]"||T instanceof Error}util.isError=C;function E(T){return typeof T=="function"}util.isFunction=E;function M(T){return T===null||typeof T=="boolean"||typeof T=="number"||typeof T=="string"||typeof T=="symbol"||typeof T>"u"}util.isPrimitive=M,util.isBuffer=requireDist().Buffer.isBuffer;function A(T){return Object.prototype.toString.call(T)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,(function(r){function f(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}var d=requireSafeBuffer().Buffer,g=requireUtil$1();function v(m,w,_){m.copy(w,_)}r.exports=(function(){function m(){f(this,m),this.head=null,this.tail=null,this.length=0}return m.prototype.push=function(_){var S={data:_,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},m.prototype.unshift=function(_){var S={data:_,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},m.prototype.shift=function(){if(this.length!==0){var _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}},m.prototype.clear=function(){this.head=this.tail=null,this.length=0},m.prototype.join=function(_){if(this.length===0)return"";for(var S=this.head,x=""+S.data;S=S.next;)x+=_+S.data;return x},m.prototype.concat=function(_){if(this.length===0)return d.alloc(0);for(var S=d.allocUnsafe(_>>>0),x=this.head,b=0;x;)v(x.data,S,b),b+=x.data.length,x=x.next;return S},m})(),g&&g.inspect&&g.inspect.custom&&(r.exports.prototype[g.inspect.custom]=function(){var m=g.inspect({length:this.length});return this.constructor.name+" "+m})})(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var r=requireProcessNextickArgs();function f(v,m){var w=this,_=this._readableState&&this._readableState.destroyed,S=this._writableState&&this._writableState.destroyed;return _||S?(m?m(v):v&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(g,this,v)):r.nextTick(g,this,v)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(v||null,function(x){!m&&x?w._writableState?w._writableState.errorEmitted||(w._writableState.errorEmitted=!0,r.nextTick(g,w,x)):r.nextTick(g,w,x):m&&m(x)}),this)}function d(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function g(v,m){v.emit("error",m)}return destroy_1={destroy:f,undestroy:d},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var r=requireProcessNextickArgs();_stream_writable=T;function f(I){var F=this;this.next=null,this.entry=null,this.finish=function(){$(F,I)}}var d=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:r.nextTick,g;T.WritableState=M;var v=Object.create(requireUtil());v.inherits=requireInherits_browser();var m={deprecate:requireBrowser$a()},w=requireStreamBrowser(),_=requireSafeBuffer().Buffer,S=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function x(I){return _.from(I)}function b(I){return _.isBuffer(I)||I instanceof S}var C=requireDestroy();v.inherits(T,w);function E(){}function M(I,F){g=g||require_stream_duplex(),I=I||{};var j=F instanceof g;this.objectMode=!!I.objectMode,j&&(this.objectMode=this.objectMode||!!I.writableObjectMode);var D=I.highWaterMark,W=I.writableHighWaterMark,R=this.objectMode?16:16*1024;D||D===0?this.highWaterMark=D:j&&(W||W===0)?this.highWaterMark=W:this.highWaterMark=R,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=I.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){se(F,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}M.prototype.getBuffer=function(){for(var F=this.bufferedRequest,j=[];F;)j.push(F),F=F.next;return j},(function(){try{Object.defineProperty(M.prototype,"buffer",{get:m.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var A;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(A=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(I){return A.call(this,I)?!0:this!==T?!1:I&&I._writableState instanceof M}})):A=function(I){return I instanceof this};function T(I){if(g=g||require_stream_duplex(),!A.call(T,this)&&!(this instanceof g))return new T(I);this._writableState=new M(I,this),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),w.call(this)}T.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function L(I,F){var j=new Error("write after end");I.emit("error",j),r.nextTick(F,j)}function O(I,F,j,D){var W=!0,R=!1;return j===null?R=new TypeError("May not write null values to stream"):typeof j!="string"&&j!==void 0&&!F.objectMode&&(R=new TypeError("Invalid non-string/buffer chunk")),R&&(I.emit("error",R),r.nextTick(D,R),W=!1),W}T.prototype.write=function(I,F,j){var D=this._writableState,W=!1,R=!D.objectMode&&b(I);return R&&!_.isBuffer(I)&&(I=x(I)),typeof F=="function"&&(j=F,F=null),R?F="buffer":F||(F=D.defaultEncoding),typeof j!="function"&&(j=E),D.ended?L(this,j):(R||O(this,D,I,j))&&(D.pendingcb++,W=H(this,D,R,I,F,j)),W},T.prototype.cork=function(){var I=this._writableState;I.corked++},T.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&we(this,I))},T.prototype.setDefaultEncoding=function(F){if(typeof F=="string"&&(F=F.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+F);return this._writableState.defaultEncoding=F,this};function N(I,F,j){return!I.objectMode&&I.decodeStrings!==!1&&typeof F=="string"&&(F=_.from(F,j)),F}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function H(I,F,j,D,W,R){if(!j){var z=N(F,D,W);D!==z&&(j=!0,W="buffer",D=z)}var ye=F.objectMode?1:D.length;F.length+=ye;var Ce=F.length<F.highWaterMark;if(Ce||(F.needDrain=!0),F.writing||F.corked){var me=F.lastBufferedRequest;F.lastBufferedRequest={chunk:D,encoding:W,isBuf:j,callback:R,next:null},me?me.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else V(I,F,!1,ye,D,W,R);return Ce}function V(I,F,j,D,W,R,z){F.writelen=D,F.writecb=z,F.writing=!0,F.sync=!0,j?I._writev(W,F.onwrite):I._write(W,R,F.onwrite),F.sync=!1}function X(I,F,j,D,W){--F.pendingcb,j?(r.nextTick(W,D),r.nextTick(y,I,F),I._writableState.errorEmitted=!0,I.emit("error",D)):(W(D),I._writableState.errorEmitted=!0,I.emit("error",D),y(I,F))}function oe(I){I.writing=!1,I.writecb=null,I.length-=I.writelen,I.writelen=0}function se(I,F){var j=I._writableState,D=j.sync,W=j.writecb;if(oe(j),F)X(I,j,D,F,W);else{var R=te(j);!R&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&we(I,j),D?d(de,I,j,R,W):de(I,j,R,W)}}function de(I,F,j,D){j||he(I,F),F.pendingcb--,D(),y(I,F)}function he(I,F){F.length===0&&F.needDrain&&(F.needDrain=!1,I.emit("drain"))}function we(I,F){F.bufferProcessing=!0;var j=F.bufferedRequest;if(I._writev&&j&&j.next){var D=F.bufferedRequestCount,W=new Array(D),R=F.corkedRequestsFree;R.entry=j;for(var z=0,ye=!0;j;)W[z]=j,j.isBuf||(ye=!1),j=j.next,z+=1;W.allBuffers=ye,V(I,F,!0,F.length,W,"",R.finish),F.pendingcb++,F.lastBufferedRequest=null,R.next?(F.corkedRequestsFree=R.next,R.next=null):F.corkedRequestsFree=new f(F),F.bufferedRequestCount=0}else{for(;j;){var Ce=j.chunk,me=j.encoding,ie=j.callback,ee=F.objectMode?1:Ce.length;if(V(I,F,!1,ee,Ce,me,ie),j=j.next,F.bufferedRequestCount--,F.writing)break}j===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=j,F.bufferProcessing=!1}T.prototype._write=function(I,F,j){j(new Error("_write() is not implemented"))},T.prototype._writev=null,T.prototype.end=function(I,F,j){var D=this._writableState;typeof I=="function"?(j=I,I=null,F=null):typeof F=="function"&&(j=F,F=null),I!=null&&this.write(I,F),D.corked&&(D.corked=1,this.uncork()),D.ending||B(this,D,j)};function te(I){return I.ending&&I.length===0&&I.bufferedRequest===null&&!I.finished&&!I.writing}function q(I,F){I._final(function(j){F.pendingcb--,j&&I.emit("error",j),F.prefinished=!0,I.emit("prefinish"),y(I,F)})}function k(I,F){!F.prefinished&&!F.finalCalled&&(typeof I._final=="function"?(F.pendingcb++,F.finalCalled=!0,r.nextTick(q,I,F)):(F.prefinished=!0,I.emit("prefinish")))}function y(I,F){var j=te(F);return j&&(k(I,F),F.pendingcb===0&&(F.finished=!0,I.emit("finish"))),j}function B(I,F,j){F.ending=!0,y(I,F),j&&(F.finished?r.nextTick(j):I.once("finish",j)),F.ended=!0,I.writable=!1}function $(I,F,j){var D=I.entry;for(I.entry=null;D;){var W=D.callback;F.pendingcb--,W(j),D=D.next}F.corkedRequestsFree.next=I}return Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(I){this._writableState&&(this._writableState.destroyed=I)}}),T.prototype.destroy=C.destroy,T.prototype._undestroy=C.undestroy,T.prototype._destroy=function(I,F){this.end(),F(I)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var r=requireProcessNextickArgs(),f=Object.keys||function(C){var E=[];for(var M in C)E.push(M);return E};_stream_duplex=S;var d=Object.create(requireUtil());d.inherits=requireInherits_browser();var g=require_stream_readable(),v=require_stream_writable();d.inherits(S,g);for(var m=f(v.prototype),w=0;w<m.length;w++){var _=m[w];S.prototype[_]||(S.prototype[_]=v.prototype[_])}function S(C){if(!(this instanceof S))return new S(C);g.call(this,C),v.call(this,C),C&&C.readable===!1&&(this.readable=!1),C&&C.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,C&&C.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",x)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function x(){this.allowHalfOpen||this._writableState.ended||r.nextTick(b,this)}function b(C){C.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(C){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=C,this._writableState.destroyed=C)}}),S.prototype._destroy=function(C,E){this.push(null),this.end(),r.nextTick(E,C)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var r=requireProcessNextickArgs();_stream_readable=N;var f=requireIsarray(),d;N.ReadableState=O,requireEvents().EventEmitter;var g=function(ie,ee){return ie.listeners(ee).length},v=requireStreamBrowser(),m=requireSafeBuffer().Buffer,w=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _(ie){return m.from(ie)}function S(ie){return m.isBuffer(ie)||ie instanceof w}var x=Object.create(requireUtil());x.inherits=requireInherits_browser();var b=requireUtil$1(),C=void 0;b&&b.debuglog?C=b.debuglog("stream"):C=function(){};var E=requireBufferList(),M=requireDestroy(),A;x.inherits(N,v);var T=["error","close","destroy","pause","resume"];function L(ie,ee,pe){if(typeof ie.prependListener=="function")return ie.prependListener(ee,pe);!ie._events||!ie._events[ee]?ie.on(ee,pe):f(ie._events[ee])?ie._events[ee].unshift(pe):ie._events[ee]=[pe,ie._events[ee]]}function O(ie,ee){d=d||require_stream_duplex(),ie=ie||{};var pe=ee instanceof d;this.objectMode=!!ie.objectMode,pe&&(this.objectMode=this.objectMode||!!ie.readableObjectMode);var be=ie.highWaterMark,ae=ie.readableHighWaterMark,ne=this.objectMode?16:16*1024;be||be===0?this.highWaterMark=be:pe&&(ae||ae===0)?this.highWaterMark=ae:this.highWaterMark=ne,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new E,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(A||(A=requireString_decoder().StringDecoder),this.decoder=new A(ie.encoding),this.encoding=ie.encoding)}function N(ie){if(d=d||require_stream_duplex(),!(this instanceof N))return new N(ie);this._readableState=new O(ie,this),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),v.call(this)}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ie){this._readableState&&(this._readableState.destroyed=ie)}}),N.prototype.destroy=M.destroy,N.prototype._undestroy=M.undestroy,N.prototype._destroy=function(ie,ee){this.push(null),ee(ie)},N.prototype.push=function(ie,ee){var pe=this._readableState,be;return pe.objectMode?be=!0:typeof ie=="string"&&(ee=ee||pe.defaultEncoding,ee!==pe.encoding&&(ie=m.from(ie,ee),ee=""),be=!0),H(this,ie,ee,!1,be)},N.prototype.unshift=function(ie){return H(this,ie,null,!0,!1)};function H(ie,ee,pe,be,ae){var ne=ie._readableState;if(ee===null)ne.reading=!1,we(ie,ne);else{var Se;ae||(Se=X(ne,ee)),Se?ie.emit("error",Se):ne.objectMode||ee&&ee.length>0?(typeof ee!="string"&&!ne.objectMode&&Object.getPrototypeOf(ee)!==m.prototype&&(ee=_(ee)),be?ne.endEmitted?ie.emit("error",new Error("stream.unshift() after end event")):V(ie,ne,ee,!0):ne.ended?ie.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!pe?(ee=ne.decoder.write(ee),ne.objectMode||ee.length!==0?V(ie,ne,ee,!1):k(ie,ne)):V(ie,ne,ee,!1))):be||(ne.reading=!1)}return oe(ne)}function V(ie,ee,pe,be){ee.flowing&&ee.length===0&&!ee.sync?(ie.emit("data",pe),ie.read(0)):(ee.length+=ee.objectMode?1:pe.length,be?ee.buffer.unshift(pe):ee.buffer.push(pe),ee.needReadable&&te(ie)),k(ie,ee)}function X(ie,ee){var pe;return!S(ee)&&typeof ee!="string"&&ee!==void 0&&!ie.objectMode&&(pe=new TypeError("Invalid non-string/buffer chunk")),pe}function oe(ie){return!ie.ended&&(ie.needReadable||ie.length<ie.highWaterMark||ie.length===0)}N.prototype.isPaused=function(){return this._readableState.flowing===!1},N.prototype.setEncoding=function(ie){return A||(A=requireString_decoder().StringDecoder),this._readableState.decoder=new A(ie),this._readableState.encoding=ie,this};var se=8388608;function de(ie){return ie>=se?ie=se:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function he(ie,ee){return ie<=0||ee.length===0&&ee.ended?0:ee.objectMode?1:ie!==ie?ee.flowing&&ee.length?ee.buffer.head.data.length:ee.length:(ie>ee.highWaterMark&&(ee.highWaterMark=de(ie)),ie<=ee.length?ie:ee.ended?ee.length:(ee.needReadable=!0,0))}N.prototype.read=function(ie){C("read",ie),ie=parseInt(ie,10);var ee=this._readableState,pe=ie;if(ie!==0&&(ee.emittedReadable=!1),ie===0&&ee.needReadable&&(ee.length>=ee.highWaterMark||ee.ended))return C("read: emitReadable",ee.length,ee.ended),ee.length===0&&ee.ended?ye(this):te(this),null;if(ie=he(ie,ee),ie===0&&ee.ended)return ee.length===0&&ye(this),null;var be=ee.needReadable;C("need readable",be),(ee.length===0||ee.length-ie<ee.highWaterMark)&&(be=!0,C("length less than watermark",be)),ee.ended||ee.reading?(be=!1,C("reading or ended",be)):be&&(C("do read"),ee.reading=!0,ee.sync=!0,ee.length===0&&(ee.needReadable=!0),this._read(ee.highWaterMark),ee.sync=!1,ee.reading||(ie=he(pe,ee)));var ae;return ie>0?ae=D(ie,ee):ae=null,ae===null?(ee.needReadable=!0,ie=0):ee.length-=ie,ee.length===0&&(ee.ended||(ee.needReadable=!0),pe!==ie&&ee.ended&&ye(this)),ae!==null&&this.emit("data",ae),ae};function we(ie,ee){if(!ee.ended){if(ee.decoder){var pe=ee.decoder.end();pe&&pe.length&&(ee.buffer.push(pe),ee.length+=ee.objectMode?1:pe.length)}ee.ended=!0,te(ie)}}function te(ie){var ee=ie._readableState;ee.needReadable=!1,ee.emittedReadable||(C("emitReadable",ee.flowing),ee.emittedReadable=!0,ee.sync?r.nextTick(q,ie):q(ie))}function q(ie){C("emit readable"),ie.emit("readable"),j(ie)}function k(ie,ee){ee.readingMore||(ee.readingMore=!0,r.nextTick(y,ie,ee))}function y(ie,ee){for(var pe=ee.length;!ee.reading&&!ee.flowing&&!ee.ended&&ee.length<ee.highWaterMark&&(C("maybeReadMore read 0"),ie.read(0),pe!==ee.length);)pe=ee.length;ee.readingMore=!1}N.prototype._read=function(ie){this.emit("error",new Error("_read() is not implemented"))},N.prototype.pipe=function(ie,ee){var pe=this,be=this._readableState;switch(be.pipesCount){case 0:be.pipes=ie;break;case 1:be.pipes=[be.pipes,ie];break;default:be.pipes.push(ie);break}be.pipesCount+=1,C("pipe count=%d opts=%j",be.pipesCount,ee);var ae=(!ee||ee.end!==!1)&&ie!==process$1.stdout&&ie!==process$1.stderr,ne=ae?ke:Je;be.endEmitted?r.nextTick(ne):pe.once("end",ne),ie.on("unpipe",Se);function Se(Ge,ut){C("onunpipe"),Ge===pe&&ut&&ut.hasUnpiped===!1&&(ut.hasUnpiped=!0,Ue())}function ke(){C("onend"),ie.end()}var Ie=B(pe);ie.on("drain",Ie);var Oe=!1;function Ue(){C("cleanup"),ie.removeListener("close",Ye),ie.removeListener("finish",st),ie.removeListener("drain",Ie),ie.removeListener("error",je),ie.removeListener("unpipe",Se),pe.removeListener("end",ke),pe.removeListener("end",Je),pe.removeListener("data",$e),Oe=!0,be.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&Ie()}var De=!1;pe.on("data",$e);function $e(Ge){C("ondata"),De=!1;var ut=ie.write(Ge);ut===!1&&!De&&((be.pipesCount===1&&be.pipes===ie||be.pipesCount>1&&me(be.pipes,ie)!==-1)&&!Oe&&(C("false write response, pause",be.awaitDrain),be.awaitDrain++,De=!0),pe.pause())}function je(Ge){C("onerror",Ge),Je(),ie.removeListener("error",je),g(ie,"error")===0&&ie.emit("error",Ge)}L(ie,"error",je);function Ye(){ie.removeListener("finish",st),Je()}ie.once("close",Ye);function st(){C("onfinish"),ie.removeListener("close",Ye),Je()}ie.once("finish",st);function Je(){C("unpipe"),pe.unpipe(ie)}return ie.emit("pipe",pe),be.flowing||(C("pipe resume"),pe.resume()),ie};function B(ie){return function(){var ee=ie._readableState;C("pipeOnDrain",ee.awaitDrain),ee.awaitDrain&&ee.awaitDrain--,ee.awaitDrain===0&&g(ie,"data")&&(ee.flowing=!0,j(ie))}}N.prototype.unpipe=function(ie){var ee=this._readableState,pe={hasUnpiped:!1};if(ee.pipesCount===0)return this;if(ee.pipesCount===1)return ie&&ie!==ee.pipes?this:(ie||(ie=ee.pipes),ee.pipes=null,ee.pipesCount=0,ee.flowing=!1,ie&&ie.emit("unpipe",this,pe),this);if(!ie){var be=ee.pipes,ae=ee.pipesCount;ee.pipes=null,ee.pipesCount=0,ee.flowing=!1;for(var ne=0;ne<ae;ne++)be[ne].emit("unpipe",this,{hasUnpiped:!1});return this}var Se=me(ee.pipes,ie);return Se===-1?this:(ee.pipes.splice(Se,1),ee.pipesCount-=1,ee.pipesCount===1&&(ee.pipes=ee.pipes[0]),ie.emit("unpipe",this,pe),this)},N.prototype.on=function(ie,ee){var pe=v.prototype.on.call(this,ie,ee);if(ie==="data")this._readableState.flowing!==!1&&this.resume();else if(ie==="readable"){var be=this._readableState;!be.endEmitted&&!be.readableListening&&(be.readableListening=be.needReadable=!0,be.emittedReadable=!1,be.reading?be.length&&te(this):r.nextTick($,this))}return pe},N.prototype.addListener=N.prototype.on;function $(ie){C("readable nexttick read 0"),ie.read(0)}N.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(C("resume"),ie.flowing=!0,I(this,ie)),this};function I(ie,ee){ee.resumeScheduled||(ee.resumeScheduled=!0,r.nextTick(F,ie,ee))}function F(ie,ee){ee.reading||(C("resume read 0"),ie.read(0)),ee.resumeScheduled=!1,ee.awaitDrain=0,ie.emit("resume"),j(ie),ee.flowing&&!ee.reading&&ie.read(0)}N.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function j(ie){var ee=ie._readableState;for(C("flow",ee.flowing);ee.flowing&&ie.read()!==null;);}N.prototype.wrap=function(ie){var ee=this,pe=this._readableState,be=!1;ie.on("end",function(){if(C("wrapped end"),pe.decoder&&!pe.ended){var Se=pe.decoder.end();Se&&Se.length&&ee.push(Se)}ee.push(null)}),ie.on("data",function(Se){if(C("wrapped data"),pe.decoder&&(Se=pe.decoder.write(Se)),!(pe.objectMode&&Se==null)&&!(!pe.objectMode&&(!Se||!Se.length))){var ke=ee.push(Se);ke||(be=!0,ie.pause())}});for(var ae in ie)this[ae]===void 0&&typeof ie[ae]=="function"&&(this[ae]=(function(Se){return function(){return ie[Se].apply(ie,arguments)}})(ae));for(var ne=0;ne<T.length;ne++)ie.on(T[ne],this.emit.bind(this,T[ne]));return this._read=function(Se){C("wrapped _read",Se),be&&(be=!1,ie.resume())},this},Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),N._fromList=D;function D(ie,ee){if(ee.length===0)return null;var pe;return ee.objectMode?pe=ee.buffer.shift():!ie||ie>=ee.length?(ee.decoder?pe=ee.buffer.join(""):ee.buffer.length===1?pe=ee.buffer.head.data:pe=ee.buffer.concat(ee.length),ee.buffer.clear()):pe=W(ie,ee.buffer,ee.decoder),pe}function W(ie,ee,pe){var be;return ie<ee.head.data.length?(be=ee.head.data.slice(0,ie),ee.head.data=ee.head.data.slice(ie)):ie===ee.head.data.length?be=ee.shift():be=pe?R(ie,ee):z(ie,ee),be}function R(ie,ee){var pe=ee.head,be=1,ae=pe.data;for(ie-=ae.length;pe=pe.next;){var ne=pe.data,Se=ie>ne.length?ne.length:ie;if(Se===ne.length?ae+=ne:ae+=ne.slice(0,ie),ie-=Se,ie===0){Se===ne.length?(++be,pe.next?ee.head=pe.next:ee.head=ee.tail=null):(ee.head=pe,pe.data=ne.slice(Se));break}++be}return ee.length-=be,ae}function z(ie,ee){var pe=m.allocUnsafe(ie),be=ee.head,ae=1;for(be.data.copy(pe),ie-=be.data.length;be=be.next;){var ne=be.data,Se=ie>ne.length?ne.length:ie;if(ne.copy(pe,pe.length-ie,0,Se),ie-=Se,ie===0){Se===ne.length?(++ae,be.next?ee.head=be.next:ee.head=ee.tail=null):(ee.head=be,be.data=ne.slice(Se));break}++ae}return ee.length-=ae,pe}function ye(ie){var ee=ie._readableState;if(ee.length>0)throw new Error('"endReadable()" called on non-empty stream');ee.endEmitted||(ee.ended=!0,r.nextTick(Ce,ee,ie))}function Ce(ie,ee){!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ee.readable=!1,ee.emit("end"))}function me(ie,ee){for(var pe=0,be=ie.length;pe<be;pe++)if(ie[pe]===ee)return pe;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=g;var r=require_stream_duplex(),f=Object.create(requireUtil());f.inherits=requireInherits_browser(),f.inherits(g,r);function d(w,_){var S=this._transformState;S.transforming=!1;var x=S.writecb;if(!x)return this.emit("error",new Error("write callback called multiple times"));S.writechunk=null,S.writecb=null,_!=null&&this.push(_),x(w);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function g(w){if(!(this instanceof g))return new g(w);r.call(this,w),this._transformState={afterTransform:d.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,w&&(typeof w.transform=="function"&&(this._transform=w.transform),typeof w.flush=="function"&&(this._flush=w.flush)),this.on("prefinish",v)}function v(){var w=this;typeof this._flush=="function"?this._flush(function(_,S){m(w,_,S)}):m(this,null,null)}g.prototype.push=function(w,_){return this._transformState.needTransform=!1,r.prototype.push.call(this,w,_)},g.prototype._transform=function(w,_,S){throw new Error("_transform() is not implemented")},g.prototype._write=function(w,_,S){var x=this._transformState;if(x.writecb=S,x.writechunk=w,x.writeencoding=_,!x.transforming){var b=this._readableState;(x.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},g.prototype._read=function(w){var _=this._transformState;_.writechunk!==null&&_.writecb&&!_.transforming?(_.transforming=!0,this._transform(_.writechunk,_.writeencoding,_.afterTransform)):_.needTransform=!0},g.prototype._destroy=function(w,_){var S=this;r.prototype._destroy.call(this,w,function(x){_(x),S.emit("close")})};function m(w,_,S){if(_)return w.emit("error",_);if(S!=null&&w.push(S),w._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(w._transformState.transforming)throw new Error("Calling transform done when still transforming");return w.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=d;var r=require_stream_transform(),f=Object.create(requireUtil());f.inherits=requireInherits_browser(),f.inherits(d,r);function d(g){if(!(this instanceof d))return new d(g);r.call(this,g)}return d.prototype._transform=function(g,v,m){m(null,g)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,(function(r,f){f=r.exports=require_stream_readable(),f.Stream=f,f.Readable=f,f.Writable=require_stream_writable(),f.Duplex=require_stream_duplex(),f.Transform=require_stream_transform(),f.PassThrough=require_stream_passthrough()})(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var sign={exports:{}},bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,(function(r){(function(f,d){function g(k,y){if(!k)throw new Error(y||"Assertion failed")}function v(k,y){k.super_=y;var B=function(){};B.prototype=y.prototype,k.prototype=new B,k.prototype.constructor=k}function m(k,y,B){if(m.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((y==="le"||y==="be")&&(B=y,y=10),this._init(k||0,y||10,B||"be"))}typeof f=="object"?f.exports=m:d.BN=m,m.BN=m,m.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}m.isBN=function(y){return y instanceof m?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===m.wordSize&&Array.isArray(y.words)},m.max=function(y,B){return y.cmp(B)>0?y:B},m.min=function(y,B){return y.cmp(B)<0?y:B},m.prototype._init=function(y,B,$){if(typeof y=="number")return this._initNumber(y,B,$);if(typeof y=="object")return this._initArray(y,B,$);B==="hex"&&(B=16),g(B===(B|0)&&B>=2&&B<=36),y=y.toString().replace(/\s+/g,"");var I=0;y[0]==="-"&&(I++,this.negative=1),I<y.length&&(B===16?this._parseHex(y,I,$):(this._parseBase(y,B,I),$==="le"&&this._initArray(this.toArray(),B,$)))},m.prototype._initNumber=function(y,B,$){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(g(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),B,$)},m.prototype._initArray=function(y,B,$){if(g(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F,j,D=0;if($==="be")for(I=y.length-1,F=0;I>=0;I-=3)j=y[I]|y[I-1]<<8|y[I-2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);else if($==="le")for(I=0,F=0;I<y.length;I+=3)j=y[I]|y[I+1]<<8|y[I+2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);return this._strip()};function _(k,y){var B=k.charCodeAt(y);if(B>=48&&B<=57)return B-48;if(B>=65&&B<=70)return B-55;if(B>=97&&B<=102)return B-87;g(!1,"Invalid character in "+k)}function S(k,y,B){var $=_(k,B);return B-1>=y&&($|=_(k,B-1)<<4),$}m.prototype._parseHex=function(y,B,$){this.length=Math.ceil((y.length-B)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F=0,j=0,D;if($==="be")for(I=y.length-1;I>=B;I-=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8;else{var W=y.length-B;for(I=W%2===0?B+1:B;I<y.length;I+=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8}this._strip()};function x(k,y,B,$){for(var I=0,F=0,j=Math.min(k.length,B),D=y;D<j;D++){var W=k.charCodeAt(D)-48;I*=$,W>=49?F=W-49+10:W>=17?F=W-17+10:F=W,g(W>=0&&F<$,"Invalid character"),I+=F}return I}m.prototype._parseBase=function(y,B,$){this.words=[0],this.length=1;for(var I=0,F=1;F<=67108863;F*=B)I++;I--,F=F/B|0;for(var j=y.length-$,D=j%I,W=Math.min(j,j-D)+$,R=0,z=$;z<W;z+=I)R=x(y,z,z+I,B),this.imuln(F),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(D!==0){var ye=1;for(R=x(y,z,y.length,B),z=0;z<D;z++)ye*=B;this.imuln(ye),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},m.prototype.copy=function(y){y.words=new Array(this.length);for(var B=0;B<this.length;B++)y.words[B]=this.words[B];y.length=this.length,y.negative=this.negative,y.red=this.red};function b(k,y){k.words=y.words,k.length=y.length,k.negative=y.negative,k.red=y.red}if(m.prototype._move=function(y){b(y,this)},m.prototype.clone=function(){var y=new m(null);return this.copy(y),y},m.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},m.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},m.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{m.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{m.prototype.inspect=C}else m.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];m.prototype.toString=function(y,B){y=y||10,B=B|0||1;var $;if(y===16||y==="hex"){$="";for(var I=0,F=0,j=0;j<this.length;j++){var D=this.words[j],W=((D<<I|F)&16777215).toString(16);F=D>>>24-I&16777215,I+=2,I>=26&&(I-=26,j--),F!==0||j!==this.length-1?$=E[6-W.length]+W+$:$=W+$}for(F!==0&&($=F.toString(16)+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(y===(y|0)&&y>=2&&y<=36){var R=M[y],z=A[y];$="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var Ce=ye.modrn(z).toString(y);ye=ye.idivn(z),ye.isZero()?$=Ce+$:$=E[R-Ce.length]+Ce+$}for(this.isZero()&&($="0"+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}g(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&g(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},m.prototype.toJSON=function(){return this.toString(16,2)},w&&(m.prototype.toBuffer=function(y,B){return this.toArrayLike(w,y,B)}),m.prototype.toArray=function(y,B){return this.toArrayLike(Array,y,B)};var T=function(y,B){return y.allocUnsafe?y.allocUnsafe(B):new y(B)};m.prototype.toArrayLike=function(y,B,$){this._strip();var I=this.byteLength(),F=$||Math.max(1,I);g(I<=F,"byte array longer than desired length"),g(F>0,"Requested array length <= 0");var j=T(y,F),D=B==="le"?"LE":"BE";return this["_toArrayLike"+D](j,I),j},m.prototype._toArrayLikeLE=function(y,B){for(var $=0,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$++]=D&255,$<y.length&&(y[$++]=D>>8&255),$<y.length&&(y[$++]=D>>16&255),j===6?($<y.length&&(y[$++]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($<y.length)for(y[$++]=I;$<y.length;)y[$++]=0},m.prototype._toArrayLikeBE=function(y,B){for(var $=y.length-1,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$--]=D&255,$>=0&&(y[$--]=D>>8&255),$>=0&&(y[$--]=D>>16&255),j===6?($>=0&&(y[$--]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($>=0)for(y[$--]=I;$>=0;)y[$--]=0},Math.clz32?m.prototype._countBits=function(y){return 32-Math.clz32(y)}:m.prototype._countBits=function(y){var B=y,$=0;return B>=4096&&($+=13,B>>>=13),B>=64&&($+=7,B>>>=7),B>=8&&($+=4,B>>>=4),B>=2&&($+=2,B>>>=2),$+B},m.prototype._zeroBits=function(y){if(y===0)return 26;var B=y,$=0;return(B&8191)===0&&($+=13,B>>>=13),(B&127)===0&&($+=7,B>>>=7),(B&15)===0&&($+=4,B>>>=4),(B&3)===0&&($+=2,B>>>=2),(B&1)===0&&$++,$},m.prototype.bitLength=function(){var y=this.words[this.length-1],B=this._countBits(y);return(this.length-1)*26+B};function L(k){for(var y=new Array(k.bitLength()),B=0;B<y.length;B++){var $=B/26|0,I=B%26;y[B]=k.words[$]>>>I&1}return y}m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,B=0;B<this.length;B++){var $=this._zeroBits(this.words[B]);if(y+=$,$!==26)break}return y},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},m.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return this.negative!==0},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var B=0;B<y.length;B++)this.words[B]=this.words[B]|y.words[B];return this._strip()},m.prototype.ior=function(y){return g((this.negative|y.negative)===0),this.iuor(y)},m.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},m.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},m.prototype.iuand=function(y){var B;this.length>y.length?B=y:B=this;for(var $=0;$<B.length;$++)this.words[$]=this.words[$]&y.words[$];return this.length=B.length,this._strip()},m.prototype.iand=function(y){return g((this.negative|y.negative)===0),this.iuand(y)},m.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},m.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},m.prototype.iuxor=function(y){var B,$;this.length>y.length?(B=this,$=y):(B=y,$=this);for(var I=0;I<$.length;I++)this.words[I]=B.words[I]^$.words[I];if(this!==B)for(;I<B.length;I++)this.words[I]=B.words[I];return this.length=B.length,this._strip()},m.prototype.ixor=function(y){return g((this.negative|y.negative)===0),this.iuxor(y)},m.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},m.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},m.prototype.inotn=function(y){g(typeof y=="number"&&y>=0);var B=Math.ceil(y/26)|0,$=y%26;this._expand(B),$>0&&B--;for(var I=0;I<B;I++)this.words[I]=~this.words[I]&67108863;return $>0&&(this.words[I]=~this.words[I]&67108863>>26-$),this._strip()},m.prototype.notn=function(y){return this.clone().inotn(y)},m.prototype.setn=function(y,B){g(typeof y=="number"&&y>=0);var $=y/26|0,I=y%26;return this._expand($+1),B?this.words[$]=this.words[$]|1<<I:this.words[$]=this.words[$]&~(1<<I),this._strip()},m.prototype.iadd=function(y){var B;if(this.negative!==0&&y.negative===0)return this.negative=0,B=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,B=this.isub(y),y.negative=1,B._normSign();var $,I;this.length>y.length?($=this,I=y):($=y,I=this);for(var F=0,j=0;j<I.length;j++)B=($.words[j]|0)+(I.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;for(;F!==0&&j<$.length;j++)B=($.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;if(this.length=$.length,F!==0)this.words[this.length]=F,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},m.prototype.add=function(y){var B;return y.negative!==0&&this.negative===0?(y.negative=0,B=this.sub(y),y.negative^=1,B):y.negative===0&&this.negative!==0?(this.negative=0,B=y.sub(this),this.negative=1,B):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},m.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var B=this.iadd(y);return y.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var $=this.cmp(y);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,F;$>0?(I=this,F=y):(I=y,F=this);for(var j=0,D=0;D<F.length;D++)B=(I.words[D]|0)-(F.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;for(;j!==0&&D<I.length;D++)B=(I.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;if(j===0&&D<I.length&&I!==this)for(;D<I.length;D++)this.words[D]=I.words[D];return this.length=Math.max(this.length,D),I!==this&&(this.negative=1),this._strip()},m.prototype.sub=function(y){return this.clone().isub(y)};function O(k,y,B){B.negative=y.negative^k.negative;var $=k.length+y.length|0;B.length=$,$=$-1|0;var I=k.words[0]|0,F=y.words[0]|0,j=I*F,D=j&67108863,W=j/67108864|0;B.words[0]=D;for(var R=1;R<$;R++){for(var z=W>>>26,ye=W&67108863,Ce=Math.min(R,y.length-1),me=Math.max(0,R-k.length+1);me<=Ce;me++){var ie=R-me|0;I=k.words[ie]|0,F=y.words[me]|0,j=I*F+ye,z+=j/67108864|0,ye=j&67108863}B.words[R]=ye|0,W=z|0}return W!==0?B.words[R]=W|0:B.length--,B._strip()}var N=function(y,B,$){var I=y.words,F=B.words,j=$.words,D=0,W,R,z,ye=I[0]|0,Ce=ye&8191,me=ye>>>13,ie=I[1]|0,ee=ie&8191,pe=ie>>>13,be=I[2]|0,ae=be&8191,ne=be>>>13,Se=I[3]|0,ke=Se&8191,Ie=Se>>>13,Oe=I[4]|0,Ue=Oe&8191,De=Oe>>>13,$e=I[5]|0,je=$e&8191,Ye=$e>>>13,st=I[6]|0,Je=st&8191,Ge=st>>>13,ut=I[7]|0,gt=ut&8191,rt=ut>>>13,wt=I[8]|0,bt=wt&8191,le=wt>>>13,Z=I[9]|0,J=Z&8191,ge=Z>>>13,Ee=F[0]|0,Re=Ee&8191,qe=Ee>>>13,Xe=F[1]|0,He=Xe&8191,Ze=Xe>>>13,_t=F[2]|0,tt=_t&8191,mt=_t>>>13,Tt=F[3]|0,St=Tt&8191,lt=Tt>>>13,Mt=F[4]|0,Ct=Mt&8191,ce=Mt>>>13,Y=F[5]|0,Q=Y&8191,ve=Y>>>13,fe=F[6]|0,U=fe&8191,G=fe>>>13,re=F[7]|0,K=re&8191,ue=re>>>13,Ae=F[8]|0,xe=Ae&8191,Te=Ae>>>13,Pe=F[9]|0,Fe=Pe&8191,Ne=Pe>>>13;$.negative=y.negative^B.negative,$.length=19,W=Math.imul(Ce,Re),R=Math.imul(Ce,qe),R=R+Math.imul(me,Re)|0,z=Math.imul(me,qe);var At=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(At>>>26)|0,At&=67108863,W=Math.imul(ee,Re),R=Math.imul(ee,qe),R=R+Math.imul(pe,Re)|0,z=Math.imul(pe,qe),W=W+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,Ze)|0,R=R+Math.imul(me,He)|0,z=z+Math.imul(me,Ze)|0;var ot=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ot>>>26)|0,ot&=67108863,W=Math.imul(ae,Re),R=Math.imul(ae,qe),R=R+Math.imul(ne,Re)|0,z=Math.imul(ne,qe),W=W+Math.imul(ee,He)|0,R=R+Math.imul(ee,Ze)|0,R=R+Math.imul(pe,He)|0,z=z+Math.imul(pe,Ze)|0,W=W+Math.imul(Ce,tt)|0,R=R+Math.imul(Ce,mt)|0,R=R+Math.imul(me,tt)|0,z=z+Math.imul(me,mt)|0;var yt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(yt>>>26)|0,yt&=67108863,W=Math.imul(ke,Re),R=Math.imul(ke,qe),R=R+Math.imul(Ie,Re)|0,z=Math.imul(Ie,qe),W=W+Math.imul(ae,He)|0,R=R+Math.imul(ae,Ze)|0,R=R+Math.imul(ne,He)|0,z=z+Math.imul(ne,Ze)|0,W=W+Math.imul(ee,tt)|0,R=R+Math.imul(ee,mt)|0,R=R+Math.imul(pe,tt)|0,z=z+Math.imul(pe,mt)|0,W=W+Math.imul(Ce,St)|0,R=R+Math.imul(Ce,lt)|0,R=R+Math.imul(me,St)|0,z=z+Math.imul(me,lt)|0;var vt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(vt>>>26)|0,vt&=67108863,W=Math.imul(Ue,Re),R=Math.imul(Ue,qe),R=R+Math.imul(De,Re)|0,z=Math.imul(De,qe),W=W+Math.imul(ke,He)|0,R=R+Math.imul(ke,Ze)|0,R=R+Math.imul(Ie,He)|0,z=z+Math.imul(Ie,Ze)|0,W=W+Math.imul(ae,tt)|0,R=R+Math.imul(ae,mt)|0,R=R+Math.imul(ne,tt)|0,z=z+Math.imul(ne,mt)|0,W=W+Math.imul(ee,St)|0,R=R+Math.imul(ee,lt)|0,R=R+Math.imul(pe,St)|0,z=z+Math.imul(pe,lt)|0,W=W+Math.imul(Ce,Ct)|0,R=R+Math.imul(Ce,ce)|0,R=R+Math.imul(me,Ct)|0,z=z+Math.imul(me,ce)|0;var xt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(xt>>>26)|0,xt&=67108863,W=Math.imul(je,Re),R=Math.imul(je,qe),R=R+Math.imul(Ye,Re)|0,z=Math.imul(Ye,qe),W=W+Math.imul(Ue,He)|0,R=R+Math.imul(Ue,Ze)|0,R=R+Math.imul(De,He)|0,z=z+Math.imul(De,Ze)|0,W=W+Math.imul(ke,tt)|0,R=R+Math.imul(ke,mt)|0,R=R+Math.imul(Ie,tt)|0,z=z+Math.imul(Ie,mt)|0,W=W+Math.imul(ae,St)|0,R=R+Math.imul(ae,lt)|0,R=R+Math.imul(ne,St)|0,z=z+Math.imul(ne,lt)|0,W=W+Math.imul(ee,Ct)|0,R=R+Math.imul(ee,ce)|0,R=R+Math.imul(pe,Ct)|0,z=z+Math.imul(pe,ce)|0,W=W+Math.imul(Ce,Q)|0,R=R+Math.imul(Ce,ve)|0,R=R+Math.imul(me,Q)|0,z=z+Math.imul(me,ve)|0;var Ve=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,W=Math.imul(Je,Re),R=Math.imul(Je,qe),R=R+Math.imul(Ge,Re)|0,z=Math.imul(Ge,qe),W=W+Math.imul(je,He)|0,R=R+Math.imul(je,Ze)|0,R=R+Math.imul(Ye,He)|0,z=z+Math.imul(Ye,Ze)|0,W=W+Math.imul(Ue,tt)|0,R=R+Math.imul(Ue,mt)|0,R=R+Math.imul(De,tt)|0,z=z+Math.imul(De,mt)|0,W=W+Math.imul(ke,St)|0,R=R+Math.imul(ke,lt)|0,R=R+Math.imul(Ie,St)|0,z=z+Math.imul(Ie,lt)|0,W=W+Math.imul(ae,Ct)|0,R=R+Math.imul(ae,ce)|0,R=R+Math.imul(ne,Ct)|0,z=z+Math.imul(ne,ce)|0,W=W+Math.imul(ee,Q)|0,R=R+Math.imul(ee,ve)|0,R=R+Math.imul(pe,Q)|0,z=z+Math.imul(pe,ve)|0,W=W+Math.imul(Ce,U)|0,R=R+Math.imul(Ce,G)|0,R=R+Math.imul(me,U)|0,z=z+Math.imul(me,G)|0;var ft=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ft>>>26)|0,ft&=67108863,W=Math.imul(gt,Re),R=Math.imul(gt,qe),R=R+Math.imul(rt,Re)|0,z=Math.imul(rt,qe),W=W+Math.imul(Je,He)|0,R=R+Math.imul(Je,Ze)|0,R=R+Math.imul(Ge,He)|0,z=z+Math.imul(Ge,Ze)|0,W=W+Math.imul(je,tt)|0,R=R+Math.imul(je,mt)|0,R=R+Math.imul(Ye,tt)|0,z=z+Math.imul(Ye,mt)|0,W=W+Math.imul(Ue,St)|0,R=R+Math.imul(Ue,lt)|0,R=R+Math.imul(De,St)|0,z=z+Math.imul(De,lt)|0,W=W+Math.imul(ke,Ct)|0,R=R+Math.imul(ke,ce)|0,R=R+Math.imul(Ie,Ct)|0,z=z+Math.imul(Ie,ce)|0,W=W+Math.imul(ae,Q)|0,R=R+Math.imul(ae,ve)|0,R=R+Math.imul(ne,Q)|0,z=z+Math.imul(ne,ve)|0,W=W+Math.imul(ee,U)|0,R=R+Math.imul(ee,G)|0,R=R+Math.imul(pe,U)|0,z=z+Math.imul(pe,G)|0,W=W+Math.imul(Ce,K)|0,R=R+Math.imul(Ce,ue)|0,R=R+Math.imul(me,K)|0,z=z+Math.imul(me,ue)|0;var et=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(et>>>26)|0,et&=67108863,W=Math.imul(bt,Re),R=Math.imul(bt,qe),R=R+Math.imul(le,Re)|0,z=Math.imul(le,qe),W=W+Math.imul(gt,He)|0,R=R+Math.imul(gt,Ze)|0,R=R+Math.imul(rt,He)|0,z=z+Math.imul(rt,Ze)|0,W=W+Math.imul(Je,tt)|0,R=R+Math.imul(Je,mt)|0,R=R+Math.imul(Ge,tt)|0,z=z+Math.imul(Ge,mt)|0,W=W+Math.imul(je,St)|0,R=R+Math.imul(je,lt)|0,R=R+Math.imul(Ye,St)|0,z=z+Math.imul(Ye,lt)|0,W=W+Math.imul(Ue,Ct)|0,R=R+Math.imul(Ue,ce)|0,R=R+Math.imul(De,Ct)|0,z=z+Math.imul(De,ce)|0,W=W+Math.imul(ke,Q)|0,R=R+Math.imul(ke,ve)|0,R=R+Math.imul(Ie,Q)|0,z=z+Math.imul(Ie,ve)|0,W=W+Math.imul(ae,U)|0,R=R+Math.imul(ae,G)|0,R=R+Math.imul(ne,U)|0,z=z+Math.imul(ne,G)|0,W=W+Math.imul(ee,K)|0,R=R+Math.imul(ee,ue)|0,R=R+Math.imul(pe,K)|0,z=z+Math.imul(pe,ue)|0,W=W+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Te)|0,R=R+Math.imul(me,xe)|0,z=z+Math.imul(me,Te)|0;var ht=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ht>>>26)|0,ht&=67108863,W=Math.imul(J,Re),R=Math.imul(J,qe),R=R+Math.imul(ge,Re)|0,z=Math.imul(ge,qe),W=W+Math.imul(bt,He)|0,R=R+Math.imul(bt,Ze)|0,R=R+Math.imul(le,He)|0,z=z+Math.imul(le,Ze)|0,W=W+Math.imul(gt,tt)|0,R=R+Math.imul(gt,mt)|0,R=R+Math.imul(rt,tt)|0,z=z+Math.imul(rt,mt)|0,W=W+Math.imul(Je,St)|0,R=R+Math.imul(Je,lt)|0,R=R+Math.imul(Ge,St)|0,z=z+Math.imul(Ge,lt)|0,W=W+Math.imul(je,Ct)|0,R=R+Math.imul(je,ce)|0,R=R+Math.imul(Ye,Ct)|0,z=z+Math.imul(Ye,ce)|0,W=W+Math.imul(Ue,Q)|0,R=R+Math.imul(Ue,ve)|0,R=R+Math.imul(De,Q)|0,z=z+Math.imul(De,ve)|0,W=W+Math.imul(ke,U)|0,R=R+Math.imul(ke,G)|0,R=R+Math.imul(Ie,U)|0,z=z+Math.imul(Ie,G)|0,W=W+Math.imul(ae,K)|0,R=R+Math.imul(ae,ue)|0,R=R+Math.imul(ne,K)|0,z=z+Math.imul(ne,ue)|0,W=W+Math.imul(ee,xe)|0,R=R+Math.imul(ee,Te)|0,R=R+Math.imul(pe,xe)|0,z=z+Math.imul(pe,Te)|0,W=W+Math.imul(Ce,Fe)|0,R=R+Math.imul(Ce,Ne)|0,R=R+Math.imul(me,Fe)|0,z=z+Math.imul(me,Ne)|0;var it=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(it>>>26)|0,it&=67108863,W=Math.imul(J,He),R=Math.imul(J,Ze),R=R+Math.imul(ge,He)|0,z=Math.imul(ge,Ze),W=W+Math.imul(bt,tt)|0,R=R+Math.imul(bt,mt)|0,R=R+Math.imul(le,tt)|0,z=z+Math.imul(le,mt)|0,W=W+Math.imul(gt,St)|0,R=R+Math.imul(gt,lt)|0,R=R+Math.imul(rt,St)|0,z=z+Math.imul(rt,lt)|0,W=W+Math.imul(Je,Ct)|0,R=R+Math.imul(Je,ce)|0,R=R+Math.imul(Ge,Ct)|0,z=z+Math.imul(Ge,ce)|0,W=W+Math.imul(je,Q)|0,R=R+Math.imul(je,ve)|0,R=R+Math.imul(Ye,Q)|0,z=z+Math.imul(Ye,ve)|0,W=W+Math.imul(Ue,U)|0,R=R+Math.imul(Ue,G)|0,R=R+Math.imul(De,U)|0,z=z+Math.imul(De,G)|0,W=W+Math.imul(ke,K)|0,R=R+Math.imul(ke,ue)|0,R=R+Math.imul(Ie,K)|0,z=z+Math.imul(Ie,ue)|0,W=W+Math.imul(ae,xe)|0,R=R+Math.imul(ae,Te)|0,R=R+Math.imul(ne,xe)|0,z=z+Math.imul(ne,Te)|0,W=W+Math.imul(ee,Fe)|0,R=R+Math.imul(ee,Ne)|0,R=R+Math.imul(pe,Fe)|0,z=z+Math.imul(pe,Ne)|0;var pt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(pt>>>26)|0,pt&=67108863,W=Math.imul(J,tt),R=Math.imul(J,mt),R=R+Math.imul(ge,tt)|0,z=Math.imul(ge,mt),W=W+Math.imul(bt,St)|0,R=R+Math.imul(bt,lt)|0,R=R+Math.imul(le,St)|0,z=z+Math.imul(le,lt)|0,W=W+Math.imul(gt,Ct)|0,R=R+Math.imul(gt,ce)|0,R=R+Math.imul(rt,Ct)|0,z=z+Math.imul(rt,ce)|0,W=W+Math.imul(Je,Q)|0,R=R+Math.imul(Je,ve)|0,R=R+Math.imul(Ge,Q)|0,z=z+Math.imul(Ge,ve)|0,W=W+Math.imul(je,U)|0,R=R+Math.imul(je,G)|0,R=R+Math.imul(Ye,U)|0,z=z+Math.imul(Ye,G)|0,W=W+Math.imul(Ue,K)|0,R=R+Math.imul(Ue,ue)|0,R=R+Math.imul(De,K)|0,z=z+Math.imul(De,ue)|0,W=W+Math.imul(ke,xe)|0,R=R+Math.imul(ke,Te)|0,R=R+Math.imul(Ie,xe)|0,z=z+Math.imul(Ie,Te)|0,W=W+Math.imul(ae,Fe)|0,R=R+Math.imul(ae,Ne)|0,R=R+Math.imul(ne,Fe)|0,z=z+Math.imul(ne,Ne)|0;var at=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(at>>>26)|0,at&=67108863,W=Math.imul(J,St),R=Math.imul(J,lt),R=R+Math.imul(ge,St)|0,z=Math.imul(ge,lt),W=W+Math.imul(bt,Ct)|0,R=R+Math.imul(bt,ce)|0,R=R+Math.imul(le,Ct)|0,z=z+Math.imul(le,ce)|0,W=W+Math.imul(gt,Q)|0,R=R+Math.imul(gt,ve)|0,R=R+Math.imul(rt,Q)|0,z=z+Math.imul(rt,ve)|0,W=W+Math.imul(Je,U)|0,R=R+Math.imul(Je,G)|0,R=R+Math.imul(Ge,U)|0,z=z+Math.imul(Ge,G)|0,W=W+Math.imul(je,K)|0,R=R+Math.imul(je,ue)|0,R=R+Math.imul(Ye,K)|0,z=z+Math.imul(Ye,ue)|0,W=W+Math.imul(Ue,xe)|0,R=R+Math.imul(Ue,Te)|0,R=R+Math.imul(De,xe)|0,z=z+Math.imul(De,Te)|0,W=W+Math.imul(ke,Fe)|0,R=R+Math.imul(ke,Ne)|0,R=R+Math.imul(Ie,Fe)|0,z=z+Math.imul(Ie,Ne)|0;var ct=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ct>>>26)|0,ct&=67108863,W=Math.imul(J,Ct),R=Math.imul(J,ce),R=R+Math.imul(ge,Ct)|0,z=Math.imul(ge,ce),W=W+Math.imul(bt,Q)|0,R=R+Math.imul(bt,ve)|0,R=R+Math.imul(le,Q)|0,z=z+Math.imul(le,ve)|0,W=W+Math.imul(gt,U)|0,R=R+Math.imul(gt,G)|0,R=R+Math.imul(rt,U)|0,z=z+Math.imul(rt,G)|0,W=W+Math.imul(Je,K)|0,R=R+Math.imul(Je,ue)|0,R=R+Math.imul(Ge,K)|0,z=z+Math.imul(Ge,ue)|0,W=W+Math.imul(je,xe)|0,R=R+Math.imul(je,Te)|0,R=R+Math.imul(Ye,xe)|0,z=z+Math.imul(Ye,Te)|0,W=W+Math.imul(Ue,Fe)|0,R=R+Math.imul(Ue,Ne)|0,R=R+Math.imul(De,Fe)|0,z=z+Math.imul(De,Ne)|0;var dt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(dt>>>26)|0,dt&=67108863,W=Math.imul(J,Q),R=Math.imul(J,ve),R=R+Math.imul(ge,Q)|0,z=Math.imul(ge,ve),W=W+Math.imul(bt,U)|0,R=R+Math.imul(bt,G)|0,R=R+Math.imul(le,U)|0,z=z+Math.imul(le,G)|0,W=W+Math.imul(gt,K)|0,R=R+Math.imul(gt,ue)|0,R=R+Math.imul(rt,K)|0,z=z+Math.imul(rt,ue)|0,W=W+Math.imul(Je,xe)|0,R=R+Math.imul(Je,Te)|0,R=R+Math.imul(Ge,xe)|0,z=z+Math.imul(Ge,Te)|0,W=W+Math.imul(je,Fe)|0,R=R+Math.imul(je,Ne)|0,R=R+Math.imul(Ye,Fe)|0,z=z+Math.imul(Ye,Ne)|0;var nt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(nt>>>26)|0,nt&=67108863,W=Math.imul(J,U),R=Math.imul(J,G),R=R+Math.imul(ge,U)|0,z=Math.imul(ge,G),W=W+Math.imul(bt,K)|0,R=R+Math.imul(bt,ue)|0,R=R+Math.imul(le,K)|0,z=z+Math.imul(le,ue)|0,W=W+Math.imul(gt,xe)|0,R=R+Math.imul(gt,Te)|0,R=R+Math.imul(rt,xe)|0,z=z+Math.imul(rt,Te)|0,W=W+Math.imul(Je,Fe)|0,R=R+Math.imul(Je,Ne)|0,R=R+Math.imul(Ge,Fe)|0,z=z+Math.imul(Ge,Ne)|0;var Le=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Le>>>26)|0,Le&=67108863,W=Math.imul(J,K),R=Math.imul(J,ue),R=R+Math.imul(ge,K)|0,z=Math.imul(ge,ue),W=W+Math.imul(bt,xe)|0,R=R+Math.imul(bt,Te)|0,R=R+Math.imul(le,xe)|0,z=z+Math.imul(le,Te)|0,W=W+Math.imul(gt,Fe)|0,R=R+Math.imul(gt,Ne)|0,R=R+Math.imul(rt,Fe)|0,z=z+Math.imul(rt,Ne)|0;var Be=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Be>>>26)|0,Be&=67108863,W=Math.imul(J,xe),R=Math.imul(J,Te),R=R+Math.imul(ge,xe)|0,z=Math.imul(ge,Te),W=W+Math.imul(bt,Fe)|0,R=R+Math.imul(bt,Ne)|0,R=R+Math.imul(le,Fe)|0,z=z+Math.imul(le,Ne)|0;var Ke=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,W=Math.imul(J,Fe),R=Math.imul(J,Ne),R=R+Math.imul(ge,Fe)|0,z=Math.imul(ge,Ne);var We=(D+W|0)+((R&8191)<<13)|0;return D=(z+(R>>>13)|0)+(We>>>26)|0,We&=67108863,j[0]=At,j[1]=ot,j[2]=yt,j[3]=vt,j[4]=xt,j[5]=Ve,j[6]=ft,j[7]=et,j[8]=ht,j[9]=it,j[10]=pt,j[11]=at,j[12]=ct,j[13]=dt,j[14]=nt,j[15]=Le,j[16]=Be,j[17]=Ke,j[18]=We,D!==0&&(j[19]=D,$.length++),$};Math.imul||(N=O);function H(k,y,B){B.negative=y.negative^k.negative,B.length=k.length+y.length;for(var $=0,I=0,F=0;F<B.length-1;F++){var j=I;I=0;for(var D=$&67108863,W=Math.min(F,y.length-1),R=Math.max(0,F-k.length+1);R<=W;R++){var z=F-R,ye=k.words[z]|0,Ce=y.words[R]|0,me=ye*Ce,ie=me&67108863;j=j+(me/67108864|0)|0,ie=ie+D|0,D=ie&67108863,j=j+(ie>>>26)|0,I+=j>>>26,j&=67108863}B.words[F]=D,$=j,j=I}return $!==0?B.words[F]=$:B.length--,B._strip()}function V(k,y,B){return H(k,y,B)}m.prototype.mulTo=function(y,B){var $,I=this.length+y.length;return this.length===10&&y.length===10?$=N(this,y,B):I<63?$=O(this,y,B):I<1024?$=H(this,y,B):$=V(this,y,B),$},m.prototype.mul=function(y){var B=new m(null);return B.words=new Array(this.length+y.length),this.mulTo(y,B)},m.prototype.mulf=function(y){var B=new m(null);return B.words=new Array(this.length+y.length),V(this,y,B)},m.prototype.imul=function(y){return this.clone().mulTo(y,this)},m.prototype.imuln=function(y){var B=y<0;B&&(y=-y),g(typeof y=="number"),g(y<67108864);for(var $=0,I=0;I<this.length;I++){var F=(this.words[I]|0)*y,j=(F&67108863)+($&67108863);$>>=26,$+=F/67108864|0,$+=j>>>26,this.words[I]=j&67108863}return $!==0&&(this.words[I]=$,this.length++),this.length=y===0?1:this.length,B?this.ineg():this},m.prototype.muln=function(y){return this.clone().imuln(y)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(y){var B=L(y);if(B.length===0)return new m(1);for(var $=this,I=0;I<B.length&&B[I]===0;I++,$=$.sqr());if(++I<B.length)for(var F=$.sqr();I<B.length;I++,F=F.sqr())B[I]!==0&&($=$.mul(F));return $},m.prototype.iushln=function(y){g(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=67108863>>>26-B<<26-B,F;if(B!==0){var j=0;for(F=0;F<this.length;F++){var D=this.words[F]&I,W=(this.words[F]|0)-D<<B;this.words[F]=W|j,j=D>>>26-B}j&&(this.words[F]=j,this.length++)}if($!==0){for(F=this.length-1;F>=0;F--)this.words[F+$]=this.words[F];for(F=0;F<$;F++)this.words[F]=0;this.length+=$}return this._strip()},m.prototype.ishln=function(y){return g(this.negative===0),this.iushln(y)},m.prototype.iushrn=function(y,B,$){g(typeof y=="number"&&y>=0);var I;B?I=(B-B%26)/26:I=0;var F=y%26,j=Math.min((y-F)/26,this.length),D=67108863^67108863>>>F<<F,W=$;if(I-=j,I=Math.max(0,I),W){for(var R=0;R<j;R++)W.words[R]=this.words[R];W.length=j}if(j!==0)if(this.length>j)for(this.length-=j,R=0;R<this.length;R++)this.words[R]=this.words[R+j];else this.words[0]=0,this.length=1;var z=0;for(R=this.length-1;R>=0&&(z!==0||R>=I);R--){var ye=this.words[R]|0;this.words[R]=z<<26-F|ye>>>F,z=ye&D}return W&&z!==0&&(W.words[W.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},m.prototype.ishrn=function(y,B,$){return g(this.negative===0),this.iushrn(y,B,$)},m.prototype.shln=function(y){return this.clone().ishln(y)},m.prototype.ushln=function(y){return this.clone().iushln(y)},m.prototype.shrn=function(y){return this.clone().ishrn(y)},m.prototype.ushrn=function(y){return this.clone().iushrn(y)},m.prototype.testn=function(y){g(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return!1;var F=this.words[$];return!!(F&I)},m.prototype.imaskn=function(y){g(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26;if(g(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(B!==0&&$++,this.length=Math.min($,this.length),B!==0){var I=67108863^67108863>>>B<<B;this.words[this.length-1]&=I}return this._strip()},m.prototype.maskn=function(y){return this.clone().imaskn(y)},m.prototype.iaddn=function(y){return g(typeof y=="number"),g(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},m.prototype._iaddn=function(y){this.words[0]+=y;for(var B=0;B<this.length&&this.words[B]>=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},m.prototype.isubn=function(y){if(g(typeof y=="number"),g(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B<this.length&&this.words[B]<0;B++)this.words[B]+=67108864,this.words[B+1]-=1;return this._strip()},m.prototype.addn=function(y){return this.clone().iaddn(y)},m.prototype.subn=function(y){return this.clone().isubn(y)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(y,B,$){var I=y.length+$,F;this._expand(I);var j,D=0;for(F=0;F<y.length;F++){j=(this.words[F+$]|0)+D;var W=(y.words[F]|0)*B;j-=W&67108863,D=(j>>26)-(W/67108864|0),this.words[F+$]=j&67108863}for(;F<this.length-$;F++)j=(this.words[F+$]|0)+D,D=j>>26,this.words[F+$]=j&67108863;if(D===0)return this._strip();for(g(D===-1),D=0,F=0;F<this.length;F++)j=-(this.words[F]|0)+D,D=j>>26,this.words[F]=j&67108863;return this.negative=1,this._strip()},m.prototype._wordDiv=function(y,B){var $=this.length-y.length,I=this.clone(),F=y,j=F.words[F.length-1]|0,D=this._countBits(j);$=26-D,$!==0&&(F=F.ushln($),I.iushln($),j=F.words[F.length-1]|0);var W=I.length-F.length,R;if(B!=="mod"){R=new m(null),R.length=W+1,R.words=new Array(R.length);for(var z=0;z<R.length;z++)R.words[z]=0}var ye=I.clone()._ishlnsubmul(F,1,W);ye.negative===0&&(I=ye,R&&(R.words[W]=1));for(var Ce=W-1;Ce>=0;Ce--){var me=(I.words[F.length+Ce]|0)*67108864+(I.words[F.length+Ce-1]|0);for(me=Math.min(me/j|0,67108863),I._ishlnsubmul(F,me,Ce);I.negative!==0;)me--,I.negative=0,I._ishlnsubmul(F,1,Ce),I.isZero()||(I.negative^=1);R&&(R.words[Ce]=me)}return R&&R._strip(),I._strip(),B!=="div"&&$!==0&&I.iushrn($),{div:R||null,mod:I}},m.prototype.divmod=function(y,B,$){if(g(!y.isZero()),this.isZero())return{div:new m(0),mod:new m(0)};var I,F,j;return this.negative!==0&&y.negative===0?(j=this.neg().divmod(y,B),B!=="mod"&&(I=j.div.neg()),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.iadd(y)),{div:I,mod:F}):this.negative===0&&y.negative!==0?(j=this.divmod(y.neg(),B),B!=="mod"&&(I=j.div.neg()),{div:I,mod:j.mod}):(this.negative&y.negative)!==0?(j=this.neg().divmod(y.neg(),B),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.isub(y)),{div:j.div,mod:F}):y.length>this.length||this.cmp(y)<0?{div:new m(0),mod:this}:y.length===1?B==="div"?{div:this.divn(y.words[0]),mod:null}:B==="mod"?{div:null,mod:new m(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new m(this.modrn(y.words[0]))}:this._wordDiv(y,B)},m.prototype.div=function(y){return this.divmod(y,"div",!1).div},m.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},m.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},m.prototype.divRound=function(y){var B=this.divmod(y);if(B.mod.isZero())return B.div;var $=B.div.negative!==0?B.mod.isub(y):B.mod,I=y.ushrn(1),F=y.andln(1),j=$.cmp(I);return j<0||F===1&&j===0?B.div:B.div.negative!==0?B.div.isubn(1):B.div.iaddn(1)},m.prototype.modrn=function(y){var B=y<0;B&&(y=-y),g(y<=67108863);for(var $=(1<<26)%y,I=0,F=this.length-1;F>=0;F--)I=($*I+(this.words[F]|0))%y;return B?-I:I},m.prototype.modn=function(y){return this.modrn(y)},m.prototype.idivn=function(y){var B=y<0;B&&(y=-y),g(y<=67108863);for(var $=0,I=this.length-1;I>=0;I--){var F=(this.words[I]|0)+$*67108864;this.words[I]=F/y|0,$=F%y}return this._strip(),B?this.ineg():this},m.prototype.divn=function(y){return this.clone().idivn(y)},m.prototype.egcd=function(y){g(y.negative===0),g(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new m(1),F=new m(0),j=new m(0),D=new m(1),W=0;B.isEven()&&$.isEven();)B.iushrn(1),$.iushrn(1),++W;for(var R=$.clone(),z=B.clone();!B.isZero();){for(var ye=0,Ce=1;(B.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(B.iushrn(ye);ye-- >0;)(I.isOdd()||F.isOdd())&&(I.iadd(R),F.isub(z)),I.iushrn(1),F.iushrn(1);for(var me=0,ie=1;($.words[0]&ie)===0&&me<26;++me,ie<<=1);if(me>0)for($.iushrn(me);me-- >0;)(j.isOdd()||D.isOdd())&&(j.iadd(R),D.isub(z)),j.iushrn(1),D.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(j),F.isub(D)):($.isub(B),j.isub(I),D.isub(F))}return{a:j,b:D,gcd:$.iushln(W)}},m.prototype._invmp=function(y){g(y.negative===0),g(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new m(1),F=new m(0),j=$.clone();B.cmpn(1)>0&&$.cmpn(1)>0;){for(var D=0,W=1;(B.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(B.iushrn(D);D-- >0;)I.isOdd()&&I.iadd(j),I.iushrn(1);for(var R=0,z=1;($.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for($.iushrn(R);R-- >0;)F.isOdd()&&F.iadd(j),F.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(F)):($.isub(B),F.isub(I))}var ye;return B.cmpn(1)===0?ye=I:ye=F,ye.cmpn(0)<0&&ye.iadd(y),ye},m.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var B=this.clone(),$=y.clone();B.negative=0,$.negative=0;for(var I=0;B.isEven()&&$.isEven();I++)B.iushrn(1),$.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;$.isEven();)$.iushrn(1);var F=B.cmp($);if(F<0){var j=B;B=$,$=j}else if(F===0||$.cmpn(1)===0)break;B.isub($)}while(!0);return $.iushln(I)},m.prototype.invm=function(y){return this.egcd(y).a.umod(y)},m.prototype.isEven=function(){return(this.words[0]&1)===0},m.prototype.isOdd=function(){return(this.words[0]&1)===1},m.prototype.andln=function(y){return this.words[0]&y},m.prototype.bincn=function(y){g(typeof y=="number");var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return this._expand($+1),this.words[$]|=I,this;for(var F=I,j=$;F!==0&&j<this.length;j++){var D=this.words[j]|0;D+=F,F=D>>>26,D&=67108863,this.words[j]=D}return F!==0&&(this.words[j]=F,this.length++),this},m.prototype.isZero=function(){return this.length===1&&this.words[0]===0},m.prototype.cmpn=function(y){var B=y<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this._strip();var $;if(this.length>1)$=1;else{B&&(y=-y),g(y<=67108863,"Number is too big");var I=this.words[0]|0;$=I===y?0:I<y?-1:1}return this.negative!==0?-$|0:$},m.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var B=this.ucmp(y);return this.negative!==0?-B|0:B},m.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var B=0,$=this.length-1;$>=0;$--){var I=this.words[$]|0,F=y.words[$]|0;if(I!==F){I<F?B=-1:I>F&&(B=1);break}}return B},m.prototype.gtn=function(y){return this.cmpn(y)===1},m.prototype.gt=function(y){return this.cmp(y)===1},m.prototype.gten=function(y){return this.cmpn(y)>=0},m.prototype.gte=function(y){return this.cmp(y)>=0},m.prototype.ltn=function(y){return this.cmpn(y)===-1},m.prototype.lt=function(y){return this.cmp(y)===-1},m.prototype.lten=function(y){return this.cmpn(y)<=0},m.prototype.lte=function(y){return this.cmp(y)<=0},m.prototype.eqn=function(y){return this.cmpn(y)===0},m.prototype.eq=function(y){return this.cmp(y)===0},m.red=function(y){return new te(y)},m.prototype.toRed=function(y){return g(!this.red,"Already a number in reduction context"),g(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},m.prototype.fromRed=function(){return g(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(y){return this.red=y,this},m.prototype.forceRed=function(y){return g(!this.red,"Already a number in reduction context"),this._forceRed(y)},m.prototype.redAdd=function(y){return g(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},m.prototype.redIAdd=function(y){return g(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},m.prototype.redSub=function(y){return g(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},m.prototype.redISub=function(y){return g(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},m.prototype.redShl=function(y){return g(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},m.prototype.redMul=function(y){return g(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},m.prototype.redIMul=function(y){return g(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},m.prototype.redSqr=function(){return g(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return g(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return g(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return g(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return g(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(y){return g(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var X={k256:null,p224:null,p192:null,p25519:null};function oe(k,y){this.name=k,this.p=new m(y,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}oe.prototype._tmp=function(){var y=new m(null);return y.words=new Array(Math.ceil(this.n/13)),y},oe.prototype.ireduce=function(y){var B=y,$;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),$=B.bitLength();while($>this.n);var I=$<this.n?-1:B.ucmp(this.p);return I===0?(B.words[0]=0,B.length=1):I>0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},oe.prototype.split=function(y,B){y.iushrn(this.n,0,B)},oe.prototype.imulK=function(y){return y.imul(this.k)};function se(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(se,oe),se.prototype.split=function(y,B){for(var $=4194303,I=Math.min(y.length,9),F=0;F<I;F++)B.words[F]=y.words[F];if(B.length=I,y.length<=9){y.words[0]=0,y.length=1;return}var j=y.words[9];for(B.words[B.length++]=j&$,F=10;F<y.length;F++){var D=y.words[F]|0;y.words[F-10]=(D&$)<<4|j>>>22,j=D}j>>>=22,y.words[F-10]=j,j===0&&y.length>10?y.length-=10:y.length-=9},se.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var B=0,$=0;$<y.length;$++){var I=y.words[$]|0;B+=I*977,y.words[$]=B&67108863,B=I*64+(B/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function de(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(de,oe);function he(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,oe);function we(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(we,oe),we.prototype.imulK=function(y){for(var B=0,$=0;$<y.length;$++){var I=(y.words[$]|0)*19+B,F=I&67108863;I>>>=26,y.words[$]=F,B=I}return B!==0&&(y.words[y.length++]=B),y},m._prime=function(y){if(X[y])return X[y];var B;if(y==="k256")B=new se;else if(y==="p224")B=new de;else if(y==="p192")B=new he;else if(y==="p25519")B=new we;else throw new Error("Unknown prime "+y);return X[y]=B,B};function te(k){if(typeof k=="string"){var y=m._prime(k);this.m=y.p,this.prime=y}else g(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}te.prototype._verify1=function(y){g(y.negative===0,"red works only with positives"),g(y.red,"red works only with red numbers")},te.prototype._verify2=function(y,B){g((y.negative|B.negative)===0,"red works only with positives"),g(y.red&&y.red===B.red,"red works only with red numbers")},te.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(b(y,y.umod(this.m)._forceRed(this)),y)},te.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},te.prototype.add=function(y,B){this._verify2(y,B);var $=y.add(B);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},te.prototype.iadd=function(y,B){this._verify2(y,B);var $=y.iadd(B);return $.cmp(this.m)>=0&&$.isub(this.m),$},te.prototype.sub=function(y,B){this._verify2(y,B);var $=y.sub(B);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},te.prototype.isub=function(y,B){this._verify2(y,B);var $=y.isub(B);return $.cmpn(0)<0&&$.iadd(this.m),$},te.prototype.shl=function(y,B){return this._verify1(y),this.imod(y.ushln(B))},te.prototype.imul=function(y,B){return this._verify2(y,B),this.imod(y.imul(B))},te.prototype.mul=function(y,B){return this._verify2(y,B),this.imod(y.mul(B))},te.prototype.isqr=function(y){return this.imul(y,y.clone())},te.prototype.sqr=function(y){return this.mul(y,y)},te.prototype.sqrt=function(y){if(y.isZero())return y.clone();var B=this.m.andln(3);if(g(B%2===1),B===3){var $=this.m.add(new m(1)).iushrn(2);return this.pow(y,$)}for(var I=this.m.subn(1),F=0;!I.isZero()&&I.andln(1)===0;)F++,I.iushrn(1);g(!I.isZero());var j=new m(1).toRed(this),D=j.redNeg(),W=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new m(2*R*R).toRed(this);this.pow(R,W).cmp(D)!==0;)R.redIAdd(D);for(var z=this.pow(R,I),ye=this.pow(y,I.addn(1).iushrn(1)),Ce=this.pow(y,I),me=F;Ce.cmp(j)!==0;){for(var ie=Ce,ee=0;ie.cmp(j)!==0;ee++)ie=ie.redSqr();g(ee<me);var pe=this.pow(z,new m(1).iushln(me-ee-1));ye=ye.redMul(pe),z=pe.redSqr(),Ce=Ce.redMul(z),me=ee}return ye},te.prototype.invm=function(y){var B=y._invmp(this.m);return B.negative!==0?(B.negative=0,this.imod(B).redNeg()):this.imod(B)},te.prototype.pow=function(y,B){if(B.isZero())return new m(1).toRed(this);if(B.cmpn(1)===0)return y.clone();var $=4,I=new Array(1<<$);I[0]=new m(1).toRed(this),I[1]=y;for(var F=2;F<I.length;F++)I[F]=this.mul(I[F-1],y);var j=I[0],D=0,W=0,R=B.bitLength()%26;for(R===0&&(R=26),F=B.length-1;F>=0;F--){for(var z=B.words[F],ye=R-1;ye>=0;ye--){var Ce=z>>ye&1;if(j!==I[0]&&(j=this.sqr(j)),Ce===0&&D===0){W=0;continue}D<<=1,D|=Ce,W++,!(W!==$&&(F!==0||ye!==0))&&(j=this.mul(j,I[D]),W=0,D=0)}R=26}return j},te.prototype.convertTo=function(y){var B=y.umod(this.m);return B===y?B.clone():B},te.prototype.convertFrom=function(y){var B=y.clone();return B.red=null,B},m.mont=function(y){return new q(y)};function q(k){te.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new m(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(q,te),q.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},q.prototype.convertFrom=function(y){var B=this.imod(y.mul(this.rinv));return B.red=null,B},q.prototype.imul=function(y,B){if(y.isZero()||B.isZero())return y.words[0]=0,y.length=1,y;var $=y.imul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},q.prototype.mul=function(y,B){if(y.isZero()||B.isZero())return new m(0)._forceRed(this);var $=y.mul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},q.prototype.invm=function(y){var B=this.imod(y._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(r,bn$2)})(bn$3)),bn$3.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var r=requireBn$1(),f=requireBrowser$b(),d=requireSafeBuffer$1().Buffer;function g(w){var _=w.modulus.byteLength(),S;do S=new r(f(_));while(S.cmp(w.modulus)>=0||!S.umod(w.prime1)||!S.umod(w.prime2));return S}function v(w){var _=g(w),S=_.toRed(r.mont(w.modulus)).redPow(new r(w.publicExponent)).fromRed();return{blinder:S,unblinder:_.invm(w.modulus)}}function m(w,_){var S=v(_),x=_.modulus.byteLength(),b=new r(w).mul(S.blinder).umod(_.modulus),C=b.toRed(r.mont(_.prime1)),E=b.toRed(r.mont(_.prime2)),M=_.coefficient,A=_.prime1,T=_.prime2,L=C.redPow(_.exponent1).fromRed(),O=E.redPow(_.exponent2).fromRed(),N=L.isub(O).imul(M).umod(A).imul(T);return O.iadd(N).imul(S.unblinder).umod(_.modulus).toArrayLike(d,"be",x)}return m.getr=g,browserifyRsa=m,browserifyRsa}var elliptic={};const version="6.6.1",require$$0={version};var utils$2={},utils$1={},hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,(function(r){var f=r;function d(m,w){if(Array.isArray(m))return m.slice();if(!m)return[];var _=[];if(typeof m!="string"){for(var S=0;S<m.length;S++)_[S]=m[S]|0;return _}if(w==="hex"){m=m.replace(/[^a-z0-9]+/ig,""),m.length%2!==0&&(m="0"+m);for(var S=0;S<m.length;S+=2)_.push(parseInt(m[S]+m[S+1],16))}else for(var S=0;S<m.length;S++){var x=m.charCodeAt(S),b=x>>8,C=x&255;b?_.push(b,C):_.push(C)}return _}f.toArray=d;function g(m){return m.length===1?"0"+m:m}f.zero2=g;function v(m){for(var w="",_=0;_<m.length;_++)w+=g(m[_].toString(16));return w}f.toHex=v,f.encode=function(w,_){return _==="hex"?v(w):w}})(utils$1)),utils$1}var hasRequiredUtils$1;function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,(function(r){var f=r,d=requireBn$2(),g=requireMinimalisticAssert(),v=requireUtils$2();f.assert=g,f.toArray=v.toArray,f.zero2=v.zero2,f.toHex=v.toHex,f.encode=v.encode;function m(b,C,E){var M=new Array(Math.max(b.bitLength(),E)+1),A;for(A=0;A<M.length;A+=1)M[A]=0;var T=1<<C+1,L=b.clone();for(A=0;A<M.length;A++){var O,N=L.andln(T-1);L.isOdd()?(N>(T>>1)-1?O=(T>>1)-N:O=N,L.isubn(O)):O=0,M[A]=O,L.iushrn(1)}return M}f.getNAF=m;function w(b,C){var E=[[],[]];b=b.clone(),C=C.clone();for(var M=0,A=0,T;b.cmpn(-M)>0||C.cmpn(-A)>0;){var L=b.andln(3)+M&3,O=C.andln(3)+A&3;L===3&&(L=-1),O===3&&(O=-1);var N;(L&1)===0?N=0:(T=b.andln(7)+M&7,(T===3||T===5)&&O===2?N=-L:N=L),E[0].push(N);var H;(O&1)===0?H=0:(T=C.andln(7)+A&7,(T===3||T===5)&&L===2?H=-O:H=O),E[1].push(H),2*M===N+1&&(M=1-M),2*A===H+1&&(A=1-A),b.iushrn(1),C.iushrn(1)}return E}f.getJSF=w;function _(b,C,E){var M="_"+C;b.prototype[C]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}f.cachedProperty=_;function S(b){return typeof b=="string"?f.toArray(b,"hex"):b}f.parseBytes=S;function x(b){return new d(b,"hex","le")}f.intFromLE=x})(utils$2)),utils$2}var curve={},base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.getNAF,g=f.getJSF,v=f.assert;function m(_,S){this.type=_,this.p=new r(S.p,16),this.red=S.prime?r.red(S.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=S.n&&new r(S.n,16),this.g=S.g&&this.pointFromJSON(S.g,S.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var x=this.n&&this.p.div(this.n);!x||x.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$1=m,m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(S,x){v(S.precomputed);var b=S._getDoubles(),C=d(x,1,this._bitLength),E=(1<<b.step+1)-(b.step%2===0?2:1);E/=3;var M=[],A,T;for(A=0;A<C.length;A+=b.step){T=0;for(var L=A+b.step-1;L>=A;L--)T=(T<<1)+C[L];M.push(T)}for(var O=this.jpoint(null,null,null),N=this.jpoint(null,null,null),H=E;H>0;H--){for(A=0;A<M.length;A++)T=M[A],T===H?N=N.mixedAdd(b.points[A]):T===-H&&(N=N.mixedAdd(b.points[A].neg()));O=O.add(N)}return O.toP()},m.prototype._wnafMul=function(S,x){var b=4,C=S._getNAFPoints(b);b=C.wnd;for(var E=C.points,M=d(x,b,this._bitLength),A=this.jpoint(null,null,null),T=M.length-1;T>=0;T--){for(var L=0;T>=0&&M[T]===0;T--)L++;if(T>=0&&L++,A=A.dblp(L),T<0)break;var O=M[T];v(O!==0),S.type==="affine"?O>0?A=A.mixedAdd(E[O-1>>1]):A=A.mixedAdd(E[-O-1>>1].neg()):O>0?A=A.add(E[O-1>>1]):A=A.add(E[-O-1>>1].neg())}return S.type==="affine"?A.toP():A},m.prototype._wnafMulAdd=function(S,x,b,C,E){var M=this._wnafT1,A=this._wnafT2,T=this._wnafT3,L=0,O,N,H;for(O=0;O<C;O++){H=x[O];var V=H._getNAFPoints(S);M[O]=V.wnd,A[O]=V.points}for(O=C-1;O>=1;O-=2){var X=O-1,oe=O;if(M[X]!==1||M[oe]!==1){T[X]=d(b[X],M[X],this._bitLength),T[oe]=d(b[oe],M[oe],this._bitLength),L=Math.max(T[X].length,L),L=Math.max(T[oe].length,L);continue}var se=[x[X],null,null,x[oe]];x[X].y.cmp(x[oe].y)===0?(se[1]=x[X].add(x[oe]),se[2]=x[X].toJ().mixedAdd(x[oe].neg())):x[X].y.cmp(x[oe].y.redNeg())===0?(se[1]=x[X].toJ().mixedAdd(x[oe]),se[2]=x[X].add(x[oe].neg())):(se[1]=x[X].toJ().mixedAdd(x[oe]),se[2]=x[X].toJ().mixedAdd(x[oe].neg()));var de=[-3,-1,-5,-7,0,7,5,1,3],he=g(b[X],b[oe]);for(L=Math.max(he[0].length,L),T[X]=new Array(L),T[oe]=new Array(L),N=0;N<L;N++){var we=he[0][N]|0,te=he[1][N]|0;T[X][N]=de[(we+1)*3+(te+1)],T[oe][N]=0,A[X]=se}}var q=this.jpoint(null,null,null),k=this._wnafT4;for(O=L;O>=0;O--){for(var y=0;O>=0;){var B=!0;for(N=0;N<C;N++)k[N]=T[N][O]|0,k[N]!==0&&(B=!1);if(!B)break;y++,O--}if(O>=0&&y++,q=q.dblp(y),O<0)break;for(N=0;N<C;N++){var $=k[N];$!==0&&($>0?H=A[N][$-1>>1]:$<0&&(H=A[N][-$-1>>1].neg()),H.type==="affine"?q=q.mixedAdd(H):q=q.add(H))}}for(O=0;O<C;O++)A[O]=null;return E?q:q.toP()};function w(_,S){this.curve=_,this.type=S,this.precomputed=null}return m.BasePoint=w,w.prototype.eq=function(){throw new Error("Not implemented")},w.prototype.validate=function(){return this.curve.validate(this)},m.prototype.decodePoint=function(S,x){S=f.toArray(S,x);var b=this.p.byteLength();if((S[0]===4||S[0]===6||S[0]===7)&&S.length-1===2*b){S[0]===6?v(S[S.length-1]%2===0):S[0]===7&&v(S[S.length-1]%2===1);var C=this.point(S.slice(1,1+b),S.slice(1+b,1+2*b));return C}else if((S[0]===2||S[0]===3)&&S.length-1===b)return this.pointFromX(S.slice(1,1+b),S[0]===3);throw new Error("Unknown point format")},w.prototype.encodeCompressed=function(S){return this.encode(S,!0)},w.prototype._encode=function(S){var x=this.curve.p.byteLength(),b=this.getX().toArray("be",x);return S?[this.getY().isEven()?2:3].concat(b):[4].concat(b,this.getY().toArray("be",x))},w.prototype.encode=function(S,x){return f.encode(this._encode(x),S)},w.prototype.precompute=function(S){if(this.precomputed)return this;var x={doubles:null,naf:null,beta:null};return x.naf=this._getNAFPoints(8),x.doubles=this._getDoubles(4,S),x.beta=this._getBeta(),this.precomputed=x,this},w.prototype._hasDoubles=function(S){if(!this.precomputed)return!1;var x=this.precomputed.doubles;return x?x.points.length>=Math.ceil((S.bitLength()+1)/x.step):!1},w.prototype._getDoubles=function(S,x){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var b=[this],C=this,E=0;E<x;E+=S){for(var M=0;M<S;M++)C=C.dbl();b.push(C)}return{step:S,points:b}},w.prototype._getNAFPoints=function(S){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var x=[this],b=(1<<S)-1,C=b===1?null:this.dbl(),E=1;E<b;E++)x[E]=x[E-1].add(C);return{wnd:S,points:x}},w.prototype._getBeta=function(){return null},w.prototype.dblp=function(S){for(var x=this,b=0;b<S;b++)x=x.dbl();return x},base$1}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var r=requireUtils$1(),f=requireBn$2(),d=requireInherits_browser(),g=requireBase$1(),v=r.assert;function m(S){g.call(this,"short",S),this.a=new f(S.a,16).toRed(this.red),this.b=new f(S.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(S),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}d(m,g),short=m,m.prototype._getEndomorphism=function(x){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var b,C;if(x.beta)b=new f(x.beta,16).toRed(this.red);else{var E=this._getEndoRoots(this.p);b=E[0].cmp(E[1])<0?E[0]:E[1],b=b.toRed(this.red)}if(x.lambda)C=new f(x.lambda,16);else{var M=this._getEndoRoots(this.n);this.g.mul(M[0]).x.cmp(this.g.x.redMul(b))===0?C=M[0]:(C=M[1],v(this.g.mul(C).x.cmp(this.g.x.redMul(b))===0))}var A;return x.basis?A=x.basis.map(function(T){return{a:new f(T.a,16),b:new f(T.b,16)}}):A=this._getEndoBasis(C),{beta:b,lambda:C,basis:A}}},m.prototype._getEndoRoots=function(x){var b=x===this.p?this.red:f.mont(x),C=new f(2).toRed(b).redInvm(),E=C.redNeg(),M=new f(3).toRed(b).redNeg().redSqrt().redMul(C),A=E.redAdd(M).fromRed(),T=E.redSub(M).fromRed();return[A,T]},m.prototype._getEndoBasis=function(x){for(var b=this.n.ushrn(Math.floor(this.n.bitLength()/2)),C=x,E=this.n.clone(),M=new f(1),A=new f(0),T=new f(0),L=new f(1),O,N,H,V,X,oe,se,de=0,he,we;C.cmpn(0)!==0;){var te=E.div(C);he=E.sub(te.mul(C)),we=T.sub(te.mul(M));var q=L.sub(te.mul(A));if(!H&&he.cmp(b)<0)O=se.neg(),N=M,H=he.neg(),V=we;else if(H&&++de===2)break;se=he,E=C,C=he,T=M,M=we,L=A,A=q}X=he.neg(),oe=we;var k=H.sqr().add(V.sqr()),y=X.sqr().add(oe.sqr());return y.cmp(k)>=0&&(X=O,oe=N),H.negative&&(H=H.neg(),V=V.neg()),X.negative&&(X=X.neg(),oe=oe.neg()),[{a:H,b:V},{a:X,b:oe}]},m.prototype._endoSplit=function(x){var b=this.endo.basis,C=b[0],E=b[1],M=E.b.mul(x).divRound(this.n),A=C.b.neg().mul(x).divRound(this.n),T=M.mul(C.a),L=A.mul(E.a),O=M.mul(C.b),N=A.mul(E.b),H=x.sub(T).sub(L),V=O.add(N).neg();return{k1:H,k2:V}},m.prototype.pointFromX=function(x,b){x=new f(x,16),x.red||(x=x.toRed(this.red));var C=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b),E=C.redSqrt();if(E.redSqr().redSub(C).cmp(this.zero)!==0)throw new Error("invalid point");var M=E.fromRed().isOdd();return(b&&!M||!b&&M)&&(E=E.redNeg()),this.point(x,E)},m.prototype.validate=function(x){if(x.inf)return!0;var b=x.x,C=x.y,E=this.a.redMul(b),M=b.redSqr().redMul(b).redIAdd(E).redIAdd(this.b);return C.redSqr().redISub(M).cmpn(0)===0},m.prototype._endoWnafMulAdd=function(x,b,C){for(var E=this._endoWnafT1,M=this._endoWnafT2,A=0;A<x.length;A++){var T=this._endoSplit(b[A]),L=x[A],O=L._getBeta();T.k1.negative&&(T.k1.ineg(),L=L.neg(!0)),T.k2.negative&&(T.k2.ineg(),O=O.neg(!0)),E[A*2]=L,E[A*2+1]=O,M[A*2]=T.k1,M[A*2+1]=T.k2}for(var N=this._wnafMulAdd(1,E,M,A*2,C),H=0;H<A*2;H++)E[H]=null,M[H]=null;return N};function w(S,x,b,C){g.BasePoint.call(this,S,"affine"),x===null&&b===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(x,16),this.y=new f(b,16),C&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}d(w,g.BasePoint),m.prototype.point=function(x,b,C){return new w(this,x,b,C)},m.prototype.pointFromJSON=function(x,b){return w.fromJSON(this,x,b)},w.prototype._getBeta=function(){if(this.curve.endo){var x=this.precomputed;if(x&&x.beta)return x.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(x){var C=this.curve,E=function(M){return C.point(M.x.redMul(C.endo.beta),M.y)};x.beta=b,b.precomputed={beta:null,naf:x.naf&&{wnd:x.naf.wnd,points:x.naf.points.map(E)},doubles:x.doubles&&{step:x.doubles.step,points:x.doubles.points.map(E)}}}return b}},w.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},w.fromJSON=function(x,b,C){typeof b=="string"&&(b=JSON.parse(b));var E=x.point(b[0],b[1],C);if(!b[2])return E;function M(T){return x.point(T[0],T[1],C)}var A=b[2];return E.precomputed={beta:null,doubles:A.doubles&&{step:A.doubles.step,points:[E].concat(A.doubles.points.map(M))},naf:A.naf&&{wnd:A.naf.wnd,points:[E].concat(A.naf.points.map(M))}},E},w.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(x){if(this.inf)return x;if(x.inf)return this;if(this.eq(x))return this.dbl();if(this.neg().eq(x))return this.curve.point(null,null);if(this.x.cmp(x.x)===0)return this.curve.point(null,null);var b=this.y.redSub(x.y);b.cmpn(0)!==0&&(b=b.redMul(this.x.redSub(x.x).redInvm()));var C=b.redSqr().redISub(this.x).redISub(x.x),E=b.redMul(this.x.redSub(C)).redISub(this.y);return this.curve.point(C,E)},w.prototype.dbl=function(){if(this.inf)return this;var x=this.y.redAdd(this.y);if(x.cmpn(0)===0)return this.curve.point(null,null);var b=this.curve.a,C=this.x.redSqr(),E=x.redInvm(),M=C.redAdd(C).redIAdd(C).redIAdd(b).redMul(E),A=M.redSqr().redISub(this.x.redAdd(this.x)),T=M.redMul(this.x.redSub(A)).redISub(this.y);return this.curve.point(A,T)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(x){return x=new f(x,16),this.isInfinity()?this:this._hasDoubles(x)?this.curve._fixedNafMul(this,x):this.curve.endo?this.curve._endoWnafMulAdd([this],[x]):this.curve._wnafMul(this,x)},w.prototype.mulAdd=function(x,b,C){var E=[this,b],M=[x,C];return this.curve.endo?this.curve._endoWnafMulAdd(E,M):this.curve._wnafMulAdd(1,E,M,2)},w.prototype.jmulAdd=function(x,b,C){var E=[this,b],M=[x,C];return this.curve.endo?this.curve._endoWnafMulAdd(E,M,!0):this.curve._wnafMulAdd(1,E,M,2,!0)},w.prototype.eq=function(x){return this===x||this.inf===x.inf&&(this.inf||this.x.cmp(x.x)===0&&this.y.cmp(x.y)===0)},w.prototype.neg=function(x){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(x&&this.precomputed){var C=this.precomputed,E=function(M){return M.neg()};b.precomputed={naf:C.naf&&{wnd:C.naf.wnd,points:C.naf.points.map(E)},doubles:C.doubles&&{step:C.doubles.step,points:C.doubles.points.map(E)}}}return b},w.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var x=this.curve.jpoint(this.x,this.y,this.curve.one);return x};function _(S,x,b,C){g.BasePoint.call(this,S,"jacobian"),x===null&&b===null&&C===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(x,16),this.y=new f(b,16),this.z=new f(C,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return d(_,g.BasePoint),m.prototype.jpoint=function(x,b,C){return new _(this,x,b,C)},_.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var x=this.z.redInvm(),b=x.redSqr(),C=this.x.redMul(b),E=this.y.redMul(b).redMul(x);return this.curve.point(C,E)},_.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_.prototype.add=function(x){if(this.isInfinity())return x;if(x.isInfinity())return this;var b=x.z.redSqr(),C=this.z.redSqr(),E=this.x.redMul(b),M=x.x.redMul(C),A=this.y.redMul(b.redMul(x.z)),T=x.y.redMul(C.redMul(this.z)),L=E.redSub(M),O=A.redSub(T);if(L.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var N=L.redSqr(),H=N.redMul(L),V=E.redMul(N),X=O.redSqr().redIAdd(H).redISub(V).redISub(V),oe=O.redMul(V.redISub(X)).redISub(A.redMul(H)),se=this.z.redMul(x.z).redMul(L);return this.curve.jpoint(X,oe,se)},_.prototype.mixedAdd=function(x){if(this.isInfinity())return x.toJ();if(x.isInfinity())return this;var b=this.z.redSqr(),C=this.x,E=x.x.redMul(b),M=this.y,A=x.y.redMul(b).redMul(this.z),T=C.redSub(E),L=M.redSub(A);if(T.cmpn(0)===0)return L.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=T.redSqr(),N=O.redMul(T),H=C.redMul(O),V=L.redSqr().redIAdd(N).redISub(H).redISub(H),X=L.redMul(H.redISub(V)).redISub(M.redMul(N)),oe=this.z.redMul(T);return this.curve.jpoint(V,X,oe)},_.prototype.dblp=function(x){if(x===0)return this;if(this.isInfinity())return this;if(!x)return this.dbl();var b;if(this.curve.zeroA||this.curve.threeA){var C=this;for(b=0;b<x;b++)C=C.dbl();return C}var E=this.curve.a,M=this.curve.tinv,A=this.x,T=this.y,L=this.z,O=L.redSqr().redSqr(),N=T.redAdd(T);for(b=0;b<x;b++){var H=A.redSqr(),V=N.redSqr(),X=V.redSqr(),oe=H.redAdd(H).redIAdd(H).redIAdd(E.redMul(O)),se=A.redMul(V),de=oe.redSqr().redISub(se.redAdd(se)),he=se.redISub(de),we=oe.redMul(he);we=we.redIAdd(we).redISub(X);var te=N.redMul(L);b+1<x&&(O=O.redMul(X)),A=de,L=te,N=we}return this.curve.jpoint(A,N.redMul(M),L)},_.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},_.prototype._zeroDbl=function(){var x,b,C;if(this.zOne){var E=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(E).redISub(A);T=T.redIAdd(T);var L=E.redAdd(E).redIAdd(E),O=L.redSqr().redISub(T).redISub(T),N=A.redIAdd(A);N=N.redIAdd(N),N=N.redIAdd(N),x=O,b=L.redMul(T.redISub(O)).redISub(N),C=this.y.redAdd(this.y)}else{var H=this.x.redSqr(),V=this.y.redSqr(),X=V.redSqr(),oe=this.x.redAdd(V).redSqr().redISub(H).redISub(X);oe=oe.redIAdd(oe);var se=H.redAdd(H).redIAdd(H),de=se.redSqr(),he=X.redIAdd(X);he=he.redIAdd(he),he=he.redIAdd(he),x=de.redISub(oe).redISub(oe),b=se.redMul(oe.redISub(x)).redISub(he),C=this.y.redMul(this.z),C=C.redIAdd(C)}return this.curve.jpoint(x,b,C)},_.prototype._threeDbl=function(){var x,b,C;if(this.zOne){var E=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(E).redISub(A);T=T.redIAdd(T);var L=E.redAdd(E).redIAdd(E).redIAdd(this.curve.a),O=L.redSqr().redISub(T).redISub(T);x=O;var N=A.redIAdd(A);N=N.redIAdd(N),N=N.redIAdd(N),b=L.redMul(T.redISub(O)).redISub(N),C=this.y.redAdd(this.y)}else{var H=this.z.redSqr(),V=this.y.redSqr(),X=this.x.redMul(V),oe=this.x.redSub(H).redMul(this.x.redAdd(H));oe=oe.redAdd(oe).redIAdd(oe);var se=X.redIAdd(X);se=se.redIAdd(se);var de=se.redAdd(se);x=oe.redSqr().redISub(de),C=this.y.redAdd(this.z).redSqr().redISub(V).redISub(H);var he=V.redSqr();he=he.redIAdd(he),he=he.redIAdd(he),he=he.redIAdd(he),b=oe.redMul(se.redISub(x)).redISub(he)}return this.curve.jpoint(x,b,C)},_.prototype._dbl=function(){var x=this.curve.a,b=this.x,C=this.y,E=this.z,M=E.redSqr().redSqr(),A=b.redSqr(),T=C.redSqr(),L=A.redAdd(A).redIAdd(A).redIAdd(x.redMul(M)),O=b.redAdd(b);O=O.redIAdd(O);var N=O.redMul(T),H=L.redSqr().redISub(N.redAdd(N)),V=N.redISub(H),X=T.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X);var oe=L.redMul(V).redISub(X),se=C.redAdd(C).redMul(E);return this.curve.jpoint(H,oe,se)},_.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var x=this.x.redSqr(),b=this.y.redSqr(),C=this.z.redSqr(),E=b.redSqr(),M=x.redAdd(x).redIAdd(x),A=M.redSqr(),T=this.x.redAdd(b).redSqr().redISub(x).redISub(E);T=T.redIAdd(T),T=T.redAdd(T).redIAdd(T),T=T.redISub(A);var L=T.redSqr(),O=E.redIAdd(E);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var N=M.redIAdd(T).redSqr().redISub(A).redISub(L).redISub(O),H=b.redMul(N);H=H.redIAdd(H),H=H.redIAdd(H);var V=this.x.redMul(L).redISub(H);V=V.redIAdd(V),V=V.redIAdd(V);var X=this.y.redMul(N.redMul(O.redISub(N)).redISub(T.redMul(L)));X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X);var oe=this.z.redAdd(T).redSqr().redISub(C).redISub(L);return this.curve.jpoint(V,X,oe)},_.prototype.mul=function(x,b){return x=new f(x,b),this.curve._wnafMul(this,x)},_.prototype.eq=function(x){if(x.type==="affine")return this.eq(x.toJ());if(this===x)return!0;var b=this.z.redSqr(),C=x.z.redSqr();if(this.x.redMul(C).redISub(x.x.redMul(b)).cmpn(0)!==0)return!1;var E=b.redMul(this.z),M=C.redMul(x.z);return this.y.redMul(M).redISub(x.y.redMul(E)).cmpn(0)===0},_.prototype.eqXToP=function(x){var b=this.z.redSqr(),C=x.toRed(this.curve.red).redMul(b);if(this.x.cmp(C)===0)return!0;for(var E=x.clone(),M=this.curve.redN.redMul(b);;){if(E.iadd(this.curve.n),E.cmp(this.curve.p)>=0)return!1;if(C.redIAdd(M),this.x.cmp(C)===0)return!0}},_.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},_.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var r=requireBn$2(),f=requireInherits_browser(),d=requireBase$1(),g=requireUtils$1();function v(w){d.call(this,"mont",w),this.a=new r(w.a,16).toRed(this.red),this.b=new r(w.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}f(v,d),mont=v,v.prototype.validate=function(_){var S=_.normalize().x,x=S.redSqr(),b=x.redMul(S).redAdd(x.redMul(this.a)).redAdd(S),C=b.redSqrt();return C.redSqr().cmp(b)===0};function m(w,_,S){d.BasePoint.call(this,w,"projective"),_===null&&S===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(_,16),this.z=new r(S,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return f(m,d.BasePoint),v.prototype.decodePoint=function(_,S){return this.point(g.toArray(_,S),1)},v.prototype.point=function(_,S){return new m(this,_,S)},v.prototype.pointFromJSON=function(_){return m.fromJSON(this,_)},m.prototype.precompute=function(){},m.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},m.fromJSON=function(_,S){return new m(_,S[0],S[1]||_.one)},m.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},m.prototype.isInfinity=function(){return this.z.cmpn(0)===0},m.prototype.dbl=function(){var _=this.x.redAdd(this.z),S=_.redSqr(),x=this.x.redSub(this.z),b=x.redSqr(),C=S.redSub(b),E=S.redMul(b),M=C.redMul(b.redAdd(this.curve.a24.redMul(C)));return this.curve.point(E,M)},m.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},m.prototype.diffAdd=function(_,S){var x=this.x.redAdd(this.z),b=this.x.redSub(this.z),C=_.x.redAdd(_.z),E=_.x.redSub(_.z),M=E.redMul(x),A=C.redMul(b),T=S.z.redMul(M.redAdd(A).redSqr()),L=S.x.redMul(M.redISub(A).redSqr());return this.curve.point(T,L)},m.prototype.mul=function(_){for(var S=_.clone(),x=this,b=this.curve.point(null,null),C=this,E=[];S.cmpn(0)!==0;S.iushrn(1))E.push(S.andln(1));for(var M=E.length-1;M>=0;M--)E[M]===0?(x=x.diffAdd(b,C),b=b.dbl()):(b=x.diffAdd(b,C),x=x.dbl());return b},m.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},m.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},m.prototype.eq=function(_){return this.getX().cmp(_.getX())===0},m.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},m.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var r=requireUtils$1(),f=requireBn$2(),d=requireInherits_browser(),g=requireBase$1(),v=r.assert;function m(_){this.twisted=(_.a|0)!==1,this.mOneA=this.twisted&&(_.a|0)===-1,this.extended=this.mOneA,g.call(this,"edwards",_),this.a=new f(_.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(_.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(_.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),v(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(_.c|0)===1}d(m,g),edwards=m,m.prototype._mulA=function(S){return this.mOneA?S.redNeg():this.a.redMul(S)},m.prototype._mulC=function(S){return this.oneC?S:this.c.redMul(S)},m.prototype.jpoint=function(S,x,b,C){return this.point(S,x,b,C)},m.prototype.pointFromX=function(S,x){S=new f(S,16),S.red||(S=S.toRed(this.red));var b=S.redSqr(),C=this.c2.redSub(this.a.redMul(b)),E=this.one.redSub(this.c2.redMul(this.d).redMul(b)),M=C.redMul(E.redInvm()),A=M.redSqrt();if(A.redSqr().redSub(M).cmp(this.zero)!==0)throw new Error("invalid point");var T=A.fromRed().isOdd();return(x&&!T||!x&&T)&&(A=A.redNeg()),this.point(S,A)},m.prototype.pointFromY=function(S,x){S=new f(S,16),S.red||(S=S.toRed(this.red));var b=S.redSqr(),C=b.redSub(this.c2),E=b.redMul(this.d).redMul(this.c2).redSub(this.a),M=C.redMul(E.redInvm());if(M.cmp(this.zero)===0){if(x)throw new Error("invalid point");return this.point(this.zero,S)}var A=M.redSqrt();if(A.redSqr().redSub(M).cmp(this.zero)!==0)throw new Error("invalid point");return A.fromRed().isOdd()!==x&&(A=A.redNeg()),this.point(A,S)},m.prototype.validate=function(S){if(S.isInfinity())return!0;S.normalize();var x=S.x.redSqr(),b=S.y.redSqr(),C=x.redMul(this.a).redAdd(b),E=this.c2.redMul(this.one.redAdd(this.d.redMul(x).redMul(b)));return C.cmp(E)===0};function w(_,S,x,b,C){g.BasePoint.call(this,_,"projective"),S===null&&x===null&&b===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(S,16),this.y=new f(x,16),this.z=b?new f(b,16):this.curve.one,this.t=C&&new f(C,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return d(w,g.BasePoint),m.prototype.pointFromJSON=function(S){return w.fromJSON(this,S)},m.prototype.point=function(S,x,b,C){return new w(this,S,x,b,C)},w.fromJSON=function(S,x){return new w(S,x[0],x[1],x[2])},w.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},w.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},w.prototype._extDbl=function(){var S=this.x.redSqr(),x=this.y.redSqr(),b=this.z.redSqr();b=b.redIAdd(b);var C=this.curve._mulA(S),E=this.x.redAdd(this.y).redSqr().redISub(S).redISub(x),M=C.redAdd(x),A=M.redSub(b),T=C.redSub(x),L=E.redMul(A),O=M.redMul(T),N=E.redMul(T),H=A.redMul(M);return this.curve.point(L,O,H,N)},w.prototype._projDbl=function(){var S=this.x.redAdd(this.y).redSqr(),x=this.x.redSqr(),b=this.y.redSqr(),C,E,M,A,T,L;if(this.curve.twisted){A=this.curve._mulA(x);var O=A.redAdd(b);this.zOne?(C=S.redSub(x).redSub(b).redMul(O.redSub(this.curve.two)),E=O.redMul(A.redSub(b)),M=O.redSqr().redSub(O).redSub(O)):(T=this.z.redSqr(),L=O.redSub(T).redISub(T),C=S.redSub(x).redISub(b).redMul(L),E=O.redMul(A.redSub(b)),M=O.redMul(L))}else A=x.redAdd(b),T=this.curve._mulC(this.z).redSqr(),L=A.redSub(T).redSub(T),C=this.curve._mulC(S.redISub(A)).redMul(L),E=this.curve._mulC(A).redMul(x.redISub(b)),M=A.redMul(L);return this.curve.point(C,E,M)},w.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},w.prototype._extAdd=function(S){var x=this.y.redSub(this.x).redMul(S.y.redSub(S.x)),b=this.y.redAdd(this.x).redMul(S.y.redAdd(S.x)),C=this.t.redMul(this.curve.dd).redMul(S.t),E=this.z.redMul(S.z.redAdd(S.z)),M=b.redSub(x),A=E.redSub(C),T=E.redAdd(C),L=b.redAdd(x),O=M.redMul(A),N=T.redMul(L),H=M.redMul(L),V=A.redMul(T);return this.curve.point(O,N,V,H)},w.prototype._projAdd=function(S){var x=this.z.redMul(S.z),b=x.redSqr(),C=this.x.redMul(S.x),E=this.y.redMul(S.y),M=this.curve.d.redMul(C).redMul(E),A=b.redSub(M),T=b.redAdd(M),L=this.x.redAdd(this.y).redMul(S.x.redAdd(S.y)).redISub(C).redISub(E),O=x.redMul(A).redMul(L),N,H;return this.curve.twisted?(N=x.redMul(T).redMul(E.redSub(this.curve._mulA(C))),H=A.redMul(T)):(N=x.redMul(T).redMul(E.redSub(C)),H=this.curve._mulC(A).redMul(T)),this.curve.point(O,N,H)},w.prototype.add=function(S){return this.isInfinity()?S:S.isInfinity()?this:this.curve.extended?this._extAdd(S):this._projAdd(S)},w.prototype.mul=function(S){return this._hasDoubles(S)?this.curve._fixedNafMul(this,S):this.curve._wnafMul(this,S)},w.prototype.mulAdd=function(S,x,b){return this.curve._wnafMulAdd(1,[this,x],[S,b],2,!1)},w.prototype.jmulAdd=function(S,x,b){return this.curve._wnafMulAdd(1,[this,x],[S,b],2,!0)},w.prototype.normalize=function(){if(this.zOne)return this;var S=this.z.redInvm();return this.x=this.x.redMul(S),this.y=this.y.redMul(S),this.t&&(this.t=this.t.redMul(S)),this.z=this.curve.one,this.zOne=!0,this},w.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},w.prototype.getX=function(){return this.normalize(),this.x.fromRed()},w.prototype.getY=function(){return this.normalize(),this.y.fromRed()},w.prototype.eq=function(S){return this===S||this.getX().cmp(S.getX())===0&&this.getY().cmp(S.getY())===0},w.prototype.eqXToP=function(S){var x=S.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(x)===0)return!0;for(var b=S.clone(),C=this.curve.redN.redMul(this.z);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(x.redIAdd(C),this.x.cmp(x)===0)return!0}},w.prototype.toP=w.prototype.normalize,w.prototype.mixedAdd=w.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(function(r){var f=r;f.base=requireBase$1(),f.short=requireShort(),f.mont=requireMont(),f.edwards=requireEdwards()})(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var r=requireMinimalisticAssert(),f=requireInherits_browser();utils.inherits=f;function d(q,k){return(q.charCodeAt(k)&64512)!==55296||k<0||k+1>=q.length?!1:(q.charCodeAt(k+1)&64512)===56320}function g(q,k){if(Array.isArray(q))return q.slice();if(!q)return[];var y=[];if(typeof q=="string")if(k){if(k==="hex")for(q=q.replace(/[^a-z0-9]+/ig,""),q.length%2!==0&&(q="0"+q),$=0;$<q.length;$+=2)y.push(parseInt(q[$]+q[$+1],16))}else for(var B=0,$=0;$<q.length;$++){var I=q.charCodeAt($);I<128?y[B++]=I:I<2048?(y[B++]=I>>6|192,y[B++]=I&63|128):d(q,$)?(I=65536+((I&1023)<<10)+(q.charCodeAt(++$)&1023),y[B++]=I>>18|240,y[B++]=I>>12&63|128,y[B++]=I>>6&63|128,y[B++]=I&63|128):(y[B++]=I>>12|224,y[B++]=I>>6&63|128,y[B++]=I&63|128)}else for($=0;$<q.length;$++)y[$]=q[$]|0;return y}utils.toArray=g;function v(q){for(var k="",y=0;y<q.length;y++)k+=_(q[y].toString(16));return k}utils.toHex=v;function m(q){var k=q>>>24|q>>>8&65280|q<<8&16711680|(q&255)<<24;return k>>>0}utils.htonl=m;function w(q,k){for(var y="",B=0;B<q.length;B++){var $=q[B];k==="little"&&($=m($)),y+=S($.toString(16))}return y}utils.toHex32=w;function _(q){return q.length===1?"0"+q:q}utils.zero2=_;function S(q){return q.length===7?"0"+q:q.length===6?"00"+q:q.length===5?"000"+q:q.length===4?"0000"+q:q.length===3?"00000"+q:q.length===2?"000000"+q:q.length===1?"0000000"+q:q}utils.zero8=S;function x(q,k,y,B){var $=y-k;r($%4===0);for(var I=new Array($/4),F=0,j=k;F<I.length;F++,j+=4){var D;B==="big"?D=q[j]<<24|q[j+1]<<16|q[j+2]<<8|q[j+3]:D=q[j+3]<<24|q[j+2]<<16|q[j+1]<<8|q[j],I[F]=D>>>0}return I}utils.join32=x;function b(q,k){for(var y=new Array(q.length*4),B=0,$=0;B<q.length;B++,$+=4){var I=q[B];k==="big"?(y[$]=I>>>24,y[$+1]=I>>>16&255,y[$+2]=I>>>8&255,y[$+3]=I&255):(y[$+3]=I>>>24,y[$+2]=I>>>16&255,y[$+1]=I>>>8&255,y[$]=I&255)}return y}utils.split32=b;function C(q,k){return q>>>k|q<<32-k}utils.rotr32=C;function E(q,k){return q<<k|q>>>32-k}utils.rotl32=E;function M(q,k){return q+k>>>0}utils.sum32=M;function A(q,k,y){return q+k+y>>>0}utils.sum32_3=A;function T(q,k,y,B){return q+k+y+B>>>0}utils.sum32_4=T;function L(q,k,y,B,$){return q+k+y+B+$>>>0}utils.sum32_5=L;function O(q,k,y,B){var $=q[k],I=q[k+1],F=B+I>>>0,j=(F<B?1:0)+y+$;q[k]=j>>>0,q[k+1]=F}utils.sum64=O;function N(q,k,y,B){var $=k+B>>>0,I=($<k?1:0)+q+y;return I>>>0}utils.sum64_hi=N;function H(q,k,y,B){var $=k+B;return $>>>0}utils.sum64_lo=H;function V(q,k,y,B,$,I,F,j){var D=0,W=k;W=W+B>>>0,D+=W<k?1:0,W=W+I>>>0,D+=W<I?1:0,W=W+j>>>0,D+=W<j?1:0;var R=q+y+$+F+D;return R>>>0}utils.sum64_4_hi=V;function X(q,k,y,B,$,I,F,j){var D=k+B+I+j;return D>>>0}utils.sum64_4_lo=X;function oe(q,k,y,B,$,I,F,j,D,W){var R=0,z=k;z=z+B>>>0,R+=z<k?1:0,z=z+I>>>0,R+=z<I?1:0,z=z+j>>>0,R+=z<j?1:0,z=z+W>>>0,R+=z<W?1:0;var ye=q+y+$+F+D+R;return ye>>>0}utils.sum64_5_hi=oe;function se(q,k,y,B,$,I,F,j,D,W){var R=k+B+I+j+W;return R>>>0}utils.sum64_5_lo=se;function de(q,k,y){var B=k<<32-y|q>>>y;return B>>>0}utils.rotr64_hi=de;function he(q,k,y){var B=q<<32-y|k>>>y;return B>>>0}utils.rotr64_lo=he;function we(q,k,y){return q>>>y}utils.shr64_hi=we;function te(q,k,y){var B=q<<32-y|k>>>y;return B>>>0}return utils.shr64_lo=te,utils}var common$3={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$3;hasRequiredCommon$1=1;var r=requireUtils(),f=requireMinimalisticAssert();function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$3.BlockHash=d,d.prototype.update=function(v,m){if(v=r.toArray(v,m),this.pending?this.pending=this.pending.concat(v):this.pending=v,this.pendingTotal+=v.length,this.pending.length>=this._delta8){v=this.pending;var w=v.length%this._delta8;this.pending=v.slice(v.length-w,v.length),this.pending.length===0&&(this.pending=null),v=r.join32(v,0,v.length-w,this.endian);for(var _=0;_<v.length;_+=this._delta32)this._update(v,_,_+this._delta32)}return this},d.prototype.digest=function(v){return this.update(this._pad()),f(this.pending===null),this._digest(v)},d.prototype._pad=function(){var v=this.pendingTotal,m=this._delta8,w=m-(v+this.padLength)%m,_=new Array(w+this.padLength);_[0]=128;for(var S=1;S<w;S++)_[S]=0;if(v<<=3,this.endian==="big"){for(var x=8;x<this.padLength;x++)_[S++]=0;_[S++]=0,_[S++]=0,_[S++]=0,_[S++]=0,_[S++]=v>>>24&255,_[S++]=v>>>16&255,_[S++]=v>>>8&255,_[S++]=v&255}else for(_[S++]=v&255,_[S++]=v>>>8&255,_[S++]=v>>>16&255,_[S++]=v>>>24&255,_[S++]=0,_[S++]=0,_[S++]=0,_[S++]=0,x=8;x<this.padLength;x++)_[S++]=0;return _},common$3}var sha={},common$2={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common$2;hasRequiredCommon=1;var r=requireUtils(),f=r.rotr32;function d(b,C,E,M){if(b===0)return g(C,E,M);if(b===1||b===3)return m(C,E,M);if(b===2)return v(C,E,M)}common$2.ft_1=d;function g(b,C,E){return b&C^~b&E}common$2.ch32=g;function v(b,C,E){return b&C^b&E^C&E}common$2.maj32=v;function m(b,C,E){return b^C^E}common$2.p32=m;function w(b){return f(b,2)^f(b,13)^f(b,22)}common$2.s0_256=w;function _(b){return f(b,6)^f(b,11)^f(b,25)}common$2.s1_256=_;function S(b){return f(b,7)^f(b,18)^b>>>3}common$2.g0_256=S;function x(b){return f(b,17)^f(b,19)^b>>>10}return common$2.g1_256=x,common$2}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var r=requireUtils(),f=requireCommon$1(),d=requireCommon(),g=r.rotl32,v=r.sum32,m=r.sum32_5,w=d.ft_1,_=f.BlockHash,S=[1518500249,1859775393,2400959708,3395469782];function x(){if(!(this instanceof x))return new x;_.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return r.inherits(x,_),_1=x,x.blockSize=512,x.outSize=160,x.hmacStrength=80,x.padLength=64,x.prototype._update=function(C,E){for(var M=this.W,A=0;A<16;A++)M[A]=C[E+A];for(;A<M.length;A++)M[A]=g(M[A-3]^M[A-8]^M[A-14]^M[A-16],1);var T=this.h[0],L=this.h[1],O=this.h[2],N=this.h[3],H=this.h[4];for(A=0;A<M.length;A++){var V=~~(A/20),X=m(g(T,5),w(V,L,O,N),H,M[A],S[V]);H=N,N=O,O=g(L,30),L=T,T=X}this.h[0]=v(this.h[0],T),this.h[1]=v(this.h[1],L),this.h[2]=v(this.h[2],O),this.h[3]=v(this.h[3],N),this.h[4]=v(this.h[4],H)},x.prototype._digest=function(C){return C==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var r=requireUtils(),f=requireCommon$1(),d=requireCommon(),g=requireMinimalisticAssert(),v=r.sum32,m=r.sum32_4,w=r.sum32_5,_=d.ch32,S=d.maj32,x=d.s0_256,b=d.s1_256,C=d.g0_256,E=d.g1_256,M=f.BlockHash,A=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function T(){if(!(this instanceof T))return new T;M.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=A,this.W=new Array(64)}return r.inherits(T,M),_256=T,T.blockSize=512,T.outSize=256,T.hmacStrength=192,T.padLength=64,T.prototype._update=function(O,N){for(var H=this.W,V=0;V<16;V++)H[V]=O[N+V];for(;V<H.length;V++)H[V]=m(E(H[V-2]),H[V-7],C(H[V-15]),H[V-16]);var X=this.h[0],oe=this.h[1],se=this.h[2],de=this.h[3],he=this.h[4],we=this.h[5],te=this.h[6],q=this.h[7];for(g(this.k.length===H.length),V=0;V<H.length;V++){var k=w(q,b(he),_(he,we,te),this.k[V],H[V]),y=v(x(X),S(X,oe,se));q=te,te=we,we=he,he=v(de,k),de=se,se=oe,oe=X,X=v(k,y)}this.h[0]=v(this.h[0],X),this.h[1]=v(this.h[1],oe),this.h[2]=v(this.h[2],se),this.h[3]=v(this.h[3],de),this.h[4]=v(this.h[4],he),this.h[5]=v(this.h[5],we),this.h[6]=v(this.h[6],te),this.h[7]=v(this.h[7],q)},T.prototype._digest=function(O){return O==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var r=requireUtils(),f=require_256();function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return r.inherits(d,f),_224=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(v){return v==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var r=requireUtils(),f=requireCommon$1(),d=requireMinimalisticAssert(),g=r.rotr64_hi,v=r.rotr64_lo,m=r.shr64_hi,w=r.shr64_lo,_=r.sum64,S=r.sum64_hi,x=r.sum64_lo,b=r.sum64_4_hi,C=r.sum64_4_lo,E=r.sum64_5_hi,M=r.sum64_5_lo,A=f.BlockHash,T=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function L(){if(!(this instanceof L))return new L;A.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=T,this.W=new Array(160)}r.inherits(L,A),_512=L,L.blockSize=1024,L.outSize=512,L.hmacStrength=192,L.padLength=128,L.prototype._prepareBlock=function(y,B){for(var $=this.W,I=0;I<32;I++)$[I]=y[B+I];for(;I<$.length;I+=2){var F=te($[I-4],$[I-3]),j=q($[I-4],$[I-3]),D=$[I-14],W=$[I-13],R=he($[I-30],$[I-29]),z=we($[I-30],$[I-29]),ye=$[I-32],Ce=$[I-31];$[I]=b(F,j,D,W,R,z,ye,Ce),$[I+1]=C(F,j,D,W,R,z,ye,Ce)}},L.prototype._update=function(y,B){this._prepareBlock(y,B);var $=this.W,I=this.h[0],F=this.h[1],j=this.h[2],D=this.h[3],W=this.h[4],R=this.h[5],z=this.h[6],ye=this.h[7],Ce=this.h[8],me=this.h[9],ie=this.h[10],ee=this.h[11],pe=this.h[12],be=this.h[13],ae=this.h[14],ne=this.h[15];d(this.k.length===$.length);for(var Se=0;Se<$.length;Se+=2){var ke=ae,Ie=ne,Oe=se(Ce,me),Ue=de(Ce,me),De=O(Ce,me,ie,ee,pe),$e=N(Ce,me,ie,ee,pe,be),je=this.k[Se],Ye=this.k[Se+1],st=$[Se],Je=$[Se+1],Ge=E(ke,Ie,Oe,Ue,De,$e,je,Ye,st,Je),ut=M(ke,Ie,Oe,Ue,De,$e,je,Ye,st,Je);ke=X(I,F),Ie=oe(I,F),Oe=H(I,F,j,D,W),Ue=V(I,F,j,D,W,R);var gt=S(ke,Ie,Oe,Ue),rt=x(ke,Ie,Oe,Ue);ae=pe,ne=be,pe=ie,be=ee,ie=Ce,ee=me,Ce=S(z,ye,Ge,ut),me=x(ye,ye,Ge,ut),z=W,ye=R,W=j,R=D,j=I,D=F,I=S(Ge,ut,gt,rt),F=x(Ge,ut,gt,rt)}_(this.h,0,I,F),_(this.h,2,j,D),_(this.h,4,W,R),_(this.h,6,z,ye),_(this.h,8,Ce,me),_(this.h,10,ie,ee),_(this.h,12,pe,be),_(this.h,14,ae,ne)},L.prototype._digest=function(y){return y==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")};function O(k,y,B,$,I){var F=k&B^~k&I;return F<0&&(F+=4294967296),F}function N(k,y,B,$,I,F){var j=y&$^~y&F;return j<0&&(j+=4294967296),j}function H(k,y,B,$,I){var F=k&B^k&I^B&I;return F<0&&(F+=4294967296),F}function V(k,y,B,$,I,F){var j=y&$^y&F^$&F;return j<0&&(j+=4294967296),j}function X(k,y){var B=g(k,y,28),$=g(y,k,2),I=g(y,k,7),F=B^$^I;return F<0&&(F+=4294967296),F}function oe(k,y){var B=v(k,y,28),$=v(y,k,2),I=v(y,k,7),F=B^$^I;return F<0&&(F+=4294967296),F}function se(k,y){var B=g(k,y,14),$=g(k,y,18),I=g(y,k,9),F=B^$^I;return F<0&&(F+=4294967296),F}function de(k,y){var B=v(k,y,14),$=v(k,y,18),I=v(y,k,9),F=B^$^I;return F<0&&(F+=4294967296),F}function he(k,y){var B=g(k,y,1),$=g(k,y,8),I=m(k,y,7),F=B^$^I;return F<0&&(F+=4294967296),F}function we(k,y){var B=v(k,y,1),$=v(k,y,8),I=w(k,y,7),F=B^$^I;return F<0&&(F+=4294967296),F}function te(k,y){var B=g(k,y,19),$=g(y,k,29),I=m(k,y,6),F=B^$^I;return F<0&&(F+=4294967296),F}function q(k,y){var B=v(k,y,19),$=v(y,k,29),I=w(k,y,6),F=B^$^I;return F<0&&(F+=4294967296),F}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var r=requireUtils(),f=require_512();function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return r.inherits(d,f),_384=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(v){return v==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var r=requireUtils(),f=requireCommon$1(),d=r.rotl32,g=r.sum32,v=r.sum32_3,m=r.sum32_4,w=f.BlockHash;function _(){if(!(this instanceof _))return new _;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}r.inherits(_,w),ripemd.ripemd160=_,_.blockSize=512,_.outSize=160,_.hmacStrength=192,_.padLength=64,_.prototype._update=function(L,O){for(var N=this.h[0],H=this.h[1],V=this.h[2],X=this.h[3],oe=this.h[4],se=N,de=H,he=V,we=X,te=oe,q=0;q<80;q++){var k=g(d(m(N,S(q,H,V,X),L[C[q]+O],x(q)),M[q]),oe);N=oe,oe=X,X=d(V,10),V=H,H=k,k=g(d(m(se,S(79-q,de,he,we),L[E[q]+O],b(q)),A[q]),te),se=te,te=we,we=d(he,10),he=de,de=k}k=v(this.h[1],V,we),this.h[1]=v(this.h[2],X,te),this.h[2]=v(this.h[3],oe,se),this.h[3]=v(this.h[4],N,de),this.h[4]=v(this.h[0],H,he),this.h[0]=k},_.prototype._digest=function(L){return L==="hex"?r.toHex32(this.h,"little"):r.split32(this.h,"little")};function S(T,L,O,N){return T<=15?L^O^N:T<=31?L&O|~L&N:T<=47?(L|~O)^N:T<=63?L&N|O&~N:L^(O|~N)}function x(T){return T<=15?0:T<=31?1518500249:T<=47?1859775393:T<=63?2400959708:2840853838}function b(T){return T<=15?1352829926:T<=31?1548603684:T<=47?1836072691:T<=63?2053994217:0}var C=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],E=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],M=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],A=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ripemd}var hmac,hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;var r=requireUtils(),f=requireMinimalisticAssert();function d(g,v,m){if(!(this instanceof d))return new d(g,v,m);this.Hash=g,this.blockSize=g.blockSize/8,this.outSize=g.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(v,m))}return hmac=d,d.prototype._init=function(v){v.length>this.blockSize&&(v=new this.Hash().update(v).digest()),f(v.length<=this.blockSize);for(var m=v.length;m<this.blockSize;m++)v.push(0);for(m=0;m<v.length;m++)v[m]^=54;for(this.inner=new this.Hash().update(v),m=0;m<v.length;m++)v[m]^=106;this.outer=new this.Hash().update(v)},d.prototype.update=function(v,m){return this.inner.update(v,m),this},d.prototype.digest=function(v){return this.outer.update(this.inner.digest()),this.outer.digest(v)},hmac}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(function(r){var f=r;f.utils=requireUtils(),f.common=requireCommon$1(),f.sha=requireSha(),f.ripemd=requireRipemd(),f.hmac=requireHmac(),f.sha1=f.sha.sha1,f.sha256=f.sha.sha256,f.sha224=f.sha.sha224,f.sha384=f.sha.sha384,f.sha512=f.sha.sha512,f.ripemd160=f.ripemd.ripemd160})(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,(function(r){var f=r,d=requireHash(),g=requireCurve(),v=requireUtils$1(),m=v.assert;function w(x){x.type==="short"?this.curve=new g.short(x):x.type==="edwards"?this.curve=new g.edwards(x):this.curve=new g.mont(x),this.g=this.curve.g,this.n=this.curve.n,this.hash=x.hash,m(this.g.validate(),"Invalid curve"),m(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}f.PresetCurve=w;function _(x,b){Object.defineProperty(f,x,{configurable:!0,enumerable:!0,get:function(){var C=new w(b);return Object.defineProperty(f,x,{configurable:!0,enumerable:!0,value:C}),C}})}_("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),_("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),_("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),_("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:d.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),_("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:d.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),_("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),_("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=requireSecp256k1()}catch{S=void 0}_("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var r=requireHash(),f=requireUtils$2(),d=requireMinimalisticAssert();function g(v){if(!(this instanceof g))return new g(v);this.hash=v.hash,this.predResist=!!v.predResist,this.outLen=this.hash.outSize,this.minEntropy=v.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var m=f.toArray(v.entropy,v.entropyEnc||"hex"),w=f.toArray(v.nonce,v.nonceEnc||"hex"),_=f.toArray(v.pers,v.persEnc||"hex");d(m.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(m,w,_)}return hmacDrbg=g,g.prototype._init=function(m,w,_){var S=m.concat(w).concat(_);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var x=0;x<this.V.length;x++)this.K[x]=0,this.V[x]=1;this._update(S),this._reseed=1,this.reseedInterval=281474976710656},g.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},g.prototype._update=function(m){var w=this._hmac().update(this.V).update([0]);m&&(w=w.update(m)),this.K=w.digest(),this.V=this._hmac().update(this.V).digest(),m&&(this.K=this._hmac().update(this.V).update([1]).update(m).digest(),this.V=this._hmac().update(this.V).digest())},g.prototype.reseed=function(m,w,_,S){typeof w!="string"&&(S=_,_=w,w=null),m=f.toArray(m,w),_=f.toArray(_,S),d(m.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(m.concat(_||[])),this._reseed=1},g.prototype.generate=function(m,w,_,S){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof w!="string"&&(S=_,_=w,w=null),_&&(_=f.toArray(_,S||"hex"),this._update(_));for(var x=[];x.length<m;)this.V=this._hmac().update(this.V).digest(),x=x.concat(this.V);var b=x.slice(0,m);return this._update(_),this._reseed++,f.encode(b,w)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert;function g(v,m){this.ec=v,this.priv=null,this.pub=null,m.priv&&this._importPrivate(m.priv,m.privEnc),m.pub&&this._importPublic(m.pub,m.pubEnc)}return key$1=g,g.fromPublic=function(m,w,_){return w instanceof g?w:new g(m,{pub:w,pubEnc:_})},g.fromPrivate=function(m,w,_){return w instanceof g?w:new g(m,{priv:w,privEnc:_})},g.prototype.validate=function(){var m=this.getPublic();return m.isInfinity()?{result:!1,reason:"Invalid public key"}:m.validate()?m.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},g.prototype.getPublic=function(m,w){return typeof m=="string"&&(w=m,m=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),w?this.pub.encode(w,m):this.pub},g.prototype.getPrivate=function(m){return m==="hex"?this.priv.toString(16,2):this.priv},g.prototype._importPrivate=function(m,w){this.priv=new r(m,w||16),this.priv=this.priv.umod(this.ec.curve.n)},g.prototype._importPublic=function(m,w){if(m.x||m.y){this.ec.curve.type==="mont"?d(m.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&d(m.x&&m.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(m.x,m.y);return}this.pub=this.ec.curve.decodePoint(m,w)},g.prototype.derive=function(m){return m.validate()||d(m.validate(),"public point not validated"),m.mul(this.priv).getX()},g.prototype.sign=function(m,w,_){return this.ec.sign(m,this,w,_)},g.prototype.verify=function(m,w,_){return this.ec.verify(m,w,this,void 0,_)},g.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert;function g(S,x){if(S instanceof g)return S;this._importDER(S,x)||(d(S.r&&S.s,"Signature without r or s"),this.r=new r(S.r,16),this.s=new r(S.s,16),S.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=S.recoveryParam)}signature$1=g;function v(){this.place=0}function m(S,x){var b=S[x.place++];if(!(b&128))return b;var C=b&15;if(C===0||C>4||S[x.place]===0)return!1;for(var E=0,M=0,A=x.place;M<C;M++,A++)E<<=8,E|=S[A],E>>>=0;return E<=127?!1:(x.place=A,E)}function w(S){for(var x=0,b=S.length-1;!S[x]&&!(S[x+1]&128)&&x<b;)x++;return x===0?S:S.slice(x)}g.prototype._importDER=function(x,b){x=f.toArray(x,b);var C=new v;if(x[C.place++]!==48)return!1;var E=m(x,C);if(E===!1||E+C.place!==x.length||x[C.place++]!==2)return!1;var M=m(x,C);if(M===!1||(x[C.place]&128)!==0)return!1;var A=x.slice(C.place,M+C.place);if(C.place+=M,x[C.place++]!==2)return!1;var T=m(x,C);if(T===!1||x.length!==T+C.place||(x[C.place]&128)!==0)return!1;var L=x.slice(C.place,T+C.place);if(A[0]===0)if(A[1]&128)A=A.slice(1);else return!1;if(L[0]===0)if(L[1]&128)L=L.slice(1);else return!1;return this.r=new r(A),this.s=new r(L),this.recoveryParam=null,!0};function _(S,x){if(x<128){S.push(x);return}var b=1+(Math.log(x)/Math.LN2>>>3);for(S.push(b|128);--b;)S.push(x>>>(b<<3)&255);S.push(x)}return g.prototype.toDER=function(x){var b=this.r.toArray(),C=this.s.toArray();for(b[0]&128&&(b=[0].concat(b)),C[0]&128&&(C=[0].concat(C)),b=w(b),C=w(C);!C[0]&&!(C[1]&128);)C=C.slice(1);var E=[2];_(E,b.length),E=E.concat(b),E.push(2),_(E,C.length);var M=E.concat(C),A=[48];return _(A,M.length),A=A.concat(M),f.encode(A,x)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var r=requireBn$2(),f=requireHmacDrbg(),d=requireUtils$1(),g=requireCurves(),v=requireBrorand(),m=d.assert,w=requireKey$1(),_=requireSignature$1();function S(x){if(!(this instanceof S))return new S(x);typeof x=="string"&&(m(Object.prototype.hasOwnProperty.call(g,x),"Unknown curve "+x),x=g[x]),x instanceof g.PresetCurve&&(x={curve:x}),this.curve=x.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=x.curve.g,this.g.precompute(x.curve.n.bitLength()+1),this.hash=x.hash||x.curve.hash}return ec=S,S.prototype.keyPair=function(b){return new w(this,b)},S.prototype.keyFromPrivate=function(b,C){return w.fromPrivate(this,b,C)},S.prototype.keyFromPublic=function(b,C){return w.fromPublic(this,b,C)},S.prototype.genKeyPair=function(b){b||(b={});for(var C=new f({hash:this.hash,pers:b.pers,persEnc:b.persEnc||"utf8",entropy:b.entropy||v(this.hash.hmacStrength),entropyEnc:b.entropy&&b.entropyEnc||"utf8",nonce:this.n.toArray()}),E=this.n.byteLength(),M=this.n.sub(new r(2));;){var A=new r(C.generate(E));if(!(A.cmp(M)>0))return A.iaddn(1),this.keyFromPrivate(A)}},S.prototype._truncateToN=function(b,C,E){var M;if(r.isBN(b)||typeof b=="number")b=new r(b,16),M=b.byteLength();else if(typeof b=="object")M=b.length,b=new r(b,16);else{var A=b.toString();M=A.length+1>>>1,b=new r(A,16)}typeof E!="number"&&(E=M*8);var T=E-this.n.bitLength();return T>0&&(b=b.ushrn(T)),!C&&b.cmp(this.n)>=0?b.sub(this.n):b},S.prototype.sign=function(b,C,E,M){if(typeof E=="object"&&(M=E,E=null),M||(M={}),typeof b!="string"&&typeof b!="number"&&!r.isBN(b)){m(typeof b=="object"&&b&&typeof b.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),m(b.length>>>0===b.length);for(var A=0;A<b.length;A++)m((b[A]&255)===b[A])}C=this.keyFromPrivate(C,E),b=this._truncateToN(b,!1,M.msgBitLength),m(!b.isNeg(),"Can not sign a negative message");var T=this.n.byteLength(),L=C.getPrivate().toArray("be",T),O=b.toArray("be",T);m(new r(O).eq(b),"Can not sign message");for(var N=new f({hash:this.hash,entropy:L,nonce:O,pers:M.pers,persEnc:M.persEnc||"utf8"}),H=this.n.sub(new r(1)),V=0;;V++){var X=M.k?M.k(V):new r(N.generate(this.n.byteLength()));if(X=this._truncateToN(X,!0),!(X.cmpn(1)<=0||X.cmp(H)>=0)){var oe=this.g.mul(X);if(!oe.isInfinity()){var se=oe.getX(),de=se.umod(this.n);if(de.cmpn(0)!==0){var he=X.invm(this.n).mul(de.mul(C.getPrivate()).iadd(b));if(he=he.umod(this.n),he.cmpn(0)!==0){var we=(oe.getY().isOdd()?1:0)|(se.cmp(de)!==0?2:0);return M.canonical&&he.cmp(this.nh)>0&&(he=this.n.sub(he),we^=1),new _({r:de,s:he,recoveryParam:we})}}}}}},S.prototype.verify=function(b,C,E,M,A){A||(A={}),b=this._truncateToN(b,!1,A.msgBitLength),E=this.keyFromPublic(E,M),C=new _(C,"hex");var T=C.r,L=C.s;if(T.cmpn(1)<0||T.cmp(this.n)>=0||L.cmpn(1)<0||L.cmp(this.n)>=0)return!1;var O=L.invm(this.n),N=O.mul(b).umod(this.n),H=O.mul(T).umod(this.n),V;return this.curve._maxwellTrick?(V=this.g.jmulAdd(N,E.getPublic(),H),V.isInfinity()?!1:V.eqXToP(T)):(V=this.g.mulAdd(N,E.getPublic(),H),V.isInfinity()?!1:V.getX().umod(this.n).cmp(T)===0)},S.prototype.recoverPubKey=function(x,b,C,E){m((3&C)===C,"The recovery param is more than two bits"),b=new _(b,E);var M=this.n,A=new r(x),T=b.r,L=b.s,O=C&1,N=C>>1;if(T.cmp(this.curve.p.umod(this.curve.n))>=0&&N)throw new Error("Unable to find sencond key candinate");N?T=this.curve.pointFromX(T.add(this.curve.n),O):T=this.curve.pointFromX(T,O);var H=b.r.invm(M),V=M.sub(A).mul(H).umod(M),X=L.mul(H).umod(M);return this.g.mulAdd(V,T,X)},S.prototype.getKeyRecoveryParam=function(x,b,C,E){if(b=new _(b,E),b.recoveryParam!==null)return b.recoveryParam;for(var M=0;M<4;M++){var A;try{A=this.recoverPubKey(x,b,M)}catch{continue}if(A.eq(C))return M}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var r=requireUtils$1(),f=r.assert,d=r.parseBytes,g=r.cachedProperty;function v(m,w){this.eddsa=m,this._secret=d(w.secret),m.isPoint(w.pub)?this._pub=w.pub:this._pubBytes=d(w.pub)}return v.fromPublic=function(w,_){return _ instanceof v?_:new v(w,{pub:_})},v.fromSecret=function(w,_){return _ instanceof v?_:new v(w,{secret:_})},v.prototype.secret=function(){return this._secret},g(v,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),g(v,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),g(v,"privBytes",function(){var w=this.eddsa,_=this.hash(),S=w.encodingLength-1,x=_.slice(0,w.encodingLength);return x[0]&=248,x[S]&=127,x[S]|=64,x}),g(v,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),g(v,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),g(v,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),v.prototype.sign=function(w){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(w,this)},v.prototype.verify=function(w,_){return this.eddsa.verify(w,_,this)},v.prototype.getSecret=function(w){return f(this._secret,"KeyPair is public only"),r.encode(this.secret(),w)},v.prototype.getPublic=function(w){return r.encode(this.pubBytes(),w)},key=v,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert,g=f.cachedProperty,v=f.parseBytes;function m(w,_){this.eddsa=w,typeof _!="object"&&(_=v(_)),Array.isArray(_)&&(d(_.length===w.encodingLength*2,"Signature has invalid size"),_={R:_.slice(0,w.encodingLength),S:_.slice(w.encodingLength)}),d(_.R&&_.S,"Signature without R or S"),w.isPoint(_.R)&&(this._R=_.R),_.S instanceof r&&(this._S=_.S),this._Rencoded=Array.isArray(_.R)?_.R:_.Rencoded,this._Sencoded=Array.isArray(_.S)?_.S:_.Sencoded}return g(m,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),g(m,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),g(m,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),g(m,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),m.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},m.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},signature=m,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var r=requireHash(),f=requireCurves(),d=requireUtils$1(),g=d.assert,v=d.parseBytes,m=requireKey(),w=requireSignature();function _(S){if(g(S==="ed25519","only tested with ed25519 so far"),!(this instanceof _))return new _(S);S=f[S].curve,this.curve=S,this.g=S.g,this.g.precompute(S.n.bitLength()+1),this.pointClass=S.point().constructor,this.encodingLength=Math.ceil(S.n.bitLength()/8),this.hash=r.sha512}return eddsa=_,_.prototype.sign=function(x,b){x=v(x);var C=this.keyFromSecret(b),E=this.hashInt(C.messagePrefix(),x),M=this.g.mul(E),A=this.encodePoint(M),T=this.hashInt(A,C.pubBytes(),x).mul(C.priv()),L=E.add(T).umod(this.curve.n);return this.makeSignature({R:M,S:L,Rencoded:A})},_.prototype.verify=function(x,b,C){if(x=v(x),b=this.makeSignature(b),b.S().gte(b.eddsa.curve.n)||b.S().isNeg())return!1;var E=this.keyFromPublic(C),M=this.hashInt(b.Rencoded(),E.pubBytes(),x),A=this.g.mul(b.S()),T=b.R().add(E.pub().mul(M));return T.eq(A)},_.prototype.hashInt=function(){for(var x=this.hash(),b=0;b<arguments.length;b++)x.update(arguments[b]);return d.intFromLE(x.digest()).umod(this.curve.n)},_.prototype.keyFromPublic=function(x){return m.fromPublic(this,x)},_.prototype.keyFromSecret=function(x){return m.fromSecret(this,x)},_.prototype.makeSignature=function(x){return x instanceof w?x:new w(this,x)},_.prototype.encodePoint=function(x){var b=x.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=x.getX().isOdd()?128:0,b},_.prototype.decodePoint=function(x){x=d.parseBytes(x);var b=x.length-1,C=x.slice(0,b).concat(x[b]&-129),E=(x[b]&128)!==0,M=d.intFromLE(C);return this.curve.pointFromY(M,E)},_.prototype.encodeInt=function(x){return x.toArray("le",this.encodingLength)},_.prototype.decodeInt=function(x){return d.intFromLE(x)},_.prototype.isPoint=function(x){return x instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(function(r){var f=r;f.version=require$$0.version,f.utils=requireUtils$1(),f.rand=requireBrorand(),f.curve=requireCurve(),f.curves=requireCurves(),f.ec=requireEc(),f.eddsa=requireEddsa()})(elliptic)),elliptic}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,(function(r){(function(f,d){function g(k,y){if(!k)throw new Error(y||"Assertion failed")}function v(k,y){k.super_=y;var B=function(){};B.prototype=y.prototype,k.prototype=new B,k.prototype.constructor=k}function m(k,y,B){if(m.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((y==="le"||y==="be")&&(B=y,y=10),this._init(k||0,y||10,B||"be"))}typeof f=="object"?f.exports=m:d.BN=m,m.BN=m,m.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}m.isBN=function(y){return y instanceof m?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===m.wordSize&&Array.isArray(y.words)},m.max=function(y,B){return y.cmp(B)>0?y:B},m.min=function(y,B){return y.cmp(B)<0?y:B},m.prototype._init=function(y,B,$){if(typeof y=="number")return this._initNumber(y,B,$);if(typeof y=="object")return this._initArray(y,B,$);B==="hex"&&(B=16),g(B===(B|0)&&B>=2&&B<=36),y=y.toString().replace(/\s+/g,"");var I=0;y[0]==="-"&&(I++,this.negative=1),I<y.length&&(B===16?this._parseHex(y,I,$):(this._parseBase(y,B,I),$==="le"&&this._initArray(this.toArray(),B,$)))},m.prototype._initNumber=function(y,B,$){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(g(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),B,$)},m.prototype._initArray=function(y,B,$){if(g(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F,j,D=0;if($==="be")for(I=y.length-1,F=0;I>=0;I-=3)j=y[I]|y[I-1]<<8|y[I-2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);else if($==="le")for(I=0,F=0;I<y.length;I+=3)j=y[I]|y[I+1]<<8|y[I+2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);return this._strip()};function _(k,y){var B=k.charCodeAt(y);if(B>=48&&B<=57)return B-48;if(B>=65&&B<=70)return B-55;if(B>=97&&B<=102)return B-87;g(!1,"Invalid character in "+k)}function S(k,y,B){var $=_(k,B);return B-1>=y&&($|=_(k,B-1)<<4),$}m.prototype._parseHex=function(y,B,$){this.length=Math.ceil((y.length-B)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F=0,j=0,D;if($==="be")for(I=y.length-1;I>=B;I-=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8;else{var W=y.length-B;for(I=W%2===0?B+1:B;I<y.length;I+=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8}this._strip()};function x(k,y,B,$){for(var I=0,F=0,j=Math.min(k.length,B),D=y;D<j;D++){var W=k.charCodeAt(D)-48;I*=$,W>=49?F=W-49+10:W>=17?F=W-17+10:F=W,g(W>=0&&F<$,"Invalid character"),I+=F}return I}m.prototype._parseBase=function(y,B,$){this.words=[0],this.length=1;for(var I=0,F=1;F<=67108863;F*=B)I++;I--,F=F/B|0;for(var j=y.length-$,D=j%I,W=Math.min(j,j-D)+$,R=0,z=$;z<W;z+=I)R=x(y,z,z+I,B),this.imuln(F),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(D!==0){var ye=1;for(R=x(y,z,y.length,B),z=0;z<D;z++)ye*=B;this.imuln(ye),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},m.prototype.copy=function(y){y.words=new Array(this.length);for(var B=0;B<this.length;B++)y.words[B]=this.words[B];y.length=this.length,y.negative=this.negative,y.red=this.red};function b(k,y){k.words=y.words,k.length=y.length,k.negative=y.negative,k.red=y.red}if(m.prototype._move=function(y){b(y,this)},m.prototype.clone=function(){var y=new m(null);return this.copy(y),y},m.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},m.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},m.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{m.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{m.prototype.inspect=C}else m.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];m.prototype.toString=function(y,B){y=y||10,B=B|0||1;var $;if(y===16||y==="hex"){$="";for(var I=0,F=0,j=0;j<this.length;j++){var D=this.words[j],W=((D<<I|F)&16777215).toString(16);F=D>>>24-I&16777215,I+=2,I>=26&&(I-=26,j--),F!==0||j!==this.length-1?$=E[6-W.length]+W+$:$=W+$}for(F!==0&&($=F.toString(16)+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(y===(y|0)&&y>=2&&y<=36){var R=M[y],z=A[y];$="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var Ce=ye.modrn(z).toString(y);ye=ye.idivn(z),ye.isZero()?$=Ce+$:$=E[R-Ce.length]+Ce+$}for(this.isZero()&&($="0"+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}g(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&g(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},m.prototype.toJSON=function(){return this.toString(16,2)},w&&(m.prototype.toBuffer=function(y,B){return this.toArrayLike(w,y,B)}),m.prototype.toArray=function(y,B){return this.toArrayLike(Array,y,B)};var T=function(y,B){return y.allocUnsafe?y.allocUnsafe(B):new y(B)};m.prototype.toArrayLike=function(y,B,$){this._strip();var I=this.byteLength(),F=$||Math.max(1,I);g(I<=F,"byte array longer than desired length"),g(F>0,"Requested array length <= 0");var j=T(y,F),D=B==="le"?"LE":"BE";return this["_toArrayLike"+D](j,I),j},m.prototype._toArrayLikeLE=function(y,B){for(var $=0,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$++]=D&255,$<y.length&&(y[$++]=D>>8&255),$<y.length&&(y[$++]=D>>16&255),j===6?($<y.length&&(y[$++]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($<y.length)for(y[$++]=I;$<y.length;)y[$++]=0},m.prototype._toArrayLikeBE=function(y,B){for(var $=y.length-1,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$--]=D&255,$>=0&&(y[$--]=D>>8&255),$>=0&&(y[$--]=D>>16&255),j===6?($>=0&&(y[$--]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($>=0)for(y[$--]=I;$>=0;)y[$--]=0},Math.clz32?m.prototype._countBits=function(y){return 32-Math.clz32(y)}:m.prototype._countBits=function(y){var B=y,$=0;return B>=4096&&($+=13,B>>>=13),B>=64&&($+=7,B>>>=7),B>=8&&($+=4,B>>>=4),B>=2&&($+=2,B>>>=2),$+B},m.prototype._zeroBits=function(y){if(y===0)return 26;var B=y,$=0;return(B&8191)===0&&($+=13,B>>>=13),(B&127)===0&&($+=7,B>>>=7),(B&15)===0&&($+=4,B>>>=4),(B&3)===0&&($+=2,B>>>=2),(B&1)===0&&$++,$},m.prototype.bitLength=function(){var y=this.words[this.length-1],B=this._countBits(y);return(this.length-1)*26+B};function L(k){for(var y=new Array(k.bitLength()),B=0;B<y.length;B++){var $=B/26|0,I=B%26;y[B]=k.words[$]>>>I&1}return y}m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,B=0;B<this.length;B++){var $=this._zeroBits(this.words[B]);if(y+=$,$!==26)break}return y},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},m.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return this.negative!==0},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var B=0;B<y.length;B++)this.words[B]=this.words[B]|y.words[B];return this._strip()},m.prototype.ior=function(y){return g((this.negative|y.negative)===0),this.iuor(y)},m.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},m.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},m.prototype.iuand=function(y){var B;this.length>y.length?B=y:B=this;for(var $=0;$<B.length;$++)this.words[$]=this.words[$]&y.words[$];return this.length=B.length,this._strip()},m.prototype.iand=function(y){return g((this.negative|y.negative)===0),this.iuand(y)},m.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},m.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},m.prototype.iuxor=function(y){var B,$;this.length>y.length?(B=this,$=y):(B=y,$=this);for(var I=0;I<$.length;I++)this.words[I]=B.words[I]^$.words[I];if(this!==B)for(;I<B.length;I++)this.words[I]=B.words[I];return this.length=B.length,this._strip()},m.prototype.ixor=function(y){return g((this.negative|y.negative)===0),this.iuxor(y)},m.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},m.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},m.prototype.inotn=function(y){g(typeof y=="number"&&y>=0);var B=Math.ceil(y/26)|0,$=y%26;this._expand(B),$>0&&B--;for(var I=0;I<B;I++)this.words[I]=~this.words[I]&67108863;return $>0&&(this.words[I]=~this.words[I]&67108863>>26-$),this._strip()},m.prototype.notn=function(y){return this.clone().inotn(y)},m.prototype.setn=function(y,B){g(typeof y=="number"&&y>=0);var $=y/26|0,I=y%26;return this._expand($+1),B?this.words[$]=this.words[$]|1<<I:this.words[$]=this.words[$]&~(1<<I),this._strip()},m.prototype.iadd=function(y){var B;if(this.negative!==0&&y.negative===0)return this.negative=0,B=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,B=this.isub(y),y.negative=1,B._normSign();var $,I;this.length>y.length?($=this,I=y):($=y,I=this);for(var F=0,j=0;j<I.length;j++)B=($.words[j]|0)+(I.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;for(;F!==0&&j<$.length;j++)B=($.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;if(this.length=$.length,F!==0)this.words[this.length]=F,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},m.prototype.add=function(y){var B;return y.negative!==0&&this.negative===0?(y.negative=0,B=this.sub(y),y.negative^=1,B):y.negative===0&&this.negative!==0?(this.negative=0,B=y.sub(this),this.negative=1,B):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},m.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var B=this.iadd(y);return y.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var $=this.cmp(y);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,F;$>0?(I=this,F=y):(I=y,F=this);for(var j=0,D=0;D<F.length;D++)B=(I.words[D]|0)-(F.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;for(;j!==0&&D<I.length;D++)B=(I.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;if(j===0&&D<I.length&&I!==this)for(;D<I.length;D++)this.words[D]=I.words[D];return this.length=Math.max(this.length,D),I!==this&&(this.negative=1),this._strip()},m.prototype.sub=function(y){return this.clone().isub(y)};function O(k,y,B){B.negative=y.negative^k.negative;var $=k.length+y.length|0;B.length=$,$=$-1|0;var I=k.words[0]|0,F=y.words[0]|0,j=I*F,D=j&67108863,W=j/67108864|0;B.words[0]=D;for(var R=1;R<$;R++){for(var z=W>>>26,ye=W&67108863,Ce=Math.min(R,y.length-1),me=Math.max(0,R-k.length+1);me<=Ce;me++){var ie=R-me|0;I=k.words[ie]|0,F=y.words[me]|0,j=I*F+ye,z+=j/67108864|0,ye=j&67108863}B.words[R]=ye|0,W=z|0}return W!==0?B.words[R]=W|0:B.length--,B._strip()}var N=function(y,B,$){var I=y.words,F=B.words,j=$.words,D=0,W,R,z,ye=I[0]|0,Ce=ye&8191,me=ye>>>13,ie=I[1]|0,ee=ie&8191,pe=ie>>>13,be=I[2]|0,ae=be&8191,ne=be>>>13,Se=I[3]|0,ke=Se&8191,Ie=Se>>>13,Oe=I[4]|0,Ue=Oe&8191,De=Oe>>>13,$e=I[5]|0,je=$e&8191,Ye=$e>>>13,st=I[6]|0,Je=st&8191,Ge=st>>>13,ut=I[7]|0,gt=ut&8191,rt=ut>>>13,wt=I[8]|0,bt=wt&8191,le=wt>>>13,Z=I[9]|0,J=Z&8191,ge=Z>>>13,Ee=F[0]|0,Re=Ee&8191,qe=Ee>>>13,Xe=F[1]|0,He=Xe&8191,Ze=Xe>>>13,_t=F[2]|0,tt=_t&8191,mt=_t>>>13,Tt=F[3]|0,St=Tt&8191,lt=Tt>>>13,Mt=F[4]|0,Ct=Mt&8191,ce=Mt>>>13,Y=F[5]|0,Q=Y&8191,ve=Y>>>13,fe=F[6]|0,U=fe&8191,G=fe>>>13,re=F[7]|0,K=re&8191,ue=re>>>13,Ae=F[8]|0,xe=Ae&8191,Te=Ae>>>13,Pe=F[9]|0,Fe=Pe&8191,Ne=Pe>>>13;$.negative=y.negative^B.negative,$.length=19,W=Math.imul(Ce,Re),R=Math.imul(Ce,qe),R=R+Math.imul(me,Re)|0,z=Math.imul(me,qe);var At=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(At>>>26)|0,At&=67108863,W=Math.imul(ee,Re),R=Math.imul(ee,qe),R=R+Math.imul(pe,Re)|0,z=Math.imul(pe,qe),W=W+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,Ze)|0,R=R+Math.imul(me,He)|0,z=z+Math.imul(me,Ze)|0;var ot=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ot>>>26)|0,ot&=67108863,W=Math.imul(ae,Re),R=Math.imul(ae,qe),R=R+Math.imul(ne,Re)|0,z=Math.imul(ne,qe),W=W+Math.imul(ee,He)|0,R=R+Math.imul(ee,Ze)|0,R=R+Math.imul(pe,He)|0,z=z+Math.imul(pe,Ze)|0,W=W+Math.imul(Ce,tt)|0,R=R+Math.imul(Ce,mt)|0,R=R+Math.imul(me,tt)|0,z=z+Math.imul(me,mt)|0;var yt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(yt>>>26)|0,yt&=67108863,W=Math.imul(ke,Re),R=Math.imul(ke,qe),R=R+Math.imul(Ie,Re)|0,z=Math.imul(Ie,qe),W=W+Math.imul(ae,He)|0,R=R+Math.imul(ae,Ze)|0,R=R+Math.imul(ne,He)|0,z=z+Math.imul(ne,Ze)|0,W=W+Math.imul(ee,tt)|0,R=R+Math.imul(ee,mt)|0,R=R+Math.imul(pe,tt)|0,z=z+Math.imul(pe,mt)|0,W=W+Math.imul(Ce,St)|0,R=R+Math.imul(Ce,lt)|0,R=R+Math.imul(me,St)|0,z=z+Math.imul(me,lt)|0;var vt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(vt>>>26)|0,vt&=67108863,W=Math.imul(Ue,Re),R=Math.imul(Ue,qe),R=R+Math.imul(De,Re)|0,z=Math.imul(De,qe),W=W+Math.imul(ke,He)|0,R=R+Math.imul(ke,Ze)|0,R=R+Math.imul(Ie,He)|0,z=z+Math.imul(Ie,Ze)|0,W=W+Math.imul(ae,tt)|0,R=R+Math.imul(ae,mt)|0,R=R+Math.imul(ne,tt)|0,z=z+Math.imul(ne,mt)|0,W=W+Math.imul(ee,St)|0,R=R+Math.imul(ee,lt)|0,R=R+Math.imul(pe,St)|0,z=z+Math.imul(pe,lt)|0,W=W+Math.imul(Ce,Ct)|0,R=R+Math.imul(Ce,ce)|0,R=R+Math.imul(me,Ct)|0,z=z+Math.imul(me,ce)|0;var xt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(xt>>>26)|0,xt&=67108863,W=Math.imul(je,Re),R=Math.imul(je,qe),R=R+Math.imul(Ye,Re)|0,z=Math.imul(Ye,qe),W=W+Math.imul(Ue,He)|0,R=R+Math.imul(Ue,Ze)|0,R=R+Math.imul(De,He)|0,z=z+Math.imul(De,Ze)|0,W=W+Math.imul(ke,tt)|0,R=R+Math.imul(ke,mt)|0,R=R+Math.imul(Ie,tt)|0,z=z+Math.imul(Ie,mt)|0,W=W+Math.imul(ae,St)|0,R=R+Math.imul(ae,lt)|0,R=R+Math.imul(ne,St)|0,z=z+Math.imul(ne,lt)|0,W=W+Math.imul(ee,Ct)|0,R=R+Math.imul(ee,ce)|0,R=R+Math.imul(pe,Ct)|0,z=z+Math.imul(pe,ce)|0,W=W+Math.imul(Ce,Q)|0,R=R+Math.imul(Ce,ve)|0,R=R+Math.imul(me,Q)|0,z=z+Math.imul(me,ve)|0;var Ve=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,W=Math.imul(Je,Re),R=Math.imul(Je,qe),R=R+Math.imul(Ge,Re)|0,z=Math.imul(Ge,qe),W=W+Math.imul(je,He)|0,R=R+Math.imul(je,Ze)|0,R=R+Math.imul(Ye,He)|0,z=z+Math.imul(Ye,Ze)|0,W=W+Math.imul(Ue,tt)|0,R=R+Math.imul(Ue,mt)|0,R=R+Math.imul(De,tt)|0,z=z+Math.imul(De,mt)|0,W=W+Math.imul(ke,St)|0,R=R+Math.imul(ke,lt)|0,R=R+Math.imul(Ie,St)|0,z=z+Math.imul(Ie,lt)|0,W=W+Math.imul(ae,Ct)|0,R=R+Math.imul(ae,ce)|0,R=R+Math.imul(ne,Ct)|0,z=z+Math.imul(ne,ce)|0,W=W+Math.imul(ee,Q)|0,R=R+Math.imul(ee,ve)|0,R=R+Math.imul(pe,Q)|0,z=z+Math.imul(pe,ve)|0,W=W+Math.imul(Ce,U)|0,R=R+Math.imul(Ce,G)|0,R=R+Math.imul(me,U)|0,z=z+Math.imul(me,G)|0;var ft=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ft>>>26)|0,ft&=67108863,W=Math.imul(gt,Re),R=Math.imul(gt,qe),R=R+Math.imul(rt,Re)|0,z=Math.imul(rt,qe),W=W+Math.imul(Je,He)|0,R=R+Math.imul(Je,Ze)|0,R=R+Math.imul(Ge,He)|0,z=z+Math.imul(Ge,Ze)|0,W=W+Math.imul(je,tt)|0,R=R+Math.imul(je,mt)|0,R=R+Math.imul(Ye,tt)|0,z=z+Math.imul(Ye,mt)|0,W=W+Math.imul(Ue,St)|0,R=R+Math.imul(Ue,lt)|0,R=R+Math.imul(De,St)|0,z=z+Math.imul(De,lt)|0,W=W+Math.imul(ke,Ct)|0,R=R+Math.imul(ke,ce)|0,R=R+Math.imul(Ie,Ct)|0,z=z+Math.imul(Ie,ce)|0,W=W+Math.imul(ae,Q)|0,R=R+Math.imul(ae,ve)|0,R=R+Math.imul(ne,Q)|0,z=z+Math.imul(ne,ve)|0,W=W+Math.imul(ee,U)|0,R=R+Math.imul(ee,G)|0,R=R+Math.imul(pe,U)|0,z=z+Math.imul(pe,G)|0,W=W+Math.imul(Ce,K)|0,R=R+Math.imul(Ce,ue)|0,R=R+Math.imul(me,K)|0,z=z+Math.imul(me,ue)|0;var et=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(et>>>26)|0,et&=67108863,W=Math.imul(bt,Re),R=Math.imul(bt,qe),R=R+Math.imul(le,Re)|0,z=Math.imul(le,qe),W=W+Math.imul(gt,He)|0,R=R+Math.imul(gt,Ze)|0,R=R+Math.imul(rt,He)|0,z=z+Math.imul(rt,Ze)|0,W=W+Math.imul(Je,tt)|0,R=R+Math.imul(Je,mt)|0,R=R+Math.imul(Ge,tt)|0,z=z+Math.imul(Ge,mt)|0,W=W+Math.imul(je,St)|0,R=R+Math.imul(je,lt)|0,R=R+Math.imul(Ye,St)|0,z=z+Math.imul(Ye,lt)|0,W=W+Math.imul(Ue,Ct)|0,R=R+Math.imul(Ue,ce)|0,R=R+Math.imul(De,Ct)|0,z=z+Math.imul(De,ce)|0,W=W+Math.imul(ke,Q)|0,R=R+Math.imul(ke,ve)|0,R=R+Math.imul(Ie,Q)|0,z=z+Math.imul(Ie,ve)|0,W=W+Math.imul(ae,U)|0,R=R+Math.imul(ae,G)|0,R=R+Math.imul(ne,U)|0,z=z+Math.imul(ne,G)|0,W=W+Math.imul(ee,K)|0,R=R+Math.imul(ee,ue)|0,R=R+Math.imul(pe,K)|0,z=z+Math.imul(pe,ue)|0,W=W+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Te)|0,R=R+Math.imul(me,xe)|0,z=z+Math.imul(me,Te)|0;var ht=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ht>>>26)|0,ht&=67108863,W=Math.imul(J,Re),R=Math.imul(J,qe),R=R+Math.imul(ge,Re)|0,z=Math.imul(ge,qe),W=W+Math.imul(bt,He)|0,R=R+Math.imul(bt,Ze)|0,R=R+Math.imul(le,He)|0,z=z+Math.imul(le,Ze)|0,W=W+Math.imul(gt,tt)|0,R=R+Math.imul(gt,mt)|0,R=R+Math.imul(rt,tt)|0,z=z+Math.imul(rt,mt)|0,W=W+Math.imul(Je,St)|0,R=R+Math.imul(Je,lt)|0,R=R+Math.imul(Ge,St)|0,z=z+Math.imul(Ge,lt)|0,W=W+Math.imul(je,Ct)|0,R=R+Math.imul(je,ce)|0,R=R+Math.imul(Ye,Ct)|0,z=z+Math.imul(Ye,ce)|0,W=W+Math.imul(Ue,Q)|0,R=R+Math.imul(Ue,ve)|0,R=R+Math.imul(De,Q)|0,z=z+Math.imul(De,ve)|0,W=W+Math.imul(ke,U)|0,R=R+Math.imul(ke,G)|0,R=R+Math.imul(Ie,U)|0,z=z+Math.imul(Ie,G)|0,W=W+Math.imul(ae,K)|0,R=R+Math.imul(ae,ue)|0,R=R+Math.imul(ne,K)|0,z=z+Math.imul(ne,ue)|0,W=W+Math.imul(ee,xe)|0,R=R+Math.imul(ee,Te)|0,R=R+Math.imul(pe,xe)|0,z=z+Math.imul(pe,Te)|0,W=W+Math.imul(Ce,Fe)|0,R=R+Math.imul(Ce,Ne)|0,R=R+Math.imul(me,Fe)|0,z=z+Math.imul(me,Ne)|0;var it=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(it>>>26)|0,it&=67108863,W=Math.imul(J,He),R=Math.imul(J,Ze),R=R+Math.imul(ge,He)|0,z=Math.imul(ge,Ze),W=W+Math.imul(bt,tt)|0,R=R+Math.imul(bt,mt)|0,R=R+Math.imul(le,tt)|0,z=z+Math.imul(le,mt)|0,W=W+Math.imul(gt,St)|0,R=R+Math.imul(gt,lt)|0,R=R+Math.imul(rt,St)|0,z=z+Math.imul(rt,lt)|0,W=W+Math.imul(Je,Ct)|0,R=R+Math.imul(Je,ce)|0,R=R+Math.imul(Ge,Ct)|0,z=z+Math.imul(Ge,ce)|0,W=W+Math.imul(je,Q)|0,R=R+Math.imul(je,ve)|0,R=R+Math.imul(Ye,Q)|0,z=z+Math.imul(Ye,ve)|0,W=W+Math.imul(Ue,U)|0,R=R+Math.imul(Ue,G)|0,R=R+Math.imul(De,U)|0,z=z+Math.imul(De,G)|0,W=W+Math.imul(ke,K)|0,R=R+Math.imul(ke,ue)|0,R=R+Math.imul(Ie,K)|0,z=z+Math.imul(Ie,ue)|0,W=W+Math.imul(ae,xe)|0,R=R+Math.imul(ae,Te)|0,R=R+Math.imul(ne,xe)|0,z=z+Math.imul(ne,Te)|0,W=W+Math.imul(ee,Fe)|0,R=R+Math.imul(ee,Ne)|0,R=R+Math.imul(pe,Fe)|0,z=z+Math.imul(pe,Ne)|0;var pt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(pt>>>26)|0,pt&=67108863,W=Math.imul(J,tt),R=Math.imul(J,mt),R=R+Math.imul(ge,tt)|0,z=Math.imul(ge,mt),W=W+Math.imul(bt,St)|0,R=R+Math.imul(bt,lt)|0,R=R+Math.imul(le,St)|0,z=z+Math.imul(le,lt)|0,W=W+Math.imul(gt,Ct)|0,R=R+Math.imul(gt,ce)|0,R=R+Math.imul(rt,Ct)|0,z=z+Math.imul(rt,ce)|0,W=W+Math.imul(Je,Q)|0,R=R+Math.imul(Je,ve)|0,R=R+Math.imul(Ge,Q)|0,z=z+Math.imul(Ge,ve)|0,W=W+Math.imul(je,U)|0,R=R+Math.imul(je,G)|0,R=R+Math.imul(Ye,U)|0,z=z+Math.imul(Ye,G)|0,W=W+Math.imul(Ue,K)|0,R=R+Math.imul(Ue,ue)|0,R=R+Math.imul(De,K)|0,z=z+Math.imul(De,ue)|0,W=W+Math.imul(ke,xe)|0,R=R+Math.imul(ke,Te)|0,R=R+Math.imul(Ie,xe)|0,z=z+Math.imul(Ie,Te)|0,W=W+Math.imul(ae,Fe)|0,R=R+Math.imul(ae,Ne)|0,R=R+Math.imul(ne,Fe)|0,z=z+Math.imul(ne,Ne)|0;var at=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(at>>>26)|0,at&=67108863,W=Math.imul(J,St),R=Math.imul(J,lt),R=R+Math.imul(ge,St)|0,z=Math.imul(ge,lt),W=W+Math.imul(bt,Ct)|0,R=R+Math.imul(bt,ce)|0,R=R+Math.imul(le,Ct)|0,z=z+Math.imul(le,ce)|0,W=W+Math.imul(gt,Q)|0,R=R+Math.imul(gt,ve)|0,R=R+Math.imul(rt,Q)|0,z=z+Math.imul(rt,ve)|0,W=W+Math.imul(Je,U)|0,R=R+Math.imul(Je,G)|0,R=R+Math.imul(Ge,U)|0,z=z+Math.imul(Ge,G)|0,W=W+Math.imul(je,K)|0,R=R+Math.imul(je,ue)|0,R=R+Math.imul(Ye,K)|0,z=z+Math.imul(Ye,ue)|0,W=W+Math.imul(Ue,xe)|0,R=R+Math.imul(Ue,Te)|0,R=R+Math.imul(De,xe)|0,z=z+Math.imul(De,Te)|0,W=W+Math.imul(ke,Fe)|0,R=R+Math.imul(ke,Ne)|0,R=R+Math.imul(Ie,Fe)|0,z=z+Math.imul(Ie,Ne)|0;var ct=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ct>>>26)|0,ct&=67108863,W=Math.imul(J,Ct),R=Math.imul(J,ce),R=R+Math.imul(ge,Ct)|0,z=Math.imul(ge,ce),W=W+Math.imul(bt,Q)|0,R=R+Math.imul(bt,ve)|0,R=R+Math.imul(le,Q)|0,z=z+Math.imul(le,ve)|0,W=W+Math.imul(gt,U)|0,R=R+Math.imul(gt,G)|0,R=R+Math.imul(rt,U)|0,z=z+Math.imul(rt,G)|0,W=W+Math.imul(Je,K)|0,R=R+Math.imul(Je,ue)|0,R=R+Math.imul(Ge,K)|0,z=z+Math.imul(Ge,ue)|0,W=W+Math.imul(je,xe)|0,R=R+Math.imul(je,Te)|0,R=R+Math.imul(Ye,xe)|0,z=z+Math.imul(Ye,Te)|0,W=W+Math.imul(Ue,Fe)|0,R=R+Math.imul(Ue,Ne)|0,R=R+Math.imul(De,Fe)|0,z=z+Math.imul(De,Ne)|0;var dt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(dt>>>26)|0,dt&=67108863,W=Math.imul(J,Q),R=Math.imul(J,ve),R=R+Math.imul(ge,Q)|0,z=Math.imul(ge,ve),W=W+Math.imul(bt,U)|0,R=R+Math.imul(bt,G)|0,R=R+Math.imul(le,U)|0,z=z+Math.imul(le,G)|0,W=W+Math.imul(gt,K)|0,R=R+Math.imul(gt,ue)|0,R=R+Math.imul(rt,K)|0,z=z+Math.imul(rt,ue)|0,W=W+Math.imul(Je,xe)|0,R=R+Math.imul(Je,Te)|0,R=R+Math.imul(Ge,xe)|0,z=z+Math.imul(Ge,Te)|0,W=W+Math.imul(je,Fe)|0,R=R+Math.imul(je,Ne)|0,R=R+Math.imul(Ye,Fe)|0,z=z+Math.imul(Ye,Ne)|0;var nt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(nt>>>26)|0,nt&=67108863,W=Math.imul(J,U),R=Math.imul(J,G),R=R+Math.imul(ge,U)|0,z=Math.imul(ge,G),W=W+Math.imul(bt,K)|0,R=R+Math.imul(bt,ue)|0,R=R+Math.imul(le,K)|0,z=z+Math.imul(le,ue)|0,W=W+Math.imul(gt,xe)|0,R=R+Math.imul(gt,Te)|0,R=R+Math.imul(rt,xe)|0,z=z+Math.imul(rt,Te)|0,W=W+Math.imul(Je,Fe)|0,R=R+Math.imul(Je,Ne)|0,R=R+Math.imul(Ge,Fe)|0,z=z+Math.imul(Ge,Ne)|0;var Le=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Le>>>26)|0,Le&=67108863,W=Math.imul(J,K),R=Math.imul(J,ue),R=R+Math.imul(ge,K)|0,z=Math.imul(ge,ue),W=W+Math.imul(bt,xe)|0,R=R+Math.imul(bt,Te)|0,R=R+Math.imul(le,xe)|0,z=z+Math.imul(le,Te)|0,W=W+Math.imul(gt,Fe)|0,R=R+Math.imul(gt,Ne)|0,R=R+Math.imul(rt,Fe)|0,z=z+Math.imul(rt,Ne)|0;var Be=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Be>>>26)|0,Be&=67108863,W=Math.imul(J,xe),R=Math.imul(J,Te),R=R+Math.imul(ge,xe)|0,z=Math.imul(ge,Te),W=W+Math.imul(bt,Fe)|0,R=R+Math.imul(bt,Ne)|0,R=R+Math.imul(le,Fe)|0,z=z+Math.imul(le,Ne)|0;var Ke=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,W=Math.imul(J,Fe),R=Math.imul(J,Ne),R=R+Math.imul(ge,Fe)|0,z=Math.imul(ge,Ne);var We=(D+W|0)+((R&8191)<<13)|0;return D=(z+(R>>>13)|0)+(We>>>26)|0,We&=67108863,j[0]=At,j[1]=ot,j[2]=yt,j[3]=vt,j[4]=xt,j[5]=Ve,j[6]=ft,j[7]=et,j[8]=ht,j[9]=it,j[10]=pt,j[11]=at,j[12]=ct,j[13]=dt,j[14]=nt,j[15]=Le,j[16]=Be,j[17]=Ke,j[18]=We,D!==0&&(j[19]=D,$.length++),$};Math.imul||(N=O);function H(k,y,B){B.negative=y.negative^k.negative,B.length=k.length+y.length;for(var $=0,I=0,F=0;F<B.length-1;F++){var j=I;I=0;for(var D=$&67108863,W=Math.min(F,y.length-1),R=Math.max(0,F-k.length+1);R<=W;R++){var z=F-R,ye=k.words[z]|0,Ce=y.words[R]|0,me=ye*Ce,ie=me&67108863;j=j+(me/67108864|0)|0,ie=ie+D|0,D=ie&67108863,j=j+(ie>>>26)|0,I+=j>>>26,j&=67108863}B.words[F]=D,$=j,j=I}return $!==0?B.words[F]=$:B.length--,B._strip()}function V(k,y,B){return H(k,y,B)}m.prototype.mulTo=function(y,B){var $,I=this.length+y.length;return this.length===10&&y.length===10?$=N(this,y,B):I<63?$=O(this,y,B):I<1024?$=H(this,y,B):$=V(this,y,B),$},m.prototype.mul=function(y){var B=new m(null);return B.words=new Array(this.length+y.length),this.mulTo(y,B)},m.prototype.mulf=function(y){var B=new m(null);return B.words=new Array(this.length+y.length),V(this,y,B)},m.prototype.imul=function(y){return this.clone().mulTo(y,this)},m.prototype.imuln=function(y){var B=y<0;B&&(y=-y),g(typeof y=="number"),g(y<67108864);for(var $=0,I=0;I<this.length;I++){var F=(this.words[I]|0)*y,j=(F&67108863)+($&67108863);$>>=26,$+=F/67108864|0,$+=j>>>26,this.words[I]=j&67108863}return $!==0&&(this.words[I]=$,this.length++),this.length=y===0?1:this.length,B?this.ineg():this},m.prototype.muln=function(y){return this.clone().imuln(y)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(y){var B=L(y);if(B.length===0)return new m(1);for(var $=this,I=0;I<B.length&&B[I]===0;I++,$=$.sqr());if(++I<B.length)for(var F=$.sqr();I<B.length;I++,F=F.sqr())B[I]!==0&&($=$.mul(F));return $},m.prototype.iushln=function(y){g(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=67108863>>>26-B<<26-B,F;if(B!==0){var j=0;for(F=0;F<this.length;F++){var D=this.words[F]&I,W=(this.words[F]|0)-D<<B;this.words[F]=W|j,j=D>>>26-B}j&&(this.words[F]=j,this.length++)}if($!==0){for(F=this.length-1;F>=0;F--)this.words[F+$]=this.words[F];for(F=0;F<$;F++)this.words[F]=0;this.length+=$}return this._strip()},m.prototype.ishln=function(y){return g(this.negative===0),this.iushln(y)},m.prototype.iushrn=function(y,B,$){g(typeof y=="number"&&y>=0);var I;B?I=(B-B%26)/26:I=0;var F=y%26,j=Math.min((y-F)/26,this.length),D=67108863^67108863>>>F<<F,W=$;if(I-=j,I=Math.max(0,I),W){for(var R=0;R<j;R++)W.words[R]=this.words[R];W.length=j}if(j!==0)if(this.length>j)for(this.length-=j,R=0;R<this.length;R++)this.words[R]=this.words[R+j];else this.words[0]=0,this.length=1;var z=0;for(R=this.length-1;R>=0&&(z!==0||R>=I);R--){var ye=this.words[R]|0;this.words[R]=z<<26-F|ye>>>F,z=ye&D}return W&&z!==0&&(W.words[W.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},m.prototype.ishrn=function(y,B,$){return g(this.negative===0),this.iushrn(y,B,$)},m.prototype.shln=function(y){return this.clone().ishln(y)},m.prototype.ushln=function(y){return this.clone().iushln(y)},m.prototype.shrn=function(y){return this.clone().ishrn(y)},m.prototype.ushrn=function(y){return this.clone().iushrn(y)},m.prototype.testn=function(y){g(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return!1;var F=this.words[$];return!!(F&I)},m.prototype.imaskn=function(y){g(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26;if(g(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(B!==0&&$++,this.length=Math.min($,this.length),B!==0){var I=67108863^67108863>>>B<<B;this.words[this.length-1]&=I}return this._strip()},m.prototype.maskn=function(y){return this.clone().imaskn(y)},m.prototype.iaddn=function(y){return g(typeof y=="number"),g(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},m.prototype._iaddn=function(y){this.words[0]+=y;for(var B=0;B<this.length&&this.words[B]>=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},m.prototype.isubn=function(y){if(g(typeof y=="number"),g(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B<this.length&&this.words[B]<0;B++)this.words[B]+=67108864,this.words[B+1]-=1;return this._strip()},m.prototype.addn=function(y){return this.clone().iaddn(y)},m.prototype.subn=function(y){return this.clone().isubn(y)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(y,B,$){var I=y.length+$,F;this._expand(I);var j,D=0;for(F=0;F<y.length;F++){j=(this.words[F+$]|0)+D;var W=(y.words[F]|0)*B;j-=W&67108863,D=(j>>26)-(W/67108864|0),this.words[F+$]=j&67108863}for(;F<this.length-$;F++)j=(this.words[F+$]|0)+D,D=j>>26,this.words[F+$]=j&67108863;if(D===0)return this._strip();for(g(D===-1),D=0,F=0;F<this.length;F++)j=-(this.words[F]|0)+D,D=j>>26,this.words[F]=j&67108863;return this.negative=1,this._strip()},m.prototype._wordDiv=function(y,B){var $=this.length-y.length,I=this.clone(),F=y,j=F.words[F.length-1]|0,D=this._countBits(j);$=26-D,$!==0&&(F=F.ushln($),I.iushln($),j=F.words[F.length-1]|0);var W=I.length-F.length,R;if(B!=="mod"){R=new m(null),R.length=W+1,R.words=new Array(R.length);for(var z=0;z<R.length;z++)R.words[z]=0}var ye=I.clone()._ishlnsubmul(F,1,W);ye.negative===0&&(I=ye,R&&(R.words[W]=1));for(var Ce=W-1;Ce>=0;Ce--){var me=(I.words[F.length+Ce]|0)*67108864+(I.words[F.length+Ce-1]|0);for(me=Math.min(me/j|0,67108863),I._ishlnsubmul(F,me,Ce);I.negative!==0;)me--,I.negative=0,I._ishlnsubmul(F,1,Ce),I.isZero()||(I.negative^=1);R&&(R.words[Ce]=me)}return R&&R._strip(),I._strip(),B!=="div"&&$!==0&&I.iushrn($),{div:R||null,mod:I}},m.prototype.divmod=function(y,B,$){if(g(!y.isZero()),this.isZero())return{div:new m(0),mod:new m(0)};var I,F,j;return this.negative!==0&&y.negative===0?(j=this.neg().divmod(y,B),B!=="mod"&&(I=j.div.neg()),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.iadd(y)),{div:I,mod:F}):this.negative===0&&y.negative!==0?(j=this.divmod(y.neg(),B),B!=="mod"&&(I=j.div.neg()),{div:I,mod:j.mod}):(this.negative&y.negative)!==0?(j=this.neg().divmod(y.neg(),B),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.isub(y)),{div:j.div,mod:F}):y.length>this.length||this.cmp(y)<0?{div:new m(0),mod:this}:y.length===1?B==="div"?{div:this.divn(y.words[0]),mod:null}:B==="mod"?{div:null,mod:new m(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new m(this.modrn(y.words[0]))}:this._wordDiv(y,B)},m.prototype.div=function(y){return this.divmod(y,"div",!1).div},m.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},m.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},m.prototype.divRound=function(y){var B=this.divmod(y);if(B.mod.isZero())return B.div;var $=B.div.negative!==0?B.mod.isub(y):B.mod,I=y.ushrn(1),F=y.andln(1),j=$.cmp(I);return j<0||F===1&&j===0?B.div:B.div.negative!==0?B.div.isubn(1):B.div.iaddn(1)},m.prototype.modrn=function(y){var B=y<0;B&&(y=-y),g(y<=67108863);for(var $=(1<<26)%y,I=0,F=this.length-1;F>=0;F--)I=($*I+(this.words[F]|0))%y;return B?-I:I},m.prototype.modn=function(y){return this.modrn(y)},m.prototype.idivn=function(y){var B=y<0;B&&(y=-y),g(y<=67108863);for(var $=0,I=this.length-1;I>=0;I--){var F=(this.words[I]|0)+$*67108864;this.words[I]=F/y|0,$=F%y}return this._strip(),B?this.ineg():this},m.prototype.divn=function(y){return this.clone().idivn(y)},m.prototype.egcd=function(y){g(y.negative===0),g(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new m(1),F=new m(0),j=new m(0),D=new m(1),W=0;B.isEven()&&$.isEven();)B.iushrn(1),$.iushrn(1),++W;for(var R=$.clone(),z=B.clone();!B.isZero();){for(var ye=0,Ce=1;(B.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(B.iushrn(ye);ye-- >0;)(I.isOdd()||F.isOdd())&&(I.iadd(R),F.isub(z)),I.iushrn(1),F.iushrn(1);for(var me=0,ie=1;($.words[0]&ie)===0&&me<26;++me,ie<<=1);if(me>0)for($.iushrn(me);me-- >0;)(j.isOdd()||D.isOdd())&&(j.iadd(R),D.isub(z)),j.iushrn(1),D.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(j),F.isub(D)):($.isub(B),j.isub(I),D.isub(F))}return{a:j,b:D,gcd:$.iushln(W)}},m.prototype._invmp=function(y){g(y.negative===0),g(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new m(1),F=new m(0),j=$.clone();B.cmpn(1)>0&&$.cmpn(1)>0;){for(var D=0,W=1;(B.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(B.iushrn(D);D-- >0;)I.isOdd()&&I.iadd(j),I.iushrn(1);for(var R=0,z=1;($.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for($.iushrn(R);R-- >0;)F.isOdd()&&F.iadd(j),F.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(F)):($.isub(B),F.isub(I))}var ye;return B.cmpn(1)===0?ye=I:ye=F,ye.cmpn(0)<0&&ye.iadd(y),ye},m.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var B=this.clone(),$=y.clone();B.negative=0,$.negative=0;for(var I=0;B.isEven()&&$.isEven();I++)B.iushrn(1),$.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;$.isEven();)$.iushrn(1);var F=B.cmp($);if(F<0){var j=B;B=$,$=j}else if(F===0||$.cmpn(1)===0)break;B.isub($)}while(!0);return $.iushln(I)},m.prototype.invm=function(y){return this.egcd(y).a.umod(y)},m.prototype.isEven=function(){return(this.words[0]&1)===0},m.prototype.isOdd=function(){return(this.words[0]&1)===1},m.prototype.andln=function(y){return this.words[0]&y},m.prototype.bincn=function(y){g(typeof y=="number");var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return this._expand($+1),this.words[$]|=I,this;for(var F=I,j=$;F!==0&&j<this.length;j++){var D=this.words[j]|0;D+=F,F=D>>>26,D&=67108863,this.words[j]=D}return F!==0&&(this.words[j]=F,this.length++),this},m.prototype.isZero=function(){return this.length===1&&this.words[0]===0},m.prototype.cmpn=function(y){var B=y<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this._strip();var $;if(this.length>1)$=1;else{B&&(y=-y),g(y<=67108863,"Number is too big");var I=this.words[0]|0;$=I===y?0:I<y?-1:1}return this.negative!==0?-$|0:$},m.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var B=this.ucmp(y);return this.negative!==0?-B|0:B},m.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var B=0,$=this.length-1;$>=0;$--){var I=this.words[$]|0,F=y.words[$]|0;if(I!==F){I<F?B=-1:I>F&&(B=1);break}}return B},m.prototype.gtn=function(y){return this.cmpn(y)===1},m.prototype.gt=function(y){return this.cmp(y)===1},m.prototype.gten=function(y){return this.cmpn(y)>=0},m.prototype.gte=function(y){return this.cmp(y)>=0},m.prototype.ltn=function(y){return this.cmpn(y)===-1},m.prototype.lt=function(y){return this.cmp(y)===-1},m.prototype.lten=function(y){return this.cmpn(y)<=0},m.prototype.lte=function(y){return this.cmp(y)<=0},m.prototype.eqn=function(y){return this.cmpn(y)===0},m.prototype.eq=function(y){return this.cmp(y)===0},m.red=function(y){return new te(y)},m.prototype.toRed=function(y){return g(!this.red,"Already a number in reduction context"),g(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},m.prototype.fromRed=function(){return g(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(y){return this.red=y,this},m.prototype.forceRed=function(y){return g(!this.red,"Already a number in reduction context"),this._forceRed(y)},m.prototype.redAdd=function(y){return g(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},m.prototype.redIAdd=function(y){return g(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},m.prototype.redSub=function(y){return g(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},m.prototype.redISub=function(y){return g(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},m.prototype.redShl=function(y){return g(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},m.prototype.redMul=function(y){return g(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},m.prototype.redIMul=function(y){return g(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},m.prototype.redSqr=function(){return g(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return g(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return g(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return g(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return g(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(y){return g(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var X={k256:null,p224:null,p192:null,p25519:null};function oe(k,y){this.name=k,this.p=new m(y,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}oe.prototype._tmp=function(){var y=new m(null);return y.words=new Array(Math.ceil(this.n/13)),y},oe.prototype.ireduce=function(y){var B=y,$;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),$=B.bitLength();while($>this.n);var I=$<this.n?-1:B.ucmp(this.p);return I===0?(B.words[0]=0,B.length=1):I>0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},oe.prototype.split=function(y,B){y.iushrn(this.n,0,B)},oe.prototype.imulK=function(y){return y.imul(this.k)};function se(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(se,oe),se.prototype.split=function(y,B){for(var $=4194303,I=Math.min(y.length,9),F=0;F<I;F++)B.words[F]=y.words[F];if(B.length=I,y.length<=9){y.words[0]=0,y.length=1;return}var j=y.words[9];for(B.words[B.length++]=j&$,F=10;F<y.length;F++){var D=y.words[F]|0;y.words[F-10]=(D&$)<<4|j>>>22,j=D}j>>>=22,y.words[F-10]=j,j===0&&y.length>10?y.length-=10:y.length-=9},se.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var B=0,$=0;$<y.length;$++){var I=y.words[$]|0;B+=I*977,y.words[$]=B&67108863,B=I*64+(B/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function de(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(de,oe);function he(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,oe);function we(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(we,oe),we.prototype.imulK=function(y){for(var B=0,$=0;$<y.length;$++){var I=(y.words[$]|0)*19+B,F=I&67108863;I>>>=26,y.words[$]=F,B=I}return B!==0&&(y.words[y.length++]=B),y},m._prime=function(y){if(X[y])return X[y];var B;if(y==="k256")B=new se;else if(y==="p224")B=new de;else if(y==="p192")B=new he;else if(y==="p25519")B=new we;else throw new Error("Unknown prime "+y);return X[y]=B,B};function te(k){if(typeof k=="string"){var y=m._prime(k);this.m=y.p,this.prime=y}else g(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}te.prototype._verify1=function(y){g(y.negative===0,"red works only with positives"),g(y.red,"red works only with red numbers")},te.prototype._verify2=function(y,B){g((y.negative|B.negative)===0,"red works only with positives"),g(y.red&&y.red===B.red,"red works only with red numbers")},te.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(b(y,y.umod(this.m)._forceRed(this)),y)},te.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},te.prototype.add=function(y,B){this._verify2(y,B);var $=y.add(B);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},te.prototype.iadd=function(y,B){this._verify2(y,B);var $=y.iadd(B);return $.cmp(this.m)>=0&&$.isub(this.m),$},te.prototype.sub=function(y,B){this._verify2(y,B);var $=y.sub(B);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},te.prototype.isub=function(y,B){this._verify2(y,B);var $=y.isub(B);return $.cmpn(0)<0&&$.iadd(this.m),$},te.prototype.shl=function(y,B){return this._verify1(y),this.imod(y.ushln(B))},te.prototype.imul=function(y,B){return this._verify2(y,B),this.imod(y.imul(B))},te.prototype.mul=function(y,B){return this._verify2(y,B),this.imod(y.mul(B))},te.prototype.isqr=function(y){return this.imul(y,y.clone())},te.prototype.sqr=function(y){return this.mul(y,y)},te.prototype.sqrt=function(y){if(y.isZero())return y.clone();var B=this.m.andln(3);if(g(B%2===1),B===3){var $=this.m.add(new m(1)).iushrn(2);return this.pow(y,$)}for(var I=this.m.subn(1),F=0;!I.isZero()&&I.andln(1)===0;)F++,I.iushrn(1);g(!I.isZero());var j=new m(1).toRed(this),D=j.redNeg(),W=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new m(2*R*R).toRed(this);this.pow(R,W).cmp(D)!==0;)R.redIAdd(D);for(var z=this.pow(R,I),ye=this.pow(y,I.addn(1).iushrn(1)),Ce=this.pow(y,I),me=F;Ce.cmp(j)!==0;){for(var ie=Ce,ee=0;ie.cmp(j)!==0;ee++)ie=ie.redSqr();g(ee<me);var pe=this.pow(z,new m(1).iushln(me-ee-1));ye=ye.redMul(pe),z=pe.redSqr(),Ce=Ce.redMul(z),me=ee}return ye},te.prototype.invm=function(y){var B=y._invmp(this.m);return B.negative!==0?(B.negative=0,this.imod(B).redNeg()):this.imod(B)},te.prototype.pow=function(y,B){if(B.isZero())return new m(1).toRed(this);if(B.cmpn(1)===0)return y.clone();var $=4,I=new Array(1<<$);I[0]=new m(1).toRed(this),I[1]=y;for(var F=2;F<I.length;F++)I[F]=this.mul(I[F-1],y);var j=I[0],D=0,W=0,R=B.bitLength()%26;for(R===0&&(R=26),F=B.length-1;F>=0;F--){for(var z=B.words[F],ye=R-1;ye>=0;ye--){var Ce=z>>ye&1;if(j!==I[0]&&(j=this.sqr(j)),Ce===0&&D===0){W=0;continue}D<<=1,D|=Ce,W++,!(W!==$&&(F!==0||ye!==0))&&(j=this.mul(j,I[D]),W=0,D=0)}R=26}return j},te.prototype.convertTo=function(y){var B=y.umod(this.m);return B===y?B.clone():B},te.prototype.convertFrom=function(y){var B=y.clone();return B.red=null,B},m.mont=function(y){return new q(y)};function q(k){te.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new m(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(q,te),q.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},q.prototype.convertFrom=function(y){var B=this.imod(y.mul(this.rinv));return B.red=null,B},q.prototype.imul=function(y,B){if(y.isZero()||B.isZero())return y.words[0]=0,y.length=1,y;var $=y.imul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},q.prototype.mul=function(y,B){if(y.isZero()||B.isZero())return new m(0)._forceRed(this);var $=y.mul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},q.prototype.invm=function(y){var B=this.imod(y._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(r,bn)})(bn$1)),bn$1.exports}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,(function(exports){var indexOf=function(r,f){if(r.indexOf)return r.indexOf(f);for(var d=0;d<r.length;d++)if(r[d]===f)return d;return-1},Object_keys=function(r){if(Object.keys)return Object.keys(r);var f=[];for(var d in r)f.push(d);return f},forEach=function(r,f){if(r.forEach)return r.forEach(f);for(var d=0;d<r.length;d++)f(r[d],d,r)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(r,f,d){Object.defineProperty(r,f,{writable:!0,enumerable:!1,configurable:!0,value:d})}}catch{return function(f,d,g){f[d]=g}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(f){if(!(this instanceof Script))return new Script(f);this.code=f};Script.prototype.runInContext=function(r){if(!(r instanceof Context))throw new TypeError("needs a 'context' argument.");var f=document.createElement("iframe");f.style||(f.style={}),f.style.display="none",document.body.appendChild(f);var d=f.contentWindow,g=d.eval,v=d.execScript;!g&&v&&(v.call(d,"null"),g=d.eval),forEach(Object_keys(r),function(_){d[_]=r[_]}),forEach(globals,function(_){r[_]&&(d[_]=r[_])});var m=Object_keys(d),w=g.call(d,this.code);return forEach(Object_keys(d),function(_){(_ in r||indexOf(m,_)===-1)&&(r[_]=d[_])}),forEach(globals,function(_){_ in r||defineProp(r,_,d[_])}),document.body.removeChild(f),w},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(r){var f=Script.createContext(r),d=this.runInContext(f);return r&&forEach(Object_keys(f),function(g){r[g]=f[g]}),d},forEach(Object_keys(Script.prototype),function(r){exports[r]=Script[r]=function(f){var d=Script(f);return d[r].apply(d,[].slice.call(arguments,1))}}),exports.isContext=function(r){return r instanceof Context},exports.createScript=function(r){return exports.Script(r)},exports.createContext=Script.createContext=function(r){var f=new Context;return typeof r=="object"&&forEach(Object_keys(r),function(d){f[d]=r[d]}),f}})(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,(function(r){var f=requireAsn1$1(),d=requireInherits_browser(),g=r;g.define=function(w,_){return new v(w,_)};function v(m,w){this.name=m,this.body=w,this.decoders={},this.encoders={}}v.prototype._createNamed=function(w){var _;try{_=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
27
+ this._initNamed(entity);
28
+ })`)}catch{_=function(x){this._initNamed(x)}}return d(_,w),_.prototype._initNamed=function(x){w.call(this,x)},new _(this)},v.prototype._getDecoder=function(w){return w=w||"der",this.decoders.hasOwnProperty(w)||(this.decoders[w]=this._createNamed(f.decoders[w])),this.decoders[w]},v.prototype.decode=function(w,_,S){return this._getDecoder(_).decode(w,S)},v.prototype._getEncoder=function(w){return w=w||"der",this.encoders.hasOwnProperty(w)||(this.encoders[w]=this._createNamed(f.encoders[w])),this.encoders[w]},v.prototype.encode=function(w,_,S){return this._getEncoder(_).encode(w,S)}})(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var r=requireInherits_browser();function f(g){this._reporterState={obj:null,path:[],options:g||{},errors:[]}}reporter.Reporter=f,f.prototype.isError=function(v){return v instanceof d},f.prototype.save=function(){var v=this._reporterState;return{obj:v.obj,pathLen:v.path.length}},f.prototype.restore=function(v){var m=this._reporterState;m.obj=v.obj,m.path=m.path.slice(0,v.pathLen)},f.prototype.enterKey=function(v){return this._reporterState.path.push(v)},f.prototype.exitKey=function(v){var m=this._reporterState;m.path=m.path.slice(0,v-1)},f.prototype.leaveKey=function(v,m,w){var _=this._reporterState;this.exitKey(v),_.obj!==null&&(_.obj[m]=w)},f.prototype.path=function(){return this._reporterState.path.join("/")},f.prototype.enterObject=function(){var v=this._reporterState,m=v.obj;return v.obj={},m},f.prototype.leaveObject=function(v){var m=this._reporterState,w=m.obj;return m.obj=v,w},f.prototype.error=function(v){var m,w=this._reporterState,_=v instanceof d;if(_?m=v:m=new d(w.path.map(function(S){return"["+JSON.stringify(S)+"]"}).join(""),v.message||v,v.stack),!w.options.partial)throw m;return _||w.errors.push(m),m},f.prototype.wrapResult=function(v){var m=this._reporterState;return m.options.partial?{result:this.isError(v)?null:v,errors:m.errors}:v};function d(g,v){this.path=g,this.rethrow(v)}return r(d,Error),d.prototype.rethrow=function(v){if(this.message=v+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,d),!this.stack)try{throw new Error(this.message)}catch(m){this.stack=m.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var r=requireInherits_browser(),f=requireBase().Reporter,d=requireDist().Buffer;function g(m,w){if(f.call(this,w),!d.isBuffer(m)){this.error("Input not Buffer");return}this.base=m,this.offset=0,this.length=m.length}r(g,f),buffer.DecoderBuffer=g,g.prototype.save=function(){return{offset:this.offset,reporter:f.prototype.save.call(this)}},g.prototype.restore=function(w){var _=new g(this.base);return _.offset=w.offset,_.length=this.offset,this.offset=w.offset,f.prototype.restore.call(this,w.reporter),_},g.prototype.isEmpty=function(){return this.offset===this.length},g.prototype.readUInt8=function(w){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(w||"DecoderBuffer overrun")},g.prototype.skip=function(w,_){if(!(this.offset+w<=this.length))return this.error(_||"DecoderBuffer overrun");var S=new g(this.base);return S._reporterState=this._reporterState,S.offset=this.offset,S.length=this.offset+w,this.offset+=w,S},g.prototype.raw=function(w){return this.base.slice(w?w.offset:this.offset,this.length)};function v(m,w){if(Array.isArray(m))this.length=0,this.value=m.map(function(_){return _ instanceof v||(_=new v(_,w)),this.length+=_.length,_},this);else if(typeof m=="number"){if(!(0<=m&&m<=255))return w.error("non-byte EncoderBuffer value");this.value=m,this.length=1}else if(typeof m=="string")this.value=m,this.length=d.byteLength(m);else if(d.isBuffer(m))this.value=m,this.length=m.length;else return w.error("Unsupported type: "+typeof m)}return buffer.EncoderBuffer=v,v.prototype.join=function(w,_){return w||(w=new d(this.length)),_||(_=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(S){S.join(w,_),_+=S.length}):(typeof this.value=="number"?w[_]=this.value:typeof this.value=="string"?w.write(this.value,_):d.isBuffer(this.value)&&this.value.copy(w,_),_+=this.length)),w},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var r=requireBase().Reporter,f=requireBase().EncoderBuffer,d=requireBase().DecoderBuffer,g=requireMinimalisticAssert(),v=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],m=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(v),w=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function _(x,b){var C={};this._baseState=C,C.enc=x,C.parent=b||null,C.children=null,C.tag=null,C.args=null,C.reverseArgs=null,C.choice=null,C.optional=!1,C.any=!1,C.obj=!1,C.use=null,C.useDecoder=null,C.key=null,C.default=null,C.explicit=null,C.implicit=null,C.contains=null,C.parent||(C.children=[],this._wrap())}node=_;var S=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return _.prototype.clone=function(){var b=this._baseState,C={};S.forEach(function(M){C[M]=b[M]});var E=new this.constructor(C.parent);return E._baseState=C,E},_.prototype._wrap=function(){var b=this._baseState;m.forEach(function(C){this[C]=function(){var M=new this.constructor(this);return b.children.push(M),M[C].apply(M,arguments)}},this)},_.prototype._init=function(b){var C=this._baseState;g(C.parent===null),b.call(this),C.children=C.children.filter(function(E){return E._baseState.parent===this},this),g.equal(C.children.length,1,"Root node can have only one child")},_.prototype._useArgs=function(b){var C=this._baseState,E=b.filter(function(M){return M instanceof this.constructor},this);b=b.filter(function(M){return!(M instanceof this.constructor)},this),E.length!==0&&(g(C.children===null),C.children=E,E.forEach(function(M){M._baseState.parent=this},this)),b.length!==0&&(g(C.args===null),C.args=b,C.reverseArgs=b.map(function(M){if(typeof M!="object"||M.constructor!==Object)return M;var A={};return Object.keys(M).forEach(function(T){T==(T|0)&&(T|=0);var L=M[T];A[L]=T}),A}))},w.forEach(function(x){_.prototype[x]=function(){var C=this._baseState;throw new Error(x+" not implemented for encoding: "+C.enc)}}),v.forEach(function(x){_.prototype[x]=function(){var C=this._baseState,E=Array.prototype.slice.call(arguments);return g(C.tag===null),C.tag=x,this._useArgs(E),this}}),_.prototype.use=function(b){g(b);var C=this._baseState;return g(C.use===null),C.use=b,this},_.prototype.optional=function(){var b=this._baseState;return b.optional=!0,this},_.prototype.def=function(b){var C=this._baseState;return g(C.default===null),C.default=b,C.optional=!0,this},_.prototype.explicit=function(b){var C=this._baseState;return g(C.explicit===null&&C.implicit===null),C.explicit=b,this},_.prototype.implicit=function(b){var C=this._baseState;return g(C.explicit===null&&C.implicit===null),C.implicit=b,this},_.prototype.obj=function(){var b=this._baseState,C=Array.prototype.slice.call(arguments);return b.obj=!0,C.length!==0&&this._useArgs(C),this},_.prototype.key=function(b){var C=this._baseState;return g(C.key===null),C.key=b,this},_.prototype.any=function(){var b=this._baseState;return b.any=!0,this},_.prototype.choice=function(b){var C=this._baseState;return g(C.choice===null),C.choice=b,this._useArgs(Object.keys(b).map(function(E){return b[E]})),this},_.prototype.contains=function(b){var C=this._baseState;return g(C.use===null),C.contains=b,this},_.prototype._decode=function(b,C){var E=this._baseState;if(E.parent===null)return b.wrapResult(E.children[0]._decode(b,C));var M=E.default,A=!0,T=null;if(E.key!==null&&(T=b.enterKey(E.key)),E.optional){var L=null;if(E.explicit!==null?L=E.explicit:E.implicit!==null?L=E.implicit:E.tag!==null&&(L=E.tag),L===null&&!E.any){var O=b.save();try{E.choice===null?this._decodeGeneric(E.tag,b,C):this._decodeChoice(b,C),A=!0}catch{A=!1}b.restore(O)}else if(A=this._peekTag(b,L,E.any),b.isError(A))return A}var N;if(E.obj&&A&&(N=b.enterObject()),A){if(E.explicit!==null){var H=this._decodeTag(b,E.explicit);if(b.isError(H))return H;b=H}var V=b.offset;if(E.use===null&&E.choice===null){if(E.any)var O=b.save();var X=this._decodeTag(b,E.implicit!==null?E.implicit:E.tag,E.any);if(b.isError(X))return X;E.any?M=b.raw(O):b=X}if(C&&C.track&&E.tag!==null&&C.track(b.path(),V,b.length,"tagged"),C&&C.track&&E.tag!==null&&C.track(b.path(),b.offset,b.length,"content"),E.any?M=M:E.choice===null?M=this._decodeGeneric(E.tag,b,C):M=this._decodeChoice(b,C),b.isError(M))return M;if(!E.any&&E.choice===null&&E.children!==null&&E.children.forEach(function(de){de._decode(b,C)}),E.contains&&(E.tag==="octstr"||E.tag==="bitstr")){var oe=new d(M);M=this._getUse(E.contains,b._reporterState.obj)._decode(oe,C)}}return E.obj&&A&&(M=b.leaveObject(N)),E.key!==null&&(M!==null||A===!0)?b.leaveKey(T,E.key,M):T!==null&&b.exitKey(T),M},_.prototype._decodeGeneric=function(b,C,E){var M=this._baseState;return b==="seq"||b==="set"?null:b==="seqof"||b==="setof"?this._decodeList(C,b,M.args[0],E):/str$/.test(b)?this._decodeStr(C,b,E):b==="objid"&&M.args?this._decodeObjid(C,M.args[0],M.args[1],E):b==="objid"?this._decodeObjid(C,null,null,E):b==="gentime"||b==="utctime"?this._decodeTime(C,b,E):b==="null_"?this._decodeNull(C,E):b==="bool"?this._decodeBool(C,E):b==="objDesc"?this._decodeStr(C,b,E):b==="int"||b==="enum"?this._decodeInt(C,M.args&&M.args[0],E):M.use!==null?this._getUse(M.use,C._reporterState.obj)._decode(C,E):C.error("unknown tag: "+b)},_.prototype._getUse=function(b,C){var E=this._baseState;return E.useDecoder=this._use(b,C),g(E.useDecoder._baseState.parent===null),E.useDecoder=E.useDecoder._baseState.children[0],E.implicit!==E.useDecoder._baseState.implicit&&(E.useDecoder=E.useDecoder.clone(),E.useDecoder._baseState.implicit=E.implicit),E.useDecoder},_.prototype._decodeChoice=function(b,C){var E=this._baseState,M=null,A=!1;return Object.keys(E.choice).some(function(T){var L=b.save(),O=E.choice[T];try{var N=O._decode(b,C);if(b.isError(N))return!1;M={type:T,value:N},A=!0}catch{return b.restore(L),!1}return!0},this),A?M:b.error("Choice not matched")},_.prototype._createEncoderBuffer=function(b){return new f(b,this.reporter)},_.prototype._encode=function(b,C,E){var M=this._baseState;if(!(M.default!==null&&M.default===b)){var A=this._encodeValue(b,C,E);if(A!==void 0&&!this._skipDefault(A,C,E))return A}},_.prototype._encodeValue=function(b,C,E){var M=this._baseState;if(M.parent===null)return M.children[0]._encode(b,C||new r);var O=null;if(this.reporter=C,M.optional&&b===void 0)if(M.default!==null)b=M.default;else return;var A=null,T=!1;if(M.any)O=this._createEncoderBuffer(b);else if(M.choice)O=this._encodeChoice(b,C);else if(M.contains)A=this._getUse(M.contains,E)._encode(b,C),T=!0;else if(M.children)A=M.children.map(function(V){if(V._baseState.tag==="null_")return V._encode(null,C,b);if(V._baseState.key===null)return C.error("Child should have a key");var X=C.enterKey(V._baseState.key);if(typeof b!="object")return C.error("Child expected, but input is not object");var oe=V._encode(b[V._baseState.key],C,b);return C.leaveKey(X),oe},this).filter(function(V){return V}),A=this._createEncoderBuffer(A);else if(M.tag==="seqof"||M.tag==="setof"){if(!(M.args&&M.args.length===1))return C.error("Too many args for : "+M.tag);if(!Array.isArray(b))return C.error("seqof/setof, but data is not Array");var L=this.clone();L._baseState.implicit=null,A=this._createEncoderBuffer(b.map(function(V){var X=this._baseState;return this._getUse(X.args[0],b)._encode(V,C)},L))}else M.use!==null?O=this._getUse(M.use,E)._encode(b,C):(A=this._encodePrimitive(M.tag,b),T=!0);var O;if(!M.any&&M.choice===null){var N=M.implicit!==null?M.implicit:M.tag,H=M.implicit===null?"universal":"context";N===null?M.use===null&&C.error("Tag could be omitted only for .use()"):M.use===null&&(O=this._encodeComposite(N,T,H,A))}return M.explicit!==null&&(O=this._encodeComposite(M.explicit,!1,"context",O)),O},_.prototype._encodeChoice=function(b,C){var E=this._baseState,M=E.choice[b.type];return M||g(!1,b.type+" not found in "+JSON.stringify(Object.keys(E.choice))),M._encode(b.value,C)},_.prototype._encodePrimitive=function(b,C){var E=this._baseState;if(/str$/.test(b))return this._encodeStr(C,b);if(b==="objid"&&E.args)return this._encodeObjid(C,E.reverseArgs[0],E.args[1]);if(b==="objid")return this._encodeObjid(C,null,null);if(b==="gentime"||b==="utctime")return this._encodeTime(C,b);if(b==="null_")return this._encodeNull();if(b==="int"||b==="enum")return this._encodeInt(C,E.args&&E.reverseArgs[0]);if(b==="bool")return this._encodeBool(C);if(b==="objDesc")return this._encodeStr(C,b);throw new Error("Unsupported tag: "+b)},_.prototype._isNumstr=function(b){return/^[0-9 ]*$/.test(b)},_.prototype._isPrintstr=function(b){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(b)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(function(r){var f=r;f.Reporter=requireReporter().Reporter,f.DecoderBuffer=requireBuffer().DecoderBuffer,f.EncoderBuffer=requireBuffer().EncoderBuffer,f.Node=requireNode()})(base)),base}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,(function(r){var f=requireConstants();r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=f._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=f._reverse(r.tag)})(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(function(r){var f=r;f._reverse=function(g){var v={};return Object.keys(g).forEach(function(m){(m|0)==m&&(m=m|0);var w=g[m];v[w]=m}),v},f.der=requireDer$2()})(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var r=requireInherits_browser(),f=requireAsn1$1(),d=f.base,g=f.bignum,v=f.constants.der;function m(x){this.enc="der",this.name=x.name,this.entity=x,this.tree=new w,this.tree._init(x.body)}der_1$1=m,m.prototype.decode=function(b,C){return b instanceof d.DecoderBuffer||(b=new d.DecoderBuffer(b,C)),this.tree._decode(b,C)};function w(x){d.Node.call(this,"der",x)}r(w,d.Node),w.prototype._peekTag=function(b,C,E){if(b.isEmpty())return!1;var M=b.save(),A=_(b,'Failed to peek tag: "'+C+'"');return b.isError(A)?A:(b.restore(M),A.tag===C||A.tagStr===C||A.tagStr+"of"===C||E)},w.prototype._decodeTag=function(b,C,E){var M=_(b,'Failed to decode tag of "'+C+'"');if(b.isError(M))return M;var A=S(b,M.primitive,'Failed to get length of "'+C+'"');if(b.isError(A))return A;if(!E&&M.tag!==C&&M.tagStr!==C&&M.tagStr+"of"!==C)return b.error('Failed to match tag: "'+C+'"');if(M.primitive||A!==null)return b.skip(A,'Failed to match body of: "'+C+'"');var T=b.save(),L=this._skipUntilEnd(b,'Failed to skip indefinite length body: "'+this.tag+'"');return b.isError(L)?L:(A=b.offset-T.offset,b.restore(T),b.skip(A,'Failed to match body of: "'+C+'"'))},w.prototype._skipUntilEnd=function(b,C){for(;;){var E=_(b,C);if(b.isError(E))return E;var M=S(b,E.primitive,C);if(b.isError(M))return M;var A;if(E.primitive||M!==null?A=b.skip(M):A=this._skipUntilEnd(b,C),b.isError(A))return A;if(E.tagStr==="end")break}},w.prototype._decodeList=function(b,C,E,M){for(var A=[];!b.isEmpty();){var T=this._peekTag(b,"end");if(b.isError(T))return T;var L=E.decode(b,"der",M);if(b.isError(L)&&T)break;A.push(L)}return A},w.prototype._decodeStr=function(b,C){if(C==="bitstr"){var E=b.readUInt8();return b.isError(E)?E:{unused:E,data:b.raw()}}else if(C==="bmpstr"){var M=b.raw();if(M.length%2===1)return b.error("Decoding of string type: bmpstr length mismatch");for(var A="",T=0;T<M.length/2;T++)A+=String.fromCharCode(M.readUInt16BE(T*2));return A}else if(C==="numstr"){var L=b.raw().toString("ascii");return this._isNumstr(L)?L:b.error("Decoding of string type: numstr unsupported characters")}else{if(C==="octstr")return b.raw();if(C==="objDesc")return b.raw();if(C==="printstr"){var O=b.raw().toString("ascii");return this._isPrintstr(O)?O:b.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(C)?b.raw().toString():b.error("Decoding of string type: "+C+" unsupported")}},w.prototype._decodeObjid=function(b,C,E){for(var M,A=[],T=0;!b.isEmpty();){var L=b.readUInt8();T<<=7,T|=L&127,(L&128)===0&&(A.push(T),T=0)}L&128&&A.push(T);var O=A[0]/40|0,N=A[0]%40;if(E?M=A:M=[O,N].concat(A.slice(1)),C){var H=C[M.join(" ")];H===void 0&&(H=C[M.join(".")]),H!==void 0&&(M=H)}return M},w.prototype._decodeTime=function(b,C){var E=b.raw().toString();if(C==="gentime")var M=E.slice(0,4)|0,A=E.slice(4,6)|0,T=E.slice(6,8)|0,L=E.slice(8,10)|0,O=E.slice(10,12)|0,N=E.slice(12,14)|0;else if(C==="utctime"){var M=E.slice(0,2)|0,A=E.slice(2,4)|0,T=E.slice(4,6)|0,L=E.slice(6,8)|0,O=E.slice(8,10)|0,N=E.slice(10,12)|0;M<70?M=2e3+M:M=1900+M}else return b.error("Decoding "+C+" time is not supported yet");return Date.UTC(M,A-1,T,L,O,N,0)},w.prototype._decodeNull=function(b){return null},w.prototype._decodeBool=function(b){var C=b.readUInt8();return b.isError(C)?C:C!==0},w.prototype._decodeInt=function(b,C){var E=b.raw(),M=new g(E);return C&&(M=C[M.toString(10)]||M),M},w.prototype._use=function(b,C){return typeof b=="function"&&(b=b(C)),b._getDecoder("der").tree};function _(x,b){var C=x.readUInt8(b);if(x.isError(C))return C;var E=v.tagClass[C>>6],M=(C&32)===0;if((C&31)===31){var A=C;for(C=0;(A&128)===128;){if(A=x.readUInt8(b),x.isError(A))return A;C<<=7,C|=A&127}}else C&=31;var T=v.tag[C];return{cls:E,primitive:M,tag:C,tagStr:T}}function S(x,b,C){var E=x.readUInt8(C);if(x.isError(E))return E;if(!b&&E===128)return null;if((E&128)===0)return E;var M=E&127;if(M>4)return x.error("length octect is too long");E=0;for(var A=0;A<M;A++){E<<=8;var T=x.readUInt8(C);if(x.isError(T))return T;E|=T}return E}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var r=requireInherits_browser(),f=requireDist().Buffer,d=requireDer$1();function g(v){d.call(this,v),this.enc="pem"}return r(g,d),pem$1=g,g.prototype.decode=function(m,w){for(var _=m.toString().split(/[\r\n]+/g),S=w.label.toUpperCase(),x=/^-----(BEGIN|END) ([^-]+)-----$/,b=-1,C=-1,E=0;E<_.length;E++){var M=_[E].match(x);if(M!==null&&M[2]===S)if(b===-1){if(M[1]!=="BEGIN")break;b=E}else{if(M[1]!=="END")break;C=E;break}}if(b===-1||C===-1)throw new Error("PEM section not found for: "+S);var A=_.slice(b+1,C).join("");A.replace(/[^a-z0-9\+\/=]+/gi,"");var T=new f(A,"base64");return d.prototype.decode.call(this,T,w)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(function(r){var f=r;f.der=requireDer$1(),f.pem=requirePem$1()})(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var r=requireInherits_browser(),f=requireDist().Buffer,d=requireAsn1$1(),g=d.base,v=d.constants.der;function m(x){this.enc="der",this.name=x.name,this.entity=x,this.tree=new w,this.tree._init(x.body)}der_1=m,m.prototype.encode=function(b,C){return this.tree._encode(b,C).join()};function w(x){g.Node.call(this,"der",x)}r(w,g.Node),w.prototype._encodeComposite=function(b,C,E,M){var A=S(b,C,E,this.reporter);if(M.length<128){var O=new f(2);return O[0]=A,O[1]=M.length,this._createEncoderBuffer([O,M])}for(var T=1,L=M.length;L>=256;L>>=8)T++;var O=new f(2+T);O[0]=A,O[1]=128|T;for(var L=1+T,N=M.length;N>0;L--,N>>=8)O[L]=N&255;return this._createEncoderBuffer([O,M])},w.prototype._encodeStr=function(b,C){if(C==="bitstr")return this._createEncoderBuffer([b.unused|0,b.data]);if(C==="bmpstr"){for(var E=new f(b.length*2),M=0;M<b.length;M++)E.writeUInt16BE(b.charCodeAt(M),M*2);return this._createEncoderBuffer(E)}else return C==="numstr"?this._isNumstr(b)?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: numstr supports only digits and space"):C==="printstr"?this._isPrintstr(b)?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(C)?this._createEncoderBuffer(b):C==="objDesc"?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: "+C+" unsupported")},w.prototype._encodeObjid=function(b,C,E){if(typeof b=="string"){if(!C)return this.reporter.error("string objid given, but no values map found");if(!C.hasOwnProperty(b))return this.reporter.error("objid not found in values map");b=C[b].split(/[\s\.]+/g);for(var M=0;M<b.length;M++)b[M]|=0}else if(Array.isArray(b)){b=b.slice();for(var M=0;M<b.length;M++)b[M]|=0}if(!Array.isArray(b))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(b));if(!E){if(b[1]>=40)return this.reporter.error("Second objid identifier OOB");b.splice(0,2,b[0]*40+b[1])}for(var A=0,M=0;M<b.length;M++){var T=b[M];for(A++;T>=128;T>>=7)A++}for(var L=new f(A),O=L.length-1,M=b.length-1;M>=0;M--){var T=b[M];for(L[O--]=T&127;(T>>=7)>0;)L[O--]=128|T&127}return this._createEncoderBuffer(L)};function _(x){return x<10?"0"+x:x}w.prototype._encodeTime=function(b,C){var E,M=new Date(b);return C==="gentime"?E=[_(M.getFullYear()),_(M.getUTCMonth()+1),_(M.getUTCDate()),_(M.getUTCHours()),_(M.getUTCMinutes()),_(M.getUTCSeconds()),"Z"].join(""):C==="utctime"?E=[_(M.getFullYear()%100),_(M.getUTCMonth()+1),_(M.getUTCDate()),_(M.getUTCHours()),_(M.getUTCMinutes()),_(M.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+C+" time is not supported yet"),this._encodeStr(E,"octstr")},w.prototype._encodeNull=function(){return this._createEncoderBuffer("")},w.prototype._encodeInt=function(b,C){if(typeof b=="string"){if(!C)return this.reporter.error("String int or enum given, but no values map");if(!C.hasOwnProperty(b))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(b));b=C[b]}if(typeof b!="number"&&!f.isBuffer(b)){var E=b.toArray();!b.sign&&E[0]&128&&E.unshift(0),b=new f(E)}if(f.isBuffer(b)){var M=b.length;b.length===0&&M++;var T=new f(M);return b.copy(T),b.length===0&&(T[0]=0),this._createEncoderBuffer(T)}if(b<128)return this._createEncoderBuffer(b);if(b<256)return this._createEncoderBuffer([0,b]);for(var M=1,A=b;A>=256;A>>=8)M++;for(var T=new Array(M),A=T.length-1;A>=0;A--)T[A]=b&255,b>>=8;return T[0]&128&&T.unshift(0),this._createEncoderBuffer(new f(T))},w.prototype._encodeBool=function(b){return this._createEncoderBuffer(b?255:0)},w.prototype._use=function(b,C){return typeof b=="function"&&(b=b(C)),b._getEncoder("der").tree},w.prototype._skipDefault=function(b,C,E){var M=this._baseState,A;if(M.default===null)return!1;var T=b.join();if(M.defaultBuffer===void 0&&(M.defaultBuffer=this._encodeValue(M.default,C,E).join()),T.length!==M.defaultBuffer.length)return!1;for(A=0;A<T.length;A++)if(T[A]!==M.defaultBuffer[A])return!1;return!0};function S(x,b,C,E){var M;if(x==="seqof"?x="seq":x==="setof"&&(x="set"),v.tagByName.hasOwnProperty(x))M=v.tagByName[x];else if(typeof x=="number"&&(x|0)===x)M=x;else return E.error("Unknown tag: "+x);return M>=31?E.error("Multi-octet tag encoding unsupported"):(b||(M|=32),M|=v.tagClassByName[C||"universal"]<<6,M)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var r=requireInherits_browser(),f=requireDer();function d(g){f.call(this,g),this.enc="pem"}return r(d,f),pem=d,d.prototype.encode=function(v,m){for(var w=f.prototype.encode.call(this,v),_=w.toString("base64"),S=["-----BEGIN "+m.label+"-----"],x=0;x<_.length;x+=64)S.push(_.slice(x,x+64));return S.push("-----END "+m.label+"-----"),S.join(`
29
+ `)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,(function(r){var f=r;f.der=requireDer(),f.pem=requirePem()})(encoders)),encoders}var hasRequiredAsn1$1;function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,(function(r){var f=r;f.bignum=requireBn$2(),f.define=requireApi().define,f.base=requireBase(),f.constants=requireConstants(),f.decoders=requireDecoders(),f.encoders=requireEncoders()})(asn1)),asn1}var certificate,hasRequiredCertificate;function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var r=requireAsn1$1(),f=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),d=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),g=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),v=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(g),this.key("subjectPublicKey").bitstr())}),m=r.define("RelativeDistinguishedName",function(){this.setof(d)}),w=r.define("RDNSequence",function(){this.seqof(m)}),_=r.define("Name",function(){this.choice({rdnSequence:this.use(w)})}),S=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(f),this.key("notAfter").use(f))}),x=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),b=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(g),this.key("issuer").use(_),this.key("validity").use(S),this.key("subject").use(_),this.key("subjectPublicKeyInfo").use(v),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(x).optional())}),C=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(b),this.key("signatureAlgorithm").use(g),this.key("signatureValue").bitstr())});return certificate=C,certificate}var hasRequiredAsn1;function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var r=requireAsn1$1();asn1$1.certificate=requireCertificate();var f=r.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});asn1$1.RSAPrivateKey=f;var d=r.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$1.RSAPublicKey=d;var g=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),v=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(g),this.key("subjectPublicKey").bitstr())});asn1$1.PublicKey=v;var m=r.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(g),this.key("subjectPrivateKey").octstr())});asn1$1.PrivateKey=m;var w=r.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});asn1$1.EncryptedPrivateKey=w;var _=r.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});asn1$1.DSAPrivateKey=_,asn1$1.DSAparam=r.define("DSAparam",function(){this.int()});var S=r.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),x=r.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(S),this.key("publicKey").optional().explicit(1).bitstr())});return asn1$1.ECPrivateKey=x,asn1$1.signature=r.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),asn1$1}const require$$1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var fixProc,hasRequiredFixProc;function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,g=requireEvp_bytestokey(),v=requireBrowser$6(),m=requireSafeBuffer$1().Buffer;return fixProc=function(w,_){var S=w.toString(),x=S.match(r),b;if(x){var E="aes"+x[1],M=m.from(x[2],"hex"),A=m.from(x[3].replace(/[\r\n]/g,""),"base64"),T=g(_,M.slice(0,8),parseInt(x[1],10)).key,L=[],O=v.createDecipheriv(E,T,M);L.push(O.update(A)),L.push(O.final()),b=m.concat(L)}else{var C=S.match(d);b=m.from(C[2].replace(/[\r\n]/g,""),"base64")}var N=S.match(f)[1];return{tag:N,data:b}},fixProc}var parseAsn1,hasRequiredParseAsn1;function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var r=requireAsn1(),f=require$$1,d=requireFixProc(),g=requireBrowser$6(),v=requireBrowser$7(),m=requireSafeBuffer$1().Buffer;function w(S,x){var b=S.algorithm.decrypt.kde.kdeparams.salt,C=parseInt(S.algorithm.decrypt.kde.kdeparams.iters.toString(),10),E=f[S.algorithm.decrypt.cipher.algo.join(".")],M=S.algorithm.decrypt.cipher.iv,A=S.subjectPrivateKey,T=parseInt(E.split("-")[1],10)/8,L=v.pbkdf2Sync(x,b,C,T,"sha1"),O=g.createDecipheriv(E,L,M),N=[];return N.push(O.update(A)),N.push(O.final()),m.concat(N)}function _(S){var x;typeof S=="object"&&!m.isBuffer(S)&&(x=S.passphrase,S=S.key),typeof S=="string"&&(S=m.from(S));var b=d(S,x),C=b.tag,E=b.data,M,A;switch(C){case"CERTIFICATE":A=r.certificate.decode(E,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(A||(A=r.PublicKey.decode(E,"der")),M=A.algorithm.algorithm.join("."),M){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(A.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return A.subjectPrivateKey=A.subjectPublicKey,{type:"ec",data:A};case"1.2.840.10040.4.1":return A.algorithm.params.pub_key=r.DSAparam.decode(A.subjectPublicKey.data,"der"),{type:"dsa",data:A.algorithm.params};default:throw new Error("unknown key id "+M)}case"ENCRYPTED PRIVATE KEY":E=r.EncryptedPrivateKey.decode(E,"der"),E=w(E,x);case"PRIVATE KEY":switch(A=r.PrivateKey.decode(E,"der"),M=A.algorithm.algorithm.join("."),M){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(A.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:A.algorithm.curve,privateKey:r.ECPrivateKey.decode(A.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return A.algorithm.params.priv_key=r.DSAparam.decode(A.subjectPrivateKey,"der"),{type:"dsa",params:A.algorithm.params};default:throw new Error("unknown key id "+M)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(E,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(E,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(E,"der")};case"EC PRIVATE KEY":return E=r.ECPrivateKey.decode(E,"der"),{curve:E.parameters.value,privateKey:E.privateKey};default:throw new Error("unknown key type "+C)}}return _.signature=r.signature,parseAsn1=_,parseAsn1}const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var r=requireSafeBuffer$1().Buffer,f=requireBrowser$8(),d=requireBrowserifyRsa(),g=requireElliptic().ec,v=requireBn(),m=requireParseAsn1(),w=require$$4,_=1;function S(O,N,H,V,X){var oe=m(N);if(oe.curve){if(V!=="ecdsa"&&V!=="ecdsa/rsa")throw new Error("wrong private key type");return x(O,oe)}else if(oe.type==="dsa"){if(V!=="dsa")throw new Error("wrong private key type");return b(O,oe,H)}if(V!=="rsa"&&V!=="ecdsa/rsa")throw new Error("wrong private key type");if(N.padding!==void 0&&N.padding!==_)throw new Error("illegal or unsupported padding mode");O=r.concat([X,O]);for(var se=oe.modulus.byteLength(),de=[0,1];O.length+de.length+1<se;)de.push(255);de.push(0);for(var he=-1;++he<O.length;)de.push(O[he]);var we=d(de,oe);return we}function x(O,N){var H=w[N.curve.join(".")];if(!H)throw new Error("unknown curve "+N.curve.join("."));var V=new g(H),X=V.keyFromPrivate(N.privateKey),oe=X.sign(O);return r.from(oe.toDER())}function b(O,N,H){for(var V=N.params.priv_key,X=N.params.p,oe=N.params.q,se=N.params.g,de=new v(0),he,we=M(O,oe).mod(oe),te=!1,q=E(V,oe,O,H);te===!1;)he=T(oe,q,H),de=L(se,he,X,oe),te=he.invm(oe).imul(we.add(V.mul(de))).mod(oe),te.cmpn(0)===0&&(te=!1,de=new v(0));return C(de,te)}function C(O,N){O=O.toArray(),N=N.toArray(),O[0]&128&&(O=[0].concat(O)),N[0]&128&&(N=[0].concat(N));var H=O.length+N.length+4,V=[48,H,2,O.length];return V=V.concat(O,[2,N.length],N),r.from(V)}function E(O,N,H,V){if(O=r.from(O.toArray()),O.length<N.byteLength()){var X=r.alloc(N.byteLength()-O.length);O=r.concat([X,O])}var oe=H.length,se=A(H,N),de=r.alloc(oe);de.fill(1);var he=r.alloc(oe);return he=f(V,he).update(de).update(r.from([0])).update(O).update(se).digest(),de=f(V,he).update(de).digest(),he=f(V,he).update(de).update(r.from([1])).update(O).update(se).digest(),de=f(V,he).update(de).digest(),{k:he,v:de}}function M(O,N){var H=new v(O),V=(O.length<<3)-N.bitLength();return V>0&&H.ishrn(V),H}function A(O,N){O=M(O,N),O=O.mod(N);var H=r.from(O.toArray());if(H.length<N.byteLength()){var V=r.alloc(N.byteLength()-H.length);H=r.concat([V,H])}return H}function T(O,N,H){var V,X;do{for(V=r.alloc(0);V.length*8<O.bitLength();)N.v=f(H,N.k).update(N.v).digest(),V=r.concat([V,N.v]);X=M(V,O),N.k=f(H,N.k).update(N.v).update(r.from([0])).digest(),N.v=f(H,N.k).update(N.v).digest()}while(X.cmp(O)!==-1);return X}function L(O,N,H,V){return O.toRed(v.mont(H)).redPow(N).fromRed().mod(V)}return sign.exports=S,sign.exports.getKey=E,sign.exports.makeKey=T,sign.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var r=requireSafeBuffer$1().Buffer,f=requireBn(),d=requireElliptic().ec,g=requireParseAsn1(),v=require$$4;function m(x,b,C,E,M){var A=g(C);if(A.type==="ec"){if(E!=="ecdsa"&&E!=="ecdsa/rsa")throw new Error("wrong public key type");return w(x,b,A)}else if(A.type==="dsa"){if(E!=="dsa")throw new Error("wrong public key type");return _(x,b,A)}if(E!=="rsa"&&E!=="ecdsa/rsa")throw new Error("wrong public key type");b=r.concat([M,b]);for(var T=A.modulus.byteLength(),L=[1],O=0;b.length+L.length+2<T;)L.push(255),O+=1;L.push(0);for(var N=-1;++N<b.length;)L.push(b[N]);L=r.from(L);var H=f.mont(A.modulus);x=new f(x).toRed(H),x=x.redPow(new f(A.publicExponent)),x=r.from(x.fromRed().toArray());var V=O<8?1:0;for(T=Math.min(x.length,L.length),x.length!==L.length&&(V=1),N=-1;++N<T;)V|=x[N]^L[N];return V===0}function w(x,b,C){var E=v[C.data.algorithm.curve.join(".")];if(!E)throw new Error("unknown curve "+C.data.algorithm.curve.join("."));var M=new d(E),A=C.data.subjectPrivateKey.data;return M.verify(b,x,A)}function _(x,b,C){var E=C.data.p,M=C.data.q,A=C.data.g,T=C.data.pub_key,L=g.signature.decode(x,"der"),O=L.s,N=L.r;S(O,M),S(N,M);var H=f.mont(E),V=O.invm(M),X=A.toRed(H).redPow(new f(b).mul(V).mod(M)).fromRed().mul(T.toRed(H).redPow(N.mul(V).mod(M)).fromRed()).mod(E).mod(M);return X.cmp(N)===0}function S(x,b){if(x.cmpn(0)<=0)throw new Error("invalid sig");if(x.cmp(b)>=0)throw new Error("invalid sig")}return verify_1=m,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var r=requireSafeBuffer$1().Buffer,f=requireBrowser$9(),d=requireReadableBrowser(),g=requireInherits_browser(),v=requireSign(),m=requireVerify(),w=require$$6;Object.keys(w).forEach(function(C){w[C].id=r.from(w[C].id,"hex"),w[C.toLowerCase()]=w[C]});function _(C){d.Writable.call(this);var E=w[C];if(!E)throw new Error("Unknown message digest");this._hashType=E.hash,this._hash=f(E.hash),this._tag=E.id,this._signType=E.sign}g(_,d.Writable),_.prototype._write=function(E,M,A){this._hash.update(E),A()},_.prototype.update=function(E,M){return this._hash.update(typeof E=="string"?r.from(E,M):E),this},_.prototype.sign=function(E,M){this.end();var A=this._hash.digest(),T=v(A,E,this._hashType,this._signType,this._tag);return M?T.toString(M):T};function S(C){d.Writable.call(this);var E=w[C];if(!E)throw new Error("Unknown message digest");this._hash=f(E.hash),this._tag=E.id,this._signType=E.sign}g(S,d.Writable),S.prototype._write=function(E,M,A){this._hash.update(E),A()},S.prototype.update=function(E,M){return this._hash.update(typeof E=="string"?r.from(E,M):E),this},S.prototype.verify=function(E,M,A){var T=typeof M=="string"?r.from(M,A):M;this.end();var L=this._hash.digest();return m(T,L,E,this._signType,this._tag)};function x(C){return new _(C)}function b(C){return new S(C)}return browser$3={Sign:x,Verify:b,createSign:x,createVerify:b},browser$3}var browser$2,hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$2;hasRequiredBrowser$2=1;var r=requireElliptic(),f=requireBn$2();browser$2=function(w){return new g(w)};var d={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};d.p224=d.secp224r1,d.p256=d.secp256r1=d.prime256v1,d.p192=d.secp192r1=d.prime192v1,d.p384=d.secp384r1,d.p521=d.secp521r1;function g(m){this.curveType=d[m],this.curveType||(this.curveType={name:m}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}g.prototype.generateKeys=function(m,w){return this.keys=this.curve.genKeyPair(),this.getPublicKey(m,w)},g.prototype.computeSecret=function(m,w,_){w=w||"utf8",Buffer.isBuffer(m)||(m=new Buffer(m,w));var S=this.curve.keyFromPublic(m).getPublic(),x=S.mul(this.keys.getPrivate()).getX();return v(x,_,this.curveType.byteLength)},g.prototype.getPublicKey=function(m,w){var _=this.keys.getPublic(w==="compressed",!0);return w==="hybrid"&&(_[_.length-1]%2?_[0]=7:_[0]=6),v(_,m)},g.prototype.getPrivateKey=function(m){return v(this.keys.getPrivate(),m)},g.prototype.setPublicKey=function(m,w){return w=w||"utf8",Buffer.isBuffer(m)||(m=new Buffer(m,w)),this.keys._importPublic(m),this},g.prototype.setPrivateKey=function(m,w){w=w||"utf8",Buffer.isBuffer(m)||(m=new Buffer(m,w));var _=new f(m);return _=_.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(_),this};function v(m,w,_){Array.isArray(m)||(m=m.toArray());var S=new Buffer(m);if(_&&S.length<_){var x=new Buffer(_-S.length);x.fill(0),S=Buffer.concat([x,S])}return w?S.toString(w):S}return browser$2}var browser$1={},mgf,hasRequiredMgf;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var r=requireBrowser$9(),f=requireSafeBuffer$1().Buffer;mgf=function(g,v){for(var m=f.alloc(0),w=0,_;m.length<v;)_=d(w++),m=f.concat([m,r("sha1").update(g).update(_).digest()]);return m.slice(0,v)};function d(g){var v=f.allocUnsafe(4);return v.writeUInt32BE(g,0),v}return mgf}var xor,hasRequiredXor;function requireXor(){return hasRequiredXor||(hasRequiredXor=1,xor=function(f,d){for(var g=f.length,v=-1;++v<g;)f[v]^=d[v];return f}),xor}var withPublic_1,hasRequiredWithPublic;function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var r=requireBn$2(),f=requireSafeBuffer$1().Buffer;function d(g,v){return f.from(g.toRed(r.mont(v.modulus)).redPow(new r(v.publicExponent)).fromRed().toArray())}return withPublic_1=d,withPublic_1}var publicEncrypt,hasRequiredPublicEncrypt;function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var r=requireParseAsn1(),f=requireBrowser$b(),d=requireBrowser$9(),g=requireMgf(),v=requireXor(),m=requireBn$2(),w=requireWithPublic(),_=requireBrowserifyRsa(),S=requireSafeBuffer$1().Buffer;publicEncrypt=function(M,A,T){var L;M.padding?L=M.padding:T?L=1:L=4;var O=r(M),N;if(L===4)N=x(O,A);else if(L===1)N=b(O,A,T);else if(L===3){if(N=new m(A),N.cmp(O.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return T?_(N,O):w(N,O)};function x(E,M){var A=E.modulus.byteLength(),T=M.length,L=d("sha1").update(S.alloc(0)).digest(),O=L.length,N=2*O;if(T>A-N-2)throw new Error("message too long");var H=S.alloc(A-T-N-2),V=A-O-1,X=f(O),oe=v(S.concat([L,H,S.alloc(1,1),M],V),g(X,V)),se=v(X,g(oe,O));return new m(S.concat([S.alloc(1),se,oe],A))}function b(E,M,A){var T=M.length,L=E.modulus.byteLength();if(T>L-11)throw new Error("message too long");var O;return A?O=S.alloc(L-T-3,255):O=C(L-T-3),new m(S.concat([S.from([0,A?1:2]),O,S.alloc(1),M],L))}function C(E){for(var M=S.allocUnsafe(E),A=0,T=f(E*2),L=0,O;A<E;)L===T.length&&(T=f(E*2),L=0),O=T[L++],O&&(M[A++]=O);return M}return publicEncrypt}var privateDecrypt,hasRequiredPrivateDecrypt;function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var r=requireParseAsn1(),f=requireMgf(),d=requireXor(),g=requireBn$2(),v=requireBrowserifyRsa(),m=requireBrowser$9(),w=requireWithPublic(),_=requireSafeBuffer$1().Buffer;privateDecrypt=function(E,M,A){var T;E.padding?T=E.padding:A?T=1:T=4;var L=r(E),O=L.modulus.byteLength();if(M.length>O||new g(M).cmp(L.modulus)>=0)throw new Error("decryption error");var N;A?N=w(new g(M),L):N=v(M,L);var H=_.alloc(O-N.length);if(N=_.concat([H,N],O),T===4)return S(L,N);if(T===1)return x(L,N,A);if(T===3)return N;throw new Error("unknown padding")};function S(C,E){var M=C.modulus.byteLength(),A=m("sha1").update(_.alloc(0)).digest(),T=A.length;if(E[0]!==0)throw new Error("decryption error");var L=E.slice(1,T+1),O=E.slice(T+1),N=d(L,f(O,T)),H=d(O,f(N,M-T-1));if(b(A,H.slice(0,T)))throw new Error("decryption error");for(var V=T;H[V]===0;)V++;if(H[V++]!==1)throw new Error("decryption error");return H.slice(V)}function x(C,E,M){for(var A=E.slice(0,2),T=2,L=0;E[T++]!==0;)if(T>=E.length){L++;break}var O=E.slice(2,T-1);if((A.toString("hex")!=="0002"&&!M||A.toString("hex")!=="0001"&&M)&&L++,O.length<8&&L++,L)throw new Error("decryption error");return E.slice(T)}function b(C,E){C=_.from(C),E=_.from(E);var M=0,A=C.length;C.length!==E.length&&(M++,A=Math.min(C.length,E.length));for(var T=-1;++T<A;)M+=C[T]^E[T];return M}return privateDecrypt}var hasRequiredBrowser$1;function requireBrowser$1(){return hasRequiredBrowser$1||(hasRequiredBrowser$1=1,(function(r){r.publicEncrypt=requirePublicEncrypt(),r.privateDecrypt=requirePrivateDecrypt(),r.privateEncrypt=function(d,g){return r.publicEncrypt(d,g,!0)},r.publicDecrypt=function(d,g){return r.privateDecrypt(d,g,!0)}})(browser$1)),browser$1}var browser={},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;function r(){throw new Error(`secure random number generation not supported by this browser
30
+ use chrome, FireFox or Internet Explorer 11`)}var f=requireSafeBuffer$1(),d=requireBrowser$b(),g=f.Buffer,v=f.kMaxLength,m=commonjsGlobal.crypto||commonjsGlobal.msCrypto,w=Math.pow(2,32)-1;function _(E,M){if(typeof E!="number"||E!==E)throw new TypeError("offset must be a number");if(E>w||E<0)throw new TypeError("offset must be a uint32");if(E>v||E>M)throw new RangeError("offset out of range")}function S(E,M,A){if(typeof E!="number"||E!==E)throw new TypeError("size must be a number");if(E>w||E<0)throw new TypeError("size must be a uint32");if(E+M>A||E>v)throw new RangeError("buffer too small")}m&&m.getRandomValues||!process$1.browser?(browser.randomFill=x,browser.randomFillSync=C):(browser.randomFill=r,browser.randomFillSync=r);function x(E,M,A,T){if(!g.isBuffer(E)&&!(E instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof M=="function")T=M,M=0,A=E.length;else if(typeof A=="function")T=A,A=E.length-M;else if(typeof T!="function")throw new TypeError('"cb" argument must be a function');return _(M,E.length),S(A,M,E.length),b(E,M,A,T)}function b(E,M,A,T){if(process$1.browser){var L=E.buffer,O=new Uint8Array(L,M,A);if(m.getRandomValues(O),T){process$1.nextTick(function(){T(null,E)});return}return E}if(T){d(A,function(H,V){if(H)return T(H);V.copy(E,M),T(null,E)});return}var N=d(A);return N.copy(E,M),E}function C(E,M,A){if(typeof M>"u"&&(M=0),!g.isBuffer(E)&&!(E instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return _(M,E.length),A===void 0&&(A=E.length-M),S(A,M,E.length),b(E,M,A)}return browser}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$9(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$8();var r=requireAlgos(),f=Object.keys(r),d=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(f);cryptoBrowserify.getHashes=function(){return d};var g=requireBrowser$7();cryptoBrowserify.pbkdf2=g.pbkdf2,cryptoBrowserify.pbkdf2Sync=g.pbkdf2Sync;var v=requireBrowser$5();cryptoBrowserify.Cipher=v.Cipher,cryptoBrowserify.createCipher=v.createCipher,cryptoBrowserify.Cipheriv=v.Cipheriv,cryptoBrowserify.createCipheriv=v.createCipheriv,cryptoBrowserify.Decipher=v.Decipher,cryptoBrowserify.createDecipher=v.createDecipher,cryptoBrowserify.Decipheriv=v.Decipheriv,cryptoBrowserify.createDecipheriv=v.createDecipheriv,cryptoBrowserify.getCiphers=v.getCiphers,cryptoBrowserify.listCiphers=v.listCiphers;var m=requireBrowser$4();cryptoBrowserify.DiffieHellmanGroup=m.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=m.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=m.getDiffieHellman,cryptoBrowserify.createDiffieHellman=m.createDiffieHellman,cryptoBrowserify.DiffieHellman=m.DiffieHellman;var w=requireBrowser$3();cryptoBrowserify.createSign=w.createSign,cryptoBrowserify.Sign=w.Sign,cryptoBrowserify.createVerify=w.createVerify,cryptoBrowserify.Verify=w.Verify,cryptoBrowserify.createECDH=requireBrowser$2();var _=requireBrowser$1();cryptoBrowserify.publicEncrypt=_.publicEncrypt,cryptoBrowserify.privateEncrypt=_.privateEncrypt,cryptoBrowserify.publicDecrypt=_.publicDecrypt,cryptoBrowserify.privateDecrypt=_.privateDecrypt;var S=requireBrowser();return cryptoBrowserify.randomFill=S.randomFill,cryptoBrowserify.randomFillSync=S.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
31
+ we accept pull requests
32
+ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var hasRequiredNaclFast;function requireNaclFast(){return hasRequiredNaclFast||(hasRequiredNaclFast=1,(function(r){(function(f){var d=function(U){var G,re=new Float64Array(16);if(U)for(G=0;G<U.length;G++)re[G]=U[G];return re},g=function(){throw new Error("no PRNG")},v=new Uint8Array(16),m=new Uint8Array(32);m[0]=9;var w=d(),_=d([1]),S=d([56129,1]),x=d([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),b=d([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),C=d([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=d([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),M=d([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(U,G,re,K){U[G]=re>>24&255,U[G+1]=re>>16&255,U[G+2]=re>>8&255,U[G+3]=re&255,U[G+4]=K>>24&255,U[G+5]=K>>16&255,U[G+6]=K>>8&255,U[G+7]=K&255}function T(U,G,re,K,ue){var Ae,xe=0;for(Ae=0;Ae<ue;Ae++)xe|=U[G+Ae]^re[K+Ae];return(1&xe-1>>>8)-1}function L(U,G,re,K){return T(U,G,re,K,16)}function O(U,G,re,K){return T(U,G,re,K,32)}function N(U,G,re,K){for(var ue=K[0]&255|(K[1]&255)<<8|(K[2]&255)<<16|(K[3]&255)<<24,Ae=re[0]&255|(re[1]&255)<<8|(re[2]&255)<<16|(re[3]&255)<<24,xe=re[4]&255|(re[5]&255)<<8|(re[6]&255)<<16|(re[7]&255)<<24,Te=re[8]&255|(re[9]&255)<<8|(re[10]&255)<<16|(re[11]&255)<<24,Pe=re[12]&255|(re[13]&255)<<8|(re[14]&255)<<16|(re[15]&255)<<24,Fe=K[4]&255|(K[5]&255)<<8|(K[6]&255)<<16|(K[7]&255)<<24,Ne=G[0]&255|(G[1]&255)<<8|(G[2]&255)<<16|(G[3]&255)<<24,At=G[4]&255|(G[5]&255)<<8|(G[6]&255)<<16|(G[7]&255)<<24,ot=G[8]&255|(G[9]&255)<<8|(G[10]&255)<<16|(G[11]&255)<<24,yt=G[12]&255|(G[13]&255)<<8|(G[14]&255)<<16|(G[15]&255)<<24,vt=K[8]&255|(K[9]&255)<<8|(K[10]&255)<<16|(K[11]&255)<<24,xt=re[16]&255|(re[17]&255)<<8|(re[18]&255)<<16|(re[19]&255)<<24,Ve=re[20]&255|(re[21]&255)<<8|(re[22]&255)<<16|(re[23]&255)<<24,ft=re[24]&255|(re[25]&255)<<8|(re[26]&255)<<16|(re[27]&255)<<24,et=re[28]&255|(re[29]&255)<<8|(re[30]&255)<<16|(re[31]&255)<<24,ht=K[12]&255|(K[13]&255)<<8|(K[14]&255)<<16|(K[15]&255)<<24,it=ue,pt=Ae,at=xe,ct=Te,dt=Pe,nt=Fe,Le=Ne,Be=At,Ke=ot,We=yt,ze=vt,Qe=xt,Et=Ve,Bt=ft,kt=et,Rt=ht,Me,$t=0;$t<20;$t+=2)Me=it+Et|0,dt^=Me<<7|Me>>>25,Me=dt+it|0,Ke^=Me<<9|Me>>>23,Me=Ke+dt|0,Et^=Me<<13|Me>>>19,Me=Et+Ke|0,it^=Me<<18|Me>>>14,Me=nt+pt|0,We^=Me<<7|Me>>>25,Me=We+nt|0,Bt^=Me<<9|Me>>>23,Me=Bt+We|0,pt^=Me<<13|Me>>>19,Me=pt+Bt|0,nt^=Me<<18|Me>>>14,Me=ze+Le|0,kt^=Me<<7|Me>>>25,Me=kt+ze|0,at^=Me<<9|Me>>>23,Me=at+kt|0,Le^=Me<<13|Me>>>19,Me=Le+at|0,ze^=Me<<18|Me>>>14,Me=Rt+Qe|0,ct^=Me<<7|Me>>>25,Me=ct+Rt|0,Be^=Me<<9|Me>>>23,Me=Be+ct|0,Qe^=Me<<13|Me>>>19,Me=Qe+Be|0,Rt^=Me<<18|Me>>>14,Me=it+ct|0,pt^=Me<<7|Me>>>25,Me=pt+it|0,at^=Me<<9|Me>>>23,Me=at+pt|0,ct^=Me<<13|Me>>>19,Me=ct+at|0,it^=Me<<18|Me>>>14,Me=nt+dt|0,Le^=Me<<7|Me>>>25,Me=Le+nt|0,Be^=Me<<9|Me>>>23,Me=Be+Le|0,dt^=Me<<13|Me>>>19,Me=dt+Be|0,nt^=Me<<18|Me>>>14,Me=ze+We|0,Qe^=Me<<7|Me>>>25,Me=Qe+ze|0,Ke^=Me<<9|Me>>>23,Me=Ke+Qe|0,We^=Me<<13|Me>>>19,Me=We+Ke|0,ze^=Me<<18|Me>>>14,Me=Rt+kt|0,Et^=Me<<7|Me>>>25,Me=Et+Rt|0,Bt^=Me<<9|Me>>>23,Me=Bt+Et|0,kt^=Me<<13|Me>>>19,Me=kt+Bt|0,Rt^=Me<<18|Me>>>14;it=it+ue|0,pt=pt+Ae|0,at=at+xe|0,ct=ct+Te|0,dt=dt+Pe|0,nt=nt+Fe|0,Le=Le+Ne|0,Be=Be+At|0,Ke=Ke+ot|0,We=We+yt|0,ze=ze+vt|0,Qe=Qe+xt|0,Et=Et+Ve|0,Bt=Bt+ft|0,kt=kt+et|0,Rt=Rt+ht|0,U[0]=it>>>0&255,U[1]=it>>>8&255,U[2]=it>>>16&255,U[3]=it>>>24&255,U[4]=pt>>>0&255,U[5]=pt>>>8&255,U[6]=pt>>>16&255,U[7]=pt>>>24&255,U[8]=at>>>0&255,U[9]=at>>>8&255,U[10]=at>>>16&255,U[11]=at>>>24&255,U[12]=ct>>>0&255,U[13]=ct>>>8&255,U[14]=ct>>>16&255,U[15]=ct>>>24&255,U[16]=dt>>>0&255,U[17]=dt>>>8&255,U[18]=dt>>>16&255,U[19]=dt>>>24&255,U[20]=nt>>>0&255,U[21]=nt>>>8&255,U[22]=nt>>>16&255,U[23]=nt>>>24&255,U[24]=Le>>>0&255,U[25]=Le>>>8&255,U[26]=Le>>>16&255,U[27]=Le>>>24&255,U[28]=Be>>>0&255,U[29]=Be>>>8&255,U[30]=Be>>>16&255,U[31]=Be>>>24&255,U[32]=Ke>>>0&255,U[33]=Ke>>>8&255,U[34]=Ke>>>16&255,U[35]=Ke>>>24&255,U[36]=We>>>0&255,U[37]=We>>>8&255,U[38]=We>>>16&255,U[39]=We>>>24&255,U[40]=ze>>>0&255,U[41]=ze>>>8&255,U[42]=ze>>>16&255,U[43]=ze>>>24&255,U[44]=Qe>>>0&255,U[45]=Qe>>>8&255,U[46]=Qe>>>16&255,U[47]=Qe>>>24&255,U[48]=Et>>>0&255,U[49]=Et>>>8&255,U[50]=Et>>>16&255,U[51]=Et>>>24&255,U[52]=Bt>>>0&255,U[53]=Bt>>>8&255,U[54]=Bt>>>16&255,U[55]=Bt>>>24&255,U[56]=kt>>>0&255,U[57]=kt>>>8&255,U[58]=kt>>>16&255,U[59]=kt>>>24&255,U[60]=Rt>>>0&255,U[61]=Rt>>>8&255,U[62]=Rt>>>16&255,U[63]=Rt>>>24&255}function H(U,G,re,K){for(var ue=K[0]&255|(K[1]&255)<<8|(K[2]&255)<<16|(K[3]&255)<<24,Ae=re[0]&255|(re[1]&255)<<8|(re[2]&255)<<16|(re[3]&255)<<24,xe=re[4]&255|(re[5]&255)<<8|(re[6]&255)<<16|(re[7]&255)<<24,Te=re[8]&255|(re[9]&255)<<8|(re[10]&255)<<16|(re[11]&255)<<24,Pe=re[12]&255|(re[13]&255)<<8|(re[14]&255)<<16|(re[15]&255)<<24,Fe=K[4]&255|(K[5]&255)<<8|(K[6]&255)<<16|(K[7]&255)<<24,Ne=G[0]&255|(G[1]&255)<<8|(G[2]&255)<<16|(G[3]&255)<<24,At=G[4]&255|(G[5]&255)<<8|(G[6]&255)<<16|(G[7]&255)<<24,ot=G[8]&255|(G[9]&255)<<8|(G[10]&255)<<16|(G[11]&255)<<24,yt=G[12]&255|(G[13]&255)<<8|(G[14]&255)<<16|(G[15]&255)<<24,vt=K[8]&255|(K[9]&255)<<8|(K[10]&255)<<16|(K[11]&255)<<24,xt=re[16]&255|(re[17]&255)<<8|(re[18]&255)<<16|(re[19]&255)<<24,Ve=re[20]&255|(re[21]&255)<<8|(re[22]&255)<<16|(re[23]&255)<<24,ft=re[24]&255|(re[25]&255)<<8|(re[26]&255)<<16|(re[27]&255)<<24,et=re[28]&255|(re[29]&255)<<8|(re[30]&255)<<16|(re[31]&255)<<24,ht=K[12]&255|(K[13]&255)<<8|(K[14]&255)<<16|(K[15]&255)<<24,it=ue,pt=Ae,at=xe,ct=Te,dt=Pe,nt=Fe,Le=Ne,Be=At,Ke=ot,We=yt,ze=vt,Qe=xt,Et=Ve,Bt=ft,kt=et,Rt=ht,Me,$t=0;$t<20;$t+=2)Me=it+Et|0,dt^=Me<<7|Me>>>25,Me=dt+it|0,Ke^=Me<<9|Me>>>23,Me=Ke+dt|0,Et^=Me<<13|Me>>>19,Me=Et+Ke|0,it^=Me<<18|Me>>>14,Me=nt+pt|0,We^=Me<<7|Me>>>25,Me=We+nt|0,Bt^=Me<<9|Me>>>23,Me=Bt+We|0,pt^=Me<<13|Me>>>19,Me=pt+Bt|0,nt^=Me<<18|Me>>>14,Me=ze+Le|0,kt^=Me<<7|Me>>>25,Me=kt+ze|0,at^=Me<<9|Me>>>23,Me=at+kt|0,Le^=Me<<13|Me>>>19,Me=Le+at|0,ze^=Me<<18|Me>>>14,Me=Rt+Qe|0,ct^=Me<<7|Me>>>25,Me=ct+Rt|0,Be^=Me<<9|Me>>>23,Me=Be+ct|0,Qe^=Me<<13|Me>>>19,Me=Qe+Be|0,Rt^=Me<<18|Me>>>14,Me=it+ct|0,pt^=Me<<7|Me>>>25,Me=pt+it|0,at^=Me<<9|Me>>>23,Me=at+pt|0,ct^=Me<<13|Me>>>19,Me=ct+at|0,it^=Me<<18|Me>>>14,Me=nt+dt|0,Le^=Me<<7|Me>>>25,Me=Le+nt|0,Be^=Me<<9|Me>>>23,Me=Be+Le|0,dt^=Me<<13|Me>>>19,Me=dt+Be|0,nt^=Me<<18|Me>>>14,Me=ze+We|0,Qe^=Me<<7|Me>>>25,Me=Qe+ze|0,Ke^=Me<<9|Me>>>23,Me=Ke+Qe|0,We^=Me<<13|Me>>>19,Me=We+Ke|0,ze^=Me<<18|Me>>>14,Me=Rt+kt|0,Et^=Me<<7|Me>>>25,Me=Et+Rt|0,Bt^=Me<<9|Me>>>23,Me=Bt+Et|0,kt^=Me<<13|Me>>>19,Me=kt+Bt|0,Rt^=Me<<18|Me>>>14;U[0]=it>>>0&255,U[1]=it>>>8&255,U[2]=it>>>16&255,U[3]=it>>>24&255,U[4]=nt>>>0&255,U[5]=nt>>>8&255,U[6]=nt>>>16&255,U[7]=nt>>>24&255,U[8]=ze>>>0&255,U[9]=ze>>>8&255,U[10]=ze>>>16&255,U[11]=ze>>>24&255,U[12]=Rt>>>0&255,U[13]=Rt>>>8&255,U[14]=Rt>>>16&255,U[15]=Rt>>>24&255,U[16]=Le>>>0&255,U[17]=Le>>>8&255,U[18]=Le>>>16&255,U[19]=Le>>>24&255,U[20]=Be>>>0&255,U[21]=Be>>>8&255,U[22]=Be>>>16&255,U[23]=Be>>>24&255,U[24]=Ke>>>0&255,U[25]=Ke>>>8&255,U[26]=Ke>>>16&255,U[27]=Ke>>>24&255,U[28]=We>>>0&255,U[29]=We>>>8&255,U[30]=We>>>16&255,U[31]=We>>>24&255}function V(U,G,re,K){N(U,G,re,K)}function X(U,G,re,K){H(U,G,re,K)}var oe=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function se(U,G,re,K,ue,Ae,xe){var Te=new Uint8Array(16),Pe=new Uint8Array(64),Fe,Ne;for(Ne=0;Ne<16;Ne++)Te[Ne]=0;for(Ne=0;Ne<8;Ne++)Te[Ne]=Ae[Ne];for(;ue>=64;){for(V(Pe,Te,xe,oe),Ne=0;Ne<64;Ne++)U[G+Ne]=re[K+Ne]^Pe[Ne];for(Fe=1,Ne=8;Ne<16;Ne++)Fe=Fe+(Te[Ne]&255)|0,Te[Ne]=Fe&255,Fe>>>=8;ue-=64,G+=64,K+=64}if(ue>0)for(V(Pe,Te,xe,oe),Ne=0;Ne<ue;Ne++)U[G+Ne]=re[K+Ne]^Pe[Ne];return 0}function de(U,G,re,K,ue){var Ae=new Uint8Array(16),xe=new Uint8Array(64),Te,Pe;for(Pe=0;Pe<16;Pe++)Ae[Pe]=0;for(Pe=0;Pe<8;Pe++)Ae[Pe]=K[Pe];for(;re>=64;){for(V(xe,Ae,ue,oe),Pe=0;Pe<64;Pe++)U[G+Pe]=xe[Pe];for(Te=1,Pe=8;Pe<16;Pe++)Te=Te+(Ae[Pe]&255)|0,Ae[Pe]=Te&255,Te>>>=8;re-=64,G+=64}if(re>0)for(V(xe,Ae,ue,oe),Pe=0;Pe<re;Pe++)U[G+Pe]=xe[Pe];return 0}function he(U,G,re,K,ue){var Ae=new Uint8Array(32);X(Ae,K,ue,oe);for(var xe=new Uint8Array(8),Te=0;Te<8;Te++)xe[Te]=K[Te+16];return de(U,G,re,xe,Ae)}function we(U,G,re,K,ue,Ae,xe){var Te=new Uint8Array(32);X(Te,Ae,xe,oe);for(var Pe=new Uint8Array(8),Fe=0;Fe<8;Fe++)Pe[Fe]=Ae[Fe+16];return se(U,G,re,K,ue,Pe,Te)}var te=function(U){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var G,re,K,ue,Ae,xe,Te,Pe;G=U[0]&255|(U[1]&255)<<8,this.r[0]=G&8191,re=U[2]&255|(U[3]&255)<<8,this.r[1]=(G>>>13|re<<3)&8191,K=U[4]&255|(U[5]&255)<<8,this.r[2]=(re>>>10|K<<6)&7939,ue=U[6]&255|(U[7]&255)<<8,this.r[3]=(K>>>7|ue<<9)&8191,Ae=U[8]&255|(U[9]&255)<<8,this.r[4]=(ue>>>4|Ae<<12)&255,this.r[5]=Ae>>>1&8190,xe=U[10]&255|(U[11]&255)<<8,this.r[6]=(Ae>>>14|xe<<2)&8191,Te=U[12]&255|(U[13]&255)<<8,this.r[7]=(xe>>>11|Te<<5)&8065,Pe=U[14]&255|(U[15]&255)<<8,this.r[8]=(Te>>>8|Pe<<8)&8191,this.r[9]=Pe>>>5&127,this.pad[0]=U[16]&255|(U[17]&255)<<8,this.pad[1]=U[18]&255|(U[19]&255)<<8,this.pad[2]=U[20]&255|(U[21]&255)<<8,this.pad[3]=U[22]&255|(U[23]&255)<<8,this.pad[4]=U[24]&255|(U[25]&255)<<8,this.pad[5]=U[26]&255|(U[27]&255)<<8,this.pad[6]=U[28]&255|(U[29]&255)<<8,this.pad[7]=U[30]&255|(U[31]&255)<<8};te.prototype.blocks=function(U,G,re){for(var K=this.fin?0:2048,ue,Ae,xe,Te,Pe,Fe,Ne,At,ot,yt,vt,xt,Ve,ft,et,ht,it,pt,at,ct=this.h[0],dt=this.h[1],nt=this.h[2],Le=this.h[3],Be=this.h[4],Ke=this.h[5],We=this.h[6],ze=this.h[7],Qe=this.h[8],Et=this.h[9],Bt=this.r[0],kt=this.r[1],Rt=this.r[2],Me=this.r[3],$t=this.r[4],Lt=this.r[5],Dt=this.r[6],qt=this.r[7],It=this.r[8],Pt=this.r[9];re>=16;)ue=U[G+0]&255|(U[G+1]&255)<<8,ct+=ue&8191,Ae=U[G+2]&255|(U[G+3]&255)<<8,dt+=(ue>>>13|Ae<<3)&8191,xe=U[G+4]&255|(U[G+5]&255)<<8,nt+=(Ae>>>10|xe<<6)&8191,Te=U[G+6]&255|(U[G+7]&255)<<8,Le+=(xe>>>7|Te<<9)&8191,Pe=U[G+8]&255|(U[G+9]&255)<<8,Be+=(Te>>>4|Pe<<12)&8191,Ke+=Pe>>>1&8191,Fe=U[G+10]&255|(U[G+11]&255)<<8,We+=(Pe>>>14|Fe<<2)&8191,Ne=U[G+12]&255|(U[G+13]&255)<<8,ze+=(Fe>>>11|Ne<<5)&8191,At=U[G+14]&255|(U[G+15]&255)<<8,Qe+=(Ne>>>8|At<<8)&8191,Et+=At>>>5|K,ot=0,yt=ot,yt+=ct*Bt,yt+=dt*(5*Pt),yt+=nt*(5*It),yt+=Le*(5*qt),yt+=Be*(5*Dt),ot=yt>>>13,yt&=8191,yt+=Ke*(5*Lt),yt+=We*(5*$t),yt+=ze*(5*Me),yt+=Qe*(5*Rt),yt+=Et*(5*kt),ot+=yt>>>13,yt&=8191,vt=ot,vt+=ct*kt,vt+=dt*Bt,vt+=nt*(5*Pt),vt+=Le*(5*It),vt+=Be*(5*qt),ot=vt>>>13,vt&=8191,vt+=Ke*(5*Dt),vt+=We*(5*Lt),vt+=ze*(5*$t),vt+=Qe*(5*Me),vt+=Et*(5*Rt),ot+=vt>>>13,vt&=8191,xt=ot,xt+=ct*Rt,xt+=dt*kt,xt+=nt*Bt,xt+=Le*(5*Pt),xt+=Be*(5*It),ot=xt>>>13,xt&=8191,xt+=Ke*(5*qt),xt+=We*(5*Dt),xt+=ze*(5*Lt),xt+=Qe*(5*$t),xt+=Et*(5*Me),ot+=xt>>>13,xt&=8191,Ve=ot,Ve+=ct*Me,Ve+=dt*Rt,Ve+=nt*kt,Ve+=Le*Bt,Ve+=Be*(5*Pt),ot=Ve>>>13,Ve&=8191,Ve+=Ke*(5*It),Ve+=We*(5*qt),Ve+=ze*(5*Dt),Ve+=Qe*(5*Lt),Ve+=Et*(5*$t),ot+=Ve>>>13,Ve&=8191,ft=ot,ft+=ct*$t,ft+=dt*Me,ft+=nt*Rt,ft+=Le*kt,ft+=Be*Bt,ot=ft>>>13,ft&=8191,ft+=Ke*(5*Pt),ft+=We*(5*It),ft+=ze*(5*qt),ft+=Qe*(5*Dt),ft+=Et*(5*Lt),ot+=ft>>>13,ft&=8191,et=ot,et+=ct*Lt,et+=dt*$t,et+=nt*Me,et+=Le*Rt,et+=Be*kt,ot=et>>>13,et&=8191,et+=Ke*Bt,et+=We*(5*Pt),et+=ze*(5*It),et+=Qe*(5*qt),et+=Et*(5*Dt),ot+=et>>>13,et&=8191,ht=ot,ht+=ct*Dt,ht+=dt*Lt,ht+=nt*$t,ht+=Le*Me,ht+=Be*Rt,ot=ht>>>13,ht&=8191,ht+=Ke*kt,ht+=We*Bt,ht+=ze*(5*Pt),ht+=Qe*(5*It),ht+=Et*(5*qt),ot+=ht>>>13,ht&=8191,it=ot,it+=ct*qt,it+=dt*Dt,it+=nt*Lt,it+=Le*$t,it+=Be*Me,ot=it>>>13,it&=8191,it+=Ke*Rt,it+=We*kt,it+=ze*Bt,it+=Qe*(5*Pt),it+=Et*(5*It),ot+=it>>>13,it&=8191,pt=ot,pt+=ct*It,pt+=dt*qt,pt+=nt*Dt,pt+=Le*Lt,pt+=Be*$t,ot=pt>>>13,pt&=8191,pt+=Ke*Me,pt+=We*Rt,pt+=ze*kt,pt+=Qe*Bt,pt+=Et*(5*Pt),ot+=pt>>>13,pt&=8191,at=ot,at+=ct*Pt,at+=dt*It,at+=nt*qt,at+=Le*Dt,at+=Be*Lt,ot=at>>>13,at&=8191,at+=Ke*$t,at+=We*Me,at+=ze*Rt,at+=Qe*kt,at+=Et*Bt,ot+=at>>>13,at&=8191,ot=(ot<<2)+ot|0,ot=ot+yt|0,yt=ot&8191,ot=ot>>>13,vt+=ot,ct=yt,dt=vt,nt=xt,Le=Ve,Be=ft,Ke=et,We=ht,ze=it,Qe=pt,Et=at,G+=16,re-=16;this.h[0]=ct,this.h[1]=dt,this.h[2]=nt,this.h[3]=Le,this.h[4]=Be,this.h[5]=Ke,this.h[6]=We,this.h[7]=ze,this.h[8]=Qe,this.h[9]=Et},te.prototype.finish=function(U,G){var re=new Uint16Array(10),K,ue,Ae,xe;if(this.leftover){for(xe=this.leftover,this.buffer[xe++]=1;xe<16;xe++)this.buffer[xe]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(K=this.h[1]>>>13,this.h[1]&=8191,xe=2;xe<10;xe++)this.h[xe]+=K,K=this.h[xe]>>>13,this.h[xe]&=8191;for(this.h[0]+=K*5,K=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=K,K=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=K,re[0]=this.h[0]+5,K=re[0]>>>13,re[0]&=8191,xe=1;xe<10;xe++)re[xe]=this.h[xe]+K,K=re[xe]>>>13,re[xe]&=8191;for(re[9]-=8192,ue=(K^1)-1,xe=0;xe<10;xe++)re[xe]&=ue;for(ue=~ue,xe=0;xe<10;xe++)this.h[xe]=this.h[xe]&ue|re[xe];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Ae=this.h[0]+this.pad[0],this.h[0]=Ae&65535,xe=1;xe<8;xe++)Ae=(this.h[xe]+this.pad[xe]|0)+(Ae>>>16)|0,this.h[xe]=Ae&65535;U[G+0]=this.h[0]>>>0&255,U[G+1]=this.h[0]>>>8&255,U[G+2]=this.h[1]>>>0&255,U[G+3]=this.h[1]>>>8&255,U[G+4]=this.h[2]>>>0&255,U[G+5]=this.h[2]>>>8&255,U[G+6]=this.h[3]>>>0&255,U[G+7]=this.h[3]>>>8&255,U[G+8]=this.h[4]>>>0&255,U[G+9]=this.h[4]>>>8&255,U[G+10]=this.h[5]>>>0&255,U[G+11]=this.h[5]>>>8&255,U[G+12]=this.h[6]>>>0&255,U[G+13]=this.h[6]>>>8&255,U[G+14]=this.h[7]>>>0&255,U[G+15]=this.h[7]>>>8&255},te.prototype.update=function(U,G,re){var K,ue;if(this.leftover){for(ue=16-this.leftover,ue>re&&(ue=re),K=0;K<ue;K++)this.buffer[this.leftover+K]=U[G+K];if(re-=ue,G+=ue,this.leftover+=ue,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(re>=16&&(ue=re-re%16,this.blocks(U,G,ue),G+=ue,re-=ue),re){for(K=0;K<re;K++)this.buffer[this.leftover+K]=U[G+K];this.leftover+=re}};function q(U,G,re,K,ue,Ae){var xe=new te(Ae);return xe.update(re,K,ue),xe.finish(U,G),0}function k(U,G,re,K,ue,Ae){var xe=new Uint8Array(16);return q(xe,0,re,K,ue,Ae),L(U,G,xe,0)}function y(U,G,re,K,ue){var Ae;if(re<32)return-1;for(we(U,0,G,0,re,K,ue),q(U,16,U,32,re-32,U),Ae=0;Ae<16;Ae++)U[Ae]=0;return 0}function B(U,G,re,K,ue){var Ae,xe=new Uint8Array(32);if(re<32||(he(xe,0,32,K,ue),k(G,16,G,32,re-32,xe)!==0))return-1;for(we(U,0,G,0,re,K,ue),Ae=0;Ae<32;Ae++)U[Ae]=0;return 0}function $(U,G){var re;for(re=0;re<16;re++)U[re]=G[re]|0}function I(U){var G,re,K=1;for(G=0;G<16;G++)re=U[G]+K+65535,K=Math.floor(re/65536),U[G]=re-K*65536;U[0]+=K-1+37*(K-1)}function F(U,G,re){for(var K,ue=~(re-1),Ae=0;Ae<16;Ae++)K=ue&(U[Ae]^G[Ae]),U[Ae]^=K,G[Ae]^=K}function j(U,G){var re,K,ue,Ae=d(),xe=d();for(re=0;re<16;re++)xe[re]=G[re];for(I(xe),I(xe),I(xe),K=0;K<2;K++){for(Ae[0]=xe[0]-65517,re=1;re<15;re++)Ae[re]=xe[re]-65535-(Ae[re-1]>>16&1),Ae[re-1]&=65535;Ae[15]=xe[15]-32767-(Ae[14]>>16&1),ue=Ae[15]>>16&1,Ae[14]&=65535,F(xe,Ae,1-ue)}for(re=0;re<16;re++)U[2*re]=xe[re]&255,U[2*re+1]=xe[re]>>8}function D(U,G){var re=new Uint8Array(32),K=new Uint8Array(32);return j(re,U),j(K,G),O(re,0,K,0)}function W(U){var G=new Uint8Array(32);return j(G,U),G[0]&1}function R(U,G){var re;for(re=0;re<16;re++)U[re]=G[2*re]+(G[2*re+1]<<8);U[15]&=32767}function z(U,G,re){for(var K=0;K<16;K++)U[K]=G[K]+re[K]}function ye(U,G,re){for(var K=0;K<16;K++)U[K]=G[K]-re[K]}function Ce(U,G,re){var K,ue,Ae=0,xe=0,Te=0,Pe=0,Fe=0,Ne=0,At=0,ot=0,yt=0,vt=0,xt=0,Ve=0,ft=0,et=0,ht=0,it=0,pt=0,at=0,ct=0,dt=0,nt=0,Le=0,Be=0,Ke=0,We=0,ze=0,Qe=0,Et=0,Bt=0,kt=0,Rt=0,Me=re[0],$t=re[1],Lt=re[2],Dt=re[3],qt=re[4],It=re[5],Pt=re[6],Wt=re[7],Ot=re[8],Nt=re[9],Ft=re[10],Ut=re[11],jt=re[12],Ht=re[13],Kt=re[14],Vt=re[15];K=G[0],Ae+=K*Me,xe+=K*$t,Te+=K*Lt,Pe+=K*Dt,Fe+=K*qt,Ne+=K*It,At+=K*Pt,ot+=K*Wt,yt+=K*Ot,vt+=K*Nt,xt+=K*Ft,Ve+=K*Ut,ft+=K*jt,et+=K*Ht,ht+=K*Kt,it+=K*Vt,K=G[1],xe+=K*Me,Te+=K*$t,Pe+=K*Lt,Fe+=K*Dt,Ne+=K*qt,At+=K*It,ot+=K*Pt,yt+=K*Wt,vt+=K*Ot,xt+=K*Nt,Ve+=K*Ft,ft+=K*Ut,et+=K*jt,ht+=K*Ht,it+=K*Kt,pt+=K*Vt,K=G[2],Te+=K*Me,Pe+=K*$t,Fe+=K*Lt,Ne+=K*Dt,At+=K*qt,ot+=K*It,yt+=K*Pt,vt+=K*Wt,xt+=K*Ot,Ve+=K*Nt,ft+=K*Ft,et+=K*Ut,ht+=K*jt,it+=K*Ht,pt+=K*Kt,at+=K*Vt,K=G[3],Pe+=K*Me,Fe+=K*$t,Ne+=K*Lt,At+=K*Dt,ot+=K*qt,yt+=K*It,vt+=K*Pt,xt+=K*Wt,Ve+=K*Ot,ft+=K*Nt,et+=K*Ft,ht+=K*Ut,it+=K*jt,pt+=K*Ht,at+=K*Kt,ct+=K*Vt,K=G[4],Fe+=K*Me,Ne+=K*$t,At+=K*Lt,ot+=K*Dt,yt+=K*qt,vt+=K*It,xt+=K*Pt,Ve+=K*Wt,ft+=K*Ot,et+=K*Nt,ht+=K*Ft,it+=K*Ut,pt+=K*jt,at+=K*Ht,ct+=K*Kt,dt+=K*Vt,K=G[5],Ne+=K*Me,At+=K*$t,ot+=K*Lt,yt+=K*Dt,vt+=K*qt,xt+=K*It,Ve+=K*Pt,ft+=K*Wt,et+=K*Ot,ht+=K*Nt,it+=K*Ft,pt+=K*Ut,at+=K*jt,ct+=K*Ht,dt+=K*Kt,nt+=K*Vt,K=G[6],At+=K*Me,ot+=K*$t,yt+=K*Lt,vt+=K*Dt,xt+=K*qt,Ve+=K*It,ft+=K*Pt,et+=K*Wt,ht+=K*Ot,it+=K*Nt,pt+=K*Ft,at+=K*Ut,ct+=K*jt,dt+=K*Ht,nt+=K*Kt,Le+=K*Vt,K=G[7],ot+=K*Me,yt+=K*$t,vt+=K*Lt,xt+=K*Dt,Ve+=K*qt,ft+=K*It,et+=K*Pt,ht+=K*Wt,it+=K*Ot,pt+=K*Nt,at+=K*Ft,ct+=K*Ut,dt+=K*jt,nt+=K*Ht,Le+=K*Kt,Be+=K*Vt,K=G[8],yt+=K*Me,vt+=K*$t,xt+=K*Lt,Ve+=K*Dt,ft+=K*qt,et+=K*It,ht+=K*Pt,it+=K*Wt,pt+=K*Ot,at+=K*Nt,ct+=K*Ft,dt+=K*Ut,nt+=K*jt,Le+=K*Ht,Be+=K*Kt,Ke+=K*Vt,K=G[9],vt+=K*Me,xt+=K*$t,Ve+=K*Lt,ft+=K*Dt,et+=K*qt,ht+=K*It,it+=K*Pt,pt+=K*Wt,at+=K*Ot,ct+=K*Nt,dt+=K*Ft,nt+=K*Ut,Le+=K*jt,Be+=K*Ht,Ke+=K*Kt,We+=K*Vt,K=G[10],xt+=K*Me,Ve+=K*$t,ft+=K*Lt,et+=K*Dt,ht+=K*qt,it+=K*It,pt+=K*Pt,at+=K*Wt,ct+=K*Ot,dt+=K*Nt,nt+=K*Ft,Le+=K*Ut,Be+=K*jt,Ke+=K*Ht,We+=K*Kt,ze+=K*Vt,K=G[11],Ve+=K*Me,ft+=K*$t,et+=K*Lt,ht+=K*Dt,it+=K*qt,pt+=K*It,at+=K*Pt,ct+=K*Wt,dt+=K*Ot,nt+=K*Nt,Le+=K*Ft,Be+=K*Ut,Ke+=K*jt,We+=K*Ht,ze+=K*Kt,Qe+=K*Vt,K=G[12],ft+=K*Me,et+=K*$t,ht+=K*Lt,it+=K*Dt,pt+=K*qt,at+=K*It,ct+=K*Pt,dt+=K*Wt,nt+=K*Ot,Le+=K*Nt,Be+=K*Ft,Ke+=K*Ut,We+=K*jt,ze+=K*Ht,Qe+=K*Kt,Et+=K*Vt,K=G[13],et+=K*Me,ht+=K*$t,it+=K*Lt,pt+=K*Dt,at+=K*qt,ct+=K*It,dt+=K*Pt,nt+=K*Wt,Le+=K*Ot,Be+=K*Nt,Ke+=K*Ft,We+=K*Ut,ze+=K*jt,Qe+=K*Ht,Et+=K*Kt,Bt+=K*Vt,K=G[14],ht+=K*Me,it+=K*$t,pt+=K*Lt,at+=K*Dt,ct+=K*qt,dt+=K*It,nt+=K*Pt,Le+=K*Wt,Be+=K*Ot,Ke+=K*Nt,We+=K*Ft,ze+=K*Ut,Qe+=K*jt,Et+=K*Ht,Bt+=K*Kt,kt+=K*Vt,K=G[15],it+=K*Me,pt+=K*$t,at+=K*Lt,ct+=K*Dt,dt+=K*qt,nt+=K*It,Le+=K*Pt,Be+=K*Wt,Ke+=K*Ot,We+=K*Nt,ze+=K*Ft,Qe+=K*Ut,Et+=K*jt,Bt+=K*Ht,kt+=K*Kt,Rt+=K*Vt,Ae+=38*pt,xe+=38*at,Te+=38*ct,Pe+=38*dt,Fe+=38*nt,Ne+=38*Le,At+=38*Be,ot+=38*Ke,yt+=38*We,vt+=38*ze,xt+=38*Qe,Ve+=38*Et,ft+=38*Bt,et+=38*kt,ht+=38*Rt,ue=1,K=Ae+ue+65535,ue=Math.floor(K/65536),Ae=K-ue*65536,K=xe+ue+65535,ue=Math.floor(K/65536),xe=K-ue*65536,K=Te+ue+65535,ue=Math.floor(K/65536),Te=K-ue*65536,K=Pe+ue+65535,ue=Math.floor(K/65536),Pe=K-ue*65536,K=Fe+ue+65535,ue=Math.floor(K/65536),Fe=K-ue*65536,K=Ne+ue+65535,ue=Math.floor(K/65536),Ne=K-ue*65536,K=At+ue+65535,ue=Math.floor(K/65536),At=K-ue*65536,K=ot+ue+65535,ue=Math.floor(K/65536),ot=K-ue*65536,K=yt+ue+65535,ue=Math.floor(K/65536),yt=K-ue*65536,K=vt+ue+65535,ue=Math.floor(K/65536),vt=K-ue*65536,K=xt+ue+65535,ue=Math.floor(K/65536),xt=K-ue*65536,K=Ve+ue+65535,ue=Math.floor(K/65536),Ve=K-ue*65536,K=ft+ue+65535,ue=Math.floor(K/65536),ft=K-ue*65536,K=et+ue+65535,ue=Math.floor(K/65536),et=K-ue*65536,K=ht+ue+65535,ue=Math.floor(K/65536),ht=K-ue*65536,K=it+ue+65535,ue=Math.floor(K/65536),it=K-ue*65536,Ae+=ue-1+37*(ue-1),ue=1,K=Ae+ue+65535,ue=Math.floor(K/65536),Ae=K-ue*65536,K=xe+ue+65535,ue=Math.floor(K/65536),xe=K-ue*65536,K=Te+ue+65535,ue=Math.floor(K/65536),Te=K-ue*65536,K=Pe+ue+65535,ue=Math.floor(K/65536),Pe=K-ue*65536,K=Fe+ue+65535,ue=Math.floor(K/65536),Fe=K-ue*65536,K=Ne+ue+65535,ue=Math.floor(K/65536),Ne=K-ue*65536,K=At+ue+65535,ue=Math.floor(K/65536),At=K-ue*65536,K=ot+ue+65535,ue=Math.floor(K/65536),ot=K-ue*65536,K=yt+ue+65535,ue=Math.floor(K/65536),yt=K-ue*65536,K=vt+ue+65535,ue=Math.floor(K/65536),vt=K-ue*65536,K=xt+ue+65535,ue=Math.floor(K/65536),xt=K-ue*65536,K=Ve+ue+65535,ue=Math.floor(K/65536),Ve=K-ue*65536,K=ft+ue+65535,ue=Math.floor(K/65536),ft=K-ue*65536,K=et+ue+65535,ue=Math.floor(K/65536),et=K-ue*65536,K=ht+ue+65535,ue=Math.floor(K/65536),ht=K-ue*65536,K=it+ue+65535,ue=Math.floor(K/65536),it=K-ue*65536,Ae+=ue-1+37*(ue-1),U[0]=Ae,U[1]=xe,U[2]=Te,U[3]=Pe,U[4]=Fe,U[5]=Ne,U[6]=At,U[7]=ot,U[8]=yt,U[9]=vt,U[10]=xt,U[11]=Ve,U[12]=ft,U[13]=et,U[14]=ht,U[15]=it}function me(U,G){Ce(U,G,G)}function ie(U,G){var re=d(),K;for(K=0;K<16;K++)re[K]=G[K];for(K=253;K>=0;K--)me(re,re),K!==2&&K!==4&&Ce(re,re,G);for(K=0;K<16;K++)U[K]=re[K]}function ee(U,G){var re=d(),K;for(K=0;K<16;K++)re[K]=G[K];for(K=250;K>=0;K--)me(re,re),K!==1&&Ce(re,re,G);for(K=0;K<16;K++)U[K]=re[K]}function pe(U,G,re){var K=new Uint8Array(32),ue=new Float64Array(80),Ae,xe,Te=d(),Pe=d(),Fe=d(),Ne=d(),At=d(),ot=d();for(xe=0;xe<31;xe++)K[xe]=G[xe];for(K[31]=G[31]&127|64,K[0]&=248,R(ue,re),xe=0;xe<16;xe++)Pe[xe]=ue[xe],Ne[xe]=Te[xe]=Fe[xe]=0;for(Te[0]=Ne[0]=1,xe=254;xe>=0;--xe)Ae=K[xe>>>3]>>>(xe&7)&1,F(Te,Pe,Ae),F(Fe,Ne,Ae),z(At,Te,Fe),ye(Te,Te,Fe),z(Fe,Pe,Ne),ye(Pe,Pe,Ne),me(Ne,At),me(ot,Te),Ce(Te,Fe,Te),Ce(Fe,Pe,At),z(At,Te,Fe),ye(Te,Te,Fe),me(Pe,Te),ye(Fe,Ne,ot),Ce(Te,Fe,S),z(Te,Te,Ne),Ce(Fe,Fe,Te),Ce(Te,Ne,ot),Ce(Ne,Pe,ue),me(Pe,At),F(Te,Pe,Ae),F(Fe,Ne,Ae);for(xe=0;xe<16;xe++)ue[xe+16]=Te[xe],ue[xe+32]=Fe[xe],ue[xe+48]=Pe[xe],ue[xe+64]=Ne[xe];var yt=ue.subarray(32),vt=ue.subarray(16);return ie(yt,yt),Ce(vt,vt,yt),j(U,vt),0}function be(U,G){return pe(U,G,m)}function ae(U,G){return g(G,32),be(U,G)}function ne(U,G,re){var K=new Uint8Array(32);return pe(K,re,G),X(U,v,K,oe)}var Se=y,ke=B;function Ie(U,G,re,K,ue,Ae){var xe=new Uint8Array(32);return ne(xe,ue,Ae),Se(U,G,re,K,xe)}function Oe(U,G,re,K,ue,Ae){var xe=new Uint8Array(32);return ne(xe,ue,Ae),ke(U,G,re,K,xe)}var Ue=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function De(U,G,re,K){for(var ue=new Int32Array(16),Ae=new Int32Array(16),xe,Te,Pe,Fe,Ne,At,ot,yt,vt,xt,Ve,ft,et,ht,it,pt,at,ct,dt,nt,Le,Be,Ke,We,ze,Qe,Et=U[0],Bt=U[1],kt=U[2],Rt=U[3],Me=U[4],$t=U[5],Lt=U[6],Dt=U[7],qt=G[0],It=G[1],Pt=G[2],Wt=G[3],Ot=G[4],Nt=G[5],Ft=G[6],Ut=G[7],jt=0;K>=128;){for(dt=0;dt<16;dt++)nt=8*dt+jt,ue[dt]=re[nt+0]<<24|re[nt+1]<<16|re[nt+2]<<8|re[nt+3],Ae[dt]=re[nt+4]<<24|re[nt+5]<<16|re[nt+6]<<8|re[nt+7];for(dt=0;dt<80;dt++)if(xe=Et,Te=Bt,Pe=kt,Fe=Rt,Ne=Me,At=$t,ot=Lt,yt=Dt,vt=qt,xt=It,Ve=Pt,ft=Wt,et=Ot,ht=Nt,it=Ft,pt=Ut,Le=Dt,Be=Ut,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=(Me>>>14|Ot<<18)^(Me>>>18|Ot<<14)^(Ot>>>9|Me<<23),Be=(Ot>>>14|Me<<18)^(Ot>>>18|Me<<14)^(Me>>>9|Ot<<23),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Me&$t^~Me&Lt,Be=Ot&Nt^~Ot&Ft,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Ue[dt*2],Be=Ue[dt*2+1],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=ue[dt%16],Be=Ae[dt%16],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,at=ze&65535|Qe<<16,ct=Ke&65535|We<<16,Le=at,Be=ct,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=(Et>>>28|qt<<4)^(qt>>>2|Et<<30)^(qt>>>7|Et<<25),Be=(qt>>>28|Et<<4)^(Et>>>2|qt<<30)^(Et>>>7|qt<<25),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Et&Bt^Et&kt^Bt&kt,Be=qt&It^qt&Pt^It&Pt,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,yt=ze&65535|Qe<<16,pt=Ke&65535|We<<16,Le=Fe,Be=ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=at,Be=ct,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,Fe=ze&65535|Qe<<16,ft=Ke&65535|We<<16,Bt=xe,kt=Te,Rt=Pe,Me=Fe,$t=Ne,Lt=At,Dt=ot,Et=yt,It=vt,Pt=xt,Wt=Ve,Ot=ft,Nt=et,Ft=ht,Ut=it,qt=pt,dt%16===15)for(nt=0;nt<16;nt++)Le=ue[nt],Be=Ae[nt],Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=ue[(nt+9)%16],Be=Ae[(nt+9)%16],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,at=ue[(nt+1)%16],ct=Ae[(nt+1)%16],Le=(at>>>1|ct<<31)^(at>>>8|ct<<24)^at>>>7,Be=(ct>>>1|at<<31)^(ct>>>8|at<<24)^(ct>>>7|at<<25),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,at=ue[(nt+14)%16],ct=Ae[(nt+14)%16],Le=(at>>>19|ct<<13)^(ct>>>29|at<<3)^at>>>6,Be=(ct>>>19|at<<13)^(at>>>29|ct<<3)^(ct>>>6|at<<26),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,ue[nt]=ze&65535|Qe<<16,Ae[nt]=Ke&65535|We<<16;Le=Et,Be=qt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[0],Be=G[0],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[0]=Et=ze&65535|Qe<<16,G[0]=qt=Ke&65535|We<<16,Le=Bt,Be=It,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[1],Be=G[1],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[1]=Bt=ze&65535|Qe<<16,G[1]=It=Ke&65535|We<<16,Le=kt,Be=Pt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[2],Be=G[2],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[2]=kt=ze&65535|Qe<<16,G[2]=Pt=Ke&65535|We<<16,Le=Rt,Be=Wt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[3],Be=G[3],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[3]=Rt=ze&65535|Qe<<16,G[3]=Wt=Ke&65535|We<<16,Le=Me,Be=Ot,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[4],Be=G[4],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[4]=Me=ze&65535|Qe<<16,G[4]=Ot=Ke&65535|We<<16,Le=$t,Be=Nt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[5],Be=G[5],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[5]=$t=ze&65535|Qe<<16,G[5]=Nt=Ke&65535|We<<16,Le=Lt,Be=Ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[6],Be=G[6],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[6]=Lt=ze&65535|Qe<<16,G[6]=Ft=Ke&65535|We<<16,Le=Dt,Be=Ut,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[7],Be=G[7],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[7]=Dt=ze&65535|Qe<<16,G[7]=Ut=Ke&65535|We<<16,jt+=128,K-=128}return K}function $e(U,G,re){var K=new Int32Array(8),ue=new Int32Array(8),Ae=new Uint8Array(256),xe,Te=re;for(K[0]=1779033703,K[1]=3144134277,K[2]=1013904242,K[3]=2773480762,K[4]=1359893119,K[5]=2600822924,K[6]=528734635,K[7]=1541459225,ue[0]=4089235720,ue[1]=2227873595,ue[2]=4271175723,ue[3]=1595750129,ue[4]=2917565137,ue[5]=725511199,ue[6]=4215389547,ue[7]=327033209,De(K,ue,G,re),re%=128,xe=0;xe<re;xe++)Ae[xe]=G[Te-re+xe];for(Ae[re]=128,re=256-128*(re<112?1:0),Ae[re-9]=0,A(Ae,re-8,Te/536870912|0,Te<<3),De(K,ue,Ae,re),xe=0;xe<8;xe++)A(U,8*xe,K[xe],ue[xe]);return 0}function je(U,G){var re=d(),K=d(),ue=d(),Ae=d(),xe=d(),Te=d(),Pe=d(),Fe=d(),Ne=d();ye(re,U[1],U[0]),ye(Ne,G[1],G[0]),Ce(re,re,Ne),z(K,U[0],U[1]),z(Ne,G[0],G[1]),Ce(K,K,Ne),Ce(ue,U[3],G[3]),Ce(ue,ue,b),Ce(Ae,U[2],G[2]),z(Ae,Ae,Ae),ye(xe,K,re),ye(Te,Ae,ue),z(Pe,Ae,ue),z(Fe,K,re),Ce(U[0],xe,Te),Ce(U[1],Fe,Pe),Ce(U[2],Pe,Te),Ce(U[3],xe,Fe)}function Ye(U,G,re){var K;for(K=0;K<4;K++)F(U[K],G[K],re)}function st(U,G){var re=d(),K=d(),ue=d();ie(ue,G[2]),Ce(re,G[0],ue),Ce(K,G[1],ue),j(U,K),U[31]^=W(re)<<7}function Je(U,G,re){var K,ue;for($(U[0],w),$(U[1],_),$(U[2],_),$(U[3],w),ue=255;ue>=0;--ue)K=re[ue/8|0]>>(ue&7)&1,Ye(U,G,K),je(G,U),je(U,U),Ye(U,G,K)}function Ge(U,G){var re=[d(),d(),d(),d()];$(re[0],C),$(re[1],E),$(re[2],_),Ce(re[3],C,E),Je(U,re,G)}function ut(U,G,re){var K=new Uint8Array(64),ue=[d(),d(),d(),d()],Ae;for(re||g(G,32),$e(K,G,32),K[0]&=248,K[31]&=127,K[31]|=64,Ge(ue,K),st(U,ue),Ae=0;Ae<32;Ae++)G[Ae+32]=U[Ae];return 0}var gt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function rt(U,G){var re,K,ue,Ae;for(K=63;K>=32;--K){for(re=0,ue=K-32,Ae=K-12;ue<Ae;++ue)G[ue]+=re-16*G[K]*gt[ue-(K-32)],re=Math.floor((G[ue]+128)/256),G[ue]-=re*256;G[ue]+=re,G[K]=0}for(re=0,ue=0;ue<32;ue++)G[ue]+=re-(G[31]>>4)*gt[ue],re=G[ue]>>8,G[ue]&=255;for(ue=0;ue<32;ue++)G[ue]-=re*gt[ue];for(K=0;K<32;K++)G[K+1]+=G[K]>>8,U[K]=G[K]&255}function wt(U){var G=new Float64Array(64),re;for(re=0;re<64;re++)G[re]=U[re];for(re=0;re<64;re++)U[re]=0;rt(U,G)}function bt(U,G,re,K){var ue=new Uint8Array(64),Ae=new Uint8Array(64),xe=new Uint8Array(64),Te,Pe,Fe=new Float64Array(64),Ne=[d(),d(),d(),d()];$e(ue,K,32),ue[0]&=248,ue[31]&=127,ue[31]|=64;var At=re+64;for(Te=0;Te<re;Te++)U[64+Te]=G[Te];for(Te=0;Te<32;Te++)U[32+Te]=ue[32+Te];for($e(xe,U.subarray(32),re+32),wt(xe),Ge(Ne,xe),st(U,Ne),Te=32;Te<64;Te++)U[Te]=K[Te];for($e(Ae,U,re+64),wt(Ae),Te=0;Te<64;Te++)Fe[Te]=0;for(Te=0;Te<32;Te++)Fe[Te]=xe[Te];for(Te=0;Te<32;Te++)for(Pe=0;Pe<32;Pe++)Fe[Te+Pe]+=Ae[Te]*ue[Pe];return rt(U.subarray(32),Fe),At}function le(U,G){var re=d(),K=d(),ue=d(),Ae=d(),xe=d(),Te=d(),Pe=d();return $(U[2],_),R(U[1],G),me(ue,U[1]),Ce(Ae,ue,x),ye(ue,ue,U[2]),z(Ae,U[2],Ae),me(xe,Ae),me(Te,xe),Ce(Pe,Te,xe),Ce(re,Pe,ue),Ce(re,re,Ae),ee(re,re),Ce(re,re,ue),Ce(re,re,Ae),Ce(re,re,Ae),Ce(U[0],re,Ae),me(K,U[0]),Ce(K,K,Ae),D(K,ue)&&Ce(U[0],U[0],M),me(K,U[0]),Ce(K,K,Ae),D(K,ue)?-1:(W(U[0])===G[31]>>7&&ye(U[0],w,U[0]),Ce(U[3],U[0],U[1]),0)}function Z(U,G,re,K){var ue,Ae=new Uint8Array(32),xe=new Uint8Array(64),Te=[d(),d(),d(),d()],Pe=[d(),d(),d(),d()];if(re<64||le(Pe,K))return-1;for(ue=0;ue<re;ue++)U[ue]=G[ue];for(ue=0;ue<32;ue++)U[ue+32]=K[ue];if($e(xe,U,re),wt(xe),Je(Te,Pe,xe),Ge(Pe,G.subarray(32)),je(Te,Pe),st(Ae,Te),re-=64,O(G,0,Ae,0)){for(ue=0;ue<re;ue++)U[ue]=0;return-1}for(ue=0;ue<re;ue++)U[ue]=G[ue+64];return re}var J=32,ge=24,Ee=32,Re=16,qe=32,Xe=32,He=32,Ze=32,_t=32,tt=ge,mt=Ee,Tt=Re,St=64,lt=32,Mt=64,Ct=32,ce=64;f.lowlevel={crypto_core_hsalsa20:X,crypto_stream_xor:we,crypto_stream:he,crypto_stream_salsa20_xor:se,crypto_stream_salsa20:de,crypto_onetimeauth:q,crypto_onetimeauth_verify:k,crypto_verify_16:L,crypto_verify_32:O,crypto_secretbox:y,crypto_secretbox_open:B,crypto_scalarmult:pe,crypto_scalarmult_base:be,crypto_box_beforenm:ne,crypto_box_afternm:Se,crypto_box:Ie,crypto_box_open:Oe,crypto_box_keypair:ae,crypto_hash:$e,crypto_sign:bt,crypto_sign_keypair:ut,crypto_sign_open:Z,crypto_secretbox_KEYBYTES:J,crypto_secretbox_NONCEBYTES:ge,crypto_secretbox_ZEROBYTES:Ee,crypto_secretbox_BOXZEROBYTES:Re,crypto_scalarmult_BYTES:qe,crypto_scalarmult_SCALARBYTES:Xe,crypto_box_PUBLICKEYBYTES:He,crypto_box_SECRETKEYBYTES:Ze,crypto_box_BEFORENMBYTES:_t,crypto_box_NONCEBYTES:tt,crypto_box_ZEROBYTES:mt,crypto_box_BOXZEROBYTES:Tt,crypto_sign_BYTES:St,crypto_sign_PUBLICKEYBYTES:lt,crypto_sign_SECRETKEYBYTES:Mt,crypto_sign_SEEDBYTES:Ct,crypto_hash_BYTES:ce,gf:d,D:x,L:gt,pack25519:j,unpack25519:R,M:Ce,A:z,S:me,Z:ye,pow2523:ee,add:je,set25519:$,modL:rt,scalarmult:Je,scalarbase:Ge};function Y(U,G){if(U.length!==J)throw new Error("bad key size");if(G.length!==ge)throw new Error("bad nonce size")}function Q(U,G){if(U.length!==He)throw new Error("bad public key size");if(G.length!==Ze)throw new Error("bad secret key size")}function ve(){for(var U=0;U<arguments.length;U++)if(!(arguments[U]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function fe(U){for(var G=0;G<U.length;G++)U[G]=0}f.randomBytes=function(U){var G=new Uint8Array(U);return g(G,U),G},f.secretbox=function(U,G,re){ve(U,G,re),Y(re,G);for(var K=new Uint8Array(Ee+U.length),ue=new Uint8Array(K.length),Ae=0;Ae<U.length;Ae++)K[Ae+Ee]=U[Ae];return y(ue,K,K.length,G,re),ue.subarray(Re)},f.secretbox.open=function(U,G,re){ve(U,G,re),Y(re,G);for(var K=new Uint8Array(Re+U.length),ue=new Uint8Array(K.length),Ae=0;Ae<U.length;Ae++)K[Ae+Re]=U[Ae];return K.length<32||B(ue,K,K.length,G,re)!==0?null:ue.subarray(Ee)},f.secretbox.keyLength=J,f.secretbox.nonceLength=ge,f.secretbox.overheadLength=Re,f.scalarMult=function(U,G){if(ve(U,G),U.length!==Xe)throw new Error("bad n size");if(G.length!==qe)throw new Error("bad p size");var re=new Uint8Array(qe);return pe(re,U,G),re},f.scalarMult.base=function(U){if(ve(U),U.length!==Xe)throw new Error("bad n size");var G=new Uint8Array(qe);return be(G,U),G},f.scalarMult.scalarLength=Xe,f.scalarMult.groupElementLength=qe,f.box=function(U,G,re,K){var ue=f.box.before(re,K);return f.secretbox(U,G,ue)},f.box.before=function(U,G){ve(U,G),Q(U,G);var re=new Uint8Array(_t);return ne(re,U,G),re},f.box.after=f.secretbox,f.box.open=function(U,G,re,K){var ue=f.box.before(re,K);return f.secretbox.open(U,G,ue)},f.box.open.after=f.secretbox.open,f.box.keyPair=function(){var U=new Uint8Array(He),G=new Uint8Array(Ze);return ae(U,G),{publicKey:U,secretKey:G}},f.box.keyPair.fromSecretKey=function(U){if(ve(U),U.length!==Ze)throw new Error("bad secret key size");var G=new Uint8Array(He);return be(G,U),{publicKey:G,secretKey:new Uint8Array(U)}},f.box.publicKeyLength=He,f.box.secretKeyLength=Ze,f.box.sharedKeyLength=_t,f.box.nonceLength=tt,f.box.overheadLength=f.secretbox.overheadLength,f.sign=function(U,G){if(ve(U,G),G.length!==Mt)throw new Error("bad secret key size");var re=new Uint8Array(St+U.length);return bt(re,U,U.length,G),re},f.sign.open=function(U,G){if(ve(U,G),G.length!==lt)throw new Error("bad public key size");var re=new Uint8Array(U.length),K=Z(re,U,U.length,G);if(K<0)return null;for(var ue=new Uint8Array(K),Ae=0;Ae<ue.length;Ae++)ue[Ae]=re[Ae];return ue},f.sign.detached=function(U,G){for(var re=f.sign(U,G),K=new Uint8Array(St),ue=0;ue<K.length;ue++)K[ue]=re[ue];return K},f.sign.detached.verify=function(U,G,re){if(ve(U,G,re),G.length!==St)throw new Error("bad signature size");if(re.length!==lt)throw new Error("bad public key size");var K=new Uint8Array(St+U.length),ue=new Uint8Array(St+U.length),Ae;for(Ae=0;Ae<St;Ae++)K[Ae]=G[Ae];for(Ae=0;Ae<U.length;Ae++)K[Ae+St]=U[Ae];return Z(ue,K,K.length,re)>=0},f.sign.keyPair=function(){var U=new Uint8Array(lt),G=new Uint8Array(Mt);return ut(U,G),{publicKey:U,secretKey:G}},f.sign.keyPair.fromSecretKey=function(U){if(ve(U),U.length!==Mt)throw new Error("bad secret key size");for(var G=new Uint8Array(lt),re=0;re<G.length;re++)G[re]=U[32+re];return{publicKey:G,secretKey:new Uint8Array(U)}},f.sign.keyPair.fromSeed=function(U){if(ve(U),U.length!==Ct)throw new Error("bad seed size");for(var G=new Uint8Array(lt),re=new Uint8Array(Mt),K=0;K<32;K++)re[K]=U[K];return ut(G,re,!0),{publicKey:G,secretKey:re}},f.sign.publicKeyLength=lt,f.sign.secretKeyLength=Mt,f.sign.seedLength=Ct,f.sign.signatureLength=St,f.hash=function(U){ve(U);var G=new Uint8Array(ce);return $e(G,U,U.length),G},f.hash.hashLength=ce,f.verify=function(U,G){return ve(U,G),U.length===0||G.length===0||U.length!==G.length?!1:T(U,0,G,0,U.length)===0},f.setPRNG=function(U){g=U},(function(){var U=typeof self<"u"?self.crypto||self.msCrypto:null;if(U&&U.getRandomValues){var G=65536;f.setPRNG(function(re,K){var ue,Ae=new Uint8Array(K);for(ue=0;ue<K;ue+=G)U.getRandomValues(Ae.subarray(ue,ue+Math.min(K-ue,G)));for(ue=0;ue<K;ue++)re[ue]=Ae[ue];fe(Ae)})}else typeof commonjsRequire<"u"&&(U=requireCryptoBrowserify(),U&&U.randomBytes&&f.setPRNG(function(re,K){var ue,Ae=U.randomBytes(K);for(ue=0;ue<K;ue++)re[ue]=Ae[ue];fe(Ae)}))})()})(r.exports?r.exports:self.nacl=self.nacl||{})})(naclFast)),naclFast.exports}var naclFastExports=requireNaclFast();const nacl$1=getDefaultExportFromCjs(naclFastExports);var CONNECT_EVENT_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",r[r.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(CONNECT_EVENT_ERROR_CODES||(CONNECT_EVENT_ERROR_CODES={}));var CONNECT_ITEM_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(CONNECT_ITEM_ERROR_CODES||(CONNECT_ITEM_ERROR_CODES={}));var SEND_TRANSACTION_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(SEND_TRANSACTION_ERROR_CODES||(SEND_TRANSACTION_ERROR_CODES={}));var SIGN_DATA_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(SIGN_DATA_ERROR_CODES||(SIGN_DATA_ERROR_CODES={}));var DISCONNECT_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(DISCONNECT_ERROR_CODES||(DISCONNECT_ERROR_CODES={}));var CHAIN;(function(r){r.MAINNET="-239",r.TESTNET="-3"})(CHAIN||(CHAIN={}));function encodeUint8Array(r,f){const d=nacl.encodeBase64(r);return f?encodeURIComponent(d):d}function decodeToUint8Array(r,f){return f&&(r=decodeURIComponent(r)),nacl.decodeBase64(r)}function encode(r,f=!1){let d;return r instanceof Uint8Array?d=r:(typeof r!="string"&&(r=JSON.stringify(r)),d=nacl.decodeUTF8(r)),encodeUint8Array(d,f)}function decode(r,f=!1){const d=decodeToUint8Array(r,f);return{toString(){return nacl.encodeUTF8(d)},toObject(){try{return JSON.parse(nacl.encodeUTF8(d))}catch{return null}},toUint8Array(){return d}}}const Base64={encode,decode};function concatUint8Arrays(r,f){const d=new Uint8Array(r.length+f.length);return d.set(r),d.set(f,r.length),d}function splitToUint8Arrays(r,f){if(f>=r.length)throw new Error("Index is out of buffer");const d=r.slice(0,f),g=r.slice(f);return[d,g]}function toHexString(r){let f="";return r.forEach(d=>{f+=("0"+(d&255).toString(16)).slice(-2)}),f}function hexToByteArray(r){if(r.length%2!==0)throw new Error(`Cannot convert ${r} to bytesArray`);const f=new Uint8Array(r.length/2);for(let d=0;d<r.length;d+=2)f[d/2]=parseInt(r.slice(d,d+2),16);return f}class SessionCrypto{constructor(f){this.nonceLength=24,this.keyPair=f?this.createKeypairFromString(f):this.createKeypair(),this.sessionId=toHexString(this.keyPair.publicKey)}createKeypair(){return nacl$1.box.keyPair()}createKeypairFromString(f){return{publicKey:hexToByteArray(f.publicKey),secretKey:hexToByteArray(f.secretKey)}}createNonce(){return nacl$1.randomBytes(this.nonceLength)}encrypt(f,d){const g=new TextEncoder().encode(f),v=this.createNonce(),m=nacl$1.box(g,v,d,this.keyPair.secretKey);return concatUint8Arrays(v,m)}decrypt(f,d){const[g,v]=splitToUint8Arrays(f,this.nonceLength),m=nacl$1.box.open(v,g,d,this.keyPair.secretKey);if(!m)throw new Error(`Decryption error:
33
+ message: ${f.toString()}
34
+ sender pubkey: ${d.toString()}
35
+ keypair pubkey: ${this.keyPair.publicKey.toString()}
36
+ keypair secretkey: ${this.keyPair.secretKey.toString()}`);return new TextDecoder().decode(m)}stringifyKeypair(){return{publicKey:toHexString(this.keyPair.publicKey),secretKey:toHexString(this.keyPair.secretKey)}}}/*! *****************************************************************************
37
+ Copyright (c) Microsoft Corporation.
38
+
39
+ Permission to use, copy, modify, and/or distribute this software for any
40
+ purpose with or without fee is hereby granted.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
43
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
44
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
45
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
46
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
47
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
48
+ PERFORMANCE OF THIS SOFTWARE.
49
+ ***************************************************************************** */function __rest(r,f){var d={};for(var g in r)Object.prototype.hasOwnProperty.call(r,g)&&f.indexOf(g)<0&&(d[g]=r[g]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(r);v<g.length;v++)f.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(r,g[v])&&(d[g[v]]=r[g[v]]);return d}function __awaiter(r,f,d,g){function v(m){return m instanceof d?m:new d(function(w){w(m)})}return new(d||(d=Promise))(function(m,w){function _(b){try{x(g.next(b))}catch(C){w(C)}}function S(b){try{x(g.throw(b))}catch(C){w(C)}}function x(b){b.done?m(b.value):v(b.value).then(_,S)}x((g=g.apply(r,[])).next())})}class TonConnectError extends Error{constructor(f,d){super(f,d),this.message=`${TonConnectError.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${f?`
50
+ `+f:""}`,Object.setPrototypeOf(this,TonConnectError.prototype)}get info(){return""}}TonConnectError.prefix="[TON_CONNECT_SDK_ERROR]";class DappMetadataError extends TonConnectError{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,DappMetadataError.prototype)}}class ManifestContentErrorError extends TonConnectError{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...f){super(...f),Object.setPrototypeOf(this,ManifestContentErrorError.prototype)}}class ManifestNotFoundError extends TonConnectError{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...f){super(...f),Object.setPrototypeOf(this,ManifestNotFoundError.prototype)}}class WalletAlreadyConnectedError extends TonConnectError{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletAlreadyConnectedError.prototype)}}class WalletNotConnectedError extends TonConnectError{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletNotConnectedError.prototype)}}class WalletNotInjectedError extends TonConnectError{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletNotInjectedError.prototype)}}class WalletNotSupportFeatureError extends TonConnectError{get info(){return"Wallet doesn't support requested feature method."}constructor(f,d){super(f,d),Object.setPrototypeOf(this,WalletNotSupportFeatureError.prototype)}}class WalletMissingRequiredFeaturesError extends TonConnectError{get info(){return"Missing required features. You need to update your wallet."}constructor(f,d){super(f,d),Object.setPrototypeOf(this,WalletMissingRequiredFeaturesError.prototype)}}function isWalletConnectionSourceJS(r){return"jsBridgeKey"in r}class UserRejectsError extends TonConnectError{get info(){return"User rejects the action in the wallet."}constructor(...f){super(...f),Object.setPrototypeOf(this,UserRejectsError.prototype)}}class BadRequestError extends TonConnectError{get info(){return"Request to the wallet contains errors."}constructor(...f){super(...f),Object.setPrototypeOf(this,BadRequestError.prototype)}}class UnknownAppError extends TonConnectError{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...f){super(...f),Object.setPrototypeOf(this,UnknownAppError.prototype)}}class FetchWalletsError extends TonConnectError{get info(){return"An error occurred while fetching the wallets list."}constructor(...f){super(...f),Object.setPrototypeOf(this,FetchWalletsError.prototype)}}class WrongAddressError extends TonConnectError{get info(){return"Passed address is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,WrongAddressError.prototype)}}class ParseHexError extends TonConnectError{get info(){return"Passed hex is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,ParseHexError.prototype)}}class UnknownError extends TonConnectError{constructor(...f){super(...f),Object.setPrototypeOf(this,UnknownError.prototype)}}const connectEventErrorsCodes={[CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:ManifestNotFoundError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:ManifestContentErrorError};class ConnectErrorsParser{parseError(f){let d=UnknownError;return f.code in connectEventErrorsCodes&&(d=connectEventErrorsCodes[f.code]||UnknownError),new d(f.message)}}const connectErrorsParser=new ConnectErrorsParser;class RpcParser{isError(f){return"error"in f}}const sendTransactionErrors={[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SendTransactionParser extends RpcParser{convertToRpcRequest(f){return{method:"sendTransaction",params:[JSON.stringify(f)]}}parseAndThrowError(f){let d=UnknownError;throw f.error.code in sendTransactionErrors&&(d=sendTransactionErrors[f.error.code]||UnknownError),new d(f.error.message)}convertFromRpcResponse(f){return{boc:f.result}}}const sendTransactionParser=new SendTransactionParser,signDataErrors={[SIGN_DATA_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SIGN_DATA_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SIGN_DATA_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SIGN_DATA_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SignDataParser extends RpcParser{convertToRpcRequest(f){return{method:"signData",params:[JSON.stringify(f)]}}parseAndThrowError(f){let d=UnknownError;throw f.error.code in signDataErrors&&(d=signDataErrors[f.error.code]||UnknownError),new d(f.error.message)}convertFromRpcResponse(f){return f.result}}const signDataParser=new SignDataParser;class HttpBridgeGatewayStorage{constructor(f,d){this.storage=f,this.storeKey="ton-connect-storage_http-bridge-gateway::"+d}storeLastEventId(f){return __awaiter(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,f)})}removeLastEventId(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);return f||null})}}function removeUrlLastSlash(r){return r.slice(-1)==="/"?r.slice(0,-1):r}function addPathToUrl(r,f){return removeUrlLastSlash(r)+"/"+f}function isTelegramUrl(r){if(!r)return!1;const f=new URL(r);return f.protocol==="tg:"||f.hostname==="t.me"}function encodeTelegramUrlParameters(r){return r.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function delay(r,f){return __awaiter(this,void 0,void 0,function*(){return new Promise((d,g)=>{var v,m;if(!((v=void 0)===null||v===void 0)&&v.aborted){g(new TonConnectError("Delay aborted"));return}const w=setTimeout(()=>d(),r);(m=void 0)===null||m===void 0||m.addEventListener("abort",()=>{clearTimeout(w),g(new TonConnectError("Delay aborted"))})})})}function createAbortController(r){const f=new AbortController;return r!=null&&r.aborted?f.abort():r==null||r.addEventListener("abort",()=>f.abort(),{once:!0}),f}function callForSuccess(r,f){var d,g;return __awaiter(this,void 0,void 0,function*(){const v=(d=f==null?void 0:f.attempts)!==null&&d!==void 0?d:10,m=(g=f==null?void 0:f.delayMs)!==null&&g!==void 0?g:200,w=createAbortController(f==null?void 0:f.signal);if(typeof r!="function")throw new TonConnectError(`Expected a function, got ${typeof r}`);let _=0,S;for(;_<v;){if(w.signal.aborted)throw new TonConnectError(`Aborted after attempts ${_}`);try{return yield r({signal:w.signal})}catch(x){S=x,_++,_<v&&(yield delay(m))}}throw S})}function logDebug$1(...r){}function logError$1(...r){}function logWarning$1(...r){}function createResource$1(r,f){let d=null,g=null,v=null,m=null,w=null;const _=(C,...E)=>__awaiter(this,void 0,void 0,function*(){if(m=C??null,w==null||w.abort(),w=createAbortController(C),w.signal.aborted)throw new TonConnectError("Resource creation was aborted");g=E??null;const M=r(w.signal,...E);v=M;const A=yield M;if(v!==M&&A!==d)throw yield f(A),new TonConnectError("Resource creation was aborted by a new resource creation");return d=A,d});return{create:_,current:()=>d??null,dispose:()=>__awaiter(this,void 0,void 0,function*(){try{const C=d;d=null;const E=v;v=null;try{w==null||w.abort()}catch{}yield Promise.allSettled([C?f(C):Promise.resolve(),E?f(yield E):Promise.resolve()])}catch{}}),recreate:C=>__awaiter(this,void 0,void 0,function*(){const E=d,M=v,A=g,T=m;if(yield delay(C),E===d&&M===v&&A===g&&T===m)return yield _(m,...A??[]);throw new TonConnectError("Resource recreation was aborted by a new resource creation")})}}function timeout(r,f){const d=f==null?void 0:f.timeout,g=f==null?void 0:f.signal,v=createAbortController(g);return new Promise((m,w)=>__awaiter(this,void 0,void 0,function*(){if(v.signal.aborted){w(new TonConnectError("Operation aborted"));return}let _;typeof d<"u"&&(_=setTimeout(()=>{v.abort(),w(new TonConnectError(`Timeout after ${d}ms`))},d)),v.signal.addEventListener("abort",()=>{clearTimeout(_),w(new TonConnectError("Operation aborted"))},{once:!0});const S={timeout:d,abort:v.signal};yield r((...x)=>{clearTimeout(_),m(...x)},()=>{clearTimeout(_),w()},S)}))}class BridgeGateway{constructor(f,d,g,v,m){this.bridgeUrl=d,this.sessionId=g,this.listener=v,this.errorsListener=m,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=createResource$1((w,_)=>__awaiter(this,void 0,void 0,function*(){const S={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:w,openingDeadlineMS:_};return yield createEventSource(S)}),w=>__awaiter(this,void 0,void 0,function*(){w.close()})),this.bridgeGatewayStorage=new HttpBridgeGatewayStorage(f,d)}get isReady(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)===EventSource.OPEN}get isClosed(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)!==EventSource.OPEN}get isConnecting(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)===EventSource.CONNECTING}registerSession(f){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.create(f==null?void 0:f.signal,f==null?void 0:f.openingDeadlineMS)})}send(f,d,g,v){var m;return __awaiter(this,void 0,void 0,function*(){const w={};typeof v=="number"?w.ttl=v:(w.ttl=v==null?void 0:v.ttl,w.signal=v==null?void 0:v.signal,w.attempts=v==null?void 0:v.attempts);const _=new URL(addPathToUrl(this.bridgeUrl,this.postPath));_.searchParams.append("client_id",this.sessionId),_.searchParams.append("to",d),_.searchParams.append("ttl",((w==null?void 0:w.ttl)||this.defaultTtl).toString()),_.searchParams.append("topic",g);const S=Base64.encode(f);yield callForSuccess(x=>__awaiter(this,void 0,void 0,function*(){const b=yield this.post(_,S,x.signal);if(!b.ok)throw new TonConnectError(`Bridge send failed, status ${b.status}`)}),{attempts:(m=w==null?void 0:w.attempts)!==null&&m!==void 0?m:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:w==null?void 0:w.signal})})}pause(){this.eventSource.dispose().catch(f=>logError$1(`Bridge pause failed, ${f}`))}unPause(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(f=>logError$1(`Bridge close failed, ${f}`))})}setListener(f){this.listener=f}setErrorsListener(f){this.errorsListener=f}post(f,d,g){return __awaiter(this,void 0,void 0,function*(){const v=yield fetch(f,{method:"post",body:d,signal:g});if(!v.ok)throw new TonConnectError(`Bridge send failed, status ${v.status}`);return v})}errorsHandler(f,d){return __awaiter(this,void 0,void 0,function*(){if(this.isConnecting)throw f.close(),new TonConnectError("Bridge error, failed to connect");if(this.isReady){try{this.errorsListener(d)}catch{}return}if(this.isClosed)return f.close(),logDebug$1(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new TonConnectError("Bridge error, unknown state")})}messagesHandler(f){return __awaiter(this,void 0,void 0,function*(){if(f.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(f.lastEventId),this.isClosed))return;let d;try{d=JSON.parse(f.data)}catch{throw new TonConnectError(`Bridge message parse failed, message ${f.data}`)}this.listener(d)})}}function createEventSource(r){return __awaiter(this,void 0,void 0,function*(){return yield timeout((f,d,g)=>__awaiter(this,void 0,void 0,function*(){var v;const w=createAbortController(g.signal).signal;if(w.aborted){d(new TonConnectError("Bridge connection aborted"));return}const _=new URL(addPathToUrl(r.bridgeUrl,r.ssePath));_.searchParams.append("client_id",r.sessionId);const S=yield r.bridgeGatewayStorage.getLastEventId();if(S&&_.searchParams.append("last_event_id",S),w.aborted){d(new TonConnectError("Bridge connection aborted"));return}const x=new EventSource(_.toString());x.onerror=b=>__awaiter(this,void 0,void 0,function*(){if(w.aborted){x.close(),d(new TonConnectError("Bridge connection aborted"));return}try{const C=yield r.errorHandler(x,b);C!==x&&x.close(),C&&C!==x&&f(C)}catch(C){x.close(),d(C)}}),x.onopen=()=>{if(w.aborted){x.close(),d(new TonConnectError("Bridge connection aborted"));return}f(x)},x.onmessage=b=>{if(w.aborted){x.close(),d(new TonConnectError("Bridge connection aborted"));return}r.messageHandler(b)},(v=r.signal)===null||v===void 0||v.addEventListener("abort",()=>{x.close(),d(new TonConnectError("Bridge connection aborted"))})}),{timeout:r.openingDeadlineMS,signal:r.signal})})}const CONNECTION_HTTP_EXPIRATION_TIME=300*1e3;function isPendingConnectionHttp(r){return!("connectEvent"in r)}function isPendingConnectionHttpRaw(r){return!("connectEvent"in r)}function isExpiredPendingConnectionHttpRaw(r){var f;return Date.now()-((f=r.createdAt)!==null&&f!==void 0?f:0)>CONNECTION_HTTP_EXPIRATION_TIME}class BridgeConnectionStorage{constructor(f){this.storage=f,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(f){return __awaiter(this,void 0,void 0,function*(){if(f.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(f));if(!isPendingConnectionHttp(f)){const g={sessionKeyPair:f.session.sessionCrypto.stringifyKeypair(),walletPublicKey:f.session.walletPublicKey,bridgeUrl:f.session.bridgeUrl},v={type:"http",connectEvent:f.connectEvent,session:g,lastWalletEventId:f.lastWalletEventId,nextRpcRequestId:f.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(v))}const d={type:"http",connectionSource:f.connectionSource,sessionCrypto:f.sessionCrypto.stringifyKeypair(),createdAt:Date.now()};return this.storage.setItem(this.storeKey,JSON.stringify(d))})}removeConnection(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);if(!f)return null;const d=JSON.parse(f);if(d.type==="injected")return d;if(!isPendingConnectionHttpRaw(d)){const g=new SessionCrypto(d.session.sessionKeyPair);return{type:"http",connectEvent:d.connectEvent,lastWalletEventId:d.lastWalletEventId,nextRpcRequestId:d.nextRpcRequestId,session:{sessionCrypto:g,bridgeUrl:d.session.bridgeUrl,walletPublicKey:d.session.walletPublicKey}}}return isExpiredPendingConnectionHttpRaw(d)?(yield this.removeConnection(),null):{type:"http",sessionCrypto:new SessionCrypto(d.sessionCrypto),connectionSource:d.connectionSource}})}getHttpConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(f.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");return f})}getHttpPendingConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(f.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");if(!isPendingConnectionHttp(f))throw new TonConnectError("Trying to read HTTP-pending connection while http connection is stored");return f})}getInjectedConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read Injected bridge connection source while nothing is stored");if((f==null?void 0:f.type)==="http")throw new TonConnectError("Trying to read Injected bridge connection source while HTTP connection is stored");return f})}storedConnectionType(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);return f?JSON.parse(f).type:null})}storeLastWalletEventId(f){return __awaiter(this,void 0,void 0,function*(){const d=yield this.getConnection();if(d&&d.type==="http"&&!isPendingConnectionHttp(d))return d.lastWalletEventId=f,this.storeConnection(d)})}getLastWalletEventId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(f&&"lastWalletEventId"in f)return f.lastWalletEventId})}increaseNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(f&&"nextRpcRequestId"in f){const d=f.nextRpcRequestId||0;return f.nextRpcRequestId=d+1,this.storeConnection(f)}})}getNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();return f&&"nextRpcRequestId"in f&&f.nextRpcRequestId||0})}}const PROTOCOL_VERSION=2;class BridgeProvider{constructor(f,d){this.storage=f,this.walletConnectionSource=d,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new BridgeConnectionStorage(f)}static fromStorage(f){return __awaiter(this,void 0,void 0,function*(){const g=yield new BridgeConnectionStorage(f).getHttpConnection();return isPendingConnectionHttp(g)?new BridgeProvider(f,g.connectionSource):new BridgeProvider(f,{bridgeUrl:g.session.bridgeUrl})})}connect(f,d){var g;const v=createAbortController(d==null?void 0:d.signal);(g=this.abortController)===null||g===void 0||g.abort(),this.abortController=v,this.closeGateways();const m=new SessionCrypto;this.session={sessionCrypto:m,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:m}).then(()=>__awaiter(this,void 0,void 0,function*(){v.signal.aborted||(yield callForSuccess(_=>{var S;return this.openGateways(m,{openingDeadlineMS:(S=d==null?void 0:d.openingDeadlineMS)!==null&&S!==void 0?S:this.defaultOpeningDeadlineMS,signal:_==null?void 0:_.signal})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:v.signal}))}));const w="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(w,f)}restoreConnection(f){var d,g;return __awaiter(this,void 0,void 0,function*(){const v=createAbortController(f==null?void 0:f.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=v,v.signal.aborted)return;this.closeGateways();const m=yield this.connectionStorage.getHttpConnection();if(!m||v.signal.aborted)return;const w=(g=f==null?void 0:f.openingDeadlineMS)!==null&&g!==void 0?g:this.defaultOpeningDeadlineMS;if(isPendingConnectionHttp(m))return this.session={sessionCrypto:m.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(m.sessionCrypto,{openingDeadlineMS:w,signal:v==null?void 0:v.signal});if(Array.isArray(this.walletConnectionSource))throw new TonConnectError("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=m.session,this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,m.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!v.signal.aborted){this.listeners.forEach(_=>_(m.connectEvent));try{yield callForSuccess(_=>this.gateway.registerSession({openingDeadlineMS:w,signal:_.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:v.signal})}catch{yield this.disconnect({signal:v.signal});return}}})}sendRequest(f,d){const g={};return typeof d=="function"?g.onRequestSent=d:(g.onRequestSent=d==null?void 0:d.onRequestSent,g.signal=d==null?void 0:d.signal,g.attempts=d==null?void 0:d.attempts),new Promise((v,m)=>__awaiter(this,void 0,void 0,function*(){var w;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new TonConnectError("Trying to send bridge request without session");const _=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send http-bridge request:",Object.assign(Object.assign({},f),{id:_}));const S=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},f),{id:_})),hexToByteArray(this.session.walletPublicKey));try{yield this.gateway.send(S,this.session.walletPublicKey,f.method,{attempts:g==null?void 0:g.attempts,signal:g==null?void 0:g.signal}),(w=g==null?void 0:g.onRequestSent)===null||w===void 0||w.call(g),this.pendingRequests.set(_.toString(),v)}catch(x){m(x)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(f){return __awaiter(this,void 0,void 0,function*(){return new Promise(d=>__awaiter(this,void 0,void 0,function*(){let g=!1,v=null;const m=()=>{g||(g=!0,this.removeBridgeAndSession().then(d))};try{this.closeGateways();const w=createAbortController(f==null?void 0:f.signal);v=setTimeout(()=>{w.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:m,signal:w.signal,attempts:1})}catch(w){logDebug$1("Disconnect error:",w),g||this.removeBridgeAndSession().then(d)}finally{v&&clearTimeout(v),m()}}))})}listen(f){return this.listeners.push(f),()=>this.listeners=this.listeners.filter(d=>d!==f)}pause(){var f;(f=this.gateway)===null||f===void 0||f.pause(),this.pendingGateways.forEach(d=>d.pause())}unPause(){return __awaiter(this,void 0,void 0,function*(){const f=this.pendingGateways.map(d=>d.unPause());this.gateway&&f.push(this.gateway.unPause()),yield Promise.all(f)})}pendingGatewaysListener(f,d,g){return __awaiter(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(f)){yield f.close();return}return this.closeGateways({except:f}),this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=d,this.gateway=f,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(g)})}gatewayListener(f){return __awaiter(this,void 0,void 0,function*(){const d=JSON.parse(this.session.sessionCrypto.decrypt(Base64.decode(f.message).toUint8Array(),hexToByteArray(f.from)));if(logDebug$1("Wallet message received:",d),!("event"in d)){const v=d.id.toString(),m=this.pendingRequests.get(v);if(!m){logDebug$1(`Response id ${v} doesn't match any request's id`);return}m(d),this.pendingRequests.delete(v);return}if(d.id!==void 0){const v=yield this.connectionStorage.getLastWalletEventId();if(v!==void 0&&d.id<=v){logError$1(`Received event id (=${d.id}) must be greater than stored last wallet event id (=${v}) `);return}d.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(d.id))}const g=this.listeners;d.event==="connect"&&(yield this.updateSession(d,f.from)),d.event==="disconnect"&&(logDebug$1("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),g.forEach(v=>v(d))})}gatewayErrorsListener(f){return __awaiter(this,void 0,void 0,function*(){throw new TonConnectError(`Bridge error ${JSON.stringify(f)}`)})}updateSession(f,d){return __awaiter(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:d});const g=f.payload.items.find(m=>m.name==="ton_addr"),v=Object.assign(Object.assign({},f),{payload:Object.assign(Object.assign({},f.payload),{items:[g]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:f.id,connectEvent:v,nextRpcRequestId:0})})}removeBridgeAndSession(){return __awaiter(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(f,d){return isTelegramUrl(f)?this.generateTGUniversalLink(f,d):this.generateRegularUniversalLink(f,d)}generateRegularUniversalLink(f,d){const g=new URL(f);return g.searchParams.append("v",PROTOCOL_VERSION.toString()),g.searchParams.append("id",this.session.sessionCrypto.sessionId),g.searchParams.append("r",JSON.stringify(d)),g.toString()}generateTGUniversalLink(f,d){const v=this.generateRegularUniversalLink("about:blank",d).split("?")[1],m="tonconnect-"+encodeTelegramUrlParameters(v),w=this.convertToDirectLink(f),_=new URL(w);return _.searchParams.append("startapp",m),_.toString()}convertToDirectLink(f){const d=new URL(f);return d.searchParams.has("attach")&&(d.searchParams.delete("attach"),d.pathname+="/start"),d.toString()}openGateways(f,d){return __awaiter(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(g=>g.close().catch()),this.pendingGateways=this.walletConnectionSource.map(g=>{const v=new BridgeGateway(this.storage,g.bridgeUrl,f.sessionId,()=>{},()=>{});return v.setListener(m=>this.pendingGatewaysListener(v,g.bridgeUrl,m)),v}),yield Promise.allSettled(this.pendingGateways.map(g=>callForSuccess(v=>{var m;return this.pendingGateways.some(w=>w===g)?g.registerSession({openingDeadlineMS:(m=d==null?void 0:d.openingDeadlineMS)!==null&&m!==void 0?m:this.defaultOpeningDeadlineMS,signal:v.signal}):g.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:d==null?void 0:d.signal})));return}else return this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,f.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:d==null?void 0:d.openingDeadlineMS,signal:d==null?void 0:d.signal})})}closeGateways(f){var d;(d=this.gateway)===null||d===void 0||d.close(),this.pendingGateways.filter(g=>g!==(f==null?void 0:f.except)).forEach(g=>g.close()),this.pendingGateways=[]}}function hasProperty(r,f){return hasProperties(r,[f])}function hasProperties(r,f){return!r||typeof r!="object"?!1:f.every(d=>d in r)}function isJSBridgeWithMetadata(r){try{return!hasProperty(r,"tonconnect")||!hasProperty(r.tonconnect,"walletInfo")?!1:hasProperties(r.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let InMemoryStorage$1=class zt{constructor(){this.storage={}}static getInstance(){return zt.instance||(zt.instance=new zt),zt.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(f){var d;return(d=this.storage[f])!==null&&d!==void 0?d:null}key(f){var d;const g=Object.keys(this.storage);return f<0||f>=g.length?null:(d=g[f])!==null&&d!==void 0?d:null}removeItem(f){delete this.storage[f]}setItem(f,d){this.storage[f]=d}};function getWindow$2(){if(!(typeof window>"u"))return window}function tryGetWindowKeys(){const r=getWindow$2();if(!r)return[];try{return Object.keys(r)}catch{return[]}}function getDocument(){if(!(typeof document>"u"))return document}function getWebPageManifest(){var r;const f=(r=getWindow$2())===null||r===void 0?void 0:r.location.origin;return f?f+"/tonconnect-manifest.json":""}function tryGetLocalStorage$1(){if(isLocalStorageAvailable$1())return localStorage;if(isNodeJs$1())throw new TonConnectError("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return InMemoryStorage$1.getInstance()}function isLocalStorageAvailable$1(){try{return typeof localStorage<"u"}catch{return!1}}function isNodeJs$1(){return typeof process$1<"u"&&process$1.versions!=null&&process$1.versions.node!=null}class InjectedProvider{constructor(f,d){this.injectedWalletKey=d,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const g=InjectedProvider.window;if(!InjectedProvider.isWindowContainsWallet(g,d))throw new WalletNotInjectedError;this.connectionStorage=new BridgeConnectionStorage(f),this.injectedWallet=g[d].tonconnect}static fromStorage(f){return __awaiter(this,void 0,void 0,function*(){const g=yield new BridgeConnectionStorage(f).getInjectedConnection();return new InjectedProvider(f,g.jsBridgeKey)})}static isWalletInjected(f){return InjectedProvider.isWindowContainsWallet(this.window,f)}static isInsideWalletBrowser(f){return InjectedProvider.isWindowContainsWallet(this.window,f)?this.window[f].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?tryGetWindowKeys().filter(([g,v])=>isJSBridgeWithMetadata(v)).map(([g,v])=>({name:v.tonconnect.walletInfo.name,appName:v.tonconnect.walletInfo.app_name,aboutUrl:v.tonconnect.walletInfo.about_url,imageUrl:v.tonconnect.walletInfo.image,tondns:v.tonconnect.walletInfo.tondns,jsBridgeKey:g,injected:!0,embedded:v.tonconnect.isWalletBrowser,platforms:v.tonconnect.walletInfo.platforms,features:v.tonconnect.walletInfo.features})):[]}static isWindowContainsWallet(f,d){return!!f&&d in f&&typeof f[d]=="object"&&"tonconnect"in f[d]}connect(f){this._connect(PROTOCOL_VERSION,f)}restoreConnection(){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1("Injected Provider restoring connection...");const f=yield this.injectedWallet.restoreConnection();logDebug$1("Injected Provider restoring connection response",f),f.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(d=>d(f))):yield this.connectionStorage.removeConnection()}catch{yield this.connectionStorage.removeConnection()}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return __awaiter(this,void 0,void 0,function*(){return new Promise(f=>{const d=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(f)};try{this.injectedWallet.disconnect(),d()}catch(g){logDebug$1(g),this.sendRequest({method:"disconnect",params:[]},d)}})})}closeAllListeners(){var f;this.listenSubscriptions=!1,this.listeners=[],(f=this.unsubscribeCallback)===null||f===void 0||f.call(this)}listen(f){return this.listeners.push(f),()=>this.listeners=this.listeners.filter(d=>d!==f)}sendRequest(f,d){var g;return __awaiter(this,void 0,void 0,function*(){const v={};typeof d=="function"?v.onRequestSent=d:(v.onRequestSent=d==null?void 0:d.onRequestSent,v.signal=d==null?void 0:d.signal);const m=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send injected-bridge request:",Object.assign(Object.assign({},f),{id:m}));const w=this.injectedWallet.send(Object.assign(Object.assign({},f),{id:m}));return w.then(_=>logDebug$1("Wallet message received:",_)),(g=v==null?void 0:v.onRequestSent)===null||g===void 0||g.call(v),w})}_connect(f,d){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1(`Injected Provider connect request: protocolVersion: ${f}, message:`,d);const g=yield this.injectedWallet.connect(f,d);logDebug$1("Injected Provider connect response:",g),g.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(v=>v(g))}catch(g){logDebug$1("Injected Provider connect error:",g);const v={event:"connect_error",payload:{code:0,message:g==null?void 0:g.toString()}};this.listeners.forEach(m=>m(v))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(f=>{logDebug$1("Wallet message received:",f),this.listenSubscriptions&&this.listeners.forEach(d=>d(f)),f.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}InjectedProvider.window=getWindow$2();class DefaultStorage{constructor(){this.localStorage=tryGetLocalStorage$1()}getItem(f){return __awaiter(this,void 0,void 0,function*(){return this.localStorage.getItem(f)})}removeItem(f){return __awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(f)})}setItem(f,d){return __awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(f,d)})}}function isWalletInfoCurrentlyInjected(r){return isWalletInfoInjectable(r)&&r.injected}function isWalletInfoCurrentlyEmbedded(r){return isWalletInfoCurrentlyInjected(r)&&r.embedded}function isWalletInfoInjectable(r){return"jsBridgeKey"in r}function isWalletInfoRemote(r){return"bridgeUrl"in r}const FALLBACK_WALLETS_LIST=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"binanceWeb3TonWallet",name:"Binance Web3 Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect"},{app_name:"fintopio-tg",name:"Fintopio",image:"https://fintopio.com/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gateio.go.link/gateio/web3?adj_t=1ff8khdw_1fu4ccc7"},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"​https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"]},{app_name:"tobi",name:"Tobi",image:"https://app.tobiwallet.app/icons/logo-288.png",about_url:"https://tobi.fun",universal_url:"https://t.me/TobiCopilotBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-bridge.tobiwallet.app/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class WalletsListManager{constructor(f){var d;this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource=(d=f==null?void 0:f.walletsListSource)!==null&&d!==void 0?d:"https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",this.cacheTTLMs=f==null?void 0:f.cacheTTLMs}getWallets(){return __awaiter(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return __awaiter(this,void 0,void 0,function*(){const d=(yield this.getWallets()).filter(isWalletInfoCurrentlyEmbedded);return d.length===1?d[0]:null})}fetchWalletsList(){return __awaiter(this,void 0,void 0,function*(){let f=[];try{if(f=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(f))throw new FetchWalletsError("Wrong wallets list format, wallets list must be an array.");const v=f.filter(m=>!this.isCorrectWalletConfigDTO(m));v.length&&(logError$1(`Wallet(s) ${v.map(m=>(m==null?void 0:m.name)||"unknown").join(", ")} config format is wrong. They were removed from the wallets list.`),f=f.filter(m=>this.isCorrectWalletConfigDTO(m)))}catch(g){logError$1(g),f=FALLBACK_WALLETS_LIST}let d=[];try{d=InjectedProvider.getCurrentlyInjectedWallets()}catch(g){logError$1(g)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(f),d)})}walletConfigDTOListToWalletConfigList(f){return f.map(d=>{const g={name:d.name,appName:d.app_name,imageUrl:d.image,aboutUrl:d.about_url,tondns:d.tondns,platforms:d.platforms,features:d.features};return d.bridge.forEach(v=>{if(v.type==="sse"&&(g.bridgeUrl=v.url,g.universalLink=d.universal_url,g.deepLink=d.deepLink),v.type==="js"){const m=v.key;g.jsBridgeKey=m,g.injected=InjectedProvider.isWalletInjected(m),g.embedded=InjectedProvider.isInsideWalletBrowser(m)}}),g})}mergeWalletsLists(f,d){return[...new Set(f.concat(d).map(v=>v.name)).values()].map(v=>{const m=f.find(_=>_.name===v),w=d.find(_=>_.name===v);return Object.assign(Object.assign({},m&&Object.assign({},m)),w&&Object.assign({},w))})}isCorrectWalletConfigDTO(f){if(!f||typeof f!="object")return!1;const d="name"in f,g="app_name"in f,v="image"in f,m="about_url"in f,w="platforms"in f;if(!d||!v||!m||!w||!g||!f.platforms||!Array.isArray(f.platforms)||!f.platforms.length||!("bridge"in f)||!Array.isArray(f.bridge)||!f.bridge.length)return!1;const _=f.bridge;if(_.some(b=>!b||typeof b!="object"||!("type"in b)))return!1;const S=_.find(b=>b.type==="sse");if(S&&(!(typeof S=="object"&&"url"in S)||!S.url||!f.universal_url))return!1;const x=_.find(b=>b.type==="js");return!(x&&(typeof x!="object"||!("key"in x)||!x.key))}}function checkSendTransactionSupport(r,f){const d=r.includes("SendTransaction"),g=findFeature(r,"SendTransaction"),v={minMessages:f.requiredMessagesNumber,extraCurrencyRequired:f.requireExtraCurrencies};if(!d&&!g)throw new WalletNotSupportFeatureError("Wallet doesn't support SendTransaction feature.",{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});if(f.requireExtraCurrencies&&(!g||!g.extraCurrencySupported))throw new WalletNotSupportFeatureError("Wallet is not able to handle such SendTransaction request. Extra currencies support is required.",{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});if(g&&g.maxMessages!==void 0){if(g.maxMessages<f.requiredMessagesNumber)throw new WalletNotSupportFeatureError(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${g.maxMessages}, but ${f.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});return}logWarning$1("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function checkSignDataSupport(r,f){const d=r.find(v=>v&&typeof v=="object"&&v.name==="SignData");if(!d)throw new WalletNotSupportFeatureError("Wallet doesn't support SignData feature.",{cause:{requiredFeature:{featureName:"SignData",value:{types:f.requiredTypes}}}});const g=f.requiredTypes.filter(v=>!d.types.includes(v));if(g.length)throw new WalletNotSupportFeatureError(`Wallet doesn't support required SignData types: ${g.join(", ")}.`,{cause:{requiredFeature:{featureName:"SignData",value:{types:g}}}})}function checkRequiredWalletFeatures(r,f){if(typeof f!="object")return!0;const{sendTransaction:d,signData:g}=f;if(d){const v=findFeature(r,"SendTransaction");if(!v||!checkSendTransaction(v,d))return!1}if(g){const v=findFeature(r,"SignData");if(!v||!checkSignData(v,g))return!1}return!0}function findFeature(r,f){return r.find(d=>d&&typeof d=="object"&&d.name===f)}function checkSendTransaction(r,f){const d=f.minMessages===void 0||f.minMessages<=r.maxMessages,g=!f.extraCurrencyRequired||r.extraCurrencySupported;return!!(d&&g)}function checkSignData(r,f){return f.types.every(d=>r.types.includes(d))}function createRequestVersionEvent(){return{type:"request-version"}}function createResponseVersionEvent(r){return{type:"response-version",version:r}}function createVersionInfo(r){return{ton_connect_sdk_lib:r.ton_connect_sdk_lib,ton_connect_ui_lib:r.ton_connect_ui_lib}}function createConnectionInfo(r,f){var d,g,v,m,w,_,S,x;const C=((d=f==null?void 0:f.connectItems)===null||d===void 0?void 0:d.tonProof)&&"proof"in f.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:(v=(g=f==null?void 0:f.account)===null||g===void 0?void 0:g.address)!==null&&v!==void 0?v:null,wallet_type:(m=f==null?void 0:f.device.appName)!==null&&m!==void 0?m:null,wallet_version:(w=f==null?void 0:f.device.appVersion)!==null&&w!==void 0?w:null,auth_type:C,custom_data:Object.assign({chain_id:(S=(_=f==null?void 0:f.account)===null||_===void 0?void 0:_.chain)!==null&&S!==void 0?S:null,provider:(x=f==null?void 0:f.provider)!==null&&x!==void 0?x:null},createVersionInfo(r))}}function createConnectionStartedEvent(r){return{type:"connection-started",custom_data:createVersionInfo(r)}}function createConnectionCompletedEvent(r,f){return Object.assign({type:"connection-completed",is_success:!0},createConnectionInfo(r,f))}function createConnectionErrorEvent(r,f,d){return{type:"connection-error",is_success:!1,error_message:f,error_code:d??null,custom_data:createVersionInfo(r)}}function createConnectionRestoringStartedEvent(r){return{type:"connection-restoring-started",custom_data:createVersionInfo(r)}}function createConnectionRestoringCompletedEvent(r,f){return Object.assign({type:"connection-restoring-completed",is_success:!0},createConnectionInfo(r,f))}function createConnectionRestoringErrorEvent(r,f){return{type:"connection-restoring-error",is_success:!1,error_message:f,custom_data:createVersionInfo(r)}}function createTransactionInfo(r,f){var d,g,v,m;return{valid_until:(d=String(f.validUntil))!==null&&d!==void 0?d:null,from:(m=(g=f.from)!==null&&g!==void 0?g:(v=r==null?void 0:r.account)===null||v===void 0?void 0:v.address)!==null&&m!==void 0?m:null,messages:f.messages.map(w=>{var _,S;return{address:(_=w.address)!==null&&_!==void 0?_:null,amount:(S=w.amount)!==null&&S!==void 0?S:null}})}}function createTransactionSentForSignatureEvent(r,f,d){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createTransactionSignedEvent(r,f,d,g){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:g.boc},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createTransactionSigningFailedEvent(r,f,d,g,v){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:g,error_code:v??null},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createDataSentForSignatureEvent(r,f,d){return Object.assign({type:"sign-data-request-initiated",data:d},createConnectionInfo(r,f))}function createDataSignedEvent(r,f,d,g){return Object.assign({type:"sign-data-request-completed",is_success:!0,data:d,signed_data:g},createConnectionInfo(r,f))}function createDataSigningFailedEvent(r,f,d,g,v){return Object.assign({type:"sign-data-request-failed",is_success:!1,data:d,error_message:g,error_code:v??null},createConnectionInfo(r,f))}function createDisconnectionEvent(r,f,d){return Object.assign({type:"disconnection",scope:d},createConnectionInfo(r,f))}class BrowserEventDispatcher{constructor(){this.window=getWindow$2()}dispatchEvent(f,d){var g;return __awaiter(this,void 0,void 0,function*(){const v=new CustomEvent(f,{detail:d});(g=this.window)===null||g===void 0||g.dispatchEvent(v)})}addEventListener(f,d,g){var v;return __awaiter(this,void 0,void 0,function*(){return(v=this.window)===null||v===void 0||v.addEventListener(f,d,g),()=>{var m;return(m=this.window)===null||m===void 0?void 0:m.removeEventListener(f,d)}})}}class TonConnectTracker{constructor(f){var d;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(d=f==null?void 0:f.eventDispatcher)!==null&&d!==void 0?d:new BrowserEventDispatcher,this.tonConnectSdkVersion=f.tonConnectSdkVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __awaiter(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return __awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>__awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",createResponseVersionEvent(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return __awaiter(this,void 0,void 0,function*(){return new Promise((f,d)=>__awaiter(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",g=>{f(g.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",createRequestVersionEvent())}catch(g){d(g)}}))})}dispatchUserActionEvent(f){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${f.type}`,f).catch()}catch{}}trackConnectionStarted(...f){try{const d=createConnectionStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(...f){try{const d=createConnectionCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(...f){try{const d=createConnectionErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(...f){try{const d=createConnectionRestoringStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(...f){try{const d=createConnectionRestoringCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(...f){try{const d=createConnectionRestoringErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(...f){try{const d=createDisconnectionEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(...f){try{const d=createTransactionSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(...f){try{const d=createTransactionSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(...f){try{const d=createTransactionSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSentForSignature(...f){try{const d=createDataSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigned(...f){try{const d=createDataSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigningFailed(...f){try{const d=createDataSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectSdkVersion="3.2.0";class TonConnect{constructor(f){if(this.walletsList=new WalletsListManager,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(f==null?void 0:f.manifestUrl)||getWebPageManifest(),storage:(f==null?void 0:f.storage)||new DefaultStorage},this.walletsRequiredFeatures=f==null?void 0:f.walletsRequiredFeatures,this.walletsList=new WalletsListManager({walletsListSource:f==null?void 0:f.walletsListSource,cacheTTLMs:f==null?void 0:f.walletsListCacheTTLMs}),this.tracker=new TonConnectTracker({eventDispatcher:f==null?void 0:f.eventDispatcher,tonConnectSdkVersion}),!this.dappSettings.manifestUrl)throw new DappMetadataError("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new BridgeConnectionStorage(this.dappSettings.storage),f!=null&&f.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var f;return((f=this._wallet)===null||f===void 0?void 0:f.account)||null}get wallet(){return this._wallet}set wallet(f){this._wallet=f,this.statusChangeSubscriptions.forEach(d=>d(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(f,d){return this.statusChangeSubscriptions.push(f),d&&this.statusChangeErrorSubscriptions.push(d),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(g=>g!==f),d&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(g=>g!==d))}}connect(f,d){var g,v;const m={};if(typeof d=="object"&&"tonProof"in d&&(m.request=d),typeof d=="object"&&("openingDeadlineMS"in d||"signal"in d||"request"in d)&&(m.request=d==null?void 0:d.request,m.openingDeadlineMS=d==null?void 0:d.openingDeadlineMS,m.signal=d==null?void 0:d.signal),this.connected)throw new WalletAlreadyConnectedError;const w=createAbortController(m==null?void 0:m.signal);if((g=this.abortController)===null||g===void 0||g.abort(),this.abortController=w,w.signal.aborted)throw new TonConnectError("Connection was aborted");return(v=this.provider)===null||v===void 0||v.closeConnection(),this.provider=this.createProvider(f),w.signal.addEventListener("abort",()=>{var _;(_=this.provider)===null||_===void 0||_.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(m==null?void 0:m.request),{openingDeadlineMS:m==null?void 0:m.openingDeadlineMS,signal:w.signal})}restoreConnection(f){var d,g;return __awaiter(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const v=createAbortController(f==null?void 0:f.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=v,v.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[m,w]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(v.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let _=null;try{switch(m){case"http":_=yield BridgeProvider.fromStorage(this.dappSettings.storage);break;case"injected":_=yield InjectedProvider.fromStorage(this.dappSettings.storage);break;default:if(w)_=this.createProvider(w);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),_==null||_.closeConnection(),_=null;return}if(v.signal.aborted){_==null||_.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!_){logError$1("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(g=this.provider)===null||g===void 0||g.closeConnection(),this.provider=_,_.listen(this.walletEventsListener.bind(this));const S=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),_==null||_.closeConnection(),_=null};v.signal.addEventListener("abort",S);const x=callForSuccess(C=>__awaiter(this,void 0,void 0,function*(){yield _==null?void 0:_.restoreConnection({openingDeadlineMS:f==null?void 0:f.openingDeadlineMS,signal:C.signal}),v.signal.removeEventListener("abort",S),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:f==null?void 0:f.signal}),b=new Promise(C=>setTimeout(()=>C(),12e3));return Promise.race([x,b])})}sendTransaction(f,d){return __awaiter(this,void 0,void 0,function*(){const g={};typeof d=="function"?g.onRequestSent=d:(g.onRequestSent=d==null?void 0:d.onRequestSent,g.signal=d==null?void 0:d.signal);const v=createAbortController(g==null?void 0:g.signal);if(v.signal.aborted)throw new TonConnectError("Transaction sending was aborted");this.checkConnection();const m=f.messages.length,w=f.messages.some(A=>A.extraCurrency&&Object.keys(A.extraCurrency).length>0);checkSendTransactionSupport(this.wallet.device.features,{requiredMessagesNumber:m,requireExtraCurrencies:w}),this.tracker.trackTransactionSentForSignature(this.wallet,f);const{validUntil:_,messages:S}=f,x=__rest(f,["validUntil","messages"]),b=f.from||this.account.address,C=f.network||this.account.chain,E=yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},x),{from:b,network:C,valid_until:_,messages:S.map(A=>{var{extraCurrency:T}=A,L=__rest(A,["extraCurrency"]);return Object.assign(Object.assign({},L),{extra_currency:T})})})),{onRequestSent:g.onRequestSent,signal:v.signal});if(sendTransactionParser.isError(E))return this.tracker.trackTransactionSigningFailed(this.wallet,f,E.error.message,E.error.code),sendTransactionParser.parseAndThrowError(E);const M=sendTransactionParser.convertFromRpcResponse(E);return this.tracker.trackTransactionSigned(this.wallet,f,M),M})}signData(f,d){return __awaiter(this,void 0,void 0,function*(){const g=createAbortController(d==null?void 0:d.signal);if(g.signal.aborted)throw new TonConnectError("data sending was aborted");this.checkConnection(),checkSignDataSupport(this.wallet.device.features,{requiredTypes:[f.type]}),this.tracker.trackDataSentForSignature(this.wallet,f);const v=f.from||this.account.address,m=f.network||this.account.chain,w=yield this.provider.sendRequest(signDataParser.convertToRpcRequest(Object.assign(Object.assign({},f),{from:v,network:m})),{onRequestSent:d==null?void 0:d.onRequestSent,signal:g.signal});if(signDataParser.isError(w))return this.tracker.trackDataSigningFailed(this.wallet,f,w.error.message,w.error.code),signDataParser.parseAndThrowError(w);const _=signDataParser.convertFromRpcResponse(w);return this.tracker.trackDataSigned(this.wallet,f,_),_})}disconnect(f){var d;return __awaiter(this,void 0,void 0,function*(){if(!this.connected)throw new WalletNotConnectedError;const g=createAbortController(f==null?void 0:f.signal),v=this.abortController;if(this.abortController=g,g.signal.aborted)throw new TonConnectError("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(d=this.provider)===null||d===void 0?void 0:d.disconnect({signal:g.signal}),v==null||v.abort()})}pauseConnection(){var f;((f=this.provider)===null||f===void 0?void 0:f.type)==="http"&&this.provider.pause()}unPauseConnection(){var f;return((f=this.provider)===null||f===void 0?void 0:f.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const f=getDocument();if(f)try{f.addEventListener("visibilitychange",()=>{f.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(d){logError$1("Cannot subscribe to the document.visibilitychange: ",d)}}createProvider(f){let d;return!Array.isArray(f)&&isWalletConnectionSourceJS(f)?d=new InjectedProvider(this.dappSettings.storage,f.jsBridgeKey):d=new BridgeProvider(this.dappSettings.storage,f),d.listen(this.walletEventsListener.bind(this)),d}walletEventsListener(f){switch(f.event){case"connect":this.onWalletConnected(f.payload);break;case"connect_error":this.tracker.trackConnectionError(f.payload.message,f.payload.code);const d=connectErrorsParser.parseError(f.payload);this.onWalletConnectError(d);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(f){var d;const g=f.items.find(_=>_.name==="ton_addr"),v=f.items.find(_=>_.name==="ton_proof");if(!g)throw new TonConnectError("ton_addr connection item was not found");if(!checkRequiredWalletFeatures(f.device.features,this.walletsRequiredFeatures)){(d=this.provider)===null||d===void 0||d.disconnect(),this.onWalletConnectError(new WalletMissingRequiredFeaturesError("Wallet does not support required features",{cause:{connectEvent:f}}));return}const w={device:f.device,provider:this.provider.type,account:{address:g.address,chain:g.network,walletStateInit:g.walletStateInit,publicKey:g.publicKey}};if(v){let _;try{if("proof"in v)_={name:"ton_proof",proof:{timestamp:v.proof.timestamp,domain:{lengthBytes:v.proof.domain.lengthBytes,value:v.proof.domain.value},payload:v.proof.payload,signature:v.proof.signature}};else if("error"in v)_={name:"ton_proof",error:{code:v.error.code,message:v.error.message}};else throw new TonConnectError("Invalid data format")}catch{_={name:"ton_proof",error:{code:CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:"Invalid data format"}}}w.connectItems={tonProof:_}}this.wallet=w,this.tracker.trackConnectionCompleted(w)}onWalletConnectError(f){if(this.statusChangeErrorSubscriptions.forEach(d=>d(f)),logDebug$1(f),f instanceof ManifestNotFoundError||f instanceof ManifestContentErrorError)throw logError$1(f),f}onWalletDisconnected(f){this.tracker.trackDisconnection(this.wallet,f),this.wallet=null}checkConnection(){if(!this.connected)throw new WalletNotConnectedError}createConnectRequest(f){const d=[{name:"ton_addr"}];return f!=null&&f.tonProof&&d.push({name:"ton_proof",payload:f.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:d}}}TonConnect.walletsList=new WalletsListManager,TonConnect.isWalletInjected=r=>InjectedProvider.isWalletInjected(r),TonConnect.isInsideWalletBrowser=r=>InjectedProvider.isInsideWalletBrowser(r);const noBounceableTag=81,testOnlyTag=128;function toUserFriendlyAddress(r,f=!1){const{wc:d,hex:g}=parseHexAddress(r);let v=noBounceableTag;f&&(v|=testOnlyTag);const m=new Int8Array(34);m[0]=v,m[1]=d,m.set(g,2);const w=new Uint8Array(36);return w.set(m),w.set(crc16(m),34),Base64.encode(w).replace(/\+/g,"-").replace(/\//g,"_")}function parseHexAddress(r){if(!r.includes(":"))throw new WrongAddressError(`Wrong address ${r}. Address must include ":".`);const f=r.split(":");if(f.length!==2)throw new WrongAddressError(`Wrong address ${r}. Address must include ":" only once.`);const d=parseInt(f[0]);if(d!==0&&d!==-1)throw new WrongAddressError(`Wrong address ${r}. WC must be eq 0 or -1, but ${d} received.`);const g=f[1];if((g==null?void 0:g.length)!==64)throw new WrongAddressError(`Wrong address ${r}. Hex part must be 64bytes length, but ${g==null?void 0:g.length} received.`);return{wc:d,hex:hexToBytes(g)}}function crc16(r){let d=0;const g=new Uint8Array(r.length+2);g.set(r);for(let v of g){let m=128;for(;m>0;)d<<=1,v&m&&(d+=1),m>>=1,d>65535&&(d&=65535,d^=4129)}return new Uint8Array([Math.floor(d/256),d%256])}const toByteMap={};for(let r=0;r<=255;r++){let f=r.toString(16);f.length<2&&(f="0"+f),toByteMap[f]=r}function hexToBytes(r){r=r.toLowerCase();const f=r.length;if(f%2!==0)throw new ParseHexError("Hex string must have length a multiple of 2: "+r);const d=f/2,g=new Uint8Array(d);for(let v=0;v<d;v++){const m=v*2,w=r.substring(m,m+2);if(!toByteMap.hasOwnProperty(w))throw new ParseHexError("Invalid hex character: "+w);g[v]=toByteMap[w]}return g}var uaParser$1={exports:{}},uaParser=uaParser$1.exports,hasRequiredUaParser;function requireUaParser(){return hasRequiredUaParser||(hasRequiredUaParser=1,(function(r,f){(function(d,g){var v="1.0.41",m="",w="?",_="function",S="undefined",x="object",b="string",C="major",E="model",M="name",A="type",T="vendor",L="version",O="architecture",N="console",H="mobile",V="tablet",X="smarttv",oe="wearable",se="embedded",de=500,he="Amazon",we="Apple",te="ASUS",q="BlackBerry",k="Browser",y="Chrome",B="Edge",$="Firefox",I="Google",F="Honor",j="Huawei",D="Lenovo",W="LG",R="Microsoft",z="Motorola",ye="Nvidia",Ce="OnePlus",me="Opera",ie="OPPO",ee="Samsung",pe="Sharp",be="Sony",ae="Xiaomi",ne="Zebra",Se="Facebook",ke="Chromium OS",Ie="Mac OS",Oe=" Browser",Ue=function(Z,J){var ge={};for(var Ee in Z)J[Ee]&&J[Ee].length%2===0?ge[Ee]=J[Ee].concat(Z[Ee]):ge[Ee]=Z[Ee];return ge},De=function(Z){for(var J={},ge=0;ge<Z.length;ge++)J[Z[ge].toUpperCase()]=Z[ge];return J},$e=function(Z,J){return typeof Z===b?je(J).indexOf(je(Z))!==-1:!1},je=function(Z){return Z.toLowerCase()},Ye=function(Z){return typeof Z===b?Z.replace(/[^\d\.]/g,m).split(".")[0]:g},st=function(Z,J){if(typeof Z===b)return Z=Z.replace(/^\s\s*/,m),typeof J===S?Z:Z.substring(0,de)},Je=function(Z,J){for(var ge=0,Ee,Re,qe,Xe,He,Ze;ge<J.length&&!He;){var _t=J[ge],tt=J[ge+1];for(Ee=Re=0;Ee<_t.length&&!He&&_t[Ee];)if(He=_t[Ee++].exec(Z),He)for(qe=0;qe<tt.length;qe++)Ze=He[++Re],Xe=tt[qe],typeof Xe===x&&Xe.length>0?Xe.length===2?typeof Xe[1]==_?this[Xe[0]]=Xe[1].call(this,Ze):this[Xe[0]]=Xe[1]:Xe.length===3?typeof Xe[1]===_&&!(Xe[1].exec&&Xe[1].test)?this[Xe[0]]=Ze?Xe[1].call(this,Ze,Xe[2]):g:this[Xe[0]]=Ze?Ze.replace(Xe[1],Xe[2]):g:Xe.length===4&&(this[Xe[0]]=Ze?Xe[3].call(this,Ze.replace(Xe[1],Xe[2])):g):this[Xe]=Ze||g;ge+=2}},Ge=function(Z,J){for(var ge in J)if(typeof J[ge]===x&&J[ge].length>0){for(var Ee=0;Ee<J[ge].length;Ee++)if($e(J[ge][Ee],Z))return ge===w?g:ge}else if($e(J[ge],Z))return ge===w?g:ge;return J.hasOwnProperty("*")?J["*"]:Z},ut={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},gt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},rt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[M,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[M,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[M,L],[/opios[\/ ]+([\w\.]+)/i],[L,[M,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[L,[M,me+" GX"]],[/\bopr\/([\w\.]+)/i],[L,[M,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[L,[M,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[L,[M,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[M,L],[/quark(?:pc)?\/([-\w\.]+)/i],[L,[M,"Quark"]],[/\bddg\/([\w\.]+)/i],[L,[M,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[M,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[L,[M,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[M,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[M,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[L,[M,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[L,[M,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[M,/(.+)/,"$1 Secure "+k],L],[/\bfocus\/([\w\.]+)/i],[L,[M,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[L,[M,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[M,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[M,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[M,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[M,"MIUI"+Oe]],[/fxios\/([\w\.-]+)/i],[L,[M,$]],[/\bqihoobrowser\/?([\w\.]*)/i],[L,[M,"360"]],[/\b(qq)\/([\w\.]+)/i],[[M,/(.+)/,"$1Browser"],L],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[M,/(.+)/,"$1"+Oe],L],[/samsungbrowser\/([\w\.]+)/i],[L,[M,ee+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[L,[M,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[M,"Sogou Mobile"],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[M,L],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[M],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[L,M],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[M,Se],L],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[M,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[M,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[L,[M,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[M,y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[M,y+" WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[M,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[M,L],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[L,[M,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[L,M],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[M,[L,Ge,ut]],[/(webkit|khtml)\/([\w\.]+)/i],[M,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[M,"Netscape"],L],[/(wolvic|librewolf)\/([\w\.]+)/i],[M,L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[M,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[M,[L,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[M,[L,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[O,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[O,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[O,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[O,/ower/,m,je]],[/ sun4\w[;\)]/i],[[O,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[O,je]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[T,ee],[A,V]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[E,[T,ee],[A,H]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[E,[T,we],[A,H]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[E,[T,we],[A,V]],[/(macintosh);/i],[E,[T,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[T,pe],[A,H]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[E,[T,F],[A,V]],[/honor([-\w ]+)[;\)]/i],[E,[T,F],[A,H]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[E,[T,j],[A,V]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[E,[T,j],[A,H]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[E,/_/g," "],[T,ae],[A,V]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[E,/_/g," "],[T,ae],[A,H]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[T,ie],[A,H]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[E,[T,Ge,{OnePlus:["304","403","203"],"*":ie}],[A,V]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[T,"Vivo"],[A,H]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[T,"Realme"],[A,H]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[E,[T,z],[A,H]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[T,z],[A,V]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[T,W],[A,V]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[T,W],[A,H]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[E,[T,D],[A,V]],[/(nokia) (t[12][01])/i],[T,E,[A,V]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[E,/_/g," "],[A,H],[T,"Nokia"]],[/(pixel (c|tablet))\b/i],[E,[T,I],[A,V]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[E,[T,I],[A,H]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[T,be],[A,H]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[T,be],[A,V]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[T,Ce],[A,H]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[T,he],[A,V]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[T,he],[A,H]],[/(playbook);[-\w\),; ]+(rim)/i],[E,T,[A,V]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[E,[T,q],[A,H]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[T,te],[A,V]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[T,te],[A,H]],[/(nexus 9)/i],[E,[T,"HTC"],[A,V]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[T,[E,/_/g," "],[A,H]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[E,[T,"TCL"],[A,V]],[/(itel) ((\w+))/i],[[T,je],E,[A,Ge,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[T,"Acer"],[A,V]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[T,"Meizu"],[A,H]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[T,"Ulefone"],[A,H]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[E,[T,"Energizer"],[A,H]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[E,[T,"Cat"],[A,H]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[E,[T,"Smartfren"],[A,H]],[/droid.+; (a(?:015|06[35]|142p?))/i],[E,[T,"Nothing"],[A,H]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[E,[T,"Archos"],[A,V]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[E,[T,"Archos"],[A,H]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[T,E,[A,V]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[T,E,[A,H]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[T,E,[A,V]],[/(surface duo)/i],[E,[T,R],[A,V]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[T,"Fairphone"],[A,H]],[/(u304aa)/i],[E,[T,"AT&T"],[A,H]],[/\bsie-(\w*)/i],[E,[T,"Siemens"],[A,H]],[/\b(rct\w+) b/i],[E,[T,"RCA"],[A,V]],[/\b(venue[\d ]{2,7}) b/i],[E,[T,"Dell"],[A,V]],[/\b(q(?:mv|ta)\w+) b/i],[E,[T,"Verizon"],[A,V]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[E,[T,"Barnes & Noble"],[A,V]],[/\b(tm\d{3}\w+) b/i],[E,[T,"NuVision"],[A,V]],[/\b(k88) b/i],[E,[T,"ZTE"],[A,V]],[/\b(nx\d{3}j) b/i],[E,[T,"ZTE"],[A,H]],[/\b(gen\d{3}) b.+49h/i],[E,[T,"Swiss"],[A,H]],[/\b(zur\d{3}) b/i],[E,[T,"Swiss"],[A,V]],[/\b((zeki)?tb.*\b) b/i],[E,[T,"Zeki"],[A,V]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[T,"Dragon Touch"],E,[A,V]],[/\b(ns-?\w{0,9}) b/i],[E,[T,"Insignia"],[A,V]],[/\b((nxa|next)-?\w{0,9}) b/i],[E,[T,"NextBook"],[A,V]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[T,"Voice"],E,[A,H]],[/\b(lvtel\-)?(v1[12]) b/i],[[T,"LvTel"],E,[A,H]],[/\b(ph-1) /i],[E,[T,"Essential"],[A,H]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[E,[T,"Envizen"],[A,V]],[/\b(trio[-\w\. ]+) b/i],[E,[T,"MachSpeed"],[A,V]],[/\btu_(1491) b/i],[E,[T,"Rotor"],[A,V]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[E,[T,ye],[A,V]],[/(sprint) (\w+)/i],[T,E,[A,H]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[T,R],[A,H]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[T,ne],[A,V]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[T,ne],[A,H]],[/smart-tv.+(samsung)/i],[T,[A,X]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[T,ee],[A,X]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[T,W],[A,X]],[/(apple) ?tv/i],[T,[E,we+" TV"],[A,X]],[/crkey/i],[[E,y+"cast"],[T,I],[A,X]],[/droid.+aft(\w+)( bui|\))/i],[E,[T,he],[A,X]],[/(shield \w+ tv)/i],[E,[T,ye],[A,X]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[T,pe],[A,X]],[/(bravia[\w ]+)( bui|\))/i],[E,[T,be],[A,X]],[/(mi(tv|box)-?\w+) bui/i],[E,[T,ae],[A,X]],[/Hbbtv.*(technisat) (.*);/i],[T,E,[A,X]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[T,st],[E,st],[A,X]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[E,[A,X]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[A,X]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[T,E,[A,N]],[/droid.+; (shield)( bui|\))/i],[E,[T,ye],[A,N]],[/(playstation \w+)/i],[E,[T,be],[A,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[T,R],[A,N]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[E,[T,ee],[A,oe]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[T,E,[A,oe]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[E,[T,ie],[A,oe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[T,we],[A,oe]],[/(opwwe\d{3})/i],[E,[T,Ce],[A,oe]],[/(moto 360)/i],[E,[T,z],[A,oe]],[/(smartwatch 3)/i],[E,[T,be],[A,oe]],[/(g watch r)/i],[E,[T,W],[A,oe]],[/droid.+; (wt63?0{2,3})\)/i],[E,[T,ne],[A,oe]],[/droid.+; (glass) \d/i],[E,[T,I],[A,oe]],[/(pico) (4|neo3(?: link|pro)?)/i],[T,E,[A,oe]],[/; (quest( \d| pro)?)/i],[E,[T,Se],[A,oe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[T,[A,se]],[/(aeobc)\b/i],[E,[T,he],[A,se]],[/(homepod).+mac os/i],[E,[T,we],[A,se]],[/windows iot/i],[[A,se]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[E,[A,H]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[E,[A,V]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[A,V]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[A,H]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[E,[T,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[M,B+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[M,L],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[M,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[M,L],[/ladybird\//i],[[M,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,M]],os:[[/microsoft (windows) (vista|xp)/i],[M,L],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[M,[L,Ge,gt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,Ge,gt],[M,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[M,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[M,Ie],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[L,M],[/(ubuntu) ([\w\.]+) like android/i],[[M,/(.+)/,"$1 Touch"],L],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[M,L],[/\(bb(10);/i],[L,[M,q]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[L,[M,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[M,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[M,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[L,[M,"watchOS"]],[/crkey\/([\d\.]+)/i],[L,[M,y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[M,ke],L],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[M,L],[/(sunos) ?([\w\.\d]*)/i],[[M,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[M,L]]},wt=function(Z,J){if(typeof Z===x&&(J=Z,Z=g),!(this instanceof wt))return new wt(Z,J).getResult();var ge=typeof d!==S&&d.navigator?d.navigator:g,Ee=Z||(ge&&ge.userAgent?ge.userAgent:m),Re=ge&&ge.userAgentData?ge.userAgentData:g,qe=J?Ue(rt,J):rt,Xe=ge&&ge.userAgent==Ee;return this.getBrowser=function(){var He={};return He[M]=g,He[L]=g,Je.call(He,Ee,qe.browser),He[C]=Ye(He[L]),Xe&&ge&&ge.brave&&typeof ge.brave.isBrave==_&&(He[M]="Brave"),He},this.getCPU=function(){var He={};return He[O]=g,Je.call(He,Ee,qe.cpu),He},this.getDevice=function(){var He={};return He[T]=g,He[E]=g,He[A]=g,Je.call(He,Ee,qe.device),Xe&&!He[A]&&Re&&Re.mobile&&(He[A]=H),Xe&&He[E]=="Macintosh"&&ge&&typeof ge.standalone!==S&&ge.maxTouchPoints&&ge.maxTouchPoints>2&&(He[E]="iPad",He[A]=V),He},this.getEngine=function(){var He={};return He[M]=g,He[L]=g,Je.call(He,Ee,qe.engine),He},this.getOS=function(){var He={};return He[M]=g,He[L]=g,Je.call(He,Ee,qe.os),Xe&&!He[M]&&Re&&Re.platform&&Re.platform!="Unknown"&&(He[M]=Re.platform.replace(/chrome os/i,ke).replace(/macos/i,Ie)),He},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ee},this.setUA=function(He){return Ee=typeof He===b&&He.length>de?st(He,de):He,this},this.setUA(Ee),this};wt.VERSION=v,wt.BROWSER=De([M,L,C]),wt.CPU=De([O]),wt.DEVICE=De([E,T,A,N,H,X,V,oe,se]),wt.ENGINE=wt.OS=De([M,L]),r.exports&&(f=r.exports=wt),f.UAParser=wt;var bt=typeof d!==S&&(d.jQuery||d.Zepto);if(bt&&!bt.ua){var le=new wt;bt.ua=le.getResult(),bt.ua.get=function(){return le.getUA()},bt.ua.set=function(Z){le.setUA(Z);var J=le.getResult();for(var ge in J)bt.ua[ge]=J[ge]}}})(typeof window=="object"?window:uaParser)})(uaParser$1,uaParser$1.exports)),uaParser$1.exports}var uaParserExports=requireUaParser();const UAParser=getDefaultExportFromCjs(uaParserExports);var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var r=function(N){return f(N)&&!d(N)};function f(O){return!!O&&typeof O=="object"}function d(O){var N=Object.prototype.toString.call(O);return N==="[object RegExp]"||N==="[object Date]"||m(O)}var g=typeof Symbol=="function"&&Symbol.for,v=g?Symbol.for("react.element"):60103;function m(O){return O.$$typeof===v}function w(O){return Array.isArray(O)?[]:{}}function _(O,N){return N.clone!==!1&&N.isMergeableObject(O)?T(w(O),O,N):O}function S(O,N,H){return O.concat(N).map(function(V){return _(V,H)})}function x(O,N){if(!N.customMerge)return T;var H=N.customMerge(O);return typeof H=="function"?H:T}function b(O){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(O).filter(function(N){return Object.propertyIsEnumerable.call(O,N)}):[]}function C(O){return Object.keys(O).concat(b(O))}function E(O,N){try{return N in O}catch{return!1}}function M(O,N){return E(O,N)&&!(Object.hasOwnProperty.call(O,N)&&Object.propertyIsEnumerable.call(O,N))}function A(O,N,H){var V={};return H.isMergeableObject(O)&&C(O).forEach(function(X){V[X]=_(O[X],H)}),C(N).forEach(function(X){M(O,X)||(E(O,X)&&H.isMergeableObject(N[X])?V[X]=x(X,H)(O[X],N[X],H):V[X]=_(N[X],H))}),V}function T(O,N,H){H=H||{},H.arrayMerge=H.arrayMerge||S,H.isMergeableObject=H.isMergeableObject||r,H.cloneUnlessOtherwiseSpecified=_;var V=Array.isArray(N),X=Array.isArray(O),oe=V===X;return oe?V?H.arrayMerge(O,N,H):A(O,N,H):_(N,H)}T.all=function(N,H){if(!Array.isArray(N))throw new Error("first argument should be an array");return N.reduce(function(V,X){return T(V,X,H)},{})};var L=T;return cjs=L,cjs}var cjsExports=requireCjs();const deepmerge=getDefaultExportFromCjs(cjsExports);var classnames={exports:{}};/*!
51
+ Copyright (c) 2018 Jed Watson.
52
+ Licensed under the MIT License (MIT), see
53
+ http://jedwatson.github.io/classnames
54
+ */var hasRequiredClassnames;function requireClassnames(){return hasRequiredClassnames||(hasRequiredClassnames=1,(function(r){(function(){var f={}.hasOwnProperty;function d(){for(var m="",w=0;w<arguments.length;w++){var _=arguments[w];_&&(m=v(m,g(_)))}return m}function g(m){if(typeof m=="string"||typeof m=="number")return m;if(typeof m!="object")return"";if(Array.isArray(m))return d.apply(null,m);if(m.toString!==Object.prototype.toString&&!m.toString.toString().includes("[native code]"))return m.toString();var w="";for(var _ in m)f.call(m,_)&&m[_]&&(w=v(w,_));return w}function v(m,w){return w?m?m+" "+w:m+w:m}r.exports?(d.default=d,r.exports=d):window.classNames=d})()})(classnames)),classnames.exports}var classnamesExports=requireClassnames();const cn=getDefaultExportFromCjs(classnamesExports);var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(r,f,d)=>f in r?__defProp(r,f,{enumerable:!0,configurable:!0,writable:!0,value:d}):r[f]=d,__spreadValues=(r,f)=>{for(var d in f||(f={}))__hasOwnProp.call(f,d)&&__defNormalProp(r,d,f[d]);if(__getOwnPropSymbols)for(var d of __getOwnPropSymbols(f))__propIsEnum.call(f,d)&&__defNormalProp(r,d,f[d]);return r},__spreadProps=(r,f)=>__defProps(r,__getOwnPropDescs(f)),__publicField=(r,f,d)=>(__defNormalProp(r,typeof f!="symbol"?f+"":f,d),d),__async=(r,f,d)=>new Promise((g,v)=>{var m=S=>{try{_(d.next(S))}catch(x){v(x)}},w=S=>{try{_(d.throw(S))}catch(x){v(x)}},_=S=>S.done?g(S.value):Promise.resolve(S.value).then(m,w);_((d=d.apply(r,f)).next())}),_a,_b,_c,_d,_e,_f,_g,_h;const sharedConfig={};function setHydrateContext(r){sharedConfig.context=r}const equalFn=(r,f)=>r===f,$PROXY=Symbol("solid-proxy"),$TRACK=Symbol("solid-track"),signalOptions={equals:equalFn};let runEffects=runQueue;const STALE=1,PENDING=2,UNOWNED={owned:null,cleanups:null,context:null,owner:null},NO_INIT={};var Owner=null;let Transition$1=null,Listener=null,Updates=null,Effects=null,ExecCount=0;function createRoot(r,f){const d=Listener,g=Owner,v=r.length===0,m=v?UNOWNED:{owned:null,cleanups:null,context:null,owner:f===void 0?g:f},w=v?r:()=>r(()=>untrack(()=>cleanNode(m)));Owner=m,Listener=null;try{return runUpdates(w,!0)}finally{Listener=d,Owner=g}}function createSignal(r,f){f=f?Object.assign({},signalOptions,f):signalOptions;const d={value:r,observers:null,observerSlots:null,comparator:f.equals||void 0},g=v=>(typeof v=="function"&&(v=v(d.value)),writeSignal(d,v));return[readSignal.bind(d),g]}function createComputed(r,f,d){const g=createComputation(r,f,!0,STALE);updateComputation(g)}function createRenderEffect(r,f,d){const g=createComputation(r,f,!1,STALE);updateComputation(g)}function createEffect(r,f,d){runEffects=runUserEffects;const g=createComputation(r,f,!1,STALE);g.user=!0,Effects?Effects.push(g):updateComputation(g)}function createMemo(r,f,d){d=d?Object.assign({},signalOptions,d):signalOptions;const g=createComputation(r,f,!0,0);return g.observers=null,g.observerSlots=null,g.comparator=d.equals||void 0,updateComputation(g),readSignal.bind(g)}function createResource(r,f,d){let g,v,m;arguments.length===1?(g=!0,v=r,m={}):(g=r,v=f,m={});let w=null,_=NO_INIT,S=null,x=!1,b="initialValue"in m,C=typeof g=="function"&&createMemo(g);const E=new Set,[M,A]=(m.storage||createSignal)(m.initialValue),[T,L]=createSignal(void 0),[O,N]=createSignal(void 0,{equals:!1}),[H,V]=createSignal(b?"ready":"unresolved");if(sharedConfig.context){S=`${sharedConfig.context.id}${sharedConfig.context.count++}`;let he;m.ssrLoadFrom==="initial"?_=m.initialValue:sharedConfig.load&&(he=sharedConfig.load(S))&&(_=he[0])}function X(he,we,te,q){return w===he&&(w=null,b=!0,(he===_||we===_)&&m.onHydrated&&queueMicrotask(()=>m.onHydrated(q,{value:we})),_=NO_INIT,oe(we,te)),we}function oe(he,we){runUpdates(()=>{we===void 0&&A(()=>he),V(we!==void 0?"errored":"ready"),L(we);for(const te of E.keys())te.decrement();E.clear()},!1)}function se(){const he=SuspenseContext,we=M(),te=T();if(te!==void 0&&!w)throw te;return Listener&&Listener.user,we}function de(he=!0){if(he!==!1&&x)return;x=!1;const we=C?C():g;if(we==null||we===!1){X(w,untrack(M));return}const te=_!==NO_INIT?_:untrack(()=>v(we,{value:M(),refetching:he}));return typeof te!="object"||!(te&&"then"in te)?(X(w,te,void 0,we),te):(w=te,x=!0,queueMicrotask(()=>x=!1),runUpdates(()=>{V(b?"refreshing":"pending"),N()},!1),te.then(q=>X(te,q,void 0,we),q=>X(te,void 0,castError(q),we)))}return Object.defineProperties(se,{state:{get:()=>H()},error:{get:()=>T()},loading:{get(){const he=H();return he==="pending"||he==="refreshing"}},latest:{get(){if(!b)return se();const he=T();if(he&&!w)throw he;return M()}}}),C?createComputed(()=>de(!1)):de(!1),[se,{refetch:de,mutate:A}]}function batch(r){return runUpdates(r,!1)}function untrack(r){if(Listener===null)return r();const f=Listener;Listener=null;try{return r()}finally{Listener=f}}function on(r,f,d){const g=Array.isArray(r);let v;return m=>{let w;if(g){w=Array(r.length);for(let S=0;S<r.length;S++)w[S]=r[S]()}else w=r();const _=untrack(()=>f(w,v,m));return v=w,_}}function onMount(r){createEffect(()=>untrack(r))}function onCleanup(r){return Owner===null||(Owner.cleanups===null?Owner.cleanups=[r]:Owner.cleanups.push(r)),r}function getListener(){return Listener}function getOwner(){return Owner}function createContext(r,f){const d=Symbol("context");return{id:d,Provider:createProvider(d),defaultValue:r}}function useContext(r){let f;return(f=lookup(Owner,r.id))!==void 0?f:r.defaultValue}function children(r){const f=createMemo(r),d=createMemo(()=>resolveChildren(f()));return d.toArray=()=>{const g=d();return Array.isArray(g)?g:g!=null?[g]:[]},d}let SuspenseContext;function readSignal(){const r=Transition$1;if(this.sources&&(this.state||r))if(this.state===STALE||r)updateComputation(this);else{const f=Updates;Updates=null,runUpdates(()=>lookUpstream(this),!1),Updates=f}if(Listener){const f=this.observers?this.observers.length:0;Listener.sources?(Listener.sources.push(this),Listener.sourceSlots.push(f)):(Listener.sources=[this],Listener.sourceSlots=[f]),this.observers?(this.observers.push(Listener),this.observerSlots.push(Listener.sources.length-1)):(this.observers=[Listener],this.observerSlots=[Listener.sources.length-1])}return this.value}function writeSignal(r,f,d){let g=r.value;return(!r.comparator||!r.comparator(g,f))&&(r.value=f,r.observers&&r.observers.length&&runUpdates(()=>{for(let v=0;v<r.observers.length;v+=1){const m=r.observers[v],w=Transition$1&&Transition$1.running;w&&Transition$1.disposed.has(m),(w&&!m.tState||!w&&!m.state)&&(m.pure?Updates.push(m):Effects.push(m),m.observers&&markDownstream(m)),w||(m.state=STALE)}if(Updates.length>1e6)throw Updates=[],new Error},!1)),f}function updateComputation(r){if(!r.fn)return;cleanNode(r);const f=Owner,d=Listener,g=ExecCount;Listener=Owner=r,runComputation(r,r.value,g),Listener=d,Owner=f}function runComputation(r,f,d){let g;try{g=r.fn(f)}catch(v){r.pure&&(r.state=STALE,r.owned&&r.owned.forEach(cleanNode),r.owned=null),handleError(v)}(!r.updatedAt||r.updatedAt<=d)&&(r.updatedAt!=null&&"observers"in r?writeSignal(r,g):r.value=g,r.updatedAt=d)}function createComputation(r,f,d,g=STALE,v){const m={fn:r,state:g,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:f,owner:Owner,context:null,pure:d};return Owner===null||Owner!==UNOWNED&&(Owner.owned?Owner.owned.push(m):Owner.owned=[m]),m}function runTop(r){const f=Transition$1;if(r.state===0||f)return;if(r.state===PENDING||f)return lookUpstream(r);if(r.suspense&&untrack(r.suspense.inFallback))return r.suspense.effects.push(r);const d=[r];for(;(r=r.owner)&&(!r.updatedAt||r.updatedAt<ExecCount);)(r.state||f)&&d.push(r);for(let g=d.length-1;g>=0;g--)if(r=d[g],r.state===STALE||f)updateComputation(r);else if(r.state===PENDING||f){const v=Updates;Updates=null,runUpdates(()=>lookUpstream(r,d[0]),!1),Updates=v}}function runUpdates(r,f){if(Updates)return r();let d=!1;f||(Updates=[]),Effects?d=!0:Effects=[],ExecCount++;try{const g=r();return completeUpdates(d),g}catch(g){d||(Effects=null),Updates=null,handleError(g)}}function completeUpdates(r){if(Updates&&(runQueue(Updates),Updates=null),r)return;const f=Effects;Effects=null,f.length&&runUpdates(()=>runEffects(f),!1)}function runQueue(r){for(let f=0;f<r.length;f++)runTop(r[f])}function runUserEffects(r){let f,d=0;for(f=0;f<r.length;f++){const g=r[f];g.user?r[d++]=g:runTop(g)}for(sharedConfig.context&&setHydrateContext(),f=0;f<d;f++)runTop(r[f])}function lookUpstream(r,f){const d=Transition$1;r.state=0;for(let g=0;g<r.sources.length;g+=1){const v=r.sources[g];v.sources&&(v.state===STALE||d?v!==f&&runTop(v):(v.state===PENDING||d)&&lookUpstream(v,f))}}function markDownstream(r){const f=Transition$1;for(let d=0;d<r.observers.length;d+=1){const g=r.observers[d];(!g.state||f)&&(g.state=PENDING,g.pure?Updates.push(g):Effects.push(g),g.observers&&markDownstream(g))}}function cleanNode(r){let f;if(r.sources)for(;r.sources.length;){const d=r.sources.pop(),g=r.sourceSlots.pop(),v=d.observers;if(v&&v.length){const m=v.pop(),w=d.observerSlots.pop();g<v.length&&(m.sourceSlots[w]=g,v[g]=m,d.observerSlots[g]=w)}}if(r.owned){for(f=0;f<r.owned.length;f++)cleanNode(r.owned[f]);r.owned=null}if(r.cleanups){for(f=0;f<r.cleanups.length;f++)r.cleanups[f]();r.cleanups=null}r.state=0,r.context=null}function castError(r){return r instanceof Error||typeof r=="string"?r:new Error("Unknown error")}function handleError(r){throw r=castError(r),r}function lookup(r,f){return r?r.context&&r.context[f]!==void 0?r.context[f]:lookup(r.owner,f):void 0}function resolveChildren(r){if(typeof r=="function"&&!r.length)return resolveChildren(r());if(Array.isArray(r)){const f=[];for(let d=0;d<r.length;d++){const g=resolveChildren(r[d]);Array.isArray(g)?f.push.apply(f,g):f.push(g)}return f}return r}function createProvider(r,f){return function(g){let v;return createRenderEffect(()=>v=untrack(()=>(Owner.context={[r]:g.value},children(()=>g.children))),void 0),v}}const FALLBACK=Symbol("fallback");function dispose(r){for(let f=0;f<r.length;f++)r[f]()}function mapArray(r,f,d={}){let g=[],v=[],m=[],w=0,_=f.length>1?[]:null;return onCleanup(()=>dispose(m)),()=>{let S=r()||[],x,b;return S[$TRACK],untrack(()=>{let E=S.length,M,A,T,L,O,N,H,V,X;if(E===0)w!==0&&(dispose(m),m=[],g=[],v=[],w=0,_&&(_=[])),d.fallback&&(g=[FALLBACK],v[0]=createRoot(oe=>(m[0]=oe,d.fallback())),w=1);else if(w===0){for(v=new Array(E),b=0;b<E;b++)g[b]=S[b],v[b]=createRoot(C);w=E}else{for(T=new Array(E),L=new Array(E),_&&(O=new Array(E)),N=0,H=Math.min(w,E);N<H&&g[N]===S[N];N++);for(H=w-1,V=E-1;H>=N&&V>=N&&g[H]===S[V];H--,V--)T[V]=v[H],L[V]=m[H],_&&(O[V]=_[H]);for(M=new Map,A=new Array(V+1),b=V;b>=N;b--)X=S[b],x=M.get(X),A[b]=x===void 0?-1:x,M.set(X,b);for(x=N;x<=H;x++)X=g[x],b=M.get(X),b!==void 0&&b!==-1?(T[b]=v[x],L[b]=m[x],_&&(O[b]=_[x]),b=A[b],M.set(X,b)):m[x]();for(b=N;b<E;b++)b in T?(v[b]=T[b],m[b]=L[b],_&&(_[b]=O[b],_[b](b))):v[b]=createRoot(C);v=v.slice(0,w=E),g=S.slice(0)}return v});function C(E){if(m[b]=E,_){const[M,A]=createSignal(b);return _[b]=A,f(S[b],M)}return f(S[b])}}}function createComponent(r,f){return untrack(()=>r(f||{}))}function trueFn(){return!0}const propTraps={get(r,f,d){return f===$PROXY?d:r.get(f)},has(r,f){return f===$PROXY?!0:r.has(f)},set:trueFn,deleteProperty:trueFn,getOwnPropertyDescriptor(r,f){return{configurable:!0,enumerable:!0,get(){return r.get(f)},set:trueFn,deleteProperty:trueFn}},ownKeys(r){return r.keys()}};function resolveSource(r){return(r=typeof r=="function"?r():r)?r:{}}function mergeProps(...r){let f=!1;for(let g=0;g<r.length;g++){const v=r[g];f=f||!!v&&$PROXY in v,r[g]=typeof v=="function"?(f=!0,createMemo(v)):v}if(f)return new Proxy({get(g){for(let v=r.length-1;v>=0;v--){const m=resolveSource(r[v])[g];if(m!==void 0)return m}},has(g){for(let v=r.length-1;v>=0;v--)if(g in resolveSource(r[v]))return!0;return!1},keys(){const g=[];for(let v=0;v<r.length;v++)g.push(...Object.keys(resolveSource(r[v])));return[...new Set(g)]}},propTraps);const d={};for(let g=r.length-1;g>=0;g--)if(r[g]){const v=Object.getOwnPropertyDescriptors(r[g]);for(const m in v)m in d||Object.defineProperty(d,m,{enumerable:!0,get(){for(let w=r.length-1;w>=0;w--){const _=(r[w]||{})[m];if(_!==void 0)return _}}})}return d}function splitProps(r,...f){const d=new Set(f.flat());if($PROXY in r){const v=f.map(m=>new Proxy({get(w){return m.includes(w)?r[w]:void 0},has(w){return m.includes(w)&&w in r},keys(){return m.filter(w=>w in r)}},propTraps));return v.push(new Proxy({get(m){return d.has(m)?void 0:r[m]},has(m){return d.has(m)?!1:m in r},keys(){return Object.keys(r).filter(m=>!d.has(m))}},propTraps)),v}const g=Object.getOwnPropertyDescriptors(r);return f.push(Object.keys(g).filter(v=>!d.has(v))),f.map(v=>{const m={};for(let w=0;w<v.length;w++){const _=v[w];_ in r&&Object.defineProperty(m,_,g[_]?g[_]:{get(){return r[_]},set(){return!0},enumerable:!0})}return m})}function For(r){const f="fallback"in r&&{fallback:()=>r.fallback};return createMemo(mapArray(()=>r.each,r.children,f||void 0))}function Show(r){let f=!1;const d=r.keyed,g=createMemo(()=>r.when,void 0,{equals:(v,m)=>f?v===m:!v==!m});return createMemo(()=>{const v=g();if(v){const m=r.children,w=typeof m=="function"&&m.length>0;return f=d||w,w?untrack(()=>m(v)):m}return r.fallback},void 0,void 0)}function Switch(r){let f=!1,d=!1;const g=(w,_)=>w[0]===_[0]&&(f?w[1]===_[1]:!w[1]==!_[1])&&w[2]===_[2],v=children(()=>r.children),m=createMemo(()=>{let w=v();Array.isArray(w)||(w=[w]);for(let _=0;_<w.length;_++){const S=w[_].when;if(S)return d=!!w[_].keyed,[_,S,w[_]]}return[-1]},void 0,{equals:g});return createMemo(()=>{const[w,_,S]=m();if(w<0)return r.fallback;const x=S.children,b=typeof x=="function"&&x.length>0;return f=d||b,b?untrack(()=>x(_)):x},void 0,void 0)}function Match(r){return r}const booleans=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Properties=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...booleans]),ChildProperties=new Set(["innerHTML","textContent","innerText","children"]),Aliases=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),PropAliases=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),DelegatedEvents=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),SVGElements=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),SVGNamespace={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function reconcileArrays(r,f,d){let g=d.length,v=f.length,m=g,w=0,_=0,S=f[v-1].nextSibling,x=null;for(;w<v||_<m;){if(f[w]===d[_]){w++,_++;continue}for(;f[v-1]===d[m-1];)v--,m--;if(v===w){const b=m<g?_?d[_-1].nextSibling:d[m-_]:S;for(;_<m;)r.insertBefore(d[_++],b)}else if(m===_)for(;w<v;)(!x||!x.has(f[w]))&&f[w].remove(),w++;else if(f[w]===d[m-1]&&d[_]===f[v-1]){const b=f[--v].nextSibling;r.insertBefore(d[_++],f[w++].nextSibling),r.insertBefore(d[--m],b),f[v]=d[m]}else{if(!x){x=new Map;let C=_;for(;C<m;)x.set(d[C],C++)}const b=x.get(f[w]);if(b!=null)if(_<b&&b<m){let C=w,E=1,M;for(;++C<v&&C<m&&!((M=x.get(f[C]))==null||M!==b+E);)E++;if(E>b-_){const A=f[w];for(;_<b;)r.insertBefore(d[_++],A)}else r.replaceChild(d[_++],f[w++])}else w++;else f[w++].remove()}}}const $$EVENTS="_$DX_DELEGATE";function render(r,f,d,g={}){let v;return createRoot(m=>{v=m,f===document?r():insert(f,r(),f.firstChild?null:void 0,d)},g.owner),()=>{v(),f.textContent=""}}function template$1(r,f,d){if(typeof window>"u")return null;const g=document.createElement("template");g.innerHTML=r;let v=g.content.firstChild;return d&&(v=v.firstChild),v}function delegateEvents(r,f=window.document){const d=f[$$EVENTS]||(f[$$EVENTS]=new Set);for(let g=0,v=r.length;g<v;g++){const m=r[g];d.has(m)||(d.add(m),f.addEventListener(m,eventHandler))}}function setAttribute(r,f,d){d==null?r.removeAttribute(f):r.setAttribute(f,d)}function setAttributeNS(r,f,d,g){g==null?r.removeAttributeNS(f,d):r.setAttributeNS(f,d,g)}function className(r,f){f==null?r.removeAttribute("class"):r.className=f}function addEventListener(r,f,d,g){if(g)Array.isArray(d)?(r[`$$${f}`]=d[0],r[`$$${f}Data`]=d[1]):r[`$$${f}`]=d;else if(Array.isArray(d)){const v=d[0];r.addEventListener(f,d[0]=m=>v.call(r,d[1],m))}else r.addEventListener(f,d)}function classList(r,f,d={}){const g=Object.keys(f||{}),v=Object.keys(d);let m,w;for(m=0,w=v.length;m<w;m++){const _=v[m];!_||_==="undefined"||f[_]||(toggleClassKey(r,_,!1),delete d[_])}for(m=0,w=g.length;m<w;m++){const _=g[m],S=!!f[_];!_||_==="undefined"||d[_]===S||!S||(toggleClassKey(r,_,!0),d[_]=S)}return d}function style(r,f,d){if(!f)return d?setAttribute(r,"style"):f;const g=r.style;if(typeof f=="string")return g.cssText=f;typeof d=="string"&&(g.cssText=d=void 0),d||(d={}),f||(f={});let v,m;for(m in d)f[m]==null&&g.removeProperty(m),delete d[m];for(m in f)v=f[m],v!==d[m]&&(g.setProperty(m,v),d[m]=v);return d}function spread(r,f={},d,g){const v={};return createRenderEffect(()=>v.children=insertExpression(r,f.children,v.children)),createRenderEffect(()=>f.ref&&f.ref(r)),createRenderEffect(()=>assign(r,f,d,!0,v,!0)),v}function use(r,f,d){return untrack(()=>r(f,d))}function insert(r,f,d,g){if(d!==void 0&&!g&&(g=[]),typeof f!="function")return insertExpression(r,f,g,d);createRenderEffect(v=>insertExpression(r,f(),v,d),g)}function assign(r,f,d,g,v={},m=!1){f||(f={});for(const w in v)if(!(w in f)){if(w==="children")continue;v[w]=assignProp(r,w,null,v[w],d,m)}for(const w in f){if(w==="children")continue;const _=f[w];v[w]=assignProp(r,w,_,v[w],d,m)}}function getNextElement(r){let f,d;return!sharedConfig.context||!(f=sharedConfig.registry.get(d=getHydrationKey()))?r.cloneNode(!0):(sharedConfig.completed&&sharedConfig.completed.add(f),sharedConfig.registry.delete(d),f)}function toPropertyName(r){return r.toLowerCase().replace(/-([a-z])/g,(f,d)=>d.toUpperCase())}function toggleClassKey(r,f,d){const g=f.trim().split(/\s+/);for(let v=0,m=g.length;v<m;v++)r.classList.toggle(g[v],d)}function assignProp(r,f,d,g,v,m){let w,_,S;if(f==="style")return style(r,d,g);if(f==="classList")return classList(r,d,g);if(d===g)return g;if(f==="ref")m||d(r);else if(f.slice(0,3)==="on:"){const x=f.slice(3);g&&r.removeEventListener(x,g),d&&r.addEventListener(x,d)}else if(f.slice(0,10)==="oncapture:"){const x=f.slice(10);g&&r.removeEventListener(x,g,!0),d&&r.addEventListener(x,d,!0)}else if(f.slice(0,2)==="on"){const x=f.slice(2).toLowerCase(),b=DelegatedEvents.has(x);if(!b&&g){const C=Array.isArray(g)?g[0]:g;r.removeEventListener(x,C)}(b||d)&&(addEventListener(r,x,d,b),b&&delegateEvents([x]))}else if((S=ChildProperties.has(f))||!v&&(PropAliases[f]||(_=Properties.has(f)))||(w=r.nodeName.includes("-")))f==="class"||f==="className"?className(r,d):w&&!_&&!S?r[toPropertyName(f)]=d:r[PropAliases[f]||f]=d;else{const x=v&&f.indexOf(":")>-1&&SVGNamespace[f.split(":")[0]];x?setAttributeNS(r,x,f,d):setAttribute(r,Aliases[f]||f,d)}return d}function eventHandler(r){const f=`$$${r.type}`;let d=r.composedPath&&r.composedPath()[0]||r.target;for(r.target!==d&&Object.defineProperty(r,"target",{configurable:!0,value:d}),Object.defineProperty(r,"currentTarget",{configurable:!0,get(){return d||document}}),sharedConfig.registry&&!sharedConfig.done&&(sharedConfig.done=!0,document.querySelectorAll("[id^=pl-]").forEach(g=>{for(;g&&g.nodeType!==8&&g.nodeValue!=="pl-"+r;){let v=g.nextSibling;g.remove(),g=v}g&&g.remove()}));d;){const g=d[f];if(g&&!d.disabled){const v=d[`${f}Data`];if(v!==void 0?g.call(d,v,r):g.call(d,r),r.cancelBubble)return}d=d._$host||d.parentNode||d.host}}function insertExpression(r,f,d,g,v){for(sharedConfig.context&&!d&&(d=[...r.childNodes]);typeof d=="function";)d=d();if(f===d)return d;const m=typeof f,w=g!==void 0;if(r=w&&d[0]&&d[0].parentNode||r,m==="string"||m==="number"){if(sharedConfig.context)return d;if(m==="number"&&(f=f.toString()),w){let _=d[0];_&&_.nodeType===3?_.data=f:_=document.createTextNode(f),d=cleanChildren(r,d,g,_)}else d!==""&&typeof d=="string"?d=r.firstChild.data=f:d=r.textContent=f}else if(f==null||m==="boolean"){if(sharedConfig.context)return d;d=cleanChildren(r,d,g)}else{if(m==="function")return createRenderEffect(()=>{let _=f();for(;typeof _=="function";)_=_();d=insertExpression(r,_,d,g)}),()=>d;if(Array.isArray(f)){const _=[],S=d&&Array.isArray(d);if(normalizeIncomingArray(_,f,d,v))return createRenderEffect(()=>d=insertExpression(r,_,d,g,!0)),()=>d;if(sharedConfig.context){if(!_.length)return d;for(let x=0;x<_.length;x++)if(_[x].parentNode)return d=_}if(_.length===0){if(d=cleanChildren(r,d,g),w)return d}else S?d.length===0?appendNodes(r,_,g):reconcileArrays(r,d,_):(d&&cleanChildren(r),appendNodes(r,_));d=_}else if(f instanceof Node){if(sharedConfig.context&&f.parentNode)return d=w?[f]:f;if(Array.isArray(d)){if(w)return d=cleanChildren(r,d,g,f);cleanChildren(r,d,null,f)}else d==null||d===""||!r.firstChild?r.appendChild(f):r.replaceChild(f,r.firstChild);d=f}}return d}function normalizeIncomingArray(r,f,d,g){let v=!1;for(let m=0,w=f.length;m<w;m++){let _=f[m],S=d&&d[m];if(_ instanceof Node)r.push(_);else if(!(_==null||_===!0||_===!1))if(Array.isArray(_))v=normalizeIncomingArray(r,_,S)||v;else if(typeof _=="function")if(g){for(;typeof _=="function";)_=_();v=normalizeIncomingArray(r,Array.isArray(_)?_:[_],Array.isArray(S)?S:[S])||v}else r.push(_),v=!0;else{const x=String(_);S&&S.nodeType===3&&S.data===x?r.push(S):r.push(document.createTextNode(x))}}return v}function appendNodes(r,f,d=null){for(let g=0,v=f.length;g<v;g++)r.insertBefore(f[g],d)}function cleanChildren(r,f,d,g){if(d===void 0)return r.textContent="";const v=g||document.createTextNode("");if(f.length){let m=!1;for(let w=f.length-1;w>=0;w--){const _=f[w];if(v!==_){const S=_.parentNode===r;!m&&!w?S?r.replaceChild(v,_):r.insertBefore(v,d):S&&_.remove()}else m=!0}}else r.insertBefore(v,d);return[v]}function getHydrationKey(){const r=sharedConfig.context;return`${r.id}${r.count++}`}const SVG_NAMESPACE="http://www.w3.org/2000/svg";function createElement(r,f=!1){return f?document.createElementNS(SVG_NAMESPACE,r):document.createElement(r)}function Portal(r){const{useShadow:f}=r,d=document.createTextNode(""),g=r.mount||document.body;function v(){if(sharedConfig.context){const[m,w]=createSignal(!1);return queueMicrotask(()=>w(!0)),()=>m()&&r.children}else return()=>r.children}if(g instanceof HTMLHeadElement){const[m,w]=createSignal(!1),_=()=>w(!0);createRoot(S=>insert(g,()=>m()?S():v()(),null)),onCleanup(()=>{sharedConfig.context?queueMicrotask(_):_()})}else{const m=createElement(r.isSVG?"g":"div",r.isSVG),w=f&&m.attachShadow?m.attachShadow({mode:"open"}):m;Object.defineProperty(m,"_$host",{get(){return d.parentNode},configurable:!0}),insert(w,v()),g.appendChild(m),r.ref&&r.ref(m),onCleanup(()=>g.removeChild(m))}return d}function Dynamic(r){const[f,d]=splitProps(r,["component"]),g=createMemo(()=>f.component);return createMemo(()=>{const v=g();switch(typeof v){case"function":return untrack(()=>v(d));case"string":const m=SVGElements.has(v),w=sharedConfig.context?getNextElement():createElement(v,m);return spread(w,d,m),w}})}var THEME=(r=>(r.DARK="DARK",r.LIGHT="LIGHT",r))(THEME||{});let e={data:""},t=r=>typeof window=="object"?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n=/\n+/g,o=(r,f)=>{let d="",g="",v="";for(let m in r){let w=r[m];m[0]=="@"?m[1]=="i"?d=m+" "+w+";":g+=m[1]=="f"?o(w,m):m+"{"+o(w,m[1]=="k"?"":f)+"}":typeof w=="object"?g+=o(w,f?f.replace(/([^,])+/g,_=>m.replace(/(^:.*)|([^,])+/g,S=>/&/.test(S)?S.replace(/&/g,_):_?_+" "+S:S)):m):w!=null&&(m=/^--/.test(m)?m:m.replace(/[A-Z]/g,"-$&").toLowerCase(),v+=o.p?o.p(m,w):m+":"+w+";")}return d+(f&&v?f+"{"+v+"}":v)+g},c={},s=r=>{if(typeof r=="object"){let f="";for(let d in r)f+=d+s(r[d]);return f}return r},i=(r,f,d,g,v)=>{let m=s(r),w=c[m]||(c[m]=(S=>{let x=0,b=11;for(;x<S.length;)b=101*b+S.charCodeAt(x++)>>>0;return"go"+b})(m));if(!c[w]){let S=m!==r?r:(x=>{let b,C,E=[{}];for(;b=l.exec(x.replace(a,""));)b[4]?E.shift():b[3]?(C=b[3].replace(n," ").trim(),E.unshift(E[0][C]=E[0][C]||{})):E[0][b[1]]=b[2].replace(n," ").trim();return E[0]})(r);c[w]=o(v?{["@keyframes "+w]:S}:S,d?"":"."+w)}let _=d&&c.g?c.g:null;return d&&(c.g=c[w]),((S,x,b,C)=>{C?x.data=x.data.replace(C,S):x.data.indexOf(S)===-1&&(x.data=b?S+x.data:x.data+S)})(c[w],f,g,_),w},p=(r,f,d)=>r.reduce((g,v,m)=>{let w=f[m];if(w&&w.call){let _=w(d),S=_&&_.props&&_.props.className||/^go/.test(_)&&_;w=S?"."+S:_&&typeof _=="object"?_.props?"":o(_,""):_===!1?"":_}return g+v+(w??"")},"");function u(r){let f=this||{},d=r.call?r(f.p):r;return i(d.unshift?d.raw?p(d,[].slice.call(arguments,1),f.p):d.reduce((g,v)=>Object.assign(g,v&&v.call?v(f.p):v),{}):d,t(f.target),f.g,f.o,f.k)}u.bind({g:1});let h=u.bind({k:1});const ThemeContext=createContext();function ThemeProvider(r){return createComponent(ThemeContext.Provider,{value:r.theme,get children(){return r.children}})}function useTheme(){return useContext(ThemeContext)}function makeStyled(r){let f=this||{};return(...d)=>{const g=v=>{const m=useContext(ThemeContext),w=mergeProps(v,{theme:m}),_=mergeProps(w,{get class(){const M=w.class,A="class"in w&&/^go[0-9]+/.test(M);let T=u.apply({target:f.target,o:A,p:w,g:f.g},d);return[M,T].filter(Boolean).join(" ")}}),[S,x]=splitProps(_,["as","theme"]),b=x,C=S.as||r;let E;return typeof C=="function"?E=C(b):f.g==1?(E=document.createElement(C),spread(E,b)):E=Dynamic(mergeProps({component:C},b)),E};return g.class=v=>untrack(()=>u.apply({target:f.target,p:v,g:f.g},d)),g}}const styled=new Proxy(makeStyled,{get(r,f){return r(f)}});function createGlobalStyles(){const r=makeStyled.call({g:1},"div").apply(null,arguments);return function(d){return r(d),null}}const globalStylesTag="tc-root",disableScrollClass="tc-disable-scroll",usingMouseClass="tc-using-mouse",GlobalStyles=()=>{document.body.addEventListener("mousedown",()=>document.body.classList.add(usingMouseClass)),document.body.addEventListener("keydown",f=>{f.key==="Tab"&&document.body.classList.remove(usingMouseClass)});const r=createGlobalStyles`
55
+ ${globalStylesTag} * {
56
+ margin: 0;
57
+ padding: 0;
58
+ box-sizing: border-box;
59
+
60
+ font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif;
61
+ -webkit-font-smoothing: antialiased;
62
+ -moz-osx-font-smoothing: grayscale;
63
+ -webkit-tap-highlight-color: transparent;
64
+ }
65
+
66
+ ${globalStylesTag} img {
67
+ -webkit-user-select: none;
68
+ -webkit-touch-callout: none;
69
+ }
70
+
71
+ ${globalStylesTag} *:focus {
72
+ outline: #08f auto 2px;
73
+ }
74
+
75
+ ${globalStylesTag} li {
76
+ list-style: none;
77
+ }
78
+
79
+ ${globalStylesTag} button {
80
+ outline: none;
81
+ }
82
+
83
+ body.${disableScrollClass} {
84
+ position: fixed;
85
+ overflow-y: scroll;
86
+ right: 0;
87
+ left: 0;
88
+ }
89
+
90
+ body.${usingMouseClass} ${globalStylesTag} *:focus {
91
+ outline: none;
92
+ }
93
+ `;return createComponent(r,{})};function hexToRgb(r){r[0]==="#"&&(r=r.slice(1));const f=parseInt(r,16),d=f>>16&255,g=f>>8&255,v=f&255;return[d,g,v].join(",")}function rgba(r,f){return r[0]==="#"&&(r=hexToRgb(r)),`rgba(${r}, ${f})`}function toPx(r){return r.toString()+"px"}const _InMemoryStorage=class{constructor(){__publicField(this,"storage",{})}static getInstance(){return _InMemoryStorage.instance||(_InMemoryStorage.instance=new _InMemoryStorage),_InMemoryStorage.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(r){var f;return(f=this.storage[r])!=null?f:null}key(r){var f;const d=Object.keys(this.storage);return r<0||r>=d.length?null:(f=d[r])!=null?f:null}removeItem(r){delete this.storage[r]}setItem(r,f){this.storage[r]=f}};let InMemoryStorage=_InMemoryStorage;__publicField(InMemoryStorage,"instance");class TonConnectUIError extends TonConnectError{constructor(...f){super(...f),Object.setPrototypeOf(this,TonConnectUIError.prototype)}}function logDebug(...r){}function logError(...r){}function logWarning(...r){}function openLink(r,f="_self"){logDebug("openLink",r,f),window.open(r,f,"noopener noreferrer")}function openLinkBlank(r){openLink(r,"_blank")}function openDeeplinkWithFallback(r,f){const d=()=>{isBrowser("safari")||isOS("android")&&isBrowser("firefox")||f()},g=setTimeout(()=>d(),200);window.addEventListener("blur",()=>clearTimeout(g),{once:!0}),openLink(r,"_self")}function getSystemTheme(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?THEME.LIGHT:THEME.DARK}function subscribeToThemeChange(r){const f=d=>r(d.matches?THEME.DARK:THEME.LIGHT);return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",f),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",f)}function disableScroll(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=toPx(-document.documentElement.scrollTop),document.body.classList.add(disableScrollClass))}function enableScroll(){document.body.classList.remove(disableScrollClass),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top="auto"}function fixMobileSafariActiveTransition(){document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")}function defineStylesRoot(){customElements.define(globalStylesTag,class extends HTMLElement{})}function createMacrotask(r){return __async(this,null,function*(){yield new Promise(f=>requestAnimationFrame(f)),r()})}function createMacrotaskAsync(r){return __async(this,null,function*(){return yield new Promise(f=>requestAnimationFrame(f)),r()})}function preloadImages(r){document.readyState!=="complete"?window.addEventListener("load",()=>createMacrotask(()=>preloadImages(r)),{once:!0}):r.forEach(f=>{const d=new window.Image;d.src=f})}function getWindow$1(){if(typeof window<"u")return window}function tryGetLocalStorage(){if(isLocalStorageAvailable())return localStorage;if(isNodeJs())throw new TonConnectUIError("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return InMemoryStorage.getInstance()}function isLocalStorageAvailable(){try{return typeof localStorage<"u"}catch{return!1}}function isNodeJs(){return typeof process$1<"u"&&process$1.versions!=null&&process$1.versions.node!=null}function getUserAgent(){var r,f,d;const g=new UAParser().getResult(),v=(r=g.os.name)==null?void 0:r.toLowerCase(),m=(f=g.device.model)==null?void 0:f.toLowerCase();let w;switch(!0){case m==="ipad":w="ipad";break;case v==="ios":w="ios";break;case v==="android":w="android";break;case v==="mac os":w="macos";break;case v==="linux":w="linux";break;case(v==null?void 0:v.includes("windows")):w="windows";break}const _=(d=g.browser.name)==null?void 0:d.toLowerCase();let S;switch(!0){case _==="chrome":S="chrome";break;case _==="firefox":S="firefox";break;case(_==null?void 0:_.includes("safari")):S="safari";break;case(_==null?void 0:_.includes("opera")):S="opera";break}return{os:w,browser:S}}function isOS(...r){return r.includes(getUserAgent().os)}function isBrowser(...r){return r.includes(getUserAgent().browser)}function toDeeplink(r,f){const d=new URL(r);return f+d.search}class WalletInfoStorage{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_wallet-info"),this.localStorage=tryGetLocalStorage()}setWalletInfo(f){this.localStorage.setItem(this.storageKey,JSON.stringify(f))}getWalletInfo(){const f=this.localStorage.getItem(this.storageKey);return f?JSON.parse(f):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}}class PreferredWalletStorage{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_preferred-wallet"),this.localStorage=tryGetLocalStorage()}setPreferredWalletAppName(f){this.localStorage.setItem(this.storageKey,f)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}}class LastSelectedWalletInfoStorage{constructor(){__publicField(this,"localStorage"),__publicField(this,"storageKey","ton-connect-ui_last-selected-wallet-info"),this.localStorage=tryGetLocalStorage()}setLastSelectedWalletInfo(f){this.localStorage.setItem(this.storageKey,JSON.stringify(f))}getLastSelectedWalletInfo(){const f=this.localStorage.getItem(this.storageKey);return f?JSON.parse(f):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}}const[walletsModalState,setWalletsModalState]=createSignal({status:"closed",closeReason:null}),getWalletsModalIsOpened=createMemo(()=>walletsModalState().status==="opened"),[singleWalletModalState,setSingleWalletModalState]=createSignal({status:"closed",closeReason:null}),getSingleWalletModalIsOpened=createMemo(()=>singleWalletModalState().status==="opened"),getSingleWalletModalWalletInfo=createMemo(()=>{const r=singleWalletModalState();return r.status==="opened"?r.walletInfo:null});let lastSelectedWalletInfoStorage=typeof window<"u"?new LastSelectedWalletInfoStorage:void 0;const[lastSelectedWalletInfo,_setLastSelectedWalletInfo]=createSignal((lastSelectedWalletInfoStorage==null?void 0:lastSelectedWalletInfoStorage.getLastSelectedWalletInfo())||null),setLastSelectedWalletInfo=r=>{lastSelectedWalletInfoStorage||(lastSelectedWalletInfoStorage=new LastSelectedWalletInfoStorage),r?lastSelectedWalletInfoStorage.setLastSelectedWalletInfo(r):lastSelectedWalletInfoStorage.removeLastSelectedWalletInfo(),_setLastSelectedWalletInfo(r)},[action,setAction]=createSignal(null),common$1={close:"Close",openWallet:"Open wallet",copyLink:"Copy Link",linkCopied:"Link Copied",copied:"Copied",yourWallet:"Your Wallet",retry:"Retry",get:"GET",mobile:"Mobile",browserExtension:"Browser Extension",desktop:"Desktop"},button$1={connectWallet:"Connect Wallet",dropdown:{copy:"Copy address",copied:"Address copied!",disconnect:"Disconnect"}},notifications$1={confirm:{header:"Open {{ name }} to confirm the transaction."},transactionSent:{header:"Transaction sent",text:"Your transaction will be processed in a few seconds."},transactionCanceled:{header:"Transaction canceled",text:"There will be no changes to your account."},dataSigned:{header:"Data signed"},signDataCanceled:{header:"Sign data canceled"}},walletItem$1={walletOn:"Wallet in",recent:"Recent",installed:"Installed",popular:"Popular"},walletModal$1={loading:"Loading wallets",wallets:"Wallets",mobileUniversalModal:{connectYourWallet:"Connect your TON wallet",openWalletOnTelegramOrSelect:"Use Wallet in Telegram or choose other application",openWalletOnTelegram:"Connect Wallet in Telegram",chooseOtherApplication:"Choose other application",openLink:"Open Link",scan:"Scan with your mobile wallet"},desktopUniversalModal:{connectYourWallet:"Connect your TON wallet",scan:"Scan with your mobile wallet",availableWallets:"Available wallets"},mobileConnectionModal:{showQR:"Show QR Code",scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",missingFeatures:"Please update {{ name }}, your version does not support required features for this dApp",notSupportedWallet:"{{ name }} doesn’t support the requested action. Please connect another wallet that supports it",continueIn:"Continue in {{ name }}…",updateWallet:"Update {{ name }}",chooseAnotherWallet:"Choose Another Wallet",connectionDeclined:"Connection declined"},desktopConnectionModal:{scanQR:"Scan the QR code below with your phone’s or {{ name }}’s camera",continueInExtension:"Continue in {{ name }} browser extension…",dontHaveExtension:"Seems you don't have installed {{ name }} browser extension",missingFeatures:"Please update {{ name }}, your version does not support required features for this dApp",notSupportedWallet:"{{ name }} doesn’t support the requested action. Please connect another wallet that supports it",getWallet:"Get {{ name }}",updateWallet:"Update {{ name }}",chooseAnotherWallet:"Choose Another Wallet",continueOnDesktop:"Continue in {{ name }} on desktop…",openWalletOnTelegram:"Connect Wallet in Telegram on desktop",connectionDeclined:"Connection declined"},infoModal:{whatIsAWallet:"What is a wallet",secureDigitalAssets:"Secure digital assets storage",walletProtects:"A wallet protects and manages your digital assets including TON, tokens and collectables.",controlIdentity:"Control your Web3 identity",manageIdentity:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.",effortlessCryptoTransactions:"Effortless crypto transactions",easilySend:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.",getAWallet:"Get a Wallet"},restoreModal:{title:"Restore",step1:{title:"Find your current recovery phrase",text:"Open your wallet settings and locate the recovery phrase"},step2:{title:"Copy your recovery phrase",text:"Write it down or copy it to a safe place"},step3:{title:"Restore in a supported wallet",text:"Enter the recovery phrase to access your wallet"}},allWallets:{walletsBelowNotSupported:"The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above.",walletNotSupportService:"{{ name }} doesn’t support connected service"},featureNotSupported:{wallet:{title:"{{ name }} doesn’t support the requested action",description:"Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.",info:"Learn how to restore your wallet"},version:{description:"Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.",updateButton:"Update {{ name }}",aboutW5:"About W5"},disconnect:{title:"Confirm Disconnect",description:"You will be disconnected from your current wallet and redirected to connect {{ name }}.",button:"Disconnect"}}},actionModal$1={confirmTransaction:{header:"Confirm the transaction in {{ name }}",text:"It will only take a moment."},signData:{header:"Sign the data in {{ name }}",text:"It will only take a moment."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled",dataSigned:"$notifications.dataSigned",signDataCanceled:"$notifications.signDataCanceled"},en={common:common$1,button:button$1,notifications:notifications$1,walletItem:walletItem$1,walletModal:walletModal$1,actionModal:actionModal$1},common={close:"Закрыть",openWallet:"Открыть кошелёк",copyLink:"Скопировать",linkCopied:"Ссылка скопирована",copied:"Скопировано",yourWallet:"Ваш кошелёк",retry:"Повторить",get:"Скачать",mobile:"Мобильный",browserExtension:"Расширение",desktop:"Десктоп"},button={connectWallet:"Подключить кошелёк",dropdown:{copy:"Скопировать адрес",copied:"Адрес скопирован!",disconnect:"Отключить кошелёк"}},notifications={confirm:{header:"Откройте {{ name }}, чтобы подтвердить транзакцию."},transactionSent:{header:"Транзакция отправлена",text:"Ваша транзакция будет обработана через несколько секунд."},transactionCanceled:{header:"Транзакция отменена",text:"Состояние вашего счёта не изменится."},dataSigned:{header:"Данные подписаны"},signDataCanceled:{header:"Подпись данных отменена"}},walletItem={walletOn:"Wallet в",recent:"Недавний",installed:"Установлен",popular:"Популярен"},walletModal={loading:"Кошельки загружаются",wallets:"Кошельки",mobileUniversalModal:{connectYourWallet:"Подключите TON кошелёк",openWalletOnTelegramOrSelect:"Подключите Wallet в Telegram или выберете другое приложение",openWalletOnTelegram:"Открыть Wallet в Telegram",chooseOtherApplication:"Выберите другое приложение",openLink:"Открыть",scan:"Отсканируйте камерой вашего телефона"},desktopUniversalModal:{connectYourWallet:"Подключите TON кошелёк",scan:"Отсканируйте QR-код камерой вашего телефона",availableWallets:"Доступные кошельки"},mobileConnectionModal:{showQR:"Показать QR-код",scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",missingFeatures:"Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp",notSupportedWallet:"{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это",continueIn:"Продолжите в {{ name }}…",updateWallet:"Обновить {{ name }}",chooseAnotherWallet:"Выбрать другой кошелёк",connectionDeclined:"Подключение отклонено"},desktopConnectionModal:{scanQR:"Отсканируйте QR-код ниже камерой в приложении {{ name }}, или камерой телефона",continueInExtension:"Откройте браузерное расширение {{ name }}",dontHaveExtension:"Похоже, у вас не установлено браузерное расширение {{ name }}",missingFeatures:"Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp",notSupportedWallet:"{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это",getWallet:"Скачать {{ name }}",updateWallet:"Обновить {{ name }}",chooseAnotherWallet:"Выбрать другой кошелёк",continueOnDesktop:"Откройте {{ name }} на компьютере…",openWalletOnTelegram:"Открыть Wallet в Telegram",connectionDeclined:"Подключение отклонено"},infoModal:{whatIsAWallet:"Что такое кошелёк?",secureDigitalAssets:"Надежное хранилище цифровых активов",walletProtects:"Кошелёк защищает ваши цифровые активы, включая TON, токены и предметы коллекционирования, и управляет ими.",controlIdentity:"Контроль своей личности Web3",manageIdentity:"Управляйте своей цифровой идентификацией и с легкостью получайте доступ к децентрализованным приложениям. Сохраняйте контроль над своими данными и безопасно участвуйте в экосистеме блокчейна.",effortlessCryptoTransactions:"Простые криптотранзакции",easilySend:"Легко отправляйте, получайте и отслеживайте свои криптовалюты. Оптимизируйте свои операции с помощью децентрализованных приложений.",getAWallet:"Скачать кошелёк"},restoreModal:{title:"Восстановление",step1:{title:"Найдите вашу текущую фразу восстановления",text:"Откройте настройки кошелька и найдите фразу восстановления"},step2:{title:"Скопируйте вашу фразу восстановления",text:"Запишите её или сохраните в безопасном месте"},step3:{title:"Восстановите в поддерживаемом кошельке",text:"Введите фразу восстановления для доступа к вашему кошельку"}},allWallets:{walletsBelowNotSupported:"Кошельки ниже не поддерживают все функции подключённого сервиса. Вы можете использовать свою фразу восстановления в одном из поддерживаемых выше кошельков.",walletNotSupportService:"{{ name }} не поддерживает подключённый сервис"},featureNotSupported:{wallet:{title:"{{ name }} не поддерживает запрошенное действие",description:"Установите поддерживаемый кошелёк из списка ниже, восстановите его с помощью фразы восстановления, затем подключитесь и попробуйте снова.",info:"Узнать, как восстановить кошелёк"},version:{description:"Текущая версия {{ name }} или тип контракта кошелька не поддерживает необходимые функции. Обновите кошелёк, чтобы продолжить.",updateButton:"Обновить {{ name }}",aboutW5:"Про W5"},disconnect:{title:"Подтвердите отключение",description:"Вы будете отключены от текущего кошелька и перенаправлены на подключение {{ name }}.",button:"Отключиться"}}},actionModal={confirmTransaction:{header:"Подтвердите действие в {{ name }}",text:"Это займет пару секунд."},signData:{header:"Подпишите данные в {{ name }}",text:"Это займет пару секунд."},transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled",dataSigned:"$notifications.dataSigned",signDataCanceled:"$notifications.signDataCanceled"},ru={common,button,notifications,walletItem,walletModal,actionModal},i18nDictionary={en:parseDictionary(en),ru:parseDictionary(ru)};function parseDictionary(r){const d=g=>{Object.entries(g).forEach(([v,m])=>{if(typeof m=="object"&&m)return d(m);if(typeof m=="string"){if(m[0]==="$"){const w=m.slice(1).split(".");let _=r;w.forEach(S=>{if(S in _)_=_[S];else throw new Error(`Cannot parse translations: there is no property ${S} in translation`)}),g[v]=_}m.slice(0,2)==="\\$"&&(g[v]=m.slice(1))}})};return d(r),r}const ConnectorContext=createContext(),$RAW=Symbol("store-raw"),$NODE=Symbol("store-node"),$NAME=Symbol("store-name");function wrap$1(r,f){let d=r[$PROXY];if(!d&&(Object.defineProperty(r,$PROXY,{value:d=new Proxy(r,proxyTraps$1)}),!Array.isArray(r))){const g=Object.keys(r),v=Object.getOwnPropertyDescriptors(r);for(let m=0,w=g.length;m<w;m++){const _=g[m];v[_].get&&Object.defineProperty(r,_,{enumerable:v[_].enumerable,get:v[_].get.bind(d)})}}return d}function isWrappable(r){let f;return r!=null&&typeof r=="object"&&(r[$PROXY]||!(f=Object.getPrototypeOf(r))||f===Object.prototype||Array.isArray(r))}function unwrap(r,f=new Set){let d,g,v,m;if(d=r!=null&&r[$RAW])return d;if(!isWrappable(r)||f.has(r))return r;if(Array.isArray(r)){Object.isFrozen(r)?r=r.slice(0):f.add(r);for(let w=0,_=r.length;w<_;w++)v=r[w],(g=unwrap(v,f))!==v&&(r[w]=g)}else{Object.isFrozen(r)?r=Object.assign({},r):f.add(r);const w=Object.keys(r),_=Object.getOwnPropertyDescriptors(r);for(let S=0,x=w.length;S<x;S++)m=w[S],!_[m].get&&(v=r[m],(g=unwrap(v,f))!==v&&(r[m]=g))}return r}function getDataNodes(r){let f=r[$NODE];return f||Object.defineProperty(r,$NODE,{value:f={}}),f}function getDataNode(r,f,d){return r[f]||(r[f]=createDataNode(d))}function proxyDescriptor$1(r,f){const d=Reflect.getOwnPropertyDescriptor(r,f);return!d||d.get||!d.configurable||f===$PROXY||f===$NODE||f===$NAME||(delete d.value,delete d.writable,d.get=()=>r[$PROXY][f]),d}function trackSelf(r){if(getListener()){const f=getDataNodes(r);(f._||(f._=createDataNode()))()}}function ownKeys(r){return trackSelf(r),Reflect.ownKeys(r)}function createDataNode(r){const[f,d]=createSignal(r,{equals:!1,internal:!0});return f.$=d,f}const proxyTraps$1={get(r,f,d){if(f===$RAW)return r;if(f===$PROXY)return d;if(f===$TRACK)return trackSelf(r),d;const g=getDataNodes(r),v=g.hasOwnProperty(f);let m=v?g[f]():r[f];if(f===$NODE||f==="__proto__")return m;if(!v){const w=Object.getOwnPropertyDescriptor(r,f);getListener()&&(typeof m!="function"||r.hasOwnProperty(f))&&!(w&&w.get)&&(m=getDataNode(g,f,m)())}return isWrappable(m)?wrap$1(m):m},has(r,f){return f===$RAW||f===$PROXY||f===$TRACK||f===$NODE||f==="__proto__"?!0:(this.get(r,f,r),f in r)},set(){return!0},deleteProperty(){return!0},ownKeys,getOwnPropertyDescriptor:proxyDescriptor$1};function setProperty(r,f,d,g=!1){if(!g&&r[f]===d)return;const v=r[f],m=r.length;d===void 0?delete r[f]:r[f]=d;let w=getDataNodes(r),_;(_=getDataNode(w,f,v))&&_.$(()=>d),Array.isArray(r)&&r.length!==m&&(_=getDataNode(w,"length",m))&&_.$(r.length),(_=w._)&&_.$()}function mergeStoreNode(r,f){const d=Object.keys(f);for(let g=0;g<d.length;g+=1){const v=d[g];setProperty(r,v,f[v])}}function updateArray(r,f){if(typeof f=="function"&&(f=f(r)),f=unwrap(f),Array.isArray(f)){if(r===f)return;let d=0,g=f.length;for(;d<g;d++){const v=f[d];r[d]!==v&&setProperty(r,d,v)}setProperty(r,"length",g)}else mergeStoreNode(r,f)}function updatePath(r,f,d=[]){let g,v=r;if(f.length>1){g=f.shift();const w=typeof g,_=Array.isArray(r);if(Array.isArray(g)){for(let S=0;S<g.length;S++)updatePath(r,[g[S]].concat(f),d);return}else if(_&&w==="function"){for(let S=0;S<r.length;S++)g(r[S],S)&&updatePath(r,[S].concat(f),d);return}else if(_&&w==="object"){const{from:S=0,to:x=r.length-1,by:b=1}=g;for(let C=S;C<=x;C+=b)updatePath(r,[C].concat(f),d);return}else if(f.length>1){updatePath(r[g],f,[g].concat(d));return}v=r[g],d=[g].concat(d)}let m=f[0];typeof m=="function"&&(m=m(v,d),m===v)||g===void 0&&m==null||(m=unwrap(m),g===void 0||isWrappable(v)&&isWrappable(m)&&!Array.isArray(m)?mergeStoreNode(v,m):setProperty(r,g,m))}function createStore(...[r,f]){const d=unwrap(r||{}),g=Array.isArray(d),v=wrap$1(d);function m(...w){batch(()=>{g&&w.length===1?updateArray(d,w[0]):updatePath(d,w)})}return[v,m]}const defaultLightColorsSet={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#0098EA",telegramButton:"#0098EA",icon:{primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#F1F3F5"},text:{primary:"#0F0F0F",secondary:"#6A7785"}},defaultDarkColorsSet={constant:{black:"#000000",white:"#FFFFFF"},connectButton:{background:"#0098EA",foreground:"#FFFFFF"},accent:"#E5E5EA",telegramButton:"#31A6F5",icon:{primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"},background:{primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#FFFFFF"},text:{primary:"#E5E5EA",secondary:"#7D7D85"}};/*!
94
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
95
+ *
96
+ * Copyright (c) 2014-2017, Jon Schlinkert.
97
+ * Released under the MIT License.
98
+ */function isObject(r){return Object.prototype.toString.call(r)==="[object Object]"}function isPlainObject(r){var f,d;return isObject(r)===!1?!1:(f=r.constructor,f===void 0?!0:(d=f.prototype,!(isObject(d)===!1||d.hasOwnProperty("isPrototypeOf")===!1)))}function mergeOptions(r,f){return r?deepmerge(f,r,{arrayMerge:(g,v,m)=>v,isMergeableObject:isPlainObject}):f}const[themeState,setThemeState]=createStore({theme:THEME.LIGHT,colors:defaultLightColorsSet,borderRadius:"m"}),themeColorsMappingDefault={[THEME.LIGHT]:defaultLightColorsSet,[THEME.DARK]:defaultDarkColorsSet},themeCustomColors={[THEME.LIGHT]:void 0,[THEME.DARK]:void 0};function setTheme(r,f){f&&(themeCustomColors[THEME.DARK]=mergeOptions(f[THEME.DARK],themeCustomColors[THEME.DARK]),themeCustomColors[THEME.LIGHT]=mergeOptions(f[THEME.LIGHT],themeCustomColors[THEME.LIGHT])),setThemeState({theme:r,colors:mergeOptions(themeCustomColors[r],themeColorsMappingDefault[r])})}function setBorderRadius(r){setThemeState({borderRadius:r})}function setColors(r){themeCustomColors[THEME.DARK]=mergeOptions(r[THEME.DARK],themeCustomColors[THEME.DARK]),themeCustomColors[THEME.LIGHT]=mergeOptions(r[THEME.LIGHT],themeCustomColors[THEME.LIGHT]),setThemeState(f=>({colors:mergeOptions(themeCustomColors[f.theme],themeColorsMappingDefault[f.theme])}))}const ImagePlaceholder=styled.div`
99
+ background-color: ${r=>r.theme.colors.background.secondary};
100
+ `,Image=r=>{let f;const[d,g]=createSignal(null);return createEffect(()=>{const v=new window.Image;return v.src=r.src,v.alt=r.alt||"",v.setAttribute("draggable","false"),r.class&&v.classList.add(r.class),v.complete?g(v):(v.addEventListener("load",()=>g(v)),()=>v.removeEventListener("load",()=>g(v)))}),[createComponent(Show,{get when(){return d()},get children(){return d()}}),createComponent(Show,{get when(){return!d()},get children(){return createComponent(ImagePlaceholder,{get class(){return r.class},ref(v){const m=f;typeof m=="function"?m(v):f=v}})}})]};let initParams={};try{let r=location.hash.toString();initParams=urlParseHashParams(r)}catch(r){}let tmaPlatform="unknown";if(initParams!=null&&initParams.tgWebAppPlatform&&(tmaPlatform=(_a=initParams.tgWebAppPlatform)!=null?_a:"unknown"),tmaPlatform==="unknown"){const r=getWindow$1();tmaPlatform=(_d=(_c=(_b=r==null?void 0:r.Telegram)==null?void 0:_b.WebApp)==null?void 0:_c.platform)!=null?_d:"unknown"}let webAppVersion="6.0";if(initParams!=null&&initParams.tgWebAppVersion&&(webAppVersion=initParams.tgWebAppVersion),!webAppVersion){const r=getWindow$1();webAppVersion=(_g=(_f=(_e=r==null?void 0:r.Telegram)==null?void 0:_e.WebApp)==null?void 0:_f.version)!=null?_g:"6.0"}function isTmaPlatform(...r){return r.includes(tmaPlatform)}function isInTMA(){var r;return tmaPlatform!=="unknown"||!!((r=getWindow$1())!=null&&r.TelegramWebviewProxy)}function isInTelegramBrowser(){var r;const f=!!((r=getWindow$1())!=null&&r.TelegramWebview);return(isInTMA()||f)&&tmaPlatform==="unknown"}function sendExpand(){postEvent("web_app_expand",{})}function sendOpenTelegramLink(r,f){const d=new URL(r);if(d.protocol!=="http:"&&d.protocol!=="https:"){if(f)return f();throw new TonConnectUIError(`Url protocol is not supported: ${d}`)}if(d.hostname!=="t.me"){if(f)return f();throw new TonConnectUIError(`Url host is not supported: ${d}`)}const g=d.pathname+d.search;isIframe()||versionAtLeast("6.1")?postEvent("web_app_open_tg_link",{path_full:g}):openLinkBlank("https://t.me"+g)}function isIframe(){try{const r=getWindow$1();return r?r.parent!=null&&r!==r.parent:!1}catch{return!1}}function postEvent(r,f){try{const d=getWindow$1();if(!d)throw new TonConnectUIError("Can't post event to parent window: window is not defined");if(d.TelegramWebviewProxy!==void 0)logDebug("postEvent",r,f),d.TelegramWebviewProxy.postEvent(r,JSON.stringify(f));else if(d.external&&"notify"in d.external)logDebug("postEvent",r,f),d.external.notify(JSON.stringify({eventType:r,eventData:f}));else if(isIframe()){const v=JSON.stringify({eventType:r,eventData:f});logDebug("postEvent",r,f),d.parent.postMessage(v,"*")}else throw new TonConnectUIError("Can't post event to TMA")}catch(d){logError(`Can't post event to parent window: ${d}`)}}function urlParseHashParams(r){r=r.replace(/^#/,"");let f={};if(!r.length)return f;if(r.indexOf("=")<0&&r.indexOf("?")<0)return f._path=urlSafeDecode(r),f;let d=r.indexOf("?");if(d>=0){let v=r.substr(0,d);f._path=urlSafeDecode(v),r=r.substr(d+1)}let g=urlParseQueryString(r);for(let v in g)f[v]=g[v];return f}function urlSafeDecode(r){try{return r=r.replace(/\+/g,"%20"),decodeURIComponent(r)}catch{return r}}function urlParseQueryString(r){let f={};if(!r.length)return f;let d=r.split("&"),g,v,m,w;for(g=0;g<d.length;g++)v=d[g].split("="),m=urlSafeDecode(v[0]),w=v[1]==null?null:urlSafeDecode(v[1]),f[m]=w;return f}function versionCompare(r,f){typeof r!="string"&&(r="");let d=r.replace(/^\s+|\s+$/g,"").split("."),g=f.replace(/^\s+|\s+$/g,"").split("."),v,m,w,_;for(v=Math.max(d.length,g.length),m=0;m<v;m++)if(w=parseInt(d[m])||0,_=parseInt(g[m])||0,w!==_)return w>_?1:-1;return 0}function versionAtLeast(r){return versionCompare(webAppVersion,r)>=0}const maxWidth={mobile:440,tablet:1020};function isDevice(r){const f=getWindow$1();if(!f)return r==="desktop";if(isTmaPlatform("weba"))return!0;const d=f.innerWidth;switch(r){case"desktop":return d>maxWidth.tablet;case"tablet":return d>maxWidth.mobile;default:case"mobile":return d<=maxWidth.mobile||isOS("ios","android","ipad")}}function media(r){switch(r){case"mobile":return`@media (max-width: ${maxWidth.mobile}px)`;case"tablet":return`@media (max-width: ${maxWidth.tablet}px) (min-width: ${maxWidth.mobile}px)`;default:case"desktop":return`@media (min-width: ${maxWidth.tablet}px)`}}const mediaTouch="@media (hover: none)",mediaNotTouch="@media not all and (hover: none)",borders$6={m:"100vh",s:"8px",none:"0"},scaleValues={s:.02,m:.04},ButtonStyled$1=styled.button`
101
+ display: ${r=>r.leftIcon||r.rightIcon?"flex":"inline-block"};
102
+ gap: ${r=>r.leftIcon||r.rightIcon?"6px":"unset"};
103
+ align-items: ${r=>r.leftIcon||r.rightIcon?"center":"unset"};
104
+ justify-content: ${r=>r.leftIcon||r.rightIcon?"space-between":"unset"};
105
+ background-color: ${r=>r.appearance==="flat"?"transparent":r.appearance==="secondary"?r.theme.colors.background.tint:rgba(r.theme.colors.accent,.12)};
106
+ color: ${r=>r.appearance==="secondary"?r.theme.colors.text.primary:r.theme.colors.accent};
107
+
108
+ padding: ${r=>r.appearance==="flat"?"0":"9px 16px"};
109
+ padding-left: ${r=>r.leftIcon&&r.appearance!=="flat"?"12px":"16px"};
110
+ padding-right: ${r=>r.rightIcon&&r.appearance!=="flat"?"12px":"16px"};
111
+ border: none;
112
+ border-radius: ${r=>borders$6[r.theme.borderRadius]};
113
+ cursor: ${r=>r.disabled?"not-allowed":"pointer"};
114
+
115
+ font-size: 14px;
116
+ font-weight: 510;
117
+ line-height: 18px;
118
+
119
+ transition: transform 0.125s ease-in-out;
120
+
121
+ ${mediaNotTouch} {
122
+ &:hover {
123
+ transform: ${r=>r.disabled?"unset":`scale(${1+scaleValues[r.scale]})`};
124
+ }
125
+ }
126
+
127
+ &:active {
128
+ transform: ${r=>r.disabled?"unset":`scale(${1-scaleValues[r.scale]})`};
129
+ }
130
+
131
+ ${mediaTouch} {
132
+ &:active {
133
+ transform: ${r=>r.disabled?"unset":`scale(${1-scaleValues[r.scale]*2})`};
134
+ }
135
+ }
136
+ `;function useDataAttributes(r){const f=untrack(()=>Object.keys(r).filter(g=>g.startsWith("data-"))),[d]=splitProps(r,f);return d}const Button=r=>{const f=useDataAttributes(r);return createComponent(ButtonStyled$1,mergeProps({get appearance(){return r.appearance||"primary"},get class(){return r.class},onClick:d=>{var g;return(g=r.onClick)==null?void 0:g.call(r,d)},onMouseEnter:d=>{var g;return(g=r.onMouseEnter)==null?void 0:g.call(r,d)},onMouseLeave:d=>{var g;return(g=r.onMouseLeave)==null?void 0:g.call(r,d)},ref(d){const g=r.ref;typeof g=="function"?g(d):r.ref=d},get disabled(){return r.disabled},get scale(){return r.scale||"m"},get leftIcon(){return!!r.leftIcon},get rightIcon(){return!!r.rightIcon},"data-tc-button":"true"},f,{get children(){return[createMemo(()=>r.leftIcon),createMemo(()=>r.children),createMemo(()=>r.rightIcon)]}}))};function nextFrame(r){requestAnimationFrame(()=>{requestAnimationFrame(r)})}const Transition=r=>{let f,d=!0;const[g,v]=createSignal(),[m,w]=createSignal(),_=children(()=>r.children),{onBeforeEnter:S,onEnter:x,onAfterEnter:b,onBeforeExit:C,onExit:E,onAfterExit:M}=r,A=createMemo(()=>{const O=r.name||"s";return{enterActiveClass:r.enterActiveClass||O+"-enter-active",enterClass:r.enterClass||O+"-enter",enterToClass:r.enterToClass||O+"-enter-to",exitActiveClass:r.exitActiveClass||O+"-exit-active",exitClass:r.exitClass||O+"-exit",exitToClass:r.exitToClass||O+"-exit-to"}});function T(O,N){if(!d||r.appear){let H=function(se){O&&(!se||se.target===O)&&(O.removeEventListener("transitionend",H),O.removeEventListener("animationend",H),O.classList.remove(...X),O.classList.remove(...oe),batch(()=>{g()!==O&&v(O),m()===O&&w(void 0)}),b&&b(O),r.mode==="inout"&&L(O,N))};const V=A().enterClass.split(" "),X=A().enterActiveClass.split(" "),oe=A().enterToClass.split(" ");S&&S(O),O.classList.add(...V),O.classList.add(...X),nextFrame(()=>{O.classList.remove(...V),O.classList.add(...oe),x&&x(O,()=>H()),(!x||x.length<2)&&(O.addEventListener("transitionend",H),O.addEventListener("animationend",H))})}N&&!r.mode?w(O):v(O)}function L(O,N){const H=A().exitClass.split(" "),V=A().exitActiveClass.split(" "),X=A().exitToClass.split(" ");if(!N.parentNode)return oe();C&&C(N),N.classList.add(...H),N.classList.add(...V),nextFrame(()=>{N.classList.remove(...H),N.classList.add(...X)}),E&&E(N,()=>oe()),(!E||E.length<2)&&(N.addEventListener("transitionend",oe),N.addEventListener("animationend",oe));function oe(se){(!se||se.target===N)&&(N.removeEventListener("transitionend",oe),N.removeEventListener("animationend",oe),N.classList.remove(...V),N.classList.remove(...X),g()===N&&v(void 0),M&&M(N),r.mode==="outin"&&T(O,N))}}return createComputed(O=>{for(f=_();typeof f=="function";)f=f();return untrack(()=>(f&&f!==O&&(r.mode!=="outin"?T(f,O):d&&v(f)),O&&O!==f&&r.mode!=="inout"&&L(f,O),d=!1,f))}),[g,m]};function getRect(r){const{top:f,bottom:d,left:g,right:v,width:m,height:w}=r.getBoundingClientRect(),_=r.parentNode.getBoundingClientRect();return{top:f-_.top,bottom:d,left:g-_.left,right:v,width:m,height:w}}const TransitionGroup=r=>{const f=children(()=>r.children),d=createMemo(()=>{const M=r.name||"s";return{enterActiveClass:r.enterActiveClass||M+"-enter-active",enterClass:r.enterClass||M+"-enter",enterToClass:r.enterToClass||M+"-enter-to",exitActiveClass:r.exitActiveClass||M+"-exit-active",exitClass:r.exitClass||M+"-exit",exitToClass:r.exitToClass||M+"-exit-to",moveClass:r.moveClass||M+"-move"}}),{onBeforeEnter:g,onEnter:v,onAfterEnter:m,onBeforeExit:w,onExit:_,onAfterExit:S}=r,[x,b]=createSignal();let C=[],E=!0;return createComputed(()=>{const M=f(),A=[...M],T=new Set(M),L=new Set(C),O=d().enterClass.split(" "),N=d().enterActiveClass.split(" "),H=d().enterToClass.split(" "),V=d().exitClass.split(" "),X=d().exitActiveClass.split(" "),oe=d().exitToClass.split(" ");for(let se=0;se<M.length;se++){const de=M[se];if(!E&&!L.has(de)){let he=function(we){de&&(!we||we.target===de)&&(de.removeEventListener("transitionend",he),de.removeEventListener("animationend",he),de.classList.remove(...N),de.classList.remove(...H),m&&m(de))};g&&g(de),de.classList.add(...O),de.classList.add(...N),nextFrame(()=>{de.classList.remove(...O),de.classList.add(...H),v&&v(de,()=>he()),(!v||v.length<2)&&(de.addEventListener("transitionend",he),de.addEventListener("animationend",he))})}}for(let se=0;se<C.length;se++){const de=C[se];if(!T.has(de)&&de.parentNode){let he=function(we){(!we||we.target===de)&&(de.removeEventListener("transitionend",he),de.removeEventListener("animationend",he),de.classList.remove(...X),de.classList.remove(...oe),S&&S(de),C=C.filter(te=>te!==de),b(C))};A.splice(se,0,de),w&&w(de),de.classList.add(...V),de.classList.add(...X),nextFrame(()=>{de.classList.remove(...V),de.classList.add(...oe)}),_&&_(de,()=>he()),(!_||_.length<2)&&(de.addEventListener("transitionend",he),de.addEventListener("animationend",he))}}C=A,b(A)}),createEffect(M=>{const A=x();return A.forEach(T=>{let L;(L=M.get(T))?L.new&&(L.new=!1,L.newPos=getRect(T)):M.set(T,L={pos:getRect(T),new:!E}),L.new&&T.addEventListener("transitionend",()=>{L.new=!1,T.parentNode&&(L.newPos=getRect(T))},{once:!0}),L.newPos&&(L.pos=L.newPos),L.newPos=getRect(T)}),E?(E=!1,M):(A.forEach(T=>{const L=M.get(T),O=L.pos,N=L.newPos,H=O.left-N.left,V=O.top-N.top;if(H||V){L.moved=!0;const X=T.style;X.transform=`translate(${H}px,${V}px)`,X.transitionDuration="0s"}}),document.body.offsetHeight,A.forEach(T=>{const L=M.get(T);if(L.moved){let O=function(V){V&&V.target!==T||!T.parentNode||(!V||/transform$/.test(V.propertyName))&&(T.removeEventListener("transitionend",O),T.classList.remove(...H))};L.moved=!1;const N=T.style,H=d().moveClass.split(" ");T.classList.add(...H),N.transform=N.transitionDuration="",T.addEventListener("transitionend",O)}}),M)},new Map),x};function clickOutside$1(r,f){const d=g=>{var v;return!r.contains(g.target)&&((v=f())==null?void 0:v())};document.body.addEventListener("click",d),onCleanup(()=>document.body.removeEventListener("click",d))}function escPressed(r,f){const d=g=>{var v,m;g.key==="Escape"&&((v=document.activeElement)==null||v.blur(),(m=f())==null||m())};document.body.addEventListener("keydown",d),onCleanup(()=>document.body.removeEventListener("keydown",d))}function androidBackHandler$1(r,f){const{isEnabled:d,onClose:g}=f();if(!d||!(getUserAgent().os==="android"))return;window.history.pushState(ROUTE_STATE,"");const m=w=>{w.preventDefault(),g()};window.addEventListener("popstate",m,{once:!0}),onCleanup(()=>{window.removeEventListener("popstate",m),createMacrotask(()=>{var w;((w=window.history.state)==null?void 0:w[ROUTE_STATE_KEY])===!0&&window.history.back()})})}const ROUTE_STATE_KEY="androidBackHandler",ROUTE_STATE={[ROUTE_STATE_KEY]:!0},_tmpl$$v=template$1('<svg><path fill-rule="evenodd" clip-rule="evenodd" d="M10.2122 14.3407C10.5384 14.0854 10.5959 13.614 10.3406 13.2878L6.20237 8.00003L10.3406 2.71227C10.5959 2.38607 10.5384 1.91469 10.2122 1.6594C9.88604 1.40412 9.41465 1.46161 9.15937 1.7878L4.65937 7.5378C4.44688 7.80932 4.44688 8.19074 4.65937 8.46226L9.15937 14.2123C9.41465 14.5385 9.88604 14.5959 10.2122 14.3407Z"></path></svg>',4,!0),rotationDegrees={left:0,top:90,right:180,bottom:270},ArrowIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary,g=()=>r.direction||"left",v=styled("svg")`
137
+ transform: rotate(${m=>rotationDegrees[m.svgDirection]}deg);
138
+ transition: transform 0.1s ease-in-out;
139
+ `;return createComponent(v,{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){return g()},get children(){const m=_tmpl$$v.cloneNode(!0);return createRenderEffect(()=>setAttribute(m,"fill",d())),m}})},_tmpl$$u=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.71966 2.71968C3.01255 2.42678 3.48743 2.42677 3.78032 2.71966L8.00002 6.93925L12.2197 2.71967C12.5126 2.42677 12.9874 2.42678 13.2803 2.71967C13.5732 3.01257 13.5732 3.48744 13.2803 3.78033L9.06068 7.99991L13.2803 12.2197C13.5732 12.5126 13.5732 12.9874 13.2803 13.2803C12.9874 13.5732 12.5126 13.5732 12.2197 13.2803L8.00002 9.06057L3.78033 13.2803C3.48744 13.5732 3.01257 13.5732 2.71967 13.2803C2.42678 12.9874 2.42677 12.5126 2.71967 12.2197L6.93936 7.99991L2.71968 3.78034C2.42678 3.48745 2.42677 3.01257 2.71966 2.71968Z"></path></svg>'),CloseIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$u.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},IconButtonStyled=styled.button`
140
+ padding: 0;
141
+ display: flex;
142
+ justify-content: center;
143
+ align-items: center;
144
+ width: 32px;
145
+ height: 32px;
146
+ border-radius: 50%;
147
+ background-color: ${r=>r.theme.colors.background.tint};
148
+ border: none;
149
+ cursor: pointer;
150
+
151
+ transition: transform 0.125s ease-in-out;
152
+
153
+ ${mediaNotTouch} {
154
+ &:hover {
155
+ transform: scale(1.04);
156
+ }
157
+ }
158
+
159
+ &:active {
160
+ transform: scale(0.96);
161
+ }
162
+
163
+ ${mediaTouch} {
164
+ &:active {
165
+ transform: scale(0.92);
166
+ }
167
+ }
168
+ `,IconButton=r=>{const f=useDataAttributes(r),d=()=>r.icon||"close";return createComponent(IconButtonStyled,mergeProps({get class(){return r.class},onClick:()=>r.onClick(),"data-tc-icon-button":"true"},f,{get children(){return[createComponent(Show,{get when(){return!!r.children},get children(){return r.children}}),createComponent(Show,{get when(){return!r.children},get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return d()==="close"},get children(){return createComponent(CloseIcon,{get fill(){return r.fill}})}}),createComponent(Match,{get when(){return d()==="arrow"},get children(){return createComponent(ArrowIcon,{get fill(){return r.fill}})}}),createComponent(Match,{get when(){return d()==="question"},get children(){return createComponent(QuestionIcon,{get fill(){return r.fill}})}}),createComponent(Match,{get when(){return typeof d()!="string"},get children(){return d()}})]}})}})]}}))},borders$5={m:"24px",s:"16px",none:"0"},ModalBackgroundStyled=styled.div`
169
+ display: flex;
170
+ position: fixed;
171
+ z-index: 1000;
172
+ left: 0;
173
+ top: 0;
174
+ width: 100%;
175
+ height: 100%;
176
+ background-color: rgba(0, 0, 0, 0.4);
177
+ padding: 20px 0;
178
+ overflow-y: auto;
179
+
180
+ ${media("mobile")} {
181
+ padding-bottom: 0;
182
+ }
183
+ `,ModalWrapperClass=u`
184
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16);
185
+ width: fit-content;
186
+ margin: auto;
187
+
188
+ ${media("mobile")} {
189
+ width: 100%;
190
+ height: fit-content;
191
+ margin: auto 0 0 0;
192
+ }
193
+ `,ModalBodyStyled=styled.div`
194
+ position: relative;
195
+ min-height: 100px;
196
+ width: 416px;
197
+ padding: 44px 56px 24px;
198
+
199
+ box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
200
+
201
+ background-color: ${r=>r.theme.colors.background.primary};
202
+ border-radius: ${r=>borders$5[r.theme.borderRadius]};
203
+
204
+ ${media("mobile")} {
205
+ width: 100%;
206
+ }
207
+ `,CloseButtonStyled=styled(IconButton)`
208
+ position: absolute;
209
+ right: 16px;
210
+ top: 16px;
211
+ `,ModalFooterStyled=styled.div`
212
+ display: flex;
213
+ justify-content: space-between;
214
+ align-items: center;
215
+ padding: 16px 16px 16px 18px;
216
+ border-radius: 0 0 ${r=>borders$5[r.theme.borderRadius]}
217
+ ${r=>borders$5[r.theme.borderRadius]};
218
+ `,QuestionButtonStyled=styled(IconButton)`
219
+ background-color: ${r=>rgba(r.theme.colors.icon.secondary,.12)};
220
+ `;class AnimationTimelineNoop{constructor(){__publicField(this,"currentTime",0)}}const _AnimationNoop=class{constructor(){__publicField(this,"currentTime",0),__publicField(this,"playbackRate",1),__publicField(this,"startTime",null),__publicField(this,"timeline",new AnimationTimelineNoop),__publicField(this,"finished",Promise.resolve(this)),__publicField(this,"effect",null),__publicField(this,"id",""),__publicField(this,"pending",!1),__publicField(this,"playState","finished"),__publicField(this,"replaceState","active"),__publicField(this,"ready",Promise.resolve(this)),__publicField(this,"oncancel",null),__publicField(this,"onfinish",null),__publicField(this,"onremove",null)}static create(){return _AnimationNoop._instance||(logWarning("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),_AnimationNoop._instance=new _AnimationNoop),_AnimationNoop._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(r,f,d){}dispatchEvent(r){return!1}removeEventListener(r,f,d){}updatePlaybackRate(r){}commitStyles(){}persist(){}};let AnimationNoop=_AnimationNoop;__publicField(AnimationNoop,"_instance",null);function animate(r,f,d){return"animate"in r?r.animate(f,d):AnimationNoop.create()}const _tmpl$$t=template$1("<div></div>"),clickOutside=clickOutside$1,keyPressed=escPressed,androidBackHandler=androidBackHandler$1,Modal=r=>{const f=useTheme(),d=useDataAttributes(r);return createEffect(()=>{r.opened?disableScroll():enableScroll()}),createComponent(Transition,{onBeforeEnter:g=>{const v=isDevice("mobile")?200:100;animate(g,[{opacity:0},{opacity:1}],{duration:v}),isDevice("mobile")&&animate(g.firstElementChild,[{transform:"translateY(390px)"},{transform:"translateY(0)"}],{duration:v})},onExit:(g,v)=>{const m=isDevice("mobile")?200:100,w=animate(g,[{opacity:1},{opacity:0}],{duration:m});if(isDevice("mobile")){const _=animate(g.firstElementChild,[{transform:"translateY(0)"},{transform:"translateY(390px)"}],{duration:m});Promise.all([w.finished,_.finished]).then(v)}else w.finished.then(v)},get children(){return createComponent(Show,{get when(){return r.opened},get children(){return createComponent(ModalBackgroundStyled,mergeProps({"data-tc-modal":"true"},d,{get children(){const g=_tmpl$$t.cloneNode(!0);return use(androidBackHandler,g,()=>({isEnabled:r.enableAndroidBackHandler,onClose:()=>r.onClose()})),use(keyPressed,g,()=>()=>r.onClose()),use(clickOutside,g,()=>()=>r.onClose()),insert(g,createComponent(ModalBodyStyled,{get class(){return r.class},get children(){return[createComponent(CloseButtonStyled,{icon:"close",onClick:()=>r.onClose()}),createMemo(()=>r.children)]}}),null),insert(g,createComponent(Show,{get when(){return r.onClickQuestion&&r.showFooter},get children(){return createComponent(ModalFooterStyled,{get children(){return[createComponent(TonConnectBrand,{}),createComponent(QuestionButtonStyled,{get onClick(){return r.onClickQuestion},icon:"question"})]}})}}),null),createRenderEffect(()=>className(g,cn(ModalWrapperClass,u`
221
+ border-radius: ${borders$5[f.borderRadius]};
222
+ background-color: ${f.colors.background.tint};
223
+
224
+ ${media("mobile")} {
225
+ border-radius: ${borders$5[f.borderRadius]}
226
+ ${borders$5[f.borderRadius]} 0 0;
227
+ }
228
+ `))),g}}))}})}})},wrapperBorderRadius={m:"22px",s:"12px",none:"0"},sliderBorderRadius={m:"18px",s:"8px",none:"0"},TabBarStyled=styled.div`
229
+ display: grid;
230
+ grid-template: 1fr / 1fr 1fr;
231
+ width: fit-content;
232
+ justify-items: center;
233
+ gap: 4px;
234
+
235
+ position: relative;
236
+ padding: 4px;
237
+ border-radius: ${r=>wrapperBorderRadius[r.theme.borderRadius]};
238
+
239
+ background-color: ${r=>r.theme.colors.background.secondary};
240
+ `,SliderStyled=styled.div`
241
+ position: absolute;
242
+ top: 4px;
243
+ left: 4px;
244
+
245
+ height: calc(100% - 8px);
246
+ width: calc(50% - 4px);
247
+
248
+ border-radius: ${r=>sliderBorderRadius[r.theme.borderRadius]};
249
+ background-color: ${r=>r.theme.colors.background.segment};
250
+
251
+ transform: ${r=>r.right?"translateX(100%)":"translateX(0)"};
252
+
253
+ transition: transform 0.13s ease-in-out;
254
+ `,InputStyled=styled.input`
255
+ display: none;
256
+ `,LabelStyled=styled.label`
257
+ padding: 9px 12px;
258
+ z-index: 1;
259
+
260
+ cursor: ${r=>r.isActive?"default":"pointer"};
261
+
262
+ transition: transform 0.13s ease-in-out;
263
+
264
+ &:hover {
265
+ transform: ${r=>r.isActive?"none":"scale(1.025)"};
266
+ }
267
+
268
+ > * {
269
+ ${r=>r.isActive?"":`color: ${r.theme.colors.text.secondary};`}
270
+ }
271
+ `,TabBar=r=>{const f="tabBar"+Math.floor(Math.random()*1e4);return createComponent(TabBarStyled,{get class(){return r.class},"data-tc-tab-bar":"true",get children(){return[createComponent(SliderStyled,{get right(){return r.selectedTabIndex===1}}),createComponent(LabelStyled,{get isActive(){return r.selectedTabIndex===0},get children(){return[createComponent(InputStyled,{type:"radio",name:f,get checked(){return r.selectedTabIndex===0},onInput:()=>{var d;return(d=r.onSelectedTabIndexChange)==null?void 0:d.call(r,0)}}),createMemo(()=>r.tab1)]}}),createComponent(LabelStyled,{get isActive(){return r.selectedTabIndex===1},get children(){return[createComponent(InputStyled,{type:"radio",get checked(){return r.selectedTabIndex===1},name:f,onInput:()=>{var d;return(d=r.onSelectedTabIndexChange)==null?void 0:d.call(r,1)}}),createMemo(()=>r.tab2)]}})]}})},backgroundBorders={m:"16px",s:"12px",none:"0"},imageBorders={m:"12px",s:"8px",none:"0"},qrNormalSize=256,imgSizeDefault=60,picSizeDefault=48,qrPaddingTop=24,CopyIconButton=styled.div`
272
+ width: 52px;
273
+ height: 52px;
274
+ background: transparent;
275
+ position: absolute;
276
+ right: 0;
277
+ bottom: 0;
278
+
279
+ display: flex;
280
+ align-items: center;
281
+ justify-content: center;
282
+ transition: transform 0.125s ease-in-out;
283
+ `,QrCodeBackground=styled.button`
284
+ display: flex;
285
+ align-items: center;
286
+ justify-content: center;
287
+ position: relative;
288
+ background-color: ${r=>r.theme.colors.background.qr};
289
+ border-radius: ${r=>backgroundBorders[r.theme.borderRadius]};
290
+ padding: ${toPx(qrPaddingTop)} 0;
291
+ height: ${toPx(qrNormalSize+qrPaddingTop*2)};
292
+ width: 100%;
293
+
294
+ overflow: hidden;
295
+ cursor: pointer;
296
+ border: none;
297
+
298
+ ${mediaNotTouch} {
299
+ &:hover {
300
+ ${CopyIconButton.class} {
301
+ transform: scale(1.04);
302
+ }
303
+ }
304
+ }
305
+
306
+ &:active {
307
+ ${CopyIconButton.class} {
308
+ transform: scale(0.96);
309
+ }
310
+ }
311
+
312
+ ${mediaTouch} {
313
+ &:active {
314
+ ${CopyIconButton.class} {
315
+ transform: scale(0.92);
316
+ }
317
+ }
318
+ }
319
+ `,QrCodeWrapper$2=styled.div`
320
+ position: relative;
321
+ display: flex;
322
+ justify-content: center;
323
+ align-items: center;
324
+ margin: 0 auto;
325
+
326
+ > div:first-child {
327
+ display: flex;
328
+ align-items: center;
329
+ justify-content: center;
330
+ }
331
+
332
+ rect {
333
+ fill: transparent;
334
+ }
335
+
336
+ path {
337
+ fill: ${r=>r.theme.colors.constant.black};
338
+ }
339
+ `,ImageBackground=styled.div`
340
+ position: absolute;
341
+ width: ${toPx(imgSizeDefault)};
342
+ height: ${toPx(imgSizeDefault)};
343
+ background: ${r=>r.theme.colors.background.qr};
344
+
345
+ display: flex;
346
+ align-items: center;
347
+ justify-content: center;
348
+ `,ImageStyled$3=styled(Image)`
349
+ width: ${r=>toPx(r.size)};
350
+ height: ${r=>toPx(r.size)};
351
+ border-radius: ${r=>imageBorders[r.theme.borderRadius]};
352
+ background-color: ${r=>r.theme.colors.background.qr};
353
+ `,CopiedBoxStyled=styled.div`
354
+ position: absolute;
355
+ bottom: 14px;
356
+ left: 50%;
357
+ transform: translate(-50%, 0);
358
+
359
+ display: flex;
360
+ gap: 6px;
361
+ align-items: center;
362
+ border-radius: 18px;
363
+ min-width: 126px;
364
+ padding: 9px 16px 9px 10px;
365
+
366
+ filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
367
+ background-color: ${r=>r.theme.colors.background.segment};
368
+ `;var qrcode$1={exports:{}};(function(r,f){var d=(function(){var g=function(X,oe){var se=236,de=17,he=X,we=m[oe],te=null,q=0,k=null,y=[],B={},$=function(ee,pe){q=he*4+17,te=(function(be){for(var ae=new Array(be),ne=0;ne<be;ne+=1){ae[ne]=new Array(be);for(var Se=0;Se<be;Se+=1)ae[ne][Se]=null}return ae})(q),I(0,0),I(q-7,0),I(0,q-7),D(),j(),R(ee,pe),he>=7&&W(ee),k==null&&(k=Ce(he,we,y)),z(k,pe)},I=function(ee,pe){for(var be=-1;be<=7;be+=1)if(!(ee+be<=-1||q<=ee+be))for(var ae=-1;ae<=7;ae+=1)pe+ae<=-1||q<=pe+ae||(0<=be&&be<=6&&(ae==0||ae==6)||0<=ae&&ae<=6&&(be==0||be==6)||2<=be&&be<=4&&2<=ae&&ae<=4?te[ee+be][pe+ae]=!0:te[ee+be][pe+ae]=!1)},F=function(){for(var ee=0,pe=0,be=0;be<8;be+=1){$(!0,be);var ae=_.getLostPoint(B);(be==0||ee>ae)&&(ee=ae,pe=be)}return pe},j=function(){for(var ee=8;ee<q-8;ee+=1)te[ee][6]==null&&(te[ee][6]=ee%2==0);for(var pe=8;pe<q-8;pe+=1)te[6][pe]==null&&(te[6][pe]=pe%2==0)},D=function(){for(var ee=_.getPatternPosition(he),pe=0;pe<ee.length;pe+=1)for(var be=0;be<ee.length;be+=1){var ae=ee[pe],ne=ee[be];if(te[ae][ne]==null)for(var Se=-2;Se<=2;Se+=1)for(var ke=-2;ke<=2;ke+=1)Se==-2||Se==2||ke==-2||ke==2||Se==0&&ke==0?te[ae+Se][ne+ke]=!0:te[ae+Se][ne+ke]=!1}},W=function(ee){for(var pe=_.getBCHTypeNumber(he),be=0;be<18;be+=1){var ae=!ee&&(pe>>be&1)==1;te[Math.floor(be/3)][be%3+q-8-3]=ae}for(var be=0;be<18;be+=1){var ae=!ee&&(pe>>be&1)==1;te[be%3+q-8-3][Math.floor(be/3)]=ae}},R=function(ee,pe){for(var be=we<<3|pe,ae=_.getBCHTypeInfo(be),ne=0;ne<15;ne+=1){var Se=!ee&&(ae>>ne&1)==1;ne<6?te[ne][8]=Se:ne<8?te[ne+1][8]=Se:te[q-15+ne][8]=Se}for(var ne=0;ne<15;ne+=1){var Se=!ee&&(ae>>ne&1)==1;ne<8?te[8][q-ne-1]=Se:ne<9?te[8][15-ne-1+1]=Se:te[8][15-ne-1]=Se}te[q-8][8]=!ee},z=function(ee,pe){for(var be=-1,ae=q-1,ne=7,Se=0,ke=_.getMaskFunction(pe),Ie=q-1;Ie>0;Ie-=2)for(Ie==6&&(Ie-=1);;){for(var Oe=0;Oe<2;Oe+=1)if(te[ae][Ie-Oe]==null){var Ue=!1;Se<ee.length&&(Ue=(ee[Se]>>>ne&1)==1);var De=ke(ae,Ie-Oe);De&&(Ue=!Ue),te[ae][Ie-Oe]=Ue,ne-=1,ne==-1&&(Se+=1,ne=7)}if(ae+=be,ae<0||q<=ae){ae-=be,be=-be;break}}},ye=function(ee,pe){for(var be=0,ae=0,ne=0,Se=new Array(pe.length),ke=new Array(pe.length),Ie=0;Ie<pe.length;Ie+=1){var Oe=pe[Ie].dataCount,Ue=pe[Ie].totalCount-Oe;ae=Math.max(ae,Oe),ne=Math.max(ne,Ue),Se[Ie]=new Array(Oe);for(var De=0;De<Se[Ie].length;De+=1)Se[Ie][De]=255&ee.getBuffer()[De+be];be+=Oe;var $e=_.getErrorCorrectPolynomial(Ue),je=x(Se[Ie],$e.getLength()-1),Ye=je.mod($e);ke[Ie]=new Array($e.getLength()-1);for(var De=0;De<ke[Ie].length;De+=1){var st=De+Ye.getLength()-ke[Ie].length;ke[Ie][De]=st>=0?Ye.getAt(st):0}}for(var Je=0,De=0;De<pe.length;De+=1)Je+=pe[De].totalCount;for(var Ge=new Array(Je),ut=0,De=0;De<ae;De+=1)for(var Ie=0;Ie<pe.length;Ie+=1)De<Se[Ie].length&&(Ge[ut]=Se[Ie][De],ut+=1);for(var De=0;De<ne;De+=1)for(var Ie=0;Ie<pe.length;Ie+=1)De<ke[Ie].length&&(Ge[ut]=ke[Ie][De],ut+=1);return Ge},Ce=function(ee,pe,be){for(var ae=b.getRSBlocks(ee,pe),ne=C(),Se=0;Se<be.length;Se+=1){var ke=be[Se];ne.put(ke.getMode(),4),ne.put(ke.getLength(),_.getLengthInBits(ke.getMode(),ee)),ke.write(ne)}for(var Ie=0,Se=0;Se<ae.length;Se+=1)Ie+=ae[Se].dataCount;if(ne.getLengthInBits()>Ie*8)throw"code length overflow. ("+ne.getLengthInBits()+">"+Ie*8+")";for(ne.getLengthInBits()+4<=Ie*8&&ne.put(0,4);ne.getLengthInBits()%8!=0;)ne.putBit(!1);for(;!(ne.getLengthInBits()>=Ie*8||(ne.put(se,8),ne.getLengthInBits()>=Ie*8));)ne.put(de,8);return ye(ne,ae)};B.addData=function(ee,pe){pe=pe||"Byte";var be=null;switch(pe){case"Numeric":be=E(ee);break;case"Alphanumeric":be=M(ee);break;case"Byte":be=A(ee);break;case"Kanji":be=T(ee);break;default:throw"mode:"+pe}y.push(be),k=null},B.isDark=function(ee,pe){if(ee<0||q<=ee||pe<0||q<=pe)throw ee+","+pe;return te[ee][pe]},B.getModuleCount=function(){return q},B.make=function(){if(he<1){for(var ee=1;ee<40;ee++){for(var pe=b.getRSBlocks(ee,we),be=C(),ae=0;ae<y.length;ae++){var ne=y[ae];be.put(ne.getMode(),4),be.put(ne.getLength(),_.getLengthInBits(ne.getMode(),ee)),ne.write(be)}for(var Se=0,ae=0;ae<pe.length;ae++)Se+=pe[ae].dataCount;if(be.getLengthInBits()<=Se*8)break}he=ee}$(!1,F())},B.createTableTag=function(ee,pe){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var be="";be+='<table style="',be+=" border-width: 0px; border-style: none;",be+=" border-collapse: collapse;",be+=" padding: 0px; margin: "+pe+"px;",be+='">',be+="<tbody>";for(var ae=0;ae<B.getModuleCount();ae+=1){be+="<tr>";for(var ne=0;ne<B.getModuleCount();ne+=1)be+='<td style="',be+=" border-width: 0px; border-style: none;",be+=" border-collapse: collapse;",be+=" padding: 0px; margin: 0px;",be+=" width: "+ee+"px;",be+=" height: "+ee+"px;",be+=" background-color: ",be+=B.isDark(ae,ne)?"#000000":"#ffffff",be+=";",be+='"/>';be+="</tr>"}return be+="</tbody>",be+="</table>",be},B.createSvgTag=function(ee,pe,be,ae){var ne={};typeof arguments[0]=="object"&&(ne=arguments[0],ee=ne.cellSize,pe=ne.margin,be=ne.alt,ae=ne.title),ee=ee||2,pe=typeof pe>"u"?ee*4:pe,be=typeof be=="string"?{text:be}:be||{},be.text=be.text||null,be.id=be.text?be.id||"qrcode-description":null,ae=typeof ae=="string"?{text:ae}:ae||{},ae.text=ae.text||null,ae.id=ae.text?ae.id||"qrcode-title":null;var Se=B.getModuleCount()*ee+pe*2,ke,Ie,Oe,Ue,De="",$e;for($e="l"+ee+",0 0,"+ee+" -"+ee+",0 0,-"+ee+"z ",De+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',De+=ne.scalable?"":' width="'+Se+'px" height="'+Se+'px"',De+=' viewBox="0 0 '+Se+" "+Se+'" ',De+=' preserveAspectRatio="xMinYMin meet"',De+=ae.text||be.text?' role="img" aria-labelledby="'+me([ae.id,be.id].join(" ").trim())+'"':"",De+=">",De+=ae.text?'<title id="'+me(ae.id)+'">'+me(ae.text)+"</title>":"",De+=be.text?'<description id="'+me(be.id)+'">'+me(be.text)+"</description>":"",De+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',De+='<path d="',Oe=0;Oe<B.getModuleCount();Oe+=1)for(Ue=Oe*ee+pe,ke=0;ke<B.getModuleCount();ke+=1)B.isDark(Oe,ke)&&(Ie=ke*ee+pe,De+="M"+Ie+","+Ue+$e);return De+='" stroke="transparent" fill="black"/>',De+="</svg>",De},B.createDataURL=function(ee,pe){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var be=B.getModuleCount()*ee+pe*2,ae=pe,ne=be-pe;return V(be,be,function(Se,ke){if(ae<=Se&&Se<ne&&ae<=ke&&ke<ne){var Ie=Math.floor((Se-ae)/ee),Oe=Math.floor((ke-ae)/ee);return B.isDark(Oe,Ie)?0:1}else return 1})},B.createImgTag=function(ee,pe,be){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var ae=B.getModuleCount()*ee+pe*2,ne="";return ne+="<img",ne+=' src="',ne+=B.createDataURL(ee,pe),ne+='"',ne+=' width="',ne+=ae,ne+='"',ne+=' height="',ne+=ae,ne+='"',be&&(ne+=' alt="',ne+=me(be),ne+='"'),ne+="/>",ne};var me=function(ee){for(var pe="",be=0;be<ee.length;be+=1){var ae=ee.charAt(be);switch(ae){case"<":pe+="&lt;";break;case">":pe+="&gt;";break;case"&":pe+="&amp;";break;case'"':pe+="&quot;";break;default:pe+=ae;break}}return pe},ie=function(ee){var pe=1;ee=typeof ee>"u"?pe*2:ee;var be=B.getModuleCount()*pe+ee*2,ae=ee,ne=be-ee,Se,ke,Ie,Oe,Ue,De={"██":"█","█ ":"▀"," █":"▄"," ":" "},$e={"██":"▀","█ ":"▀"," █":" "," ":" "},je="";for(Se=0;Se<be;Se+=2){for(Ie=Math.floor((Se-ae)/pe),Oe=Math.floor((Se+1-ae)/pe),ke=0;ke<be;ke+=1)Ue="█",ae<=ke&&ke<ne&&ae<=Se&&Se<ne&&B.isDark(Ie,Math.floor((ke-ae)/pe))&&(Ue=" "),ae<=ke&&ke<ne&&ae<=Se+1&&Se+1<ne&&B.isDark(Oe,Math.floor((ke-ae)/pe))?Ue+=" ":Ue+="█",je+=ee<1&&Se+1>=ne?$e[Ue]:De[Ue];je+=`
369
+ `}return be%2&&ee>0?je.substring(0,je.length-be-1)+Array(be+1).join("▀"):je.substring(0,je.length-1)};return B.createASCII=function(ee,pe){if(ee=ee||1,ee<2)return ie(pe);ee-=1,pe=typeof pe>"u"?ee*2:pe;var be=B.getModuleCount()*ee+pe*2,ae=pe,ne=be-pe,Se,ke,Ie,Oe,Ue=Array(ee+1).join("██"),De=Array(ee+1).join(" "),$e="",je="";for(Se=0;Se<be;Se+=1){for(Ie=Math.floor((Se-ae)/ee),je="",ke=0;ke<be;ke+=1)Oe=1,ae<=ke&&ke<ne&&ae<=Se&&Se<ne&&B.isDark(Ie,Math.floor((ke-ae)/ee))&&(Oe=0),je+=Oe?Ue:De;for(Ie=0;Ie<ee;Ie+=1)$e+=je+`
370
+ `}return $e.substring(0,$e.length-1)},B.renderTo2dContext=function(ee,pe){pe=pe||2;for(var be=B.getModuleCount(),ae=0;ae<be;ae++)for(var ne=0;ne<be;ne++)ee.fillStyle=B.isDark(ae,ne)?"black":"white",ee.fillRect(ae*pe,ne*pe,pe,pe)},B};g.stringToBytesFuncs={default:function(X){for(var oe=[],se=0;se<X.length;se+=1){var de=X.charCodeAt(se);oe.push(de&255)}return oe}},g.stringToBytes=g.stringToBytesFuncs.default,g.createStringToBytes=function(X,oe){var se=(function(){for(var he=N(X),we=function(){var j=he.read();if(j==-1)throw"eof";return j},te=0,q={};;){var k=he.read();if(k==-1)break;var y=we(),B=we(),$=we(),I=String.fromCharCode(k<<8|y),F=B<<8|$;q[I]=F,te+=1}if(te!=oe)throw te+" != "+oe;return q})(),de=63;return function(he){for(var we=[],te=0;te<he.length;te+=1){var q=he.charCodeAt(te);if(q<128)we.push(q);else{var k=se[he.charAt(te)];typeof k=="number"?(k&255)==k?we.push(k):(we.push(k>>>8),we.push(k&255)):we.push(de)}}return we}};var v={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},m={L:1,M:0,Q:3,H:2},w={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},_=(function(){var X=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],oe=1335,se=7973,de=21522,he={},we=function(te){for(var q=0;te!=0;)q+=1,te>>>=1;return q};return he.getBCHTypeInfo=function(te){for(var q=te<<10;we(q)-we(oe)>=0;)q^=oe<<we(q)-we(oe);return(te<<10|q)^de},he.getBCHTypeNumber=function(te){for(var q=te<<12;we(q)-we(se)>=0;)q^=se<<we(q)-we(se);return te<<12|q},he.getPatternPosition=function(te){return X[te-1]},he.getMaskFunction=function(te){switch(te){case w.PATTERN000:return function(q,k){return(q+k)%2==0};case w.PATTERN001:return function(q,k){return q%2==0};case w.PATTERN010:return function(q,k){return k%3==0};case w.PATTERN011:return function(q,k){return(q+k)%3==0};case w.PATTERN100:return function(q,k){return(Math.floor(q/2)+Math.floor(k/3))%2==0};case w.PATTERN101:return function(q,k){return q*k%2+q*k%3==0};case w.PATTERN110:return function(q,k){return(q*k%2+q*k%3)%2==0};case w.PATTERN111:return function(q,k){return(q*k%3+(q+k)%2)%2==0};default:throw"bad maskPattern:"+te}},he.getErrorCorrectPolynomial=function(te){for(var q=x([1],0),k=0;k<te;k+=1)q=q.multiply(x([1,S.gexp(k)],0));return q},he.getLengthInBits=function(te,q){if(1<=q&&q<10)switch(te){case v.MODE_NUMBER:return 10;case v.MODE_ALPHA_NUM:return 9;case v.MODE_8BIT_BYTE:return 8;case v.MODE_KANJI:return 8;default:throw"mode:"+te}else if(q<27)switch(te){case v.MODE_NUMBER:return 12;case v.MODE_ALPHA_NUM:return 11;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 10;default:throw"mode:"+te}else if(q<41)switch(te){case v.MODE_NUMBER:return 14;case v.MODE_ALPHA_NUM:return 13;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 12;default:throw"mode:"+te}else throw"type:"+q},he.getLostPoint=function(te){for(var q=te.getModuleCount(),k=0,y=0;y<q;y+=1)for(var B=0;B<q;B+=1){for(var $=0,I=te.isDark(y,B),F=-1;F<=1;F+=1)if(!(y+F<0||q<=y+F))for(var j=-1;j<=1;j+=1)B+j<0||q<=B+j||F==0&&j==0||I==te.isDark(y+F,B+j)&&($+=1);$>5&&(k+=3+$-5)}for(var y=0;y<q-1;y+=1)for(var B=0;B<q-1;B+=1){var D=0;te.isDark(y,B)&&(D+=1),te.isDark(y+1,B)&&(D+=1),te.isDark(y,B+1)&&(D+=1),te.isDark(y+1,B+1)&&(D+=1),(D==0||D==4)&&(k+=3)}for(var y=0;y<q;y+=1)for(var B=0;B<q-6;B+=1)te.isDark(y,B)&&!te.isDark(y,B+1)&&te.isDark(y,B+2)&&te.isDark(y,B+3)&&te.isDark(y,B+4)&&!te.isDark(y,B+5)&&te.isDark(y,B+6)&&(k+=40);for(var B=0;B<q;B+=1)for(var y=0;y<q-6;y+=1)te.isDark(y,B)&&!te.isDark(y+1,B)&&te.isDark(y+2,B)&&te.isDark(y+3,B)&&te.isDark(y+4,B)&&!te.isDark(y+5,B)&&te.isDark(y+6,B)&&(k+=40);for(var W=0,B=0;B<q;B+=1)for(var y=0;y<q;y+=1)te.isDark(y,B)&&(W+=1);var R=Math.abs(100*W/q/q-50)/5;return k+=R*10,k},he})(),S=(function(){for(var X=new Array(256),oe=new Array(256),se=0;se<8;se+=1)X[se]=1<<se;for(var se=8;se<256;se+=1)X[se]=X[se-4]^X[se-5]^X[se-6]^X[se-8];for(var se=0;se<255;se+=1)oe[X[se]]=se;var de={};return de.glog=function(he){if(he<1)throw"glog("+he+")";return oe[he]},de.gexp=function(he){for(;he<0;)he+=255;for(;he>=256;)he-=255;return X[he]},de})();function x(X,oe){if(typeof X.length>"u")throw X.length+"/"+oe;var se=(function(){for(var he=0;he<X.length&&X[he]==0;)he+=1;for(var we=new Array(X.length-he+oe),te=0;te<X.length-he;te+=1)we[te]=X[te+he];return we})(),de={};return de.getAt=function(he){return se[he]},de.getLength=function(){return se.length},de.multiply=function(he){for(var we=new Array(de.getLength()+he.getLength()-1),te=0;te<de.getLength();te+=1)for(var q=0;q<he.getLength();q+=1)we[te+q]^=S.gexp(S.glog(de.getAt(te))+S.glog(he.getAt(q)));return x(we,0)},de.mod=function(he){if(de.getLength()-he.getLength()<0)return de;for(var we=S.glog(de.getAt(0))-S.glog(he.getAt(0)),te=new Array(de.getLength()),q=0;q<de.getLength();q+=1)te[q]=de.getAt(q);for(var q=0;q<he.getLength();q+=1)te[q]^=S.gexp(S.glog(he.getAt(q))+we);return x(te,0).mod(he)},de}var b=(function(){var X=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],oe=function(he,we){var te={};return te.totalCount=he,te.dataCount=we,te},se={},de=function(he,we){switch(we){case m.L:return X[(he-1)*4+0];case m.M:return X[(he-1)*4+1];case m.Q:return X[(he-1)*4+2];case m.H:return X[(he-1)*4+3];default:return}};return se.getRSBlocks=function(he,we){var te=de(he,we);if(typeof te>"u")throw"bad rs block @ typeNumber:"+he+"/errorCorrectionLevel:"+we;for(var q=te.length/3,k=[],y=0;y<q;y+=1)for(var B=te[y*3+0],$=te[y*3+1],I=te[y*3+2],F=0;F<B;F+=1)k.push(oe($,I));return k},se})(),C=function(){var X=[],oe=0,se={};return se.getBuffer=function(){return X},se.getAt=function(de){var he=Math.floor(de/8);return(X[he]>>>7-de%8&1)==1},se.put=function(de,he){for(var we=0;we<he;we+=1)se.putBit((de>>>he-we-1&1)==1)},se.getLengthInBits=function(){return oe},se.putBit=function(de){var he=Math.floor(oe/8);X.length<=he&&X.push(0),de&&(X[he]|=128>>>oe%8),oe+=1},se},E=function(X){var oe=v.MODE_NUMBER,se=X,de={};de.getMode=function(){return oe},de.getLength=function(te){return se.length},de.write=function(te){for(var q=se,k=0;k+2<q.length;)te.put(he(q.substring(k,k+3)),10),k+=3;k<q.length&&(q.length-k==1?te.put(he(q.substring(k,k+1)),4):q.length-k==2&&te.put(he(q.substring(k,k+2)),7))};var he=function(te){for(var q=0,k=0;k<te.length;k+=1)q=q*10+we(te.charAt(k));return q},we=function(te){if("0"<=te&&te<="9")return te.charCodeAt(0)-48;throw"illegal char :"+te};return de},M=function(X){var oe=v.MODE_ALPHA_NUM,se=X,de={};de.getMode=function(){return oe},de.getLength=function(we){return se.length},de.write=function(we){for(var te=se,q=0;q+1<te.length;)we.put(he(te.charAt(q))*45+he(te.charAt(q+1)),11),q+=2;q<te.length&&we.put(he(te.charAt(q)),6)};var he=function(we){if("0"<=we&&we<="9")return we.charCodeAt(0)-48;if("A"<=we&&we<="Z")return we.charCodeAt(0)-65+10;switch(we){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+we}};return de},A=function(X){var oe=v.MODE_8BIT_BYTE,se=g.stringToBytes(X),de={};return de.getMode=function(){return oe},de.getLength=function(he){return se.length},de.write=function(he){for(var we=0;we<se.length;we+=1)he.put(se[we],8)},de},T=function(X){var oe=v.MODE_KANJI,se=g.stringToBytesFuncs.SJIS;if(!se)throw"sjis not supported.";(function(we,te){var q=se(we);if(q.length!=2||(q[0]<<8|q[1])!=te)throw"sjis not supported."})("友",38726);var de=se(X),he={};return he.getMode=function(){return oe},he.getLength=function(we){return~~(de.length/2)},he.write=function(we){for(var te=de,q=0;q+1<te.length;){var k=(255&te[q])<<8|255&te[q+1];if(33088<=k&&k<=40956)k-=33088;else if(57408<=k&&k<=60351)k-=49472;else throw"illegal char at "+(q+1)+"/"+k;k=(k>>>8&255)*192+(k&255),we.put(k,13),q+=2}if(q<te.length)throw"illegal char at "+(q+1)},he},L=function(){var X=[],oe={};return oe.writeByte=function(se){X.push(se&255)},oe.writeShort=function(se){oe.writeByte(se),oe.writeByte(se>>>8)},oe.writeBytes=function(se,de,he){de=de||0,he=he||se.length;for(var we=0;we<he;we+=1)oe.writeByte(se[we+de])},oe.writeString=function(se){for(var de=0;de<se.length;de+=1)oe.writeByte(se.charCodeAt(de))},oe.toByteArray=function(){return X},oe.toString=function(){var se="";se+="[";for(var de=0;de<X.length;de+=1)de>0&&(se+=","),se+=X[de];return se+="]",se},oe},O=function(){var X=0,oe=0,se=0,de="",he={},we=function(q){de+=String.fromCharCode(te(q&63))},te=function(q){if(!(q<0)){if(q<26)return 65+q;if(q<52)return 97+(q-26);if(q<62)return 48+(q-52);if(q==62)return 43;if(q==63)return 47}throw"n:"+q};return he.writeByte=function(q){for(X=X<<8|q&255,oe+=8,se+=1;oe>=6;)we(X>>>oe-6),oe-=6},he.flush=function(){if(oe>0&&(we(X<<6-oe),X=0,oe=0),se%3!=0)for(var q=3-se%3,k=0;k<q;k+=1)de+="="},he.toString=function(){return de},he},N=function(X){var oe=X,se=0,de=0,he=0,we={};we.read=function(){for(;he<8;){if(se>=oe.length){if(he==0)return-1;throw"unexpected end of file./"+he}var q=oe.charAt(se);if(se+=1,q=="=")return he=0,-1;if(q.match(/^\s$/))continue;de=de<<6|te(q.charCodeAt(0)),he+=6}var k=de>>>he-8&255;return he-=8,k};var te=function(q){if(65<=q&&q<=90)return q-65;if(97<=q&&q<=122)return q-97+26;if(48<=q&&q<=57)return q-48+52;if(q==43)return 62;if(q==47)return 63;throw"c:"+q};return we},H=function(X,oe){var se=X,de=oe,he=new Array(X*oe),we={};we.setPixel=function(y,B,$){he[B*se+y]=$},we.write=function(y){y.writeString("GIF87a"),y.writeShort(se),y.writeShort(de),y.writeByte(128),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(255),y.writeByte(255),y.writeByte(255),y.writeString(","),y.writeShort(0),y.writeShort(0),y.writeShort(se),y.writeShort(de),y.writeByte(0);var B=2,$=q(B);y.writeByte(B);for(var I=0;$.length-I>255;)y.writeByte(255),y.writeBytes($,I,255),I+=255;y.writeByte($.length-I),y.writeBytes($,I,$.length-I),y.writeByte(0),y.writeString(";")};var te=function(y){var B=y,$=0,I=0,F={};return F.write=function(j,D){if(j>>>D)throw"length over";for(;$+D>=8;)B.writeByte(255&(j<<$|I)),D-=8-$,j>>>=8-$,I=0,$=0;I=j<<$|I,$=$+D},F.flush=function(){$>0&&B.writeByte(I)},F},q=function(y){for(var B=1<<y,$=(1<<y)+1,I=y+1,F=k(),j=0;j<B;j+=1)F.add(String.fromCharCode(j));F.add(String.fromCharCode(B)),F.add(String.fromCharCode($));var D=L(),W=te(D);W.write(B,I);var R=0,z=String.fromCharCode(he[R]);for(R+=1;R<he.length;){var ye=String.fromCharCode(he[R]);R+=1,F.contains(z+ye)?z=z+ye:(W.write(F.indexOf(z),I),F.size()<4095&&(F.size()==1<<I&&(I+=1),F.add(z+ye)),z=ye)}return W.write(F.indexOf(z),I),W.write($,I),W.flush(),D.toByteArray()},k=function(){var y={},B=0,$={};return $.add=function(I){if($.contains(I))throw"dup key:"+I;y[I]=B,B+=1},$.size=function(){return B},$.indexOf=function(I){return y[I]},$.contains=function(I){return typeof y[I]<"u"},$};return we},V=function(X,oe,se){for(var de=H(X,oe),he=0;he<oe;he+=1)for(var we=0;we<X;we+=1)de.setPixel(we,he,se(we,he));var te=L();de.write(te);for(var q=O(),k=te.toByteArray(),y=0;y<k.length;y+=1)q.writeByte(k[y]);return q.flush(),"data:image/gif;base64,"+q};return g})();(function(){d.stringToBytesFuncs["UTF-8"]=function(g){function v(m){for(var w=[],_=0;_<m.length;_++){var S=m.charCodeAt(_);S<128?w.push(S):S<2048?w.push(192|S>>6,128|S&63):S<55296||S>=57344?w.push(224|S>>12,128|S>>6&63,128|S&63):(_++,S=65536+((S&1023)<<10|m.charCodeAt(_)&1023),w.push(240|S>>18,128|S>>12&63,128|S>>6&63,128|S&63))}return w}return v(g)}})(),(function(g){r.exports=g()})(function(){return d})})(qrcode$1);const qrcode=qrcode$1.exports;function copyToClipboard(r){return __async(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new TonConnectUIError("Clipboard API not available");return yield navigator.clipboard.writeText(r)}catch{}fallbackCopyTextToClipboard(r)})}function fallbackCopyTextToClipboard(r){const f=document.createElement("textarea");f.value=r,f.style.top="0",f.style.left="0",f.style.position="fixed",document.body.appendChild(f),f.focus(),f.select();try{document.execCommand("copy")}finally{document.body.removeChild(f)}}const _tmpl$$s=template$1("<div></div>"),QRCode=r=>{let f,d,g;const[v,m]=createSignal(!1),[w,_]=createSignal(picSizeDefault);createEffect(()=>{const E=qrcode(0,"L");E.addData(r.sourceUrl),E.make(),f.innerHTML=E.createSvgTag(4,0);const M=f.firstElementChild.clientWidth,A=Math.round(qrNormalSize/M*1e5)/1e5;if(g){const T=Math.ceil(imgSizeDefault/(A*4))*4,L=toPx(Math.ceil((M-T)/8)*4);g.style.top=L,g.style.left=L,g.style.height=toPx(T),g.style.width=toPx(T),_(Math.round(picSizeDefault/A))}d.style.transform=`scale(${A})`});let S=null;return createComponent(QrCodeBackground,{get class(){return r.class},onClick:()=>{m(!0),copyToClipboard(r.sourceUrl),S!=null&&clearTimeout(S),S=setTimeout(()=>m(!1),1500)},get children(){return[createComponent(QrCodeWrapper$2,{ref(b){const C=d;typeof C=="function"?C(b):d=b},get children(){return[(()=>{const b=_tmpl$$s.cloneNode(!0),C=f;return typeof C=="function"?use(C,b):f=b,b})(),createComponent(Show,{get when(){return r.imageUrl},get children(){return createComponent(ImageBackground,{ref(b){const C=g;typeof C=="function"?C(b):g=b},get children(){return createComponent(ImageStyled$3,{get src(){return r.imageUrl},alt:"",get size(){return w()}})}})}})]}}),createComponent(Transition,{onBeforeEnter:b=>{animate(b,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(b,C)=>{animate(b,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{C()})},get children(){return createComponent(Show,{get when(){return v()&&!r.disableCopy},get children(){return createComponent(CopiedBoxStyled,{get children(){return[createComponent(SuccessIcon,{size:"xs"}),createComponent(Text,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),createComponent(Show,{get when(){return!r.disableCopy},get children(){return createComponent(CopyIconButton,{get children(){return createComponent(CopyLightIcon,{})}})}})]}})};var deepReadObject=(r,f,d)=>{const g=f.trim().split(".").reduce((v,m)=>v?v[m]:void 0,r);return g!==void 0?g:d},template=(r,f,d=/{{(.*?)}}/g)=>r.replace(d,(g,v)=>deepReadObject(f,v,"")),createI18nContext=(r={},f=navigator.language in r?navigator.language:Object.keys(r)[0])=>{const[d,g]=createSignal(f),[v,m]=createStore(r);return[(S,x,b)=>{const C=deepReadObject(v[d()],S,b||"");return typeof C=="function"?C(x):typeof C=="string"?template(C,x||{}):C},{add(S,x){m(S,b=>Object.assign(b||{},x))},locale:S=>S?g(S):d(),dict:S=>deepReadObject(v,S)}]},I18nContext=createContext({}),useI18n=()=>useContext(I18nContext);const TextStyled$4=styled.div`
371
+ font-style: normal;
372
+ font-weight: ${r=>r.fontWeight};
373
+ font-size: ${r=>r.fontSize};
374
+ line-height: ${r=>r.lineHeight};
375
+
376
+ color: ${r=>r.color};
377
+ `,Text=r=>{const f=useTheme(),[d]=useI18n();let g;const v=()=>r.color||f.colors.text.primary,m=mergeProps({fontSize:"14px",fontWeight:"510",lineHeight:"130%"},r);return createEffect(()=>{g&&m.cursor!=="unset"&&getComputedStyle(g).cursor!=="pointer"&&(g.style.cursor="default")}),createComponent(TextStyled$4,{get fontSize(){return m.fontSize},get fontWeight(){return m.fontWeight},get lineHeight(){return m.lineHeight},get color(){return v()},get class(){return m.class},ref(w){const _=g;typeof _=="function"?_(w):g=w},"data-tc-text":"true",get children(){var w;return createMemo(()=>!!m.translationKey)()?d(m.translationKey,m.translationValues,(w=m.children)==null?void 0:w.toString()):m.children}})},ImageContainer=styled.div`
378
+ position: relative;
379
+
380
+ &::after {
381
+ content: '';
382
+ display: block;
383
+ position: absolute;
384
+ top: 0;
385
+ bottom: 0;
386
+ left: 0;
387
+ right: 0;
388
+ border: 0.5px solid rgba(0, 0, 0, 0.08);
389
+ border-radius: inherit;
390
+ }
391
+ `,ImageStyled$2=styled(Image)`
392
+ width: 100%;
393
+ height: 100%;
394
+ border-radius: inherit;
395
+ `,WalletImage=r=>createComponent(ImageContainer,{get class(){return r.class},get children(){return[createComponent(ImageStyled$2,{get src(){return r.src}}),createMemo(()=>r.badge)]}}),borders$4={m:"16px",s:"12px",none:"0"},badgeBorders={m:"6px",s:"6px",none:"0"},WalletUlContainer=styled.ul`
396
+ display: flex;
397
+ gap: 0;
398
+ width: 100%;
399
+ overflow-x: auto;
400
+ padding: 8px 12px 16px 12px;
401
+ margin: 0;
402
+ list-style: none;
403
+ flex-wrap: nowrap;
404
+
405
+ &&::-webkit-scrollbar {
406
+ display: none;
407
+ }
408
+ -ms-overflow-style: none;
409
+ scrollbar-width: none;
410
+
411
+ > li {
412
+ display: flex;
413
+ flex: 1;
414
+ min-width: 78px;
415
+ height: fit-content;
416
+ }
417
+
418
+ > li > button {
419
+ width: 100%;
420
+ }
421
+ `,WalletItemStyled=styled.button`
422
+ position: relative;
423
+ cursor: pointer;
424
+ border: none;
425
+ background-color: unset;
426
+ padding: 8px 4px;
427
+ width: 100%;
428
+ min-width: 78px;
429
+ display: flex;
430
+ flex-direction: column;
431
+ align-items: center;
432
+
433
+ transition: transform 0.125s ease-in-out;
434
+
435
+ ${mediaNotTouch} {
436
+ &:hover {
437
+ transform: scale(1.04);
438
+ }
439
+ }
440
+
441
+ &:active {
442
+ transform: scale(0.96);
443
+ }
444
+
445
+ ${mediaTouch} {
446
+ &:active {
447
+ transform: scale(0.92);
448
+ }
449
+ }
450
+ `,ImageStyled$1=styled(WalletImage)`
451
+ width: 60px;
452
+ height: 60px;
453
+ border-radius: ${r=>borders$4[r.theme.borderRadius]};
454
+ margin-bottom: 8px;
455
+ position: relative;
456
+ `,BadgeStyled=styled(Image)`
457
+ position: absolute;
458
+ right: -6px;
459
+ bottom: -6px;
460
+ width: 24px;
461
+ height: 24px;
462
+ border-radius: ${r=>badgeBorders[r.theme.borderRadius]};
463
+ box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
464
+ `,StyledText=styled(Text)`
465
+ max-width: 90px;
466
+ font-weight: 510;
467
+ white-space: nowrap;
468
+ text-overflow: ellipsis;
469
+ overflow: hidden;
470
+
471
+ ${media("mobile")} {
472
+ max-width: 80px;
473
+ }
474
+ `,StyledSecondLine=styled(Text)`
475
+ font-weight: ${r=>r.colorPrimary?"510":"400"};
476
+ max-width: 90px;
477
+ white-space: nowrap;
478
+ text-overflow: ellipsis;
479
+ overflow: hidden;
480
+ color: ${r=>r.colorPrimary?r.theme.colors.text.primary:r.theme.colors.text.secondary};
481
+
482
+ ${media("mobile")} {
483
+ max-width: 80px;
484
+ }
485
+ `,_tmpl$$r=template$1("<div></div>"),WalletItem=r=>{let f=null;const d=()=>{const g=f==null?void 0:f.querySelector("div");if(g&&g.scrollWidth>g.clientWidth){let v=0;const m=-.4,w=.05;for(;g.scrollWidth>g.clientWidth&&v>=m;)v-=w,g.style.letterSpacing=`${v}px`;v!==0&&(v-=w,g.style.letterSpacing=`${v}px`)}};return onMount(()=>d()),createEffect(()=>{d()}),createComponent(WalletItemStyled,{get class(){return r.class},onClick:()=>r.onClick(),"data-tc-wallet-item":"true",get children(){return[createMemo(()=>createMemo(()=>typeof r.icon=="string")()?createComponent(ImageStyled$1,{get src(){return r.icon},get badge(){return createMemo(()=>!!r.badgeUrl)()&&createComponent(BadgeStyled,{get src(){return r.badgeUrl}})}}):r.icon),(()=>{const g=_tmpl$$r.cloneNode(!0);return use(v=>f=v,g),insert(g,createComponent(StyledText,{get children(){return r.name}})),g})(),createMemo(()=>createMemo(()=>!!r.secondLine)()&&createComponent(StyledSecondLine,{get colorPrimary(){var g;return(g=r.secondLineColorPrimary)!=null?g:!0},get children(){return r.secondLine}}))]}})},H1Styled$b=styled.h1`
486
+ font-style: normal;
487
+ font-weight: 590;
488
+ font-size: 20px;
489
+ line-height: 28px;
490
+
491
+ text-align: center;
492
+
493
+ color: ${r=>r.theme.colors.text.primary};
494
+
495
+ margin-top: 0;
496
+ margin-bottom: 0;
497
+
498
+ cursor: default;
499
+ `,H1=r=>{const[f]=useI18n();return createComponent(H1Styled$b,{get class(){return r.class},"data-tc-h1":"true",get children(){var d;return createMemo(()=>!!r.translationKey)()?f(r.translationKey,r.translationValues,(d=r.children)==null?void 0:d.toString()):r.children}})},H2Styled$5=styled.h2`
500
+ font-style: normal;
501
+ font-weight: 400;
502
+ font-size: 16px;
503
+ line-height: 22px;
504
+
505
+ text-align: center;
506
+
507
+ color: ${r=>r.theme.colors.text.secondary};
508
+
509
+ margin-top: 0;
510
+ margin-bottom: 32px;
511
+
512
+ cursor: default;
513
+ `,H2=r=>{const[f]=useI18n();return createComponent(H2Styled$5,{get class(){return r.class},"data-tc-h2":"true",get children(){var d;return createMemo(()=>!!r.translationKey)()?f(r.translationKey,r.translationValues,(d=r.children)==null?void 0:d.toString()):r.children}})},H3Styled$2=styled.h3`
514
+ font-style: normal;
515
+ font-weight: 510;
516
+ font-size: 16px;
517
+ line-height: 20px;
518
+
519
+ color: ${r=>r.theme.colors.text.primary};
520
+
521
+ margin-top: 0;
522
+ margin-bottom: 0;
523
+
524
+ cursor: default;
525
+ `,H3=r=>{const[f]=useI18n();return createComponent(H3Styled$2,{"data-tc-h3":"true",get class(){return r.class},get children(){var d;return createMemo(()=>!!r.translationKey)()?f(r.translationKey,r.translationValues,(d=r.children)==null?void 0:d.toString()):r.children}})},_tmpl$$q=template$1('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.1839 17.7069C13.6405 18.6507 13.3688 19.1226 13.0591 19.348C12.4278 19.8074 11.5723 19.8074 10.941 19.348C10.6312 19.1226 10.3595 18.6507 9.81613 17.7069L5.52066 10.2464C4.76864 8.94024 4.39263 8.28717 4.33762 7.75894C4.2255 6.68236 4.81894 5.65591 5.80788 5.21589C6.29309 5 7.04667 5 8.55383 5H15.4462C16.9534 5 17.7069 5 18.1922 5.21589C19.1811 5.65591 19.7745 6.68236 19.6624 7.75894C19.6074 8.28717 19.2314 8.94024 18.4794 10.2464L14.1839 17.7069ZM11.1 16.3412L6.56139 8.48002C6.31995 8.06185 6.19924 7.85276 6.18146 7.68365C6.14523 7.33896 6.33507 7.01015 6.65169 6.86919C6.80703 6.80002 7.04847 6.80002 7.53133 6.80002H7.53134L11.1 6.80002V16.3412ZM12.9 16.3412L17.4387 8.48002C17.6801 8.06185 17.8008 7.85276 17.8186 7.68365C17.8548 7.33896 17.665 7.01015 17.3484 6.86919C17.193 6.80002 16.9516 6.80002 16.4687 6.80002L12.9 6.80002V16.3412Z"></path></svg>'),TonIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.primary;return(()=>{const g=_tmpl$$q.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},_tmpl$$p=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g clip-path="url(#clip0_3783_2045)"><circle cx="8" cy="8.00098" r="8"></circle><path d="M4.75 8.50098L7 10.751L11.75 6.00098" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_3783_2045"><rect width="16" height="16" fill="white" transform="translate(0 0.000976562)"></rect></clipPath></defs></svg>'),_tmpl$2$4=template$1('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.1364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z"></path></svg>'),_tmpl$3$2=template$1('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="36" cy="36" r="33"></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z"></path></svg>'),SuccessIcon=r=>{const f=useTheme(),d=()=>r.size||"s",g=()=>r.fill||f.colors.icon.success;return createMemo((()=>{const v=createMemo(()=>d()==="xs");return()=>v()?(()=>{const m=_tmpl$$p.cloneNode(!0),w=m.firstChild,_=w.firstChild,S=_.nextSibling;return createRenderEffect(x=>{const b=r.class,C=g(),E=f.colors.constant.white;return b!==x._v$&&setAttribute(m,"class",x._v$=b),C!==x._v$2&&setAttribute(_,"fill",x._v$2=C),E!==x._v$3&&setAttribute(S,"stroke",x._v$3=E),x},{_v$:void 0,_v$2:void 0,_v$3:void 0}),m})():(()=>{const m=createMemo(()=>d()==="s");return()=>m()?(()=>{const w=_tmpl$2$4.cloneNode(!0),_=w.firstChild,S=_.nextSibling;return createRenderEffect(x=>{const b=r.class,C=g(),E=f.colors.constant.white;return b!==x._v$4&&setAttribute(w,"class",x._v$4=b),C!==x._v$5&&setAttribute(_,"fill",x._v$5=C),E!==x._v$6&&setAttribute(S,"fill",x._v$6=E),x},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),w})():(()=>{const w=_tmpl$3$2.cloneNode(!0),_=w.firstChild,S=_.nextSibling;return createRenderEffect(x=>{const b=r.class,C=g(),E=f.colors.constant.white;return b!==x._v$7&&setAttribute(w,"class",x._v$7=b),C!==x._v$8&&setAttribute(_,"fill",x._v$8=C),E!==x._v$9&&setAttribute(S,"fill",x._v$9=E),x},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),w})()})()})())},_tmpl$$o=template$1('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="36" cy="36" r="33"></circle><path d="M24.0858 26.9142C23.3047 26.1332 23.3047 24.8668 24.0858 24.0858C24.8668 23.3047 26.1332 23.3047 26.9142 24.0858L36 33.1716L45.0858 24.0858C45.8668 23.3047 47.1332 23.3047 47.9142 24.0858C48.6953 24.8668 48.6953 26.1332 47.9142 26.9142L38.8284 36L47.9142 45.0858C48.6953 45.8668 48.6953 47.1332 47.9142 47.9142C47.1332 48.6953 45.8668 48.6953 45.0858 47.9142L36 38.8284L26.9142 47.9142C26.1332 48.6953 24.8668 48.6953 24.0858 47.9142C23.3047 47.1332 23.3047 45.8668 24.0858 45.0858L33.1716 36L24.0858 26.9142Z"></path></svg>'),_tmpl$2$3=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><circle cx="24" cy="24.001" r="22"></circle><path d="M24 24.001L31.5 16.501M24 24.001L16.5 16.501M24 24.001L16.5 31.501M24 24.001L31.5 31.501" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),_tmpl$3$1=template$1('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.86361 9.1364C7.51214 8.78493 7.51214 8.21508 7.86361 7.86361C8.21508 7.51214 8.78493 7.51214 9.1364 7.86361L12 10.7272L14.8636 7.86361C15.2151 7.51214 15.7849 7.51214 16.1364 7.86361C16.4879 8.21508 16.4879 8.78493 16.1364 9.1364L13.2728 12L16.1364 14.8636C16.4879 15.2151 16.4879 15.7849 16.1364 16.1364C15.7849 16.4879 15.2151 16.4879 14.8636 16.1364L12 13.2728L9.1364 16.1364C8.78493 16.4879 8.21508 16.4879 7.86361 16.1364C7.51214 15.7849 7.51214 15.2151 7.86361 14.8636L10.7272 12L7.86361 9.1364Z"></path></svg>'),ErrorIcon=r=>{const f=useTheme(),d=()=>r.size||"m",g=()=>r.fill||f.colors.icon.error;return createMemo((()=>{const v=createMemo(()=>d()==="m");return()=>v()?(()=>{const m=_tmpl$$o.cloneNode(!0),w=m.firstChild,_=w.nextSibling;return createRenderEffect(S=>{const x=r.class,b=g(),C=f.colors.constant.white;return x!==S._v$&&setAttribute(m,"class",S._v$=x),b!==S._v$2&&setAttribute(w,"fill",S._v$2=b),C!==S._v$3&&setAttribute(_,"fill",S._v$3=C),S},{_v$:void 0,_v$2:void 0,_v$3:void 0}),m})():(()=>{const m=createMemo(()=>d()==="s");return()=>m()?(()=>{const w=_tmpl$2$3.cloneNode(!0),_=w.firstChild,S=_.nextSibling;return createRenderEffect(x=>{const b=r.class,C=g(),E=f.colors.constant.white;return b!==x._v$4&&setAttribute(w,"class",x._v$4=b),C!==x._v$5&&setAttribute(_,"fill",x._v$5=C),E!==x._v$6&&setAttribute(S,"stroke",x._v$6=E),x},{_v$4:void 0,_v$5:void 0,_v$6:void 0}),w})():(()=>{const w=_tmpl$3$1.cloneNode(!0),_=w.firstChild,S=_.nextSibling;return createRenderEffect(x=>{const b=r.class,C=g(),E=f.colors.constant.white;return b!==x._v$7&&setAttribute(w,"class",x._v$7=b),C!==x._v$8&&setAttribute(_,"fill",x._v$8=C),E!==x._v$9&&setAttribute(S,"fill",x._v$9=E),x},{_v$7:void 0,_v$8:void 0,_v$9:void 0}),w})()})()})())},_tmpl$$n=template$1('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413 12.1541 3.89062 15.55 5.85123Z"></path></svg>'),_tmpl$2$2=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M22 2.99951C11.5066 2.99951 3 11.5061 3 21.9995C3 32.4929 11.5066 40.9995 22 40.9995C22.8284 40.9995 23.5 41.6711 23.5 42.4995C23.5 43.3279 22.8284 43.9995 22 43.9995C9.84974 43.9995 0 34.1498 0 21.9995C0 9.84925 9.84974 -0.000488281 22 -0.000488281C34.1503 -0.000488281 44 9.84925 44 21.9995C44 22.8279 43.3284 23.4995 42.5 23.4995C41.6716 23.4995 41 22.8279 41 21.9995C41 11.5061 32.4934 2.99951 22 2.99951Z"></path></svg>'),_tmpl$3=template$1('<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"></path></svg>'),LoaderIcon=r=>{const f=useTheme(),d=()=>r.size||"xs",g=()=>r.fill||f.colors.icon.tertiary,v=h`
526
+ 0% {
527
+ transform: rotate(0deg);
528
+ }
529
+ 100% {
530
+ transform: rotate(360deg);
531
+ }
532
+ `,m=u`
533
+ animation: ${v} 1s linear infinite;
534
+ `;return createMemo((()=>{const w=createMemo(()=>d()==="xs");return()=>w()?(()=>{const _=_tmpl$$n.cloneNode(!0),S=_.firstChild;return createRenderEffect(x=>{const b=cn(m,r.class),C=g();return b!==x._v$&&setAttribute(_,"class",x._v$=b),C!==x._v$2&&setAttribute(S,"fill",x._v$2=C),x},{_v$:void 0,_v$2:void 0}),_})():(()=>{const _=createMemo(()=>d()==="s");return()=>_()?(()=>{const S=_tmpl$2$2.cloneNode(!0),x=S.firstChild;return createRenderEffect(b=>{const C=cn(m,r.class),E=g();return C!==b._v$3&&setAttribute(S,"class",b._v$3=C),E!==b._v$4&&setAttribute(x,"fill",b._v$4=E),b},{_v$3:void 0,_v$4:void 0}),S})():(()=>{const S=_tmpl$3.cloneNode(!0),x=S.firstChild;return createRenderEffect(b=>{const C=cn(m,r.class),E=g();return C!==b._v$5&&setAttribute(S,"class",b._v$5=C),E!==b._v$6&&setAttribute(x,"stroke",b._v$6=E),b},{_v$5:void 0,_v$6:void 0}),S})()})()})())},_tmpl$$m=template$1('<svg width="158" height="28" viewBox="0 0 158 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M28 14.001C28 21.733 21.732 28.001 14 28.001C6.26801 28.001 0 21.733 0 14.001C0 6.26899 6.26801 0.000976562 14 0.000976562C21.732 0.000976562 28 6.26899 28 14.001ZM9.21931 8.00098H18.7801H18.7813C20.538 8.00098 21.6522 9.89966 20.7691 11.4302L14.8672 21.6576C14.4822 22.3254 13.5172 22.3254 13.1322 21.6576L7.23158 11.4302C6.34721 9.89726 7.4614 8.00098 9.21931 8.00098ZM13.1262 18.5882V9.74806H9.21811C8.78976 9.74806 8.53708 10.2029 8.74163 10.5578L11.8423 16.1035L13.1262 18.5882ZM16.1559 16.1047L19.2554 10.5566C19.4599 10.2017 19.2073 9.74685 18.7789 9.74685H14.8709V18.5906L16.1559 16.1047Z" fill="#0098EA"></path><path d="M18.7802 8.00098H9.21936C7.46145 8.00098 6.34727 9.89726 7.23164 11.4302L13.1322 21.6576C13.5173 22.3254 14.4823 22.3254 14.8673 21.6576L20.7691 11.4302C21.6523 9.89966 20.5381 8.00098 18.7814 8.00098H18.7802ZM13.1274 18.5906L11.8424 16.1035L8.74168 10.5578C8.53714 10.2029 8.78981 9.74806 9.21816 9.74806H13.1262V18.5918L13.1274 18.5906ZM19.2555 10.5566L16.156 16.1047L14.8709 18.5906V9.74685H18.779C19.2073 9.74685 19.46 10.2017 19.2555 10.5566Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M51.7483 22.1967C55.7182 22.1967 58.9609 18.954 58.9609 14.9841C58.9609 11.0142 55.7182 7.77148 51.7483 7.77148C47.7588 7.77148 44.5357 11.0142 44.5357 14.9841C44.5357 18.954 47.7588 22.1967 51.7483 22.1967ZM51.7483 19.1702C49.4686 19.1702 47.6802 17.2442 47.6802 14.9841C47.6802 12.724 49.4686 10.798 51.7483 10.798C54.0084 10.798 55.7968 12.724 55.7968 14.9841C55.7968 17.2442 54.0084 19.1702 51.7483 19.1702ZM37.0698 21.9609H40.2142V10.9946H44.2843V8.00732H33V10.9946H37.0698V21.9609ZM69.9379 8.00732H73.0823V21.9609H70.3899L63.59 13.3333V21.9609H60.4652V8.00732H63.1576L69.9379 16.6153V8.00732ZM79.2259 14.9887C79.2259 10.9202 82.351 7.77539 86.4982 7.77539C89.8592 7.77539 92.5519 9.95709 93.2202 12.6891H90.7437C90.154 11.0971 88.4637 9.9964 86.4982 9.9964C83.5893 9.9964 81.5452 12.1781 81.5452 14.9887C81.5452 17.7994 83.5893 19.9811 86.4982 19.9811C88.4637 19.9811 90.154 18.8804 90.7437 17.2884H93.2202C92.5519 20.0204 89.8592 22.2021 86.4982 22.2021C82.351 22.2021 79.2259 19.0573 79.2259 14.9887ZM104.584 17.0525C104.584 19.9025 102.343 22.1628 99.4342 22.1628C96.5253 22.1628 94.2846 19.9025 94.2846 17.0525C94.2846 14.2025 96.5253 11.9422 99.4342 11.9422C102.343 11.9422 104.584 14.2025 104.584 17.0525ZM96.4663 17.0525C96.4663 18.8018 97.6849 20.158 99.4342 20.158C101.164 20.158 102.382 18.8018 102.382 17.0525C102.382 15.3032 101.164 13.947 99.4342 13.947C97.6849 13.947 96.4663 15.3032 96.4663 17.0525ZM108.626 12.1388H106.463V21.9662H108.626V17.1311C108.626 15.0281 109.726 13.9077 111.161 13.9077C112.419 13.9077 113.205 14.8512 113.205 16.4039V21.9662H115.367V16.0501C115.367 13.5539 113.893 11.9422 111.613 11.9422C110.335 11.9422 109.215 12.4926 108.626 13.4753V12.1388ZM117.839 12.1388H120.001V13.4753C120.59 12.4926 121.711 11.9422 122.988 11.9422C125.268 11.9422 126.742 13.5539 126.742 16.0501V21.9662H124.58V16.4039C124.58 14.8512 123.794 13.9077 122.536 13.9077C121.101 13.9077 120.001 15.0281 120.001 17.1311V21.9662H117.839V12.1388ZM133.558 22.1628C136.054 22.1628 137.823 20.728 138.373 18.8804H136.113C135.661 19.8238 134.717 20.2563 133.636 20.2563C131.887 20.2563 130.747 19.077 130.668 17.5832H138.491C138.688 14.2419 136.585 11.9422 133.577 11.9422C130.551 11.9422 128.526 14.1436 128.526 17.0525C128.526 20.0007 130.629 22.1628 133.558 22.1628ZM130.747 16.0501C131.042 14.5367 132.162 13.7505 133.518 13.7505C134.717 13.7505 135.838 14.4581 136.172 16.0501H130.747ZM149.851 18.3694C149.32 20.5511 147.453 22.1628 144.859 22.1628C141.871 22.1628 139.709 19.8828 139.709 17.0525C139.709 14.2222 141.871 11.9422 144.859 11.9422C147.453 11.9422 149.32 13.5539 149.851 15.7356H147.571C147.178 14.6743 146.215 13.9077 144.859 13.9077C143.109 13.9077 141.91 15.2246 141.91 17.0525C141.91 18.8804 143.109 20.1973 144.859 20.1973C146.215 20.1973 147.178 19.4307 147.571 18.3694H149.851ZM155.75 22.0645C156.418 22.0645 156.929 21.9859 157.362 21.8483V19.9221C157.047 20.0401 156.615 20.1187 156.202 20.1187C155.082 20.1187 154.551 19.6666 154.551 18.448V14.065H157.362V12.1388H154.551V9.40675H152.389V12.1388H150.345V14.065H152.389V18.8018C152.389 21.0228 153.863 22.0645 155.75 22.0645Z"></path></svg>'),TonConnectBrand=()=>{const r=useTheme(),f=()=>r.theme===THEME.DARK?r.colors.constant.white:r.colors.constant.black;return(()=>{const d=_tmpl$$m.cloneNode(!0),g=d.firstChild,v=g.nextSibling,m=v.nextSibling;return createRenderEffect(()=>setAttribute(m,"fill",f())),d})()},_tmpl$$l=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.56608 4.42584C5.82527 3.32158 6.8176 2.5 8.00001 2.5C9.38072 2.5 10.5 3.61929 10.5 5C10.5 5.63026 10.3391 6.0386 10.1264 6.34455C9.90018 6.66993 9.58561 6.92478 9.18864 7.20877C9.12579 7.25372 9.05873 7.30025 8.9887 7.34883C8.27392 7.84472 7.25001 8.55507 7.25001 10V10.25C7.25001 10.6642 7.5858 11 8.00001 11C8.41422 11 8.75001 10.6642 8.75001 10.25V10C8.75001 9.36502 9.10777 9.1096 9.94554 8.51149L10.0614 8.42873C10.4769 8.13147 10.9748 7.75194 11.358 7.20076C11.7547 6.63015 12 5.91973 12 5C12 2.79086 10.2091 1 8.00001 1C6.10564 1 4.5205 2.31615 4.10577 4.08308C4.01112 4.48634 4.26129 4.88997 4.66454 4.98462C5.0678 5.07927 5.47143 4.8291 5.56608 4.42584ZM8.00001 15C8.60752 15 9.10001 14.5075 9.10001 13.9C9.10001 13.2925 8.60752 12.8 8.00001 12.8C7.39249 12.8 6.90001 13.2925 6.90001 13.9C6.90001 14.5075 7.39249 15 8.00001 15Z"></path></svg>'),QuestionIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$l.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},_tmpl$$k=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.98156 8.75C9.84854 11.4328 9.01206 13.5 8 13.5C6.98794 13.5 6.15146 11.4328 6.01844 8.75H9.98156ZM11.4832 8.75C11.4217 10.1155 11.1929 11.3869 10.8239 12.4017C10.7734 12.5405 10.7188 12.6789 10.6595 12.8154C12.1454 11.993 13.2103 10.5029 13.4493 8.75H11.4832ZM13.4493 7.25H11.4832C11.4217 5.88453 11.1929 4.61314 10.8239 3.5983C10.7734 3.4595 10.7188 3.32111 10.6595 3.18459C12.1454 4.00697 13.2103 5.49709 13.4493 7.25ZM9.98156 7.25H6.01844C6.15144 4.56764 6.98769 2.50062 7.99955 2.5H8C9.01206 2.5 9.84854 4.56724 9.98156 7.25ZM4.51678 7.25C4.57826 5.88453 4.80706 4.61314 5.1761 3.5983C5.22657 3.4595 5.28124 3.32111 5.3405 3.18459C3.85463 4.00697 2.78972 5.49709 2.55071 7.25H4.51678ZM2.55071 8.75C2.78972 10.5029 3.85463 11.993 5.3405 12.8154C5.28124 12.6789 5.22657 12.5405 5.1761 12.4017C4.80706 11.3869 4.57826 10.1155 4.51678 8.75H2.55071ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z"></path></svg>'),BrowserIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.primary;return(()=>{const g=_tmpl$$k.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},_tmpl$$j=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 4.8C2.5 3.11984 2.5 2.27976 2.82698 1.63803C3.1146 1.07354 3.57354 0.614601 4.13803 0.32698C4.77976 0 5.61984 0 7.3 0H8.7C10.3802 0 11.2202 0 11.862 0.32698C12.4265 0.614601 12.8854 1.07354 13.173 1.63803C13.5 2.27976 13.5 3.11984 13.5 4.8V11.2C13.5 12.8802 13.5 13.7202 13.173 14.362C12.8854 14.9265 12.4265 15.3854 11.862 15.673C11.2202 16 10.3802 16 8.7 16H7.3C5.61984 16 4.77976 16 4.13803 15.673C3.57354 15.3854 3.1146 14.9265 2.82698 14.362C2.5 13.7202 2.5 12.8802 2.5 11.2V4.8ZM4 3.9C4 3.05992 4 2.63988 4.16349 2.31901C4.3073 2.03677 4.53677 1.8073 4.81901 1.66349C5.13988 1.5 5.55992 1.5 6.4 1.5H9.6C10.4401 1.5 10.8601 1.5 11.181 1.66349C11.4632 1.8073 11.6927 2.03677 11.8365 2.31901C12 2.63988 12 3.05992 12 3.9V12.1C12 12.9401 12 13.3601 11.8365 13.681C11.6927 13.9632 11.4632 14.1927 11.181 14.3365C10.8601 14.5 10.4401 14.5 9.6 14.5H6.4C5.55992 14.5 5.13988 14.5 4.81901 14.3365C4.53677 14.1927 4.3073 13.9632 4.16349 13.681C4 13.3601 4 12.9401 4 12.1V3.9ZM7 2.5C6.58579 2.5 6.25 2.83579 6.25 3.25C6.25 3.66421 6.58579 4 7 4H9C9.41421 4 9.75 3.66421 9.75 3.25C9.75 2.83579 9.41421 2.5 9 2.5H7Z"></path></svg>'),MobileIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.primary;return(()=>{const g=_tmpl$$j.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},_tmpl$$i=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 6.8C1.5 5.11984 1.5 4.27976 1.82698 3.63803C2.1146 3.07354 2.57354 2.6146 3.13803 2.32698C3.77976 2 4.61984 2 6.3 2H9.7C11.3802 2 12.2202 2 12.862 2.32698C13.4265 2.6146 13.8854 3.07354 14.173 3.63803C14.5 4.27976 14.5 5.11984 14.5 6.8V11.5H15.25C15.6642 11.5 16 11.8358 16 12.25C16 12.6642 15.6642 13 15.25 13H0.75C0.335786 13 0 12.6642 0 12.25C0 11.8358 0.335786 11.5 0.75 11.5H1.5V6.8ZM3 11.5H13V5.9C13 5.05992 13 4.63988 12.8365 4.31901C12.6927 4.03677 12.4632 3.8073 12.181 3.66349C11.8601 3.5 11.4401 3.5 10.6 3.5H5.4C4.55992 3.5 4.13988 3.5 3.81901 3.66349C3.53677 3.8073 3.3073 4.03677 3.16349 4.31901C3 4.63988 3 5.05992 3 5.9V11.5Z"></path></svg>'),DesktopIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.primary;return(()=>{const g=_tmpl$$i.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},_tmpl$$h=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none"><g clip-path="url(#clip0_3676_1603)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15.5 1.25049C15.5 0.836275 15.1642 0.500488 14.75 0.500488C14.3358 0.500488 14 0.836275 14 1.25049V3.67012C12.7187 2.04487 10.7318 1.00049 8.5 1.00049C4.63401 1.00049 1.5 4.1345 1.5 8.00049C1.5 11.8665 4.63401 15.0005 8.5 15.0005C11.6844 15.0005 14.3703 12.8748 15.2199 9.96661C15.3361 9.56902 15.1079 9.15254 14.7103 9.03638C14.3127 8.92023 13.8962 9.14838 13.7801 9.54597C13.1123 11.8319 11 13.5005 8.5 13.5005C5.46243 13.5005 3 11.0381 3 8.00049C3 4.96292 5.46243 2.50049 8.5 2.50049C10.321 2.50049 11.9363 3.3855 12.9377 4.75049H10.5C10.0858 4.75049 9.75 5.08627 9.75 5.50049C9.75 5.9147 10.0858 6.25049 10.5 6.25049H14.75C15.1642 6.25049 15.5 5.9147 15.5 5.50049V1.25049Z"></path></g><defs><clipPath id="clip0_3676_1603"><rect width="16" height="16" fill="white" transform="translate(0.5 0.000488281)"></rect></clipPath></defs></svg>'),RetryIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.accent;return(()=>{const g=_tmpl$$h.cloneNode(!0),v=g.firstChild,m=v.firstChild;return createRenderEffect(()=>setAttribute(m,"fill",d())),g})()},_tmpl$$g=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M13 4.06119V6.75053C13 7.16474 13.3358 7.50053 13.75 7.50053C14.1642 7.50053 14.5 7.16474 14.5 6.75053V2.75053L14.5 2.72807C14.5001 2.63191 14.5003 2.49627 14.4842 2.37627C14.4638 2.22503 14.4063 1.99261 14.2071 1.79342C14.0079 1.59423 13.7755 1.5367 13.6243 1.51637C13.5043 1.50023 13.3686 1.50039 13.2725 1.50051L13.25 1.50053H9.25C8.83579 1.50053 8.5 1.83631 8.5 2.25053C8.5 2.66474 8.83579 3.00053 9.25 3.00053H11.9393L7.21967 7.7202C6.92678 8.01309 6.92678 8.48796 7.21967 8.78086C7.51256 9.07375 7.98744 9.07375 8.28033 8.78086L13 4.06119ZM5.85 1.50053H5.81903H5.81899C5.21528 1.50052 4.71702 1.50051 4.31113 1.53367C3.88956 1.56812 3.50203 1.64204 3.13803 1.82751C2.57354 2.11513 2.1146 2.57407 1.82698 3.13856C1.64151 3.50256 1.56759 3.89009 1.53315 4.31166C1.49998 4.71755 1.49999 5.21581 1.5 5.81953V5.81955V5.85053V10.1505V10.1815V10.1815C1.49999 10.7852 1.49998 11.2835 1.53315 11.6894C1.56759 12.111 1.64151 12.4985 1.82698 12.8625C2.1146 13.427 2.57354 13.8859 3.13803 14.1735C3.50203 14.359 3.88956 14.4329 4.31113 14.4674C4.71702 14.5005 5.21527 14.5005 5.81897 14.5005H5.81901H5.85H10.15H10.181H10.181C10.7847 14.5005 11.283 14.5005 11.6889 14.4674C12.1104 14.4329 12.498 14.359 12.862 14.1735C13.4265 13.8859 13.8854 13.427 14.173 12.8625C14.3585 12.4985 14.4324 12.111 14.4669 11.6894C14.5 11.2835 14.5 10.7853 14.5 10.1816V10.1815V10.1505V9.75053C14.5 9.33631 14.1642 9.00053 13.75 9.00053C13.3358 9.00053 13 9.33631 13 9.75053V10.1505C13 10.793 12.9994 11.2297 12.9718 11.5672C12.945 11.8961 12.8963 12.0642 12.8365 12.1815C12.6927 12.4638 12.4632 12.6932 12.181 12.837C12.0637 12.8968 11.8955 12.9455 11.5667 12.9724C11.2292 12.9999 10.7924 13.0005 10.15 13.0005H5.85C5.20757 13.0005 4.77085 12.9999 4.43328 12.9724C4.10447 12.9455 3.93632 12.8968 3.81902 12.837C3.53677 12.6932 3.3073 12.4638 3.16349 12.1815C3.10372 12.0642 3.05503 11.8961 3.02816 11.5672C3.00058 11.2297 3 10.793 3 10.1505V5.85053C3 5.20809 3.00058 4.77137 3.02816 4.43381C3.05503 4.10499 3.10372 3.93684 3.16349 3.81954C3.3073 3.5373 3.53677 3.30783 3.81902 3.16402C3.93632 3.10425 4.10447 3.05556 4.43328 3.02869C4.77085 3.00111 5.20757 3.00053 5.85 3.00053H6.25C6.66422 3.00053 7 2.66474 7 2.25053C7 1.83631 6.66422 1.50053 6.25 1.50053H5.85Z"></path></svg>'),LinkIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.accent;return(()=>{const g=_tmpl$$g.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},_tmpl$$f=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16" fill="none"><g clip-path="url(#clip0_3676_1274)"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.82698 2.63901C1.5 3.28074 1.5 4.12082 1.5 5.80098V8.80098V9.00098V10.201C1.5 11.8811 1.5 12.7212 1.82698 13.3629C2.1146 13.9274 2.57354 14.3864 3.13803 14.674C3.77976 15.001 4.61984 15.001 6.3 15.001H11.7C13.3802 15.001 14.2202 15.001 14.862 14.674C15.4265 14.3864 15.8854 13.9274 16.173 13.3629C16.5 12.7212 16.5 11.8811 16.5 10.201V8.80098C16.5 7.12082 16.5 6.28074 16.173 5.63901C15.8854 5.07452 15.4265 4.61558 14.862 4.32796C14.743 4.26733 14.6172 4.21795 14.4805 4.17772C14.4501 3.49449 14.3722 3.02994 14.173 2.63901C13.8854 2.07452 13.4265 1.61558 12.862 1.32796C12.2202 1.00098 11.3802 1.00098 9.7 1.00098H6.3C4.61984 1.00098 3.77976 1.00098 3.13803 1.32796C2.57354 1.61558 2.1146 2.07452 1.82698 2.63901ZM12.9861 4.00942C12.9684 3.7108 12.9281 3.49982 12.8365 3.31999C12.6927 3.03775 12.4632 2.80828 12.181 2.66447C11.8601 2.50098 11.4401 2.50098 10.6 2.50098H5.4C4.55992 2.50098 4.13988 2.50098 3.81901 2.66447C3.53677 2.80828 3.3073 3.03775 3.16349 3.31999C3.03615 3.56991 3.00799 3.88 3.00177 4.40188C3.04646 4.37612 3.09189 4.35146 3.13803 4.32796C3.77976 4.00098 4.61984 4.00098 6.3 4.00098H11.7C12.1966 4.00098 12.6197 4.00098 12.9861 4.00942ZM3 7.90098V8.10098C3 8.47468 3 8.76527 3.01439 9.00098H3V11.101C3 11.9411 3 12.3611 3.16349 12.682C3.3073 12.9642 3.53677 13.1937 3.81901 13.3375C4.13988 13.501 4.55992 13.501 5.4 13.501H12.6C13.4401 13.501 13.8601 13.501 14.181 13.3375C14.4632 13.1937 14.6927 12.9642 14.8365 12.682C15 12.3611 15 11.9411 15 11.101V7.90098C15 7.0609 15 6.64086 14.8365 6.31999C14.6927 6.03775 14.4632 5.80828 14.181 5.66447C13.8601 5.50098 13.4401 5.50098 12.6 5.50098H5.4C4.55992 5.50098 4.13988 5.50098 3.81901 5.66447C3.53677 5.80828 3.3073 6.03775 3.16349 6.31999C3 6.64086 3 7.0609 3 7.90098ZM10.5 9.75098C10.5 9.33676 10.8358 9.00098 11.25 9.00098H12.75C13.1642 9.00098 13.5 9.33676 13.5 9.75098C13.5 10.1652 13.1642 10.501 12.75 10.501H11.25C10.8358 10.501 10.5 10.1652 10.5 9.75098Z"></path></g><defs><clipPath id="clip0_3676_1274"><rect width="16" height="16" fill="white" transform="translate(0.5 0.000976562)"></rect></clipPath></defs></svg>'),WalletIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.accent;return(()=>{const g=_tmpl$$f.cloneNode(!0),v=g.firstChild,m=v.firstChild;return createRenderEffect(()=>setAttribute(m,"fill",d())),g})()},_tmpl$$e=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M39.6319 16.8719C38.3212 16.2041 36.7002 16.0478 34 16.0112V11C34 5.47715 29.5228 1 24 1C18.4772 1 14 5.47715 14 11V16.0112C11.2998 16.0478 9.6788 16.2041 8.36808 16.8719C6.86278 17.6389 5.63893 18.8628 4.87195 20.3681C4 22.0794 4 24.3196 4 28.8V32.2C4 36.6804 4 38.9206 4.87195 40.6319C5.63893 42.1372 6.86278 43.3611 8.36808 44.1281C10.0794 45 12.3196 45 16.8 45H31.2C35.6804 45 37.9206 45 39.6319 44.1281C41.1372 43.3611 42.3611 42.1372 43.1281 40.6319C44 38.9206 44 36.6804 44 32.2V28.8C44 24.3196 44 22.0794 43.1281 20.3681C42.3611 18.8628 41.1372 17.6389 39.6319 16.8719ZM31 11V16H17V11C17 7.13401 20.134 4 24 4C27.866 4 31 7.13401 31 11ZM7.54497 21.73C7 22.7996 7 24.1997 7 27V34C7 36.8003 7 38.2004 7.54497 39.27C8.02433 40.2108 8.78924 40.9757 9.73005 41.455C10.7996 42 12.1997 42 15 42H33C35.8003 42 37.2004 42 38.27 41.455C39.2108 40.9757 39.9757 40.2108 40.455 39.27C41 38.2004 41 36.8003 41 34V27C41 24.1997 41 22.7996 40.455 21.73C39.9757 20.7892 39.2108 20.0243 38.27 19.545C37.2004 19 35.8003 19 33 19H15C12.1997 19 10.7996 19 9.73005 19.545C8.78924 20.0243 8.02433 20.7892 7.54497 21.73ZM24 24C23.1716 24 22.5 24.6716 22.5 25.5V29.5C22.5 30.3284 23.1716 31 24 31C24.8284 31 25.5 30.3284 25.5 29.5V25.5C25.5 24.6716 24.8284 24 24 24Z"></path></svg>'),SecurityIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$e.cloneNode(!0),v=g.firstChild;return createRenderEffect(m=>{const w=r.class,_=d();return w!==m._v$&&setAttribute(g,"class",m._v$=w),_!==m._v$2&&setAttribute(v,"fill",m._v$2=_),m},{_v$:void 0,_v$2:void 0}),g})()},_tmpl$$d=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M37.485 37.3849C40.894 33.9506 43 29.2212 43 24C43 13.5066 34.4934 5 24 5C13.5066 5 5 13.5066 5 24C5 29.2213 7.1061 33.9507 10.5151 37.385C13.3583 32.9438 18.3354 30 24.0001 30C29.6647 30 34.6418 32.9437 37.485 37.3849ZM35.1809 39.3635C32.9143 35.5532 28.7554 33 24.0001 33C19.2448 33 15.0858 35.5533 12.8193 39.3636C15.9564 41.6506 19.8206 43 24 43C28.1795 43 32.0437 41.6505 35.1809 39.3635ZM24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46ZM24 24C26.7614 24 29 21.7614 29 19C29 16.2386 26.7614 14 24 14C21.2386 14 19 16.2386 19 19C19 21.7614 21.2386 24 24 24ZM24 27C28.4183 27 32 23.4183 32 19C32 14.5817 28.4183 11 24 11C19.5817 11 16 14.5817 16 19C16 23.4183 19.5817 27 24 27Z"></path></svg>'),PersonalityIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$d.cloneNode(!0),v=g.firstChild;return createRenderEffect(m=>{const w=r.class,_=d();return w!==m._v$&&setAttribute(g,"class",m._v$=w),_!==m._v$2&&setAttribute(v,"fill",m._v$2=_),m},{_v$:void 0,_v$2:void 0}),g})()},_tmpl$$c=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M34.5607 4.43934C33.9749 3.85355 33.0251 3.85355 32.4393 4.43934C31.8536 5.02513 31.8536 5.97487 32.4393 6.56066L37.8787 12H10.5C9.67157 12 9 12.6716 9 13.5C9 14.3284 9.67157 15 10.5 15H37.8787L32.4393 20.4393C31.8536 21.0251 31.8536 21.9749 32.4393 22.5607C33.0251 23.1464 33.9749 23.1464 34.5607 22.5607L42.5607 14.5607C43.1464 13.9749 43.1464 13.0251 42.5607 12.4393L34.5607 4.43934ZM13.4393 25.4393C14.0251 24.8536 14.9749 24.8536 15.5607 25.4393C16.1464 26.0251 16.1464 26.9749 15.5607 27.5607L10.1213 33H37.5C38.3284 33 39 33.6716 39 34.5C39 35.3284 38.3284 36 37.5 36H10.1213L15.5607 41.4393C16.1464 42.0251 16.1464 42.9749 15.5607 43.5607C14.9749 44.1464 14.0251 44.1464 13.4393 43.5607L5.43934 35.5607C4.85355 34.9749 4.85355 34.0251 5.43934 33.4393L13.4393 25.4393Z"></path></svg>'),SwapIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$c.cloneNode(!0),v=g.firstChild;return createRenderEffect(m=>{const w=r.class,_=d();return w!==m._v$&&setAttribute(g,"class",m._v$=w),_!==m._v$2&&setAttribute(v,"fill",m._v$2=_),m},{_v$:void 0,_v$2:void 0}),g})()},_tmpl$$b=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.75 12.002C1.75 9.20169 1.75 7.80156 2.29497 6.732C2.77433 5.79119 3.53924 5.02629 4.48005 4.54692C5.54961 4.00195 6.94974 4.00195 9.75 4.00195H17.25C20.0503 4.00195 21.4504 4.00195 22.52 4.54692C23.4608 5.02629 24.2257 5.79119 24.705 6.732C24.8256 6.96861 24.9195 7.2214 24.9926 7.50195H21.5C19.6377 7.50195 18.7065 7.50195 17.9609 7.77334C16.711 8.22828 15.7263 9.21291 15.2714 10.4629C15 11.2085 15 12.1396 15 14.002C15 15.8643 15 16.7954 15.2714 17.541C15.7263 18.791 16.711 19.7756 17.9609 20.2306C18.7065 20.502 19.6377 20.502 21.5 20.502H24.9926C24.9195 20.7825 24.8256 21.0353 24.705 21.2719C24.2257 22.2127 23.4608 22.9776 22.52 23.457C21.4504 24.002 20.0503 24.002 17.25 24.002H9.75C6.94974 24.002 5.54961 24.002 4.48005 23.457C3.53924 22.9776 2.77433 22.2127 2.29497 21.2719C1.75 20.2023 1.75 18.8022 1.75 16.002V12.002ZM16.4999 13.802C16.4999 12.1218 16.4999 11.2817 16.8269 10.64C17.1145 10.0755 17.5735 9.61656 18.138 9.32894C18.7797 9.00196 19.6198 9.00196 21.2999 9.00196H23.1999C24.8801 9.00196 25.7202 9.00196 26.3619 9.32894C26.9264 9.61656 27.3853 10.0755 27.673 10.64C27.9999 11.2817 27.9999 12.1218 27.9999 13.802V14.202C27.9999 15.8821 27.9999 16.7222 27.673 17.3639C27.3853 17.9284 26.9264 18.3874 26.3619 18.675C25.7202 19.002 24.8801 19.002 23.1999 19.002H21.2999C19.6198 19.002 18.7797 19.002 18.138 18.675C17.5735 18.3874 17.1145 17.9284 16.8269 17.3639C16.4999 16.7222 16.4999 15.8821 16.4999 14.202V13.802ZM22.4999 14.002C22.4999 14.9685 21.7164 15.752 20.7499 15.752C19.7834 15.752 18.9999 14.9685 18.9999 14.002C18.9999 13.0355 19.7834 12.252 20.7499 12.252C21.7164 12.252 22.4999 13.0355 22.4999 14.002Z"></path></svg>'),AtWalletIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.constant.white;return(()=>{const g=_tmpl$$b.cloneNode(!0),v=g.firstChild;return createRenderEffect(m=>{const w=r.class,_=d();return w!==m._v$&&setAttribute(g,"class",m._v$=w),_!==m._v$2&&setAttribute(v,"fill",m._v$2=_),m},{_v$:void 0,_v$2:void 0}),g})()},_tmpl$$a=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0001 10.0001C10.0016 8.02333 10.0267 6.98719 10.436 6.18404C10.8195 5.43139 11.4314 4.81947 12.184 4.43597C13.0397 4 14.1598 4 16.4 4H17.6C19.8402 4 20.9603 4 21.816 4.43597C22.5686 4.81947 23.1805 5.43139 23.564 6.18404C24 7.03969 24 8.15979 24 10.4V11.6C24 13.8402 24 14.9603 23.564 15.816C23.1805 16.5686 22.5686 17.1805 21.816 17.564C21.0128 17.9733 19.9767 17.9984 17.9999 17.9999C17.9984 19.9767 17.9733 21.0128 17.564 21.816C17.1805 22.5686 16.5686 23.1805 15.816 23.564C14.9603 24 13.8402 24 11.6 24H10.4C8.15979 24 7.03969 24 6.18404 23.564C5.43139 23.1805 4.81947 22.5686 4.43597 21.816C4 20.9603 4 19.8402 4 17.6V16.4C4 14.1598 4 13.0397 4.43597 12.184C4.81947 11.4314 5.43139 10.8195 6.18404 10.436C6.98719 10.0267 8.02333 10.0016 10.0001 10.0001ZM10 11.5H9.5C8.09987 11.5 7.3998 11.5 6.86502 11.7725C6.39462 12.0122 6.01217 12.3946 5.77248 12.865C5.5 13.3998 5.5 14.0999 5.5 15.5V18.5C5.5 19.9001 5.5 20.6002 5.77248 21.135C6.01217 21.6054 6.39462 21.9878 6.86502 22.2275C7.3998 22.5 8.09987 22.5 9.5 22.5H12.5C13.9001 22.5 14.6002 22.5 15.135 22.2275C15.6054 21.9878 15.9878 21.6054 16.2275 21.135C16.5 20.6002 16.5 19.9001 16.5 18.5V18H16.4C14.1598 18 13.0397 18 12.184 17.564C11.4314 17.1805 10.8195 16.5686 10.436 15.816C10 14.9603 10 13.8402 10 11.6V11.5ZM11.5 9.5C11.5 8.09987 11.5 7.3998 11.7725 6.86502C12.0122 6.39462 12.3946 6.01217 12.865 5.77248C13.3998 5.5 14.0999 5.5 15.5 5.5H18.5C19.9001 5.5 20.6002 5.5 21.135 5.77248C21.6054 6.01217 21.9878 6.39462 22.2275 6.86502C22.5 7.3998 22.5 8.09987 22.5 9.5V12.5C22.5 13.9001 22.5 14.6002 22.2275 15.135C21.9878 15.6054 21.6054 15.9878 21.135 16.2275C20.6002 16.5 19.9001 16.5 18.5 16.5H15.5C14.0999 16.5 13.3998 16.5 12.865 16.2275C12.3946 15.9878 12.0122 15.6054 11.7725 15.135C11.5 14.6002 11.5 13.9001 11.5 12.5V9.5Z"></path></svg>'),CopyLightIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$a.cloneNode(!0),v=g.firstChild;return createRenderEffect(m=>{const w=d(),_=d();return w!==m._v$&&setAttribute(g,"fill",m._v$=w),_!==m._v$2&&setAttribute(v,"fill",m._v$2=_),m},{_v$:void 0,_v$2:void 0}),g})()},_tmpl$$9=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 4.12695C1 3.07754 1 2.55284 1.19202 2.14684C1.38986 1.72856 1.7266 1.39181 2.14489 1.19397C2.55088 1.00195 3.07559 1.00195 4.125 1.00195C5.17441 1.00195 5.69912 1.00195 6.10511 1.19397C6.5234 1.39181 6.86014 1.72856 7.05798 2.14684C7.25 2.55284 7.25 3.07754 7.25 4.12695C7.25 5.17636 7.25 5.70107 7.05798 6.10706C6.86014 6.52535 6.5234 6.8621 6.10511 7.05993C5.69912 7.25195 5.17441 7.25195 4.125 7.25195C3.07559 7.25195 2.55088 7.25195 2.14489 7.05993C1.7266 6.8621 1.38986 6.52535 1.19202 6.10706C1 5.70107 1 5.17636 1 4.12695ZM2.5 3.30195C2.5 3.02193 2.5 2.88191 2.5545 2.77496C2.60243 2.68088 2.67892 2.60439 2.773 2.55645C2.87996 2.50195 3.01997 2.50195 3.3 2.50195H4.95C5.23003 2.50195 5.37004 2.50195 5.477 2.55645C5.57108 2.60439 5.64757 2.68088 5.6955 2.77496C5.75 2.88191 5.75 3.02193 5.75 3.30195V4.95195C5.75 5.23198 5.75 5.37199 5.6955 5.47895C5.64757 5.57303 5.57108 5.64952 5.477 5.69746C5.37004 5.75195 5.23003 5.75195 4.95 5.75195H3.3C3.01997 5.75195 2.87996 5.75195 2.773 5.69746C2.67892 5.64952 2.60243 5.57303 2.5545 5.47895C2.5 5.37199 2.5 5.23198 2.5 4.95195V3.30195ZM1 11.877C1 10.8275 1 10.3028 1.19202 9.89684C1.38986 9.47856 1.7266 9.14181 2.14489 8.94397C2.55088 8.75195 3.07559 8.75195 4.125 8.75195C5.17441 8.75195 5.69912 8.75195 6.10511 8.94397C6.5234 9.14181 6.86014 9.47856 7.05798 9.89684C7.25 10.3028 7.25 10.8275 7.25 11.877C7.25 12.9264 7.25 13.4511 7.05798 13.8571C6.86014 14.2753 6.5234 14.6121 6.10511 14.8099C5.69912 15.002 5.17441 15.002 4.125 15.002C3.07559 15.002 2.55088 15.002 2.14489 14.8099C1.7266 14.6121 1.38986 14.2753 1.19202 13.8571C1 13.4511 1 12.9264 1 11.877ZM2.5 11.052C2.5 10.7719 2.5 10.6319 2.5545 10.525C2.60243 10.4309 2.67892 10.3544 2.773 10.3064C2.87996 10.252 3.01997 10.252 3.3 10.252H4.95C5.23003 10.252 5.37004 10.252 5.477 10.3064C5.57108 10.3544 5.64757 10.4309 5.6955 10.525C5.75 10.6319 5.75 10.7719 5.75 11.052V12.702C5.75 12.982 5.75 13.122 5.6955 13.2289C5.64757 13.323 5.57108 13.3995 5.477 13.4475C5.37004 13.502 5.23003 13.502 4.95 13.502H3.3C3.01997 13.502 2.87996 13.502 2.773 13.4475C2.67892 13.3995 2.60243 13.323 2.5545 13.2289C2.5 13.122 2.5 12.982 2.5 12.702V11.052ZM8.94202 2.14684C8.75 2.55284 8.75 3.07754 8.75 4.12695C8.75 5.17636 8.75 5.70107 8.94202 6.10706C9.13986 6.52535 9.4766 6.8621 9.89489 7.05993C10.3009 7.25195 10.8256 7.25195 11.875 7.25195C12.9244 7.25195 13.4491 7.25195 13.8551 7.05993C14.2734 6.8621 14.6101 6.52535 14.808 6.10706C15 5.70107 15 5.17636 15 4.12695C15 3.07754 15 2.55284 14.808 2.14684C14.6101 1.72856 14.2734 1.39181 13.8551 1.19397C13.4491 1.00195 12.9244 1.00195 11.875 1.00195C10.8256 1.00195 10.3009 1.00195 9.89489 1.19397C9.4766 1.39181 9.13986 1.72856 8.94202 2.14684ZM10.3045 2.77496C10.25 2.88191 10.25 3.02193 10.25 3.30195V4.95195C10.25 5.23198 10.25 5.37199 10.3045 5.47895C10.3524 5.57303 10.4289 5.64952 10.523 5.69746C10.63 5.75195 10.77 5.75195 11.05 5.75195H12.7C12.98 5.75195 13.12 5.75195 13.227 5.69746C13.3211 5.64952 13.3976 5.57303 13.4455 5.47895C13.5 5.37199 13.5 5.23198 13.5 4.95195V3.30195C13.5 3.02193 13.5 2.88191 13.4455 2.77496C13.3976 2.68088 13.3211 2.60439 13.227 2.55645C13.12 2.50195 12.98 2.50195 12.7 2.50195H11.05C10.77 2.50195 10.63 2.50195 10.523 2.55645C10.4289 2.60439 10.3524 2.68088 10.3045 2.77496ZM8.80727 9.13518C8.75 9.26242 8.75 9.4256 8.75 9.75195C8.75 10.0783 8.75 10.2415 8.80727 10.3687C8.87245 10.5136 8.9884 10.6295 9.13323 10.6947C9.26047 10.752 9.42365 10.752 9.75 10.752C10.0764 10.752 10.2395 10.752 10.3668 10.6947C10.5116 10.6295 10.6276 10.5136 10.6927 10.3687C10.75 10.2415 10.75 10.0783 10.75 9.75195C10.75 9.4256 10.75 9.26242 10.6927 9.13518C10.6276 8.99035 10.5116 8.8744 10.3668 8.80922C10.2395 8.75195 10.0764 8.75195 9.75 8.75195C9.42365 8.75195 9.26047 8.75195 9.13323 8.80922C8.9884 8.8744 8.87245 8.99035 8.80727 9.13518ZM10.87 11.8771C10.87 11.546 10.87 11.3805 10.9289 11.2517C10.9938 11.1098 11.1077 10.9959 11.2497 10.931C11.3784 10.8721 11.5439 10.8721 11.875 10.8721C12.2061 10.8721 12.3716 10.8721 12.5003 10.931C12.6423 10.9959 12.7562 11.1098 12.8211 11.2517C12.88 11.3805 12.88 11.546 12.88 11.8771C12.88 12.2081 12.88 12.3737 12.8211 12.5024C12.7562 12.6444 12.6423 12.7583 12.5003 12.8232C12.3716 12.8821 12.2061 12.8821 11.875 12.8821C11.5439 12.8821 11.3784 12.8821 11.2497 12.8232C11.1077 12.7583 10.9938 12.6444 10.9289 12.5024C10.87 12.3737 10.87 12.2081 10.87 11.8771ZM8.80727 13.3852C8.75 13.5124 8.75 13.6756 8.75 14.002C8.75 14.3283 8.75 14.4915 8.80727 14.6187C8.87245 14.7636 8.9884 14.8795 9.13323 14.9447C9.26047 15.002 9.42365 15.002 9.75 15.002C10.0764 15.002 10.2395 15.002 10.3668 14.9447C10.5116 14.8795 10.6276 14.7636 10.6927 14.6187C10.75 14.4915 10.75 14.3283 10.75 14.002C10.75 13.6756 10.75 13.5124 10.6927 13.3852C10.6276 13.2404 10.5116 13.1244 10.3668 13.0592C10.2395 13.002 10.0764 13.002 9.75 13.002C9.42365 13.002 9.26047 13.002 9.13323 13.0592C8.9884 13.1244 8.87245 13.2404 8.80727 13.3852ZM13 9.75195C13 9.4256 13 9.26242 13.0573 9.13518C13.1224 8.99035 13.2384 8.8744 13.3832 8.80922C13.5105 8.75195 13.6736 8.75195 14 8.75195C14.3264 8.75195 14.4895 8.75195 14.6168 8.80922C14.7616 8.8744 14.8776 8.99035 14.9427 9.13518C15 9.26242 15 9.4256 15 9.75195C15 10.0783 15 10.2415 14.9427 10.3687C14.8776 10.5136 14.7616 10.6295 14.6168 10.6947C14.4895 10.752 14.3264 10.752 14 10.752C13.6736 10.752 13.5105 10.752 13.3832 10.6947C13.2384 10.6295 13.1224 10.5136 13.0573 10.3687C13 10.2415 13 10.0783 13 9.75195ZM13.0573 13.3852C13 13.5124 13 13.6756 13 14.002C13 14.3283 13 14.4915 13.0573 14.6187C13.1224 14.7636 13.2384 14.8795 13.3832 14.9447C13.5105 15.002 13.6736 15.002 14 15.002C14.3264 15.002 14.4895 15.002 14.6168 14.9447C14.7616 14.8795 14.8776 14.7636 14.9427 14.6187C15 14.4915 15 14.3283 15 14.002C15 13.6756 15 13.5124 14.9427 13.3852C14.8776 13.2404 14.7616 13.1244 14.6168 13.0592C14.4895 13.002 14.3264 13.002 14 13.002C13.6736 13.002 13.5105 13.002 13.3832 13.0592C13.2384 13.1244 13.1224 13.2404 13.0573 13.3852Z"></path></svg>'),QRIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.secondary;return(()=>{const g=_tmpl$$9.cloneNode(!0),v=g.firstChild;return createRenderEffect(()=>setAttribute(v,"fill",d())),g})()},containerBorders={m:"16px",s:"12px",none:"0"},walletBorders={m:"6px",s:"6px",none:"0"},FourWalletsCard=styled.div`
535
+ width: 60px;
536
+ height: 60px;
537
+ padding: 8px;
538
+ margin-bottom: 8px;
539
+ border-radius: ${r=>containerBorders[r.theme.borderRadius]};
540
+ background-color: ${r=>r.theme.colors.background.tint};
541
+ display: grid;
542
+ grid-template: 1fr 1fr / 1fr 1fr;
543
+ gap: 4px;
544
+ `,FourWalletsImage=styled(WalletImage)`
545
+ width: 20px;
546
+ height: 20px;
547
+ border-radius: ${r=>walletBorders[r.theme.borderRadius]};
548
+ `,FourWalletsItem=r=>createComponent(WalletItem,{get name(){return r.labelLine1},get secondLine(){return r.labelLine2},get icon(){return createComponent(FourWalletsCard,{get children(){return createComponent(For,{each:[0,1,2,3],children:f=>createComponent(FourWalletsImage,{get src(){return r.images[f]}})})}})},onClick:()=>r.onClick()}),AT_WALLET_APP_NAME="telegram-wallet",IMG={TON:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/ton-icon-48.png",TG:"https://raw.githubusercontent.com/ton-connect/sdk/main/assets/tg.png"},WalletLabeledItem=r=>{const[f]=useI18n(),d=()=>{if(r.wallet.appName!==AT_WALLET_APP_NAME){if("isPreferred"in r.wallet&&r.wallet.isPreferred)return f("walletItem.recent",{},"Recent");if(isWalletInfoCurrentlyInjected(r.wallet))return f("walletItem.installed",{},"Installed");if(r.wallet.name==="Tonkeeper")return f("walletItem.popular",{},"Popular")}};return createMemo((()=>{const g=createMemo(()=>r.wallet.appName===AT_WALLET_APP_NAME);return()=>g()?createComponent(WalletItem,{get icon(){return r.wallet.imageUrl},get name(){return f("walletItem.walletOn",{},"Wallet in")},secondLine:"Telegram",get badgeUrl(){return IMG.TG},onClick:()=>r.onClick(),get class(){return r.class}}):createComponent(WalletItem,{get icon(){return r.wallet.imageUrl},get name(){return r.wallet.name},get secondLine(){return d()},secondLineColorPrimary:!1,onClick:()=>r.onClick(),get class(){return r.class}})})())},ScrollContainerStyled=styled.div`
549
+ width: 100%;
550
+ overflow-y: auto;
551
+ max-height: ${r=>r.maxHeight};
552
+
553
+ scrollbar-width: none;
554
+ &&::-webkit-scrollbar {
555
+ display: none;
556
+ }
557
+
558
+ &&::-webkit-scrollbar-track {
559
+ background: transparent;
560
+ }
561
+
562
+ &&::-webkit-scrollbar-thumb {
563
+ display: none;
564
+ }
565
+ `,ScrollDivider=styled.div`
566
+ height: 1px;
567
+ margin: 0 -24px;
568
+ width: calc(100% + 48px);
569
+ opacity: 0.08;
570
+ background: ${r=>r.isShown?r.theme.colors.icon.secondary:"transparent"};
571
+ transition: background 0.15s ease-in-out;
572
+
573
+ ${media("mobile")} {
574
+ width: 100%;
575
+ margin: 0;
576
+ }
577
+ `,[windowHeight,setWindowHeight]=createSignal(((_h=getWindow$1())==null?void 0:_h.innerHeight)||0);getWindow$1()&&window.addEventListener("resize",()=>setWindowHeight(window.innerHeight));const[isMobile,setIsMobile]=createSignal(isDevice("mobile")),updateIsMobile=()=>setIsMobile(isDevice("mobile"));getWindow$1()&&(window.addEventListener("resize",()=>updateIsMobile()),window.addEventListener("load",()=>updateIsMobile(),{once:!0}));const ScrollContainer=r=>{const[f,d]=createSignal(!1),g=w=>{d(w.target.scrollTop>0)},v=()=>isMobile()?150:200,m=()=>r.maxHeight!==void 0?`${r.maxHeight}px`:`${windowHeight()-v()}px`;return[createComponent(ScrollDivider,{get isShown(){return f()}}),createComponent(ScrollContainerStyled,{get maxHeight(){return m()},onScroll:g,get class(){return r.class},get children(){return r.children}})]},AStyled=styled.a`
578
+ display: block;
579
+ text-decoration: unset;
580
+ `,Link=r=>createComponent(AStyled,mergeProps({get href(){return r.href},get target(){return r.blank?"_blank":"_self"},get class(){return r.class}},()=>r.blank?{rel:"noreferrer noopener"}:{},{get children(){return r.children}})),TonConnectUiContext=createContext(),_tmpl$$8=template$1('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z"></path></svg>'),CopyIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.primary;return(()=>{const g=_tmpl$$8.cloneNode(!0),v=g.firstChild;return createRenderEffect(m=>{const w=r.class,_=d();return w!==m._v$&&setAttribute(g,"class",m._v$=w),_!==m._v$2&&setAttribute(v,"fill",m._v$2=_),m},{_v$:void 0,_v$2:void 0}),g})()},_tmpl$$7=template$1('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.0458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z"></path></svg>'),DisconnectIcon=r=>{const f=useTheme(),d=()=>r.fill||f.colors.icon.primary;return(()=>{const g=_tmpl$$7.cloneNode(!0),v=g.firstChild,m=v.nextSibling;return createRenderEffect(w=>{const _=d(),S=d();return _!==w._v$&&setAttribute(v,"fill",w._v$=_),S!==w._v$2&&setAttribute(m,"fill",w._v$2=S),w},{_v$:void 0,_v$2:void 0}),g})()},hoverBorders$1={m:"8px",s:"4px",none:"0"},dropdownBorders={m:"16px",s:"8px",none:"0"},AccountButtonDropdownStyled=styled.div`
581
+ width: 256px;
582
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
583
+ border-radius: ${r=>dropdownBorders[r.theme.borderRadius]};
584
+
585
+ background-color: ${r=>r.theme.colors.background.primary}
586
+
587
+ color: ${r=>r.theme.colors.text.primary}
588
+ `,UlStyled=styled.ul`
589
+ background-color: ${r=>r.theme.colors.background.primary};
590
+ padding: 8px;
591
+ `,MenuButtonStyled=styled.button`
592
+ display: flex;
593
+ align-items: center;
594
+ gap: 8px;
595
+ height: 40px;
596
+ padding-left: 8px;
597
+ width: 100%;
598
+
599
+ background-color: ${r=>r.theme.colors.background.primary};
600
+ border: none;
601
+ border-radius: ${r=>hoverBorders$1[r.theme.borderRadius]};
602
+ cursor: pointer;
603
+
604
+ transition: background-color, transform 0.1s ease-in-out;
605
+
606
+ &:hover {
607
+ background-color: ${r=>r.theme.colors.background.secondary};
608
+ }
609
+
610
+ &:active {
611
+ transform: scale(0.96);
612
+ }
613
+ `,_tmpl$$6=template$1("<li></li>"),MenuItemText=r=>createComponent(Text,{get translationKey(){return r.translationKey},fontSize:"15px",fontWeight:"590",get children(){return r.children}}),AccountButtonDropdown=r=>{const f=useContext(TonConnectUiContext),[d,g]=createSignal(!1),v=()=>__async(void 0,null,function*(){const w=toUserFriendlyAddress(f.account.address,f.account.chain===CHAIN.TESTNET);yield copyToClipboard(w),g(!0),setTimeout(()=>g(!1),1e3)}),m=()=>{f.disconnect(),r.onClose()};return createComponent(AccountButtonDropdownStyled,{ref(w){const _=r.ref;typeof _=="function"?_(w):r.ref=w},get class(){return r.class},"data-tc-dropdown":"true",get children(){return createComponent(UlStyled,{get children(){return[(()=>{const w=_tmpl$$6.cloneNode(!0);return insert(w,createComponent(MenuButtonStyled,{onClick:()=>v(),get children(){return[createComponent(CopyIcon,{}),createComponent(Show,{get when(){return!d()},get children(){return createComponent(MenuItemText,{translationKey:"button.dropdown.copy",children:"Copy address"})}}),createComponent(Show,{get when(){return d()},get children(){return createComponent(MenuItemText,{translationKey:"button.dropdown.copied",children:"Address copied!"})}})]}})),w})(),(()=>{const w=_tmpl$$6.cloneNode(!0);return insert(w,createComponent(MenuButtonStyled,{onClick:()=>m(),get children(){return[createComponent(DisconnectIcon,{}),createComponent(MenuItemText,{translationKey:"button.dropdown.disconnect",children:"Disconnect"})]}})),w})()]}})}})},borders$3={m:"16px",s:"8px",none:"0"},NotificationStyled=styled.div`
614
+ width: 256px;
615
+ padding: 12px 16px;
616
+ display: flex;
617
+ gap: 9px;
618
+
619
+ background-color: ${r=>r.theme.colors.background.primary};
620
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
621
+ border-radius: ${r=>borders$3[r.theme.borderRadius]};
622
+ `,NotificationContentStyled=styled.div`
623
+ width: 192px;
624
+
625
+ > h3 {
626
+ font-size: 15px;
627
+ }
628
+ `,TextStyled$3=styled(Text)`
629
+ margin-top: 4px;
630
+ color: ${r=>r.theme.colors.text.secondary};
631
+ `,Notification=r=>{const f=useDataAttributes(r);return createComponent(NotificationStyled,mergeProps({get class(){return r.class},"data-tc-notification":"true"},f,{get children(){return[createComponent(NotificationContentStyled,{get children(){return[createComponent(H3,{get translationKey(){return r.header.translationKey},get translationValues(){return r.header.translationValues},get children(){return r.children}}),createComponent(Show,{get when(){return r.text},get children(){return createComponent(TextStyled$3,{get translationKey(){return r.text.translationKey},get translationValues(){return r.text.translationValues}})}})]}}),createMemo(()=>r.icon)]}}))},LoaderIconStyled$2=styled(LoaderIcon)`
632
+ align-self: center;
633
+ `,ConfirmOperationNotification=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),g=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(Notification,{get header(){return{translationKey:"notifications.confirm.header",translationValues:{name:g()}}},get class(){return r.class},get icon(){return createComponent(LoaderIconStyled$2,{})},"data-tc-notification-confirm":"true",children:"Confirm operation in your wallet"})},ErrorIconStyled$4=styled(ErrorIcon)`
634
+ margin-top: 2px;
635
+ `,ErrorTransactionNotification=r=>createComponent(Notification,{header:{translationKey:"notifications.transactionCanceled.header"},text:{translationKey:"notifications.transactionCanceled.text"},get icon(){return createComponent(ErrorIconStyled$4,{size:"xs"})},get class(){return r.class},"data-tc-notification-tx-cancelled":"true",children:"Transaction cancelled"}),SuccessIconStyled=styled(SuccessIcon)`
636
+ margin-top: 2px;
637
+ `,SuccessTransactionNotification=r=>createComponent(Notification,{header:{translationKey:"notifications.transactionSent.header"},text:{translationKey:"notifications.transactionSent.text"},get icon(){return createComponent(SuccessIconStyled,{})},get class(){return r.class},"data-tc-notification-tx-sent":"true",children:"Transaction sent"}),NotificationClass=u`
638
+ transform: translateY(-8px);
639
+ margin-bottom: 12px;
640
+ `,defaultConfig={timeout:4500},[latestAction,setLatestAction]=createSignal(null);function useOpenedNotifications(r){const{timeout:f}=__spreadValues(__spreadValues({},defaultConfig),r),[d,g]=createSignal([]),[v,m]=createSignal([]);return createEffect(on(action,w=>{var _,S;if(!w||!w.showNotification){g(M=>M.filter(A=>A.action!=="confirm-transaction"));return}if(latestAction()===w)return;const x=((_=latestAction())==null?void 0:_.name)==="confirm-transaction"&&w.name==="confirm-transaction",b=((S=latestAction())==null?void 0:S.name)==="confirm-sign-data"&&w.name==="confirm-sign-data";if(x||b)return;setLatestAction(w),g(M=>M.filter(A=>A.action!=="confirm-transaction"&&A.action!=="confirm-sign-data"));const C={action:w.name};g(M=>[...M,C]);const E=setTimeout(()=>{g(M=>M.filter(A=>A!==C)),m(M=>M.filter(A=>A!==E))},f);m(M=>[...M,E])})),onCleanup(()=>{v().forEach(w=>clearTimeout(w))}),d}const ErrorIconStyled$3=styled(ErrorIcon)`
641
+ margin-top: 2px;
642
+ `,ErrorSignDataNotification=r=>createComponent(Notification,{header:{translationKey:"notifications.signDataCanceled.header"},get icon(){return createComponent(ErrorIconStyled$3,{size:"xs"})},get class(){return r.class},"data-tc-notification-sign-data-cancelled":"true",children:"Sign data canceled"}),SuccessSignDataNotification=r=>createComponent(Notification,{header:{translationKey:"notifications.dataSigned.header"},get icon(){return createComponent(SuccessIconStyled,{})},get class(){return r.class},"data-tc-notification-data-signed":"true",children:"Data signed"}),_tmpl$$5=template$1('<div data-tc-list-notifications="true"></div>'),Notifications=r=>{const f=useOpenedNotifications();return(()=>{const d=_tmpl$$5.cloneNode(!0);return insert(d,createComponent(TransitionGroup,{onBeforeEnter:g=>{animate(g,[{opacity:0,transform:"translateY(0)"},{opacity:1,transform:"translateY(-8px)"}],{duration:200})},onExit:(g,v)=>{animate(g,[{opacity:1,transform:"translateY(-8px)"},{opacity:0,transform:"translateY(-30px)"}],{duration:200}).finished.then(v)},get children(){return createComponent(For,{get each(){return f()},children:g=>createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return g.action==="transaction-sent"},get children(){return createComponent(SuccessTransactionNotification,{class:NotificationClass})}}),createComponent(Match,{get when(){return g.action==="transaction-canceled"},get children(){return createComponent(ErrorTransactionNotification,{class:NotificationClass})}}),createComponent(Match,{get when(){return g.action==="data-signed"},get children(){return createComponent(SuccessSignDataNotification,{class:NotificationClass})}}),createComponent(Match,{get when(){return g.action==="sign-data-canceled"},get children(){return createComponent(ErrorSignDataNotification,{class:NotificationClass})}}),createComponent(Match,{get when(){return g.action==="confirm-transaction"||g.action==="confirm-sign-data"},get children(){return createComponent(ConfirmOperationNotification,{class:NotificationClass})}})]}})})}})),createRenderEffect(()=>className(d,r.class)),d})()},AccountButtonStyled=styled(Button)`
643
+ background-color: ${r=>r.theme.colors.connectButton.background};
644
+ color: ${r=>r.theme.colors.connectButton.foreground};
645
+ box-shadow: ${r=>`0 4px 24px ${rgba(r.theme.colors.constant.black,.16)}`};
646
+ padding: 8px 16px 8px 12px;
647
+
648
+ display: flex;
649
+ align-items: center;
650
+ gap: 4px;
651
+ height: 40px;
652
+ `,DropdownButtonStyled=styled(AccountButtonStyled)`
653
+ padding: 12px 16px;
654
+ min-width: 148px;
655
+ justify-content: center;
656
+ background-color: ${r=>r.theme.colors.background.primary};
657
+ `,LoaderButtonStyled$1=styled(Button)`
658
+ min-width: 148px;
659
+ height: 40px;
660
+
661
+ background-color: ${r=>r.theme.colors.background.primary};
662
+ color: ${r=>r.theme.colors.connectButton.foreground};
663
+ box-shadow: ${r=>`0 4px 24px ${rgba(r.theme.colors.constant.black,.16)}`};
664
+
665
+ display: flex;
666
+ align-items: center;
667
+ justify-content: center;
668
+ `,LoaderIconStyled$1=styled(LoaderIcon)`
669
+ height: 18px;
670
+ width: 18px;
671
+ `,DropdownContainerStyled=styled.div`
672
+ width: fit-content;
673
+ display: flex;
674
+ flex-direction: column;
675
+ align-items: flex-end;
676
+ `,DropdownStyled=styled(AccountButtonDropdown)`
677
+ box-sizing: border-box;
678
+ overflow: hidden;
679
+ margin-top: 12px;
680
+ `,NotificationsStyled=styled(Notifications)`
681
+ > div:first-child {
682
+ margin-top: 20px;
683
+ }
684
+ `;function getSide(r){return r.split("-")[0]}function getAlignment(r){return r.split("-")[1]}function getMainAxisFromPlacement(r){return["top","bottom"].includes(getSide(r))?"x":"y"}function getLengthFromAxis(r){return r==="y"?"height":"width"}function computeCoordsFromPlacement(r,f,d){let{reference:g,floating:v}=r;const m=g.x+g.width/2-v.width/2,w=g.y+g.height/2-v.height/2,_=getMainAxisFromPlacement(f),S=getLengthFromAxis(_),x=g[S]/2-v[S]/2,b=getSide(f),C=_==="x";let E;switch(b){case"top":E={x:m,y:g.y-v.height};break;case"bottom":E={x:m,y:g.y+g.height};break;case"right":E={x:g.x+g.width,y:w};break;case"left":E={x:g.x-v.width,y:w};break;default:E={x:g.x,y:g.y}}switch(getAlignment(f)){case"start":E[_]-=x*(d&&C?-1:1);break;case"end":E[_]+=x*(d&&C?-1:1);break}return E}const computePosition$1=(r,f,d)=>__async(void 0,null,function*(){const{placement:g="bottom",strategy:v="absolute",middleware:m=[],platform:w}=d,_=m.filter(Boolean),S=yield w.isRTL==null?void 0:w.isRTL(f);if({}.NODE_ENV!=="production"&&(w==null,_.filter(T=>{let{name:L}=T;return L==="autoPlacement"||L==="flip"}).length>1))throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));let x=yield w.getElementRects({reference:r,floating:f,strategy:v}),{x:b,y:C}=computeCoordsFromPlacement(x,g,S),E=g,M={},A=0;for(let T=0;T<_.length;T++){const{name:L,fn:O}=_[T],{x:N,y:H,data:V,reset:X}=yield O({x:b,y:C,initialPlacement:g,placement:E,strategy:v,middlewareData:M,rects:x,platform:w,elements:{reference:r,floating:f}});if(b=N??b,C=H??C,M=__spreadProps(__spreadValues({},M),{[L]:__spreadValues(__spreadValues({},M[L]),V)}),{}.NODE_ENV!=="production"&&A>50,X&&A<=50){A++,typeof X=="object"&&(X.placement&&(E=X.placement),X.rects&&(x=X.rects===!0?yield w.getElementRects({reference:r,floating:f,strategy:v}):X.rects),{x:b,y:C}=computeCoordsFromPlacement(x,E,S)),T=-1;continue}}return{x:b,y:C,placement:E,strategy:v,middlewareData:M}});function rectToClientRect(r){return __spreadProps(__spreadValues({},r),{top:r.y,left:r.x,right:r.x+r.width,bottom:r.y+r.height})}function getWindow(r){var f;return((f=r.ownerDocument)==null?void 0:f.defaultView)||window}function getComputedStyle$1(r){return getWindow(r).getComputedStyle(r)}function getNodeName(r){return isNode(r)?(r.nodeName||"").toLowerCase():""}let uaString;function getUAString(){if(uaString)return uaString;const r=navigator.userAgentData;return r&&Array.isArray(r.brands)?(uaString=r.brands.map(f=>f.brand+"/"+f.version).join(" "),uaString):navigator.userAgent}function isHTMLElement(r){return r instanceof getWindow(r).HTMLElement}function isElement(r){return r instanceof getWindow(r).Element}function isNode(r){return r instanceof getWindow(r).Node}function isShadowRoot(r){if(typeof ShadowRoot>"u")return!1;const f=getWindow(r).ShadowRoot;return r instanceof f||r instanceof ShadowRoot}function isOverflowElement(r){const{overflow:f,overflowX:d,overflowY:g,display:v}=getComputedStyle$1(r);return/auto|scroll|overlay|hidden/.test(f+g+d)&&!["inline","contents"].includes(v)}function isTableElement(r){return["table","td","th"].includes(getNodeName(r))}function isContainingBlock(r){const f=/firefox/i.test(getUAString()),d=getComputedStyle$1(r),g=d.backdropFilter||d.WebkitBackdropFilter;return d.transform!=="none"||d.perspective!=="none"||(g?g!=="none":!1)||f&&d.willChange==="filter"||f&&(d.filter?d.filter!=="none":!1)||["transform","perspective"].some(v=>d.willChange.includes(v))||["paint","layout","strict","content"].some(v=>{const m=d.contain;return m!=null?m.includes(v):!1})}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function isLastTraversableNode(r){return["html","body","#document"].includes(getNodeName(r))}const min=Math.min,max=Math.max,round=Math.round,FALLBACK_SCALE={x:1,y:1};function getScale(r){const f=!isElement(r)&&r.contextElement?r.contextElement:isElement(r)?r:null;if(!f)return FALLBACK_SCALE;const d=f.getBoundingClientRect(),g=getComputedStyle$1(f);if(g.boxSizing!=="border-box")return isHTMLElement(f)?{x:f.offsetWidth>0&&round(d.width)/f.offsetWidth||1,y:f.offsetHeight>0&&round(d.height)/f.offsetHeight||1}:FALLBACK_SCALE;let v=d.width/parseFloat(g.width),m=d.height/parseFloat(g.height);return(!v||!Number.isFinite(v))&&(v=1),(!m||!Number.isFinite(m))&&(m=1),{x:v,y:m}}function getBoundingClientRect(r,f,d,g){var v,m,w,_;f===void 0&&(f=!1),d===void 0&&(d=!1);const S=r.getBoundingClientRect();let x=FALLBACK_SCALE;f&&(g?isElement(g)&&(x=getScale(g)):x=getScale(r));const b=isElement(r)?getWindow(r):window,C=!isLayoutViewport()&&d,E=(S.left+(C&&(v=(m=b.visualViewport)==null?void 0:m.offsetLeft)!=null?v:0))/x.x,M=(S.top+(C&&(w=(_=b.visualViewport)==null?void 0:_.offsetTop)!=null?w:0))/x.y,A=S.width/x.x,T=S.height/x.y;return{width:A,height:T,top:M,right:E+A,bottom:M+T,left:E,x:E,y:M}}function getDocumentElement(r){return((isNode(r)?r.ownerDocument:r.document)||window.document).documentElement}function getNodeScroll(r){return isElement(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function getWindowScrollBarX(r){return getBoundingClientRect(getDocumentElement(r)).left+getNodeScroll(r).scrollLeft}function getRectRelativeToOffsetParent(r,f,d){const g=isHTMLElement(f),v=getDocumentElement(f),m=getBoundingClientRect(r,!0,d==="fixed",f);let w={scrollLeft:0,scrollTop:0};const _={x:0,y:0};if(g||!g&&d!=="fixed")if((getNodeName(f)!=="body"||isOverflowElement(v))&&(w=getNodeScroll(f)),isHTMLElement(f)){const S=getBoundingClientRect(f,!0);_.x=S.x+f.clientLeft,_.y=S.y+f.clientTop}else v&&(_.x=getWindowScrollBarX(v));return{x:m.left+w.scrollLeft-_.x,y:m.top+w.scrollTop-_.y,width:m.width,height:m.height}}function getParentNode(r){if(getNodeName(r)==="html")return r;const f=r.assignedSlot||r.parentNode||(isShadowRoot(r)?r.host:null)||getDocumentElement(r);return isShadowRoot(f)?f.host:f}function getTrueOffsetParent(r){return!isHTMLElement(r)||getComputedStyle$1(r).position==="fixed"?null:r.offsetParent}function getContainingBlock(r){let f=getParentNode(r);for(;isHTMLElement(f)&&!isLastTraversableNode(f);){if(isContainingBlock(f))return f;f=getParentNode(f)}return null}function getOffsetParent(r){const f=getWindow(r);let d=getTrueOffsetParent(r);for(;d&&isTableElement(d)&&getComputedStyle$1(d).position==="static";)d=getTrueOffsetParent(d);return d&&(getNodeName(d)==="html"||getNodeName(d)==="body"&&getComputedStyle$1(d).position==="static"&&!isContainingBlock(d))?f:d||getContainingBlock(r)||f}function getDimensions(r){if(isHTMLElement(r))return{width:r.offsetWidth,height:r.offsetHeight};const f=getBoundingClientRect(r);return{width:f.width,height:f.height}}function convertOffsetParentRelativeRectToViewportRelativeRect(r){let{rect:f,offsetParent:d,strategy:g}=r;const v=isHTMLElement(d),m=getDocumentElement(d);if(d===m)return f;let w={scrollLeft:0,scrollTop:0},_={x:1,y:1};const S={x:0,y:0};if((v||!v&&g!=="fixed")&&((getNodeName(d)!=="body"||isOverflowElement(m))&&(w=getNodeScroll(d)),isHTMLElement(d))){const x=getBoundingClientRect(d);_=getScale(d),S.x=x.x+d.clientLeft,S.y=x.y+d.clientTop}return{width:f.width*_.x,height:f.height*_.y,x:f.x*_.x-w.scrollLeft*_.x+S.x,y:f.y*_.y-w.scrollTop*_.y+S.y}}function getViewportRect(r,f){const d=getWindow(r),g=getDocumentElement(r),v=d.visualViewport;let m=g.clientWidth,w=g.clientHeight,_=0,S=0;if(v){m=v.width,w=v.height;const x=isLayoutViewport();(x||!x&&f==="fixed")&&(_=v.offsetLeft,S=v.offsetTop)}return{width:m,height:w,x:_,y:S}}function getDocumentRect(r){var f;const d=getDocumentElement(r),g=getNodeScroll(r),v=(f=r.ownerDocument)==null?void 0:f.body,m=max(d.scrollWidth,d.clientWidth,v?v.scrollWidth:0,v?v.clientWidth:0),w=max(d.scrollHeight,d.clientHeight,v?v.scrollHeight:0,v?v.clientHeight:0);let _=-g.scrollLeft+getWindowScrollBarX(r);const S=-g.scrollTop;return getComputedStyle$1(v||d).direction==="rtl"&&(_+=max(d.clientWidth,v?v.clientWidth:0)-m),{width:m,height:w,x:_,y:S}}function getNearestOverflowAncestor(r){const f=getParentNode(r);return isLastTraversableNode(f)?r.ownerDocument.body:isHTMLElement(f)&&isOverflowElement(f)?f:getNearestOverflowAncestor(f)}function getOverflowAncestors(r,f){var d;f===void 0&&(f=[]);const g=getNearestOverflowAncestor(r),v=g===((d=r.ownerDocument)==null?void 0:d.body),m=getWindow(g);return v?f.concat(m,m.visualViewport||[],isOverflowElement(g)?g:[]):f.concat(g,getOverflowAncestors(g))}function getInnerBoundingClientRect(r,f){const d=getBoundingClientRect(r,!0,f==="fixed"),g=d.top+r.clientTop,v=d.left+r.clientLeft,m=isHTMLElement(r)?getScale(r):{x:1,y:1},w=r.clientWidth*m.x,_=r.clientHeight*m.y,S=v*m.x,x=g*m.y;return{top:x,left:S,right:S+w,bottom:x+_,x:S,y:x,width:w,height:_}}function getClientRectFromClippingAncestor(r,f,d){return f==="viewport"?rectToClientRect(getViewportRect(r,d)):isElement(f)?getInnerBoundingClientRect(f,d):rectToClientRect(getDocumentRect(getDocumentElement(r)))}function getClippingElementAncestors(r,f){const d=f.get(r);if(d)return d;let g=getOverflowAncestors(r).filter(_=>isElement(_)&&getNodeName(_)!=="body"),v=null;const m=getComputedStyle$1(r).position==="fixed";let w=m?getParentNode(r):r;for(;isElement(w)&&!isLastTraversableNode(w);){const _=getComputedStyle$1(w),S=isContainingBlock(w);(m?!S&&!v:!S&&_.position==="static"&&!!v&&["absolute","fixed"].includes(v.position))?g=g.filter(b=>b!==w):v=_,w=getParentNode(w)}return f.set(r,g),g}function getClippingRect(r){let{element:f,boundary:d,rootBoundary:g,strategy:v}=r;const w=[...d==="clippingAncestors"?getClippingElementAncestors(f,this._c):[].concat(d),g],_=w[0],S=w.reduce((x,b)=>{const C=getClientRectFromClippingAncestor(f,b,v);return x.top=max(C.top,x.top),x.right=min(C.right,x.right),x.bottom=min(C.bottom,x.bottom),x.left=max(C.left,x.left),x},getClientRectFromClippingAncestor(f,_,v));return{width:S.right-S.left,height:S.bottom-S.top,x:S.left,y:S.top}}const platform={getClippingRect,convertOffsetParentRelativeRectToViewportRelativeRect,isElement,getDimensions,getOffsetParent,getDocumentElement,getScale,getElementRects(r){return __async(this,null,function*(){let{reference:f,floating:d,strategy:g}=r;const v=this.getOffsetParent||getOffsetParent,m=this.getDimensions;return{reference:getRectRelativeToOffsetParent(f,yield v(d),g),floating:__spreadValues({x:0,y:0},yield m(d))}})},getClientRects:r=>Array.from(r.getClientRects()),isRTL:r=>getComputedStyle$1(r).direction==="rtl"};function autoUpdate(r,f,d,g){g===void 0&&(g={});const{ancestorScroll:v=!0,ancestorResize:m=!0,elementResize:w=!0,animationFrame:_=!1}=g,S=v&&!_,x=S||m?[...isElement(r)?getOverflowAncestors(r):r.contextElement?getOverflowAncestors(r.contextElement):[],...getOverflowAncestors(f)]:[];x.forEach(A=>{S&&A.addEventListener("scroll",d,{passive:!0}),m&&A.addEventListener("resize",d)});let b=null;if(w){let A=!0;b=new ResizeObserver(()=>{A||d(),A=!1}),isElement(r)&&!_&&b.observe(r),!isElement(r)&&r.contextElement&&!_&&b.observe(r.contextElement),b.observe(f)}let C,E=_?getBoundingClientRect(r):null;_&&M();function M(){const A=getBoundingClientRect(r);E&&(A.x!==E.x||A.y!==E.y||A.width!==E.width||A.height!==E.height)&&d(),E=A,C=requestAnimationFrame(M)}return d(),()=>{var A;x.forEach(T=>{S&&T.removeEventListener("scroll",d),m&&T.removeEventListener("resize",d)}),(A=b)==null||A.disconnect(),b=null,_&&cancelAnimationFrame(C)}}const computePosition=(r,f,d)=>{const g=new Map,v=__spreadValues({platform},d),m=__spreadProps(__spreadValues({},v.platform),{_c:g});return computePosition$1(r,f,__spreadProps(__spreadValues({},v),{platform:m}))};function P(r,f,d){let g=()=>{var C;return(C=d==null?void 0:d.placement)!=null?C:"bottom"},v=()=>{var C;return(C=d==null?void 0:d.strategy)!=null?C:"absolute"},[m,w]=createSignal({x:null,y:null,placement:g(),strategy:v(),middlewareData:{}}),[_,S]=createSignal();createEffect(()=>{let C=_();if(C)throw C.value});let x=createMemo(()=>(r(),f(),{}));function b(){let C=r(),E=f();if(C&&E){let M=x();computePosition(C,E,{middleware:d==null?void 0:d.middleware,placement:g(),strategy:v()}).then(A=>{M===x()&&w(A)},A=>{S(A)})}}return createEffect(()=>{let C=r(),E=f();if(g(),v(),C&&E)if(d!=null&&d.whileElementsMounted){let M=d.whileElementsMounted(C,E,b);M&&onCleanup(M)}else b()}),{get x(){return m().x},get y(){return m().y},get placement(){return m().placement},get strategy(){return m().strategy},get middlewareData(){return m().middlewareData},update:b}}const _tmpl$$4=template$1('<tc-root data-tc-dropdown-container="true"></tc-root>'),AccountButton=()=>{const r=useTheme(),f=useContext(ConnectorContext),d=useContext(TonConnectUiContext),[g,v]=createSignal(!1),[m,w]=createSignal(f.account),[_,S]=createSignal(!f.account);let x;const[b,C]=createSignal(),[E,M]=createSignal(),A=P(E,b,{whileElementsMounted:autoUpdate,placement:"bottom-end"}),T=()=>{const N=m();if(N){const H=toUserFriendlyAddress(N.address,N.chain===CHAIN.TESTNET);return H.slice(0,4)+"…"+H.slice(-4)}return""};d.connectionRestored.then(()=>S(!1));const L=f.onStatusChange(N=>{if(!N){v(!1),w(null),S(!1);return}w(N.account),S(!1)}),O=N=>{if(!m()||!g())return;const H=E().contains(N.target),V=x.contains(N.target);!H&&!V&&v(!1)};return onMount(()=>{document.body.addEventListener("click",O)}),onCleanup(()=>{document.body.removeEventListener("click",O),L()}),createComponent(Dynamic,{component:globalStylesTag,get children(){return[createComponent(Show,{get when(){return _()},get children(){return createComponent(LoaderButtonStyled$1,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return createComponent(LoaderIconStyled$1,{})}})}}),createComponent(Show,{get when(){return!_()},get children(){return[createComponent(Show,{get when(){return!m()},get children(){return createComponent(AccountButtonStyled,{onClick:()=>d.openModal(),"data-tc-connect-button":"true",scale:"s",get children(){return[createComponent(TonIcon,{get fill(){return r.colors.connectButton.foreground}}),createComponent(Text,{translationKey:"button.connectWallet",fontSize:"15px",lineHeight:"18px",fontWeight:"590",get color(){return r.colors.connectButton.foreground},children:"Connect wallet"})]}})}}),createComponent(Show,{get when(){return m()},get children(){return createComponent(DropdownContainerStyled,{get children(){return[createComponent(DropdownButtonStyled,{onClick:()=>v(N=>!N),ref:M,"data-tc-dropdown-button":"true",scale:"s",get children(){return[createComponent(Text,{fontSize:"15px",fontWeight:"590",lineHeight:"18px",get children(){return T()}}),createComponent(ArrowIcon,{direction:"bottom"})]}}),createComponent(Portal,{get children(){const N=untrack(()=>document.importNode(_tmpl$$4,!0));return use(C,N),N.style.setProperty("z-index","999"),N._$owner=getOwner(),insert(N,createComponent(Transition,{onBeforeEnter:H=>{animate(H,[{opacity:0,transform:"translateY(-8px)"},{opacity:1,transform:"translateY(0)"}],{duration:150})},onExit:(H,V)=>{animate(H,[{opacity:1,transform:"translateY(0)"},{opacity:0,transform:"translateY(-8px)"}],{duration:150}).finished.then(V)},get children(){return createComponent(Show,{get when(){return g()},get children(){return createComponent(DropdownStyled,{get hidden(){return!g()},onClose:()=>v(!1),ref(H){const V=x;typeof V=="function"?V(H):x=H}})}})}}),null),insert(N,createComponent(NotificationsStyled,{}),null),createRenderEffect(H=>{var V,X;const oe=A.strategy,se=`${(V=A.y)!=null?V:0}px`,de=`${(X=A.x)!=null?X:0}px`;return oe!==H._v$&&N.style.setProperty("position",H._v$=oe),se!==H._v$2&&N.style.setProperty("top",H._v$2=se),de!==H._v$3&&N.style.setProperty("left",H._v$3=de),H},{_v$:void 0,_v$2:void 0,_v$3:void 0}),N}})]}})}})]}})]}})},StyledModal=styled(Modal)`
685
+ padding-left: 24px;
686
+ padding-right: 24px;
687
+ padding-top: 18px;
688
+ padding-bottom: 0;
689
+
690
+ ${media("mobile")} {
691
+ padding-left: 0;
692
+ padding-right: 0;
693
+ }
694
+ `,H1Styled$a=styled(H1)`
695
+ margin-top: 12px;
696
+
697
+ ${media("mobile")} {
698
+ padding: 0 10px;
699
+ }
700
+ `,LoaderContainerStyled=styled.div`
701
+ margin: 30px 0;
702
+ width: 100%;
703
+ display: flex;
704
+ justify-content: center;
705
+
706
+ ${media("mobile")} {
707
+ height: 160px;
708
+ align-items: center;
709
+ }
710
+ `;styled(Text)`
711
+ min-width: 84px;
712
+ text-align: center;
713
+ font-weight: 590;
714
+ `,styled(TabBar)`
715
+ margin: 0 auto 22px;
716
+ `;const[appState,setAppState]=createStore({buttonRootId:null,language:"en",returnStrategy:"back",twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function uniq(r){return[...new Set(r)]}function mergeConcat(r,f,d){return f.map(g=>{const v=d.find(m=>m[r]===g[r]);return d=d.filter(m=>m[r]!==g[r]),v===void 0?g:v}).concat(d)}function uiWalletToWalletInfo(r){return"jsBridgeKey"in r?__spreadProps(__spreadValues({},r),{injected:TonConnect.isWalletInjected(r.jsBridgeKey),embedded:TonConnect.isInsideWalletBrowser(r.jsBridgeKey)}):r}function applyWalletsListConfiguration(r,f){var d;return f&&(d=f.includeWallets)!=null&&d.length&&(r=mergeConcat("name",r,f.includeWallets.map(uiWalletToWalletInfo))),r}function supportsDesktop(r){return r.platforms.some(f=>["macos","linux","windows"].includes(f))}function supportsMobile(r){return r.platforms.some(f=>["ios","android"].includes(f))}function supportsExtension(r){return r.platforms.some(f=>["chrome","firefox","safari"].includes(f))}function eqWalletName(r,f){return f?r.name.toLowerCase()===f.toLowerCase()||r.appName.toLowerCase()===f.toLowerCase():!1}const DesktopSelectWalletModalStyled=styled.div`
717
+ display: flex;
718
+ flex-direction: column;
719
+ align-items: center;
720
+ `,H1Styled$9=styled(H1)`
721
+ margin-bottom: 18px;
722
+ `;styled.div`
723
+ height: 1px;
724
+ margin: 0 -24px;
725
+ width: calc(100% + 48px);
726
+ opacity: 0.12;
727
+ background: ${r=>r.isShown?r.theme.colors.icon.secondary:"transparent"};
728
+ transition: background 0.15s ease-in-out;
729
+
730
+ ${media("mobile")} {
731
+ width: 100%;
732
+ }
733
+ `;const WalletsUl=styled.ul`
734
+ display: grid;
735
+ grid-template-columns: repeat(auto-fit, 92px);
736
+ grid-template-rows: auto;
737
+ align-content: flex-start;
738
+ row-gap: 8px;
739
+ width: 100%;
740
+ padding: 0 0 16px;
741
+ align-self: flex-start;
742
+ max-width: 400px;
743
+ margin: 0 auto;
744
+ list-style: none;
745
+
746
+ > li {
747
+ display: block;
748
+ height: fit-content;
749
+ }
750
+
751
+ ${media("mobile")} {
752
+ display: grid;
753
+ grid-template-columns: repeat(4, 1fr);
754
+ gap: 0;
755
+ padding: 8px 12px 16px;
756
+ max-width: none;
757
+
758
+ > li {
759
+ min-width: 78px;
760
+ display: flex;
761
+ }
762
+
763
+ > li > * {
764
+ width: 100%;
765
+ }
766
+ }
767
+ `;styled(Button)`
768
+ display: block;
769
+ margin: 0 auto 1px;
770
+ font-size: 15px;
771
+ `;const StyledIconButton$5=styled(IconButton)`
772
+ position: absolute;
773
+ top: 16px;
774
+ left: 16px;
775
+ `,WalletLabeledItemStyled=styled(WalletLabeledItem)`
776
+ opacity: ${r=>r.withOpacity?"0.4":"1"};
777
+ `,WalletsNotSupportedNotifier=styled.div`
778
+ display: grid;
779
+ grid-template-columns: auto 28px;
780
+ gap: 16px;
781
+ padding: 16px;
782
+ margin-bottom: 16px;
783
+ border-radius: 16px;
784
+ color: ${r=>r.theme.colors.text.secondary};
785
+ background: ${r=>r.theme.colors.background.tint};
786
+
787
+ ${media("mobile")} {
788
+ margin-left: 16px;
789
+ margin-right: 16px;
790
+ }
791
+ `,WalletsNotSupportedNotifierText=styled(H2)`
792
+ color: ${r=>r.theme.colors.text.secondary};
793
+ text-align: left;
794
+ margin: 0;
795
+ `,ErrorBoxStyled=styled.div`
796
+ position: absolute;
797
+ bottom: 14px;
798
+ left: 50%;
799
+ transform: translate(-50%, 0);
800
+
801
+ text-wrap: nowrap;
802
+ display: flex;
803
+ gap: 6px;
804
+ align-items: center;
805
+ border-radius: 18px;
806
+ min-width: 126px;
807
+ padding: 9px 16px 9px 10px;
808
+
809
+ filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
810
+ background-color: ${r=>r.theme.colors.background.segment};
811
+ `,_tmpl$$3=template$1('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_5122_10355)"><circle cx="8" cy="8" r="8"></circle><circle cx="8" cy="11" r="1"></circle><path d="M7.04994 4.99875C7.02277 4.45542 7.45598 4 8 4C8.54402 4 8.97723 4.45541 8.95006 4.99875L8.78745 8.25094C8.76647 8.67055 8.42014 9 8 9C7.57986 9 7.23353 8.67055 7.21255 8.25094L7.04994 4.99875Z"></path></g><defs><clipPath id="clip0_5122_10355"><rect width="16" height="16"></rect></clipPath></defs></svg>'),_tmpl$2$1=template$1('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none"><circle cx="14" cy="14" r="12"></circle><circle cx="14" cy="18.9" r="1.4"></circle><path d="M12.6658 8.89845C12.63 8.13698 13.2377 7.5 14 7.5C14.7623 7.5 15.37 8.13698 15.3342 8.89845L15.047 15.0013C15.0207 15.5604 14.5597 16.0002 14 16.0002C13.4403 16.0002 12.9793 15.5604 12.953 15.0013L12.6658 8.89845Z"></path></svg>'),ExclamationIcon=r=>{const f=useTheme(),d=()=>r.size,g=()=>r.fill||f.colors.icon.error;return createMemo((()=>{const v=createMemo(()=>d()==="16");return()=>v()?(()=>{const m=_tmpl$$3.cloneNode(!0),w=m.firstChild,_=w.firstChild,S=_.nextSibling,x=S.nextSibling,b=w.nextSibling,C=b.firstChild,E=C.firstChild;return createRenderEffect(M=>{const A=g(),T=f.colors.constant.white,L=f.colors.constant.white,O=f.colors.constant.white;return A!==M._v$&&setAttribute(_,"fill",M._v$=A),T!==M._v$2&&setAttribute(S,"fill",M._v$2=T),L!==M._v$3&&setAttribute(x,"fill",M._v$3=L),O!==M._v$4&&setAttribute(E,"fill",M._v$4=O),M},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),m})():(()=>{const m=createMemo(()=>d()==="28");return()=>m()?(()=>{const w=_tmpl$2$1.cloneNode(!0),_=w.firstChild,S=_.nextSibling,x=S.nextSibling;return createRenderEffect(b=>{const C=r.class,E=g(),M=f.colors.constant.white,A=f.colors.constant.white;return C!==b._v$5&&setAttribute(w,"class",b._v$5=C),E!==b._v$6&&setAttribute(_,"fill",b._v$6=E),M!==b._v$7&&setAttribute(S,"fill",b._v$7=M),A!==b._v$8&&setAttribute(x,"fill",b._v$8=A),b},{_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),w})():null})()})())},_tmpl$$2=template$1("<li></li>"),AllWalletsListModal=r=>{const f=()=>isMobile()?void 0:510,[d,g]=createSignal(null);let v=null;const m=b=>{g(b),v!=null&&clearTimeout(v),v=setTimeout(()=>g(null),1500)},w=b=>{if(!b.isSupportRequiredFeatures&&r.featureCheckMode==="strict"){m(b);return}r.onSelect(b)},_=()=>isMobile()?r.walletsList.filter(supportsMobile):r.walletsList,S=()=>_().filter(b=>b.isSupportRequiredFeatures),x=()=>_().filter(b=>!b.isSupportRequiredFeatures);return createComponent(DesktopSelectWalletModalStyled,{"data-tc-wallets-modal-list":"true",get children(){return[createComponent(StyledIconButton$5,{icon:"arrow",onClick:()=>r.onBack()}),createComponent(H1Styled$9,{translationKey:"walletModal.wallets",children:"Wallets"}),createComponent(ScrollContainer,{get maxHeight(){return f()},get children(){return[createComponent(WalletsUl,{get children(){return createComponent(For,{get each(){return S()},children:b=>(()=>{const C=_tmpl$$2.cloneNode(!0);return insert(C,createComponent(WalletLabeledItemStyled,{wallet:b,onClick:()=>r.onSelect(b)})),C})()})}}),createComponent(Show,{get when(){return x().length>0&&r.featureCheckMode!=="hide"},get children(){return[createComponent(WalletsNotSupportedNotifier,{get children(){return[createComponent(WalletsNotSupportedNotifierText,{translationKey:"walletModal.allWallets.walletsBelowNotSupported",children:"The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above."}),createComponent(ExclamationIcon,{size:"28"})]}}),createComponent(WalletsUl,{get children(){return createComponent(For,{get each(){return x()},children:b=>(()=>{const C=_tmpl$$2.cloneNode(!0);return insert(C,createComponent(WalletLabeledItemStyled,{wallet:b,onClick:()=>w(b),get withOpacity(){return r.featureCheckMode==="strict"}})),C})()})}}),createComponent(Transition,{onBeforeEnter:b=>{animate(b,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(b,C)=>{animate(b,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{C()})},get children(){return createComponent(Show,{get when(){return d()},get children(){return createComponent(ErrorBoxStyled,{get children(){return[createComponent(ErrorIcon,{size:"xs"}),createComponent(Text,{translationKey:"walletModal.allWallets.walletNotSupportService",get translationValues(){return{name:d().name}},get children(){return[createMemo(()=>d().name)," doesn’t support connected service"]}})]}})}})}})]}})]}})]}})},tgButtonBorders={m:"16px",s:"12px",none:"0"},tgIconBorders={m:"6px",s:"6px",none:"0"},DesktopConnectionModalStyled=styled.div`
812
+ display: flex;
813
+ flex-direction: column;
814
+ `,BodyStyled$1=styled.div`
815
+ flex: 1;
816
+ margin-top: ${r=>r.qr?"0":"18px"};
817
+ display: flex;
818
+ flex-direction: column;
819
+ align-items: center;
820
+ justify-content: center;
821
+ min-height: 232px;
822
+ `,QRCodeStyled$1=styled(QRCode)`
823
+ margin-bottom: 24px;
824
+ `,H1Styled$8=styled(H1)`
825
+ max-width: 288px;
826
+ margin: 0 auto 2px;
827
+ `,H2Styled$4=styled(H2)`
828
+ max-width: 288px;
829
+ text-align: center;
830
+ margin: 0 auto 20px;
831
+ `,StyledIconButton$4=styled(IconButton)`
832
+ position: absolute;
833
+ top: 16px;
834
+ left: 16px;
835
+ `,ButtonsContainerStyled$2=styled.div`
836
+ display: flex;
837
+ justify-content: center;
838
+ gap: 8px;
839
+ padding-bottom: 16px;
840
+ `,BottomButtonsContainerStyled=styled(ButtonsContainerStyled$2)`
841
+ padding-bottom: 0;
842
+ `,FooterButton$1=styled(Button)`
843
+ margin-bottom: 24px;
844
+ `,LoaderStyled$1=styled(LoaderIcon)`
845
+ margin-bottom: 18px;
846
+ margin-top: 2px;
847
+ `,ErrorIconStyled$2=styled(ErrorIcon)`
848
+ margin-bottom: 16px;
849
+ `,BodyTextStyled$2=styled(H2)`
850
+ color: ${r=>r.theme.colors.text.secondary};
851
+ text-align: center;
852
+ margin-bottom: 20px;
853
+ `,TgButtonStyled=styled(Button)`
854
+ margin-top: -8px;
855
+ margin-bottom: 24px;
856
+ width: 100%;
857
+ padding: 12px 12px 12px 20px;
858
+ border-radius: ${r=>tgButtonBorders[r.theme.borderRadius]};
859
+ font-size: 16px;
860
+ line-height: 20px;
861
+ `,TgImageStyled=styled(Image)`
862
+ width: 32px;
863
+ height: 32px;
864
+ border-radius: ${r=>tgIconBorders[r.theme.borderRadius]};
865
+ `,Translation=r=>{const[f]=useI18n();return createMemo(()=>{var d;return f(r.translationKey,r.translationValues,(d=r.children)==null?void 0:d.toString())})};function addReturnStrategy(r,f){let d;typeof f=="string"?d=f:d=isInTMA()?f.twaReturnUrl||f.returnStrategy:"none";const g=addQueryParameter(r,"ret",d);if(!isTelegramUrl(r))return g;const v=g.slice(g.lastIndexOf("&")+1);return g.slice(0,g.lastIndexOf("&"))+"-"+encodeTelegramUrlParameters(v)}function redirectToTelegram(r,f){f=__spreadValues({},f);const d=convertToTGDirectLink(r),g=new URL(d);if(g.searchParams.has("startapp")||g.searchParams.append("startapp","tonconnect"),isInTelegramBrowser()){f.returnStrategy="back";const v=addReturnStrategy(g.toString(),f.returnStrategy);openLinkBlank(v)}else if(isInTMA())if(isTmaPlatform("ios","android","macos","tdesktop","web")){f.returnStrategy="back";const v=addReturnStrategy(g.toString(),f.returnStrategy);sendOpenTelegramLink(v)}else isTmaPlatform("weba")?sendOpenTelegramLink(addReturnStrategy(g.toString(),f)):openLinkBlank(addReturnStrategy(g.toString(),f));else if(isOS("ios")){f.returnStrategy==="back"&&(isBrowser("safari")?f.returnStrategy="back":isBrowser("chrome")?f.returnStrategy="googlechrome://":isBrowser("firefox")?f.returnStrategy="firefox://":isBrowser("opera")?f.returnStrategy="opera-http://":f.returnStrategy=location.href);const v=isBrowser("chrome"),m=isBrowser("firefox");if((v||m)&&!f.forceRedirect){const _=addReturnStrategy(g.toString(),f.returnStrategy),S=convertToTGDeepLink(_);openDeeplinkWithFallback(S,()=>openLinkBlank(_))}else{const _=addReturnStrategy(g.toString(),f.returnStrategy);openLinkBlank(_)}}else if(isOS("android")){f.returnStrategy="back";const v=isBrowser("chrome"),m=isBrowser("firefox");if((v||m)&&!f.forceRedirect){const _=addReturnStrategy(g.toString(),f.returnStrategy),S=convertToTGDeepLink(_);openDeeplinkWithFallback(S,()=>openLinkBlank(_))}else{const _=addReturnStrategy(g.toString(),f.returnStrategy);openLinkBlank(_)}}else if(isOS("ipad")){f.returnStrategy==="back"&&(isBrowser("safari")?f.returnStrategy="back":isBrowser("chrome")?f.returnStrategy="googlechrome://":isBrowser("firefox")?f.returnStrategy="firefox://":isBrowser("opera")?f.returnStrategy="opera-http://":f.returnStrategy=location.href);const v=isBrowser("chrome"),m=isBrowser("firefox"),w=(v||m)&&!f.forceRedirect,_=addReturnStrategy(g.toString(),f.returnStrategy);if(w){const S=convertToTGDeepLink(_);openDeeplinkWithFallback(S,()=>openLinkBlank(_))}else openLinkBlank(_)}else if(isOS("macos","windows","linux")){f.returnStrategy="back",f.twaReturnUrl=void 0;const v=addReturnStrategy(g.toString(),f.returnStrategy);if(f.forceRedirect)openLinkBlank(v);else{const m=convertToTGDeepLink(v);openDeeplinkWithFallback(m,()=>openLinkBlank(v))}}else openLinkBlank(addReturnStrategy(g.toString(),f))}function redirectToWallet(r,f,d,g){if(d=__spreadValues({},d),isInTelegramBrowser())if(isOS("ios","android"))d.returnStrategy==="back"&&(d.returnStrategy="tg://resolve"),g("universal-link"),openLink(addReturnStrategy(r,d.returnStrategy),"_self");else{g("universal-link");const v=addReturnStrategy(r,d.returnStrategy);openLinkBlank(v)}else if(isInTMA())if(isTmaPlatform("ios","android")){d.returnStrategy==="back"&&(d.returnStrategy="tg://resolve"),g("universal-link");const v=addReturnStrategy(r,d.returnStrategy);sendOpenTelegramLink(v,()=>{g("universal-link"),openLinkBlank(v)})}else if(isTmaPlatform("macos","tdesktop")){d.returnStrategy==="back"&&(d.returnStrategy="tg://resolve");const v=addReturnStrategy(r,d.returnStrategy);!!f&&!d.forceRedirect?(g("custom-deeplink"),openDeeplinkWithFallback(toDeeplink(v,f),()=>{g("universal-link"),openLinkBlank(v)})):(g("universal-link"),openLinkBlank(v))}else if(isTmaPlatform("weba")){d.returnStrategy==="back"&&(isBrowser("safari")?d.returnStrategy=location.href:isBrowser("chrome")?d.returnStrategy="googlechrome://":isBrowser("firefox")?d.returnStrategy="firefox://":isBrowser("opera")?d.returnStrategy="opera-http://":d.returnStrategy=location.href);const v=addReturnStrategy(r,d.returnStrategy);!!f&&!d.forceRedirect?(g("custom-deeplink"),openDeeplinkWithFallback(toDeeplink(v,f),()=>{g("universal-link"),openLinkBlank(v)})):(g("universal-link"),openLinkBlank(v))}else if(isTmaPlatform("web")){d.returnStrategy==="back"&&(isBrowser("safari")?d.returnStrategy=location.href:isBrowser("chrome")?d.returnStrategy="googlechrome://":isBrowser("firefox")?d.returnStrategy="firefox://":isBrowser("opera")?d.returnStrategy="opera-http://":d.returnStrategy=location.href);const v=addReturnStrategy(r,d.returnStrategy);!!f&&!d.forceRedirect?(g("custom-deeplink"),openDeeplinkWithFallback(toDeeplink(v,f),()=>{g("universal-link"),openLinkBlank(v)})):(g("universal-link"),openLinkBlank(v))}else{g("universal-link");const v=addReturnStrategy(r,d.returnStrategy);openLinkBlank(v)}else if(isOS("ios"))d.returnStrategy==="back"&&(isBrowser("safari")?d.returnStrategy="none":isBrowser("chrome")?d.returnStrategy="googlechrome://":isBrowser("firefox")?d.returnStrategy="firefox://":isBrowser("opera")?d.returnStrategy="opera-http://":d.returnStrategy=location.href),isBrowser("chrome")?(g("universal-link"),openLink(addReturnStrategy(r,d.returnStrategy),"_self")):(g("universal-link"),openLinkBlank(addReturnStrategy(r,d.returnStrategy)));else if(isOS("android"))d.returnStrategy==="back"&&(isBrowser("chrome")?d.returnStrategy="googlechrome://":isBrowser("firefox")?d.returnStrategy="firefox://":isBrowser("opera")?d.returnStrategy="opera-http://":d.returnStrategy=location.href),g("universal-link"),openLinkBlank(addReturnStrategy(r,d.returnStrategy));else if(isOS("ipad"))d.returnStrategy==="back"&&(isBrowser("safari")?d.returnStrategy="none":isBrowser("chrome")?d.returnStrategy="googlechrome://":isBrowser("firefox")?d.returnStrategy="firefox://":isBrowser("opera")?d.returnStrategy="opera-http://":d.returnStrategy=location.href),isBrowser("chrome")?(g("universal-link"),openLink(addReturnStrategy(r,d.returnStrategy),"_self")):(g("universal-link"),openLinkBlank(addReturnStrategy(r,d.returnStrategy)));else if(isOS("macos","windows","linux")){d.returnStrategy==="back"&&(isBrowser("safari")?d.returnStrategy="none":isBrowser("chrome")?d.returnStrategy="googlechrome://":isBrowser("firefox")?d.returnStrategy="firefox://":isBrowser("opera")?d.returnStrategy="opera-http://":d.returnStrategy="none");const v=addReturnStrategy(r,d.returnStrategy);!!f&&!d.forceRedirect?(g("custom-deeplink"),openDeeplinkWithFallback(toDeeplink(v,f),()=>{g("universal-link"),openLinkBlank(v)})):(g("universal-link"),openLinkBlank(v))}else g("universal-link"),openLinkBlank(addReturnStrategy(r,d.returnStrategy))}function addQueryParameter(r,f,d){const g=new URL(r);return g.searchParams.append(f,d),g.toString()}function convertToTGDirectLink(r){const f=new URL(r);return f.searchParams.has("attach")&&(f.searchParams.delete("attach"),f.pathname+="/start"),f.toString()}function convertToTGDeepLink(r){const f=new URL(r),[,d,g]=f.pathname.split("/"),v=f.searchParams.get("startapp");return`tg://resolve?domain=${d}&appname=${g}&startapp=${v}`}const DesktopConnectionModal=r=>{const[f,d]=createSignal("mobile"),[g,v]=createSignal(null);createEffect(()=>{var L;v((L=r.defaultError)!=null?L:null)});const[m,w]=createSignal(),[_,S]=createSignal(!0),x=useContext(ConnectorContext),b=x.onStatusChange(()=>{},L=>{if(L instanceof WalletMissingRequiredFeaturesError){v("missing-features");return}r.wallet.appName!==AT_WALLET_APP_NAME&&v("connection-declined")});onCleanup(b);const C=()=>{try{const L=x.connect({universalLink:r.wallet.universalLink,bridgeUrl:r.wallet.bridgeUrl},r.additionalRequest);w(L)}catch{}};createEffect(()=>{untrack(f)!=="extension"&&(supportsMobile(r.wallet)||supportsDesktop(r.wallet))&&C()});const E=()=>{v(null),f()==="extension"&&C(),d("mobile"),setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:"qrcode"}))},M=()=>{if(v(null),f()==="extension"&&C(),d("desktop"),isTelegramUrl(m()))A();else{const L=!_();S(!1),redirectToWallet(m(),r.wallet.deepLink,{returnStrategy:appState.returnStrategy,forceRedirect:L},O=>{setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:O}))})}},A=()=>{const L=!_();S(!1),setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:"universal-link"})),redirectToTelegram(m(),{returnStrategy:appState.returnStrategy,twaReturnUrl:appState.twaReturnUrl,forceRedirect:L})},T=()=>{v(null),d("extension"),isWalletInfoCurrentlyInjected(r.wallet)&&(setLastSelectedWalletInfo(r.wallet),x.connect({jsBridgeKey:r.wallet.jsBridgeKey},r.additionalRequest))};return supportsMobile(r.wallet)?E():supportsExtension(r.wallet)?T():M(),createComponent(DesktopConnectionModalStyled,{"data-tc-wallets-modal-connection-desktop":"true",get children(){return[createComponent(Show,{get when(){return!r.backDisabled},get children(){return createComponent(StyledIconButton$4,{icon:"arrow",onClick:()=>r.onBackClick()})}}),createComponent(H1Styled$8,{get children(){return r.wallet.name}}),createComponent(Show,{get when(){return createMemo(()=>f()==="mobile")()&&!g()},get children(){return createComponent(H2Styled$4,{translationKey:"walletModal.desktopConnectionModal.scanQR",get translationValues(){return{name:r.wallet.name}},get children(){return["Scan the QR code below with your phone’s or ",createMemo(()=>r.wallet.name),"’s camera"]}})}}),createComponent(BodyStyled$1,{get qr(){return f()==="mobile"},get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return g()},get children(){return[createComponent(ErrorIconStyled$2,{size:"s"}),createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return g()==="missing-features"},get children(){return createComponent(BodyTextStyled$2,{translationKey:"walletModal.desktopConnectionModal.missingFeatures",get translationValues(){return{name:r.wallet.name}},children:"Please update Wallet, your version does not support required features for this dApp"})}}),createComponent(Match,{get when(){return g()==="connection-declined"},get children(){return createComponent(BodyTextStyled$2,{translationKey:"walletModal.desktopConnectionModal.connectionDeclined",children:"Connection declined"})}}),createComponent(Match,{get when(){return g()==="not-supported"},get children(){return createComponent(BodyTextStyled$2,{translationKey:"walletModal.desktopConnectionModal.notSupportedWallet",get translationValues(){return{name:r.wallet.name}},get children(){return[createMemo(()=>r.wallet.name)," doesn’t support the requested action. Please connect another wallet that supports it."]}})}})]}}),createComponent(ButtonsContainerStyled$2,{get children(){return[createComponent(Show,{get when(){return g()!=="not-supported"},get children(){return createComponent(Button,{get leftIcon(){return createComponent(RetryIcon,{})},get onClick(){return f()==="extension"?T:M},get children(){return createComponent(Translation,{translationKey:"common.retry",children:"Retry"})}})}}),createComponent(Show,{get when(){return g()==="missing-features"},get children(){return createComponent(Link,{get href(){return r.wallet.aboutUrl},blank:!0,get children(){return createComponent(Button,{get leftIcon(){return createComponent(LinkIcon,{})},get children(){return createComponent(Translation,{translationKey:"walletModal.desktopConnectionModal.updateWallet",get translationValues(){return{name:r.wallet.name}},get children(){return["Update ",createMemo(()=>r.wallet.name)]}})}})}})}}),createComponent(Show,{get when(){return g()==="not-supported"},get children(){return createComponent(Button,{onClick:()=>r.onBackClick(),get children(){return createComponent(Translation,{translationKey:"walletModal.desktopConnectionModal.chooseAnotherWallet",children:"Choose Another Wallet"})}})}})]}})]}}),createComponent(Match,{get when(){return f()==="mobile"},get children(){return createComponent(QRCodeStyled$1,{disableCopy:!1,get sourceUrl(){return addReturnStrategy(m(),"none")},get imageUrl(){return r.wallet.imageUrl}})}}),createComponent(Match,{get when(){return f()==="extension"},get children(){return[createComponent(Show,{get when(){return isWalletInfoCurrentlyInjected(r.wallet)},get children(){return[createComponent(LoaderStyled$1,{size:"s"}),createComponent(BodyTextStyled$2,{translationKey:"walletModal.desktopConnectionModal.continueInExtension",get translationValues(){return{name:r.wallet.name}},get children(){return["Continue in ",createMemo(()=>r.wallet.name)," browser extension…"]}}),createComponent(ButtonsContainerStyled$2,{get children(){return createComponent(Button,{get leftIcon(){return createComponent(RetryIcon,{})},onClick:T,get children(){return createComponent(Translation,{translationKey:"common.retry",children:"Retry"})}})}})]}}),createComponent(Show,{get when(){return!isWalletInfoCurrentlyInjected(r.wallet)},get children(){return[createComponent(BodyTextStyled$2,{translationKey:"walletModal.desktopConnectionModal.dontHaveExtension",get translationValues(){return{name:r.wallet.name}},get children(){return["Seems you don't have installed ",createMemo(()=>r.wallet.name)," browser extension"]}}),createComponent(ButtonsContainerStyled$2,{get children(){return createComponent(Link,{get href(){return r.wallet.aboutUrl},blank:!0,get children(){return createComponent(Button,{get rightIcon(){return createComponent(LinkIcon,{})},onClick:T,get children(){return createComponent(Translation,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:r.wallet.name}},get children(){return["Get ",createMemo(()=>r.wallet.name)]}})}})}})}})]}})]}}),createComponent(Match,{get when(){return f()==="desktop"},get children(){return[createComponent(LoaderIcon,{size:"m"}),createComponent(BodyTextStyled$2,{translationKey:"walletModal.desktopConnectionModal.continueOnDesktop",get translationValues(){return{name:r.wallet.name}},get children(){return["Continue in ",createMemo(()=>r.wallet.name)," on desktop…"]}}),createComponent(ButtonsContainerStyled$2,{get children(){return[createComponent(Button,{get leftIcon(){return createComponent(RetryIcon,{})},onClick:M,get children(){return createComponent(Translation,{translationKey:"common.retry",children:"Retry"})}}),createComponent(Link,{get href(){return r.wallet.aboutUrl},blank:!0,get children(){return createComponent(Button,{get rightIcon(){return createComponent(LinkIcon,{})},get children(){return createComponent(Translation,{translationKey:"walletModal.desktopConnectionModal.getWallet",get translationValues(){return{name:r.wallet.name}},get children(){return["Get ",createMemo(()=>r.wallet.name)]}})}})}})]}})]}})]}})}}),createComponent(Show,{get when(){return r.wallet.appName===AT_WALLET_APP_NAME},get children(){return createComponent(TgButtonStyled,{get rightIcon(){return createComponent(TgImageStyled,{get src(){return IMG.TG}})},scale:"s",onClick:A,get children(){return createComponent(Translation,{translationKey:"walletModal.desktopConnectionModal.openWalletOnTelegram",children:"Open Wallet in Telegram on desktop"})}})}}),createComponent(Show,{get when(){return r.wallet.appName!==AT_WALLET_APP_NAME},get children(){return createComponent(BottomButtonsContainerStyled,{get children(){return[createComponent(Show,{get when(){return createMemo(()=>f()!=="mobile")()&&supportsMobile(r.wallet)},get children(){return createComponent(FooterButton$1,{appearance:"secondary",get leftIcon(){return createComponent(MobileIcon,{})},onClick:E,get children(){return createComponent(Translation,{translationKey:"common.mobile",children:"Mobile"})}})}}),createComponent(Show,{get when(){return createMemo(()=>f()!=="extension")()&&supportsExtension(r.wallet)},get children(){return createComponent(FooterButton$1,{appearance:"secondary",get leftIcon(){return createComponent(BrowserIcon,{})},onClick:T,get children(){return createComponent(Translation,{translationKey:"common.browserExtension",children:"Browser Extension"})}})}}),createComponent(Show,{get when(){return createMemo(()=>f()!=="desktop")()&&supportsDesktop(r.wallet)},get children(){return createComponent(FooterButton$1,{appearance:"secondary",get leftIcon(){return createComponent(DesktopIcon,{})},onClick:M,get children(){return createComponent(Translation,{translationKey:"common.desktop",children:"Desktop"})}})}})]}})}})]}})},InfoModalStyled=styled.div``,StyledIconButton$3=styled(IconButton)`
866
+ position: absolute;
867
+ top: 16px;
868
+ left: 16px;
869
+ `,H1Styled$7=styled(H1)`
870
+ margin-bottom: 18px;
871
+ `,InfoBlock=styled.div`
872
+ padding: 16px 0;
873
+ display: flex;
874
+ flex-direction: column;
875
+ align-items: center;
876
+ `,InfoBlockIconClass=u`
877
+ margin-bottom: 12px;
878
+ `,H3Styled$1=styled(H3)`
879
+ text-align: center;
880
+ margin-bottom: 4px;
881
+ `,TextStyled$2=styled(Text)`
882
+ text-align: center;
883
+ max-width: 352px;
884
+ color: ${r=>r.theme.colors.text.secondary};
885
+ `,ButtonsBlock=styled.div`
886
+ padding: 16px 24px 24px;
887
+ display: flex;
888
+ align-items: center;
889
+ justify-content: center;
890
+ gap: 8px;
891
+ `,LINKS={GET_A_WALLET:"https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1"},InfoModal=r=>createComponent(InfoModalStyled,{"data-tc-wallets-modal-info":"true",get children(){return[createComponent(StyledIconButton$3,{icon:"arrow",onClick:()=>r.onBackClick()}),createComponent(H1Styled$7,{translationKey:"walletModal.infoModal.whatIsAWallet",children:"What is a wallet"}),createComponent(ScrollContainer,{get children(){return[createComponent(InfoBlock,{get children(){return[createComponent(SecurityIcon,{class:InfoBlockIconClass}),createComponent(H3Styled$1,{translationKey:"walletModal.infoModal.secureDigitalAssets",children:"Secure digital assets storage"}),createComponent(TextStyled$2,{translationKey:"walletModal.infoModal.walletProtects",children:"A wallet protects and manages your digital assets including TON, tokens and collectables."})]}}),createComponent(InfoBlock,{get children(){return[createComponent(PersonalityIcon,{class:InfoBlockIconClass}),createComponent(H3Styled$1,{translationKey:"walletModal.infoModal.controlIdentity",children:"Control your Web3 identity"}),createComponent(TextStyled$2,{translationKey:"walletModal.infoModal.manageIdentity",children:"Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem."})]}}),createComponent(InfoBlock,{get children(){return[createComponent(SwapIcon,{class:InfoBlockIconClass}),createComponent(H3Styled$1,{translationKey:"walletModal.infoModal.effortlessCryptoTransactions",children:"Effortless crypto transactions"}),createComponent(TextStyled$2,{translationKey:"walletModal.infoModal.easilySend",children:"Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications."})]}}),createComponent(ButtonsBlock,{get children(){return createComponent(Link,{get href(){return LINKS.GET_A_WALLET},blank:!0,get children(){return createComponent(Button,{get rightIcon(){return createComponent(WalletIcon,{})},get children(){return createComponent(Translation,{translationKey:"walletModal.infoModal.getAWallet",children:"Get a Wallet"})}})}})}})]}})]}}),MobileConnectionModalStyled=styled.div``,BodyStyled=styled.div`
892
+ flex: 1;
893
+ margin-top: 18px;
894
+ display: flex;
895
+ flex-direction: column;
896
+ align-items: center;
897
+ justify-content: center;
898
+ min-height: 232px;
899
+ `,H1Styled$6=styled(H1)`
900
+ max-width: 262px;
901
+ margin: 0 auto 8px;
902
+ `,StyledIconButton$2=styled(IconButton)`
903
+ position: absolute;
904
+ top: 16px;
905
+ left: 16px;
906
+ `,FooterStyled=styled.div`
907
+ padding: 16px;
908
+ display: flex;
909
+ align-items: center;
910
+ gap: 12px;
911
+ border-top: 0.5px solid ${r=>rgba(r.theme.colors.icon.secondary,.2)};
912
+ `,ImageStyled=styled(Image)`
913
+ width: 36px;
914
+ height: 36px;
915
+ border-radius: 10px;
916
+ `,FooterButton=styled(Link)`
917
+ margin-left: auto;
918
+ `,LoaderStyled=styled(LoaderIcon)`
919
+ margin-bottom: 18px;
920
+ margin-top: 2px;
921
+ `,ErrorIconStyled$1=styled(ErrorIcon)`
922
+ margin-bottom: 16px;
923
+ `,BodyTextStyled$1=styled(H2)`
924
+ color: ${r=>r.theme.colors.text.secondary};
925
+ text-align: center;
926
+ margin-bottom: 20px;
927
+ `,ButtonsContainerStyled$1=styled.div`
928
+ display: flex;
929
+ justify-content: center;
930
+ gap: 8px;
931
+ padding-bottom: 16px;
932
+ `,actionButtonBorderRadius$1={m:"16px",s:"8px",none:"0"},H1Styled$5=styled(H1)`
933
+ margin-bottom: 2px;
934
+ padding: 0 52px;
935
+ `,H2Styled$3=styled(H2)`
936
+ margin-bottom: 20px;
937
+ padding: 0 64px;
938
+ `,QrCodeWrapper$1=styled.div`
939
+ padding: 0 24px 16px;
940
+ `,ButtonsWrapper$1=styled.div`
941
+ display: flex;
942
+ flex-direction: row;
943
+ gap: 16px;
944
+ padding: 0 24px 24px;
945
+ margin-top: 0;
946
+ `,ActionButton$1=styled(Button)`
947
+ width: 100%;
948
+ height: 56px;
949
+ border-radius: ${r=>actionButtonBorderRadius$1[r.theme.borderRadius]};
950
+ background-color: ${r=>rgba(r.theme.colors.accent,.12)};
951
+ color: ${r=>r.theme.colors.accent};
952
+ font-size: 16px;
953
+ line-height: 20px;
954
+ font-weight: 500;
955
+ padding: 17px 20px 19px 20px;
956
+ `,MobileConnectionQR=r=>[createComponent(H1Styled$5,{get children(){return r.walletInfo.name}}),createComponent(H2Styled$3,{translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){return{name:r.walletInfo.name}},get children(){return["Scan the QR code below with your phone’s or ",createMemo(()=>r.walletInfo.name),"’s camera"]}}),createComponent(QrCodeWrapper$1,{get children(){return createComponent(QRCode,{get imageUrl(){return r.walletInfo.imageUrl},get sourceUrl(){return addReturnStrategy(r.universalLink,"none")},disableCopy:!0})}}),createComponent(ButtonsWrapper$1,{get children(){return[createComponent(ActionButton$1,{appearance:"secondary",onClick:()=>{var f;return(f=r.onOpenLink)==null?void 0:f.call(r)},get children(){return createComponent(Translation,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),createComponent(ActionButton$1,{appearance:"secondary",onClick:()=>{var f;return(f=r.onCopy)==null?void 0:f.call(r)},get children(){return createComponent(Translation,{get translationKey(){return r.isCopiedShown!==void 0?"common.copied":"common.copyLink"},get children(){return r.isCopiedShown!==void 0?"Copied":"Copy Link"}})}})]}})],MobileConnectionModal=r=>{const f=useTheme(),[d,g]=createSignal(!0),[v,m]=createSignal(!1),[w,_]=createSignal(null);createEffect(()=>{var H;_((H=r.defaultError)!=null?H:null)});const S=useContext(ConnectorContext),x=S.onStatusChange(()=>{},()=>{_(null)}),b=createMemo(()=>S.connect({universalLink:r.wallet.universalLink,bridgeUrl:r.wallet.bridgeUrl},r.additionalRequest)),C=()=>{setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:"universal-link"})),redirectToTelegram(b(),{returnStrategy:appState.returnStrategy,twaReturnUrl:appState.twaReturnUrl,forceRedirect:!0})},E=()=>{const H=b();if(isTelegramUrl(H))return C();_(null);const V=!d();g(!1),redirectToWallet(b(),r.wallet.deepLink,{returnStrategy:appState.returnStrategy,forceRedirect:V},X=>{setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:X}))})},[M,A]=createSignal(void 0),T=()=>__async(void 0,null,function*(){M()!==void 0&&clearTimeout(M()),yield copyToClipboard(b());const H=setTimeout(()=>A(void 0),1500);A(H)}),L=()=>{_(null),m(!0),setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:"qrcode"}))},O=()=>{m(!1),setLastSelectedWalletInfo(__spreadProps(__spreadValues({},r.wallet),{openMethod:"universal-link"}))},N=()=>{v()?O():r.onBackClick()};return onCleanup(x),E(),createComponent(MobileConnectionModalStyled,{"data-tc-wallets-modal-connection-mobile":"true",get children(){return[createComponent(Show,{get when(){return!r.backDisabled||v()},get children(){return createComponent(StyledIconButton$2,{icon:"arrow",onClick:N})}}),createComponent(Show,{get when(){return v()},get children(){return createComponent(MobileConnectionQR,{get universalLink(){return b()},get walletInfo(){return r.wallet},onOpenLink:E,onCopy:T,get isCopiedShown(){return M()}})}}),createComponent(Show,{get when(){return!v()},get children(){return[createComponent(H1Styled$6,{get children(){return r.wallet.name}}),createComponent(BodyStyled,{get children(){return[createComponent(Show,{get when(){return w()},get children(){return[createComponent(ErrorIconStyled$1,{size:"s"}),createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return w()==="missing-features"},get children(){return createComponent(BodyTextStyled$1,{translationKey:"walletModal.mobileConnectionModal.missingFeatures",get translationValues(){return{name:r.wallet.name}},children:"Please update Wallet, your version does not support required features for this dApp"})}}),createComponent(Match,{get when(){return w()==="connection-declined"},get children(){return createComponent(BodyTextStyled$1,{translationKey:"walletModal.mobileConnectionModal.connectionDeclined",children:"Connection declined"})}}),createComponent(Match,{get when(){return w()==="not-supported"},get children(){return createComponent(BodyTextStyled$1,{translationKey:"walletModal.mobileConnectionModal.notSupportedWallet",get translationValues(){return{name:r.wallet.name}},get children(){return[createMemo(()=>r.wallet.name)," doesn’t support the requested action. Please connect another wallet that supports it."]}})}})]}}),createComponent(ButtonsContainerStyled$1,{get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return w()==="missing-features"},get children(){return[createComponent(Button,{get leftIcon(){return createComponent(RetryIcon,{})},onClick:E,get children(){return createComponent(Translation,{translationKey:"common.retry",children:"Retry"})}}),createComponent(Link,{get href(){return r.wallet.aboutUrl},blank:!0,get children(){return createComponent(Button,{get leftIcon(){return createComponent(LinkIcon,{})},get children(){return createComponent(Translation,{translationKey:"walletModal.mobileConnectionModal.updateWallet",get translationValues(){return{name:r.wallet.name}},get children(){return["Update ",createMemo(()=>r.wallet.name)]}})}})}})]}}),createComponent(Match,{get when(){return w()==="not-supported"},get children(){return createComponent(Button,{onClick:()=>r.onBackClick(),get children(){return createComponent(Translation,{translationKey:"walletModal.mobileConnectionModal.chooseAnotherWallet",children:"Choose Another Wallet"})}})}}),createComponent(Match,{get when(){return w()==="connection-declined"},get children(){return[createComponent(Button,{get leftIcon(){return createComponent(RetryIcon,{})},onClick:E,get children(){return createComponent(Translation,{translationKey:"common.retry",children:"Retry"})}}),createComponent(Button,{get leftIcon(){return createComponent(QRIcon,{get fill(){return f.colors.accent}})},onClick:L,get children(){return createComponent(Translation,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})}})]}}),createComponent(Show,{get when(){return!w()},get children(){return[createComponent(LoaderStyled,{size:"s"}),createComponent(BodyTextStyled$1,{translationKey:"walletModal.mobileConnectionModal.continueIn",get translationValues(){return{name:r.wallet.name}},get children(){return["Continue in ",createMemo(()=>r.wallet.name),"…"]}}),createComponent(ButtonsContainerStyled$1,{get children(){return[createComponent(Button,{get leftIcon(){return createComponent(RetryIcon,{})},onClick:E,get children(){return createComponent(Translation,{translationKey:"common.retry",children:"Retry"})}}),createComponent(Button,{get leftIcon(){return createComponent(QRIcon,{get fill(){return f.colors.accent}})},onClick:L,get children(){return createComponent(Translation,{translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Code"})}})]}})]}})]}}),createComponent(FooterStyled,{get children(){return[createComponent(ImageStyled,{get src(){return r.wallet.imageUrl}}),createComponent(H3,{get children(){return r.wallet.name}}),createComponent(FooterButton,{get href(){return r.wallet.aboutUrl},blank:!0,get children(){return createComponent(Button,{get children(){return createComponent(Translation,{translationKey:"common.get",children:"GET"})}})}})]}})]}})]}})},borders$2={m:"16px",s:"12px",none:"0"},tgBorders={m:"6px",s:"6px",none:"0"};styled.li`
957
+ width: 82px;
958
+ min-width: 82px;
959
+ height: 124px;
960
+ display: flex;
961
+ flex-direction: column;
962
+ align-items: center;
963
+ padding: 8px 4px;
964
+
965
+ text-align: center;
966
+ cursor: pointer;
967
+
968
+ transition: transform 0.1s ease-in-out;
969
+
970
+ ${mediaNotTouch} {
971
+ &:hover {
972
+ transform: scale(1.04);
973
+ }
974
+ }
975
+
976
+ &:active {
977
+ transform: scale(0.96);
978
+ }
979
+
980
+ ${mediaTouch} {
981
+ &:active {
982
+ transform: scale(0.92);
983
+ }
984
+ }
985
+ `;const H1Styled$4=styled(H1)`
986
+ margin-top: 38px;
987
+ margin-bottom: 4px;
988
+ padding: 0 24px;
989
+ `,H2Styled$2=styled(H2)`
990
+ margin: ${r=>{var f;return(f=r.margin)!=null?f:"0 0 28px 0"}};
991
+ padding: ${r=>{var f;return(f=r.padding)!=null?f:"0 24px"}};
992
+ min-height: ${r=>{var f;return(f=r.padding)!=null?f:"44px"}};
993
+ max-width: ${r=>r.maxWidth}px;
994
+ margin-left: ${r=>r.maxWidth?"auto":"0px"};
995
+ margin-right: ${r=>r.maxWidth?"auto":"0px"};
996
+ `;styled(Button)`
997
+ display: block;
998
+ margin: 0 auto;
999
+ `;const TelegramButtonStyled=styled(Button)`
1000
+ margin: 0 28px 24px;
1001
+ width: calc(100% - 56px);
1002
+ border-radius: ${r=>borders$2[r.theme.borderRadius]};
1003
+ padding: 14px 16px 14px 14px;
1004
+ background-color: ${r=>r.theme.colors.telegramButton};
1005
+
1006
+ color: ${r=>r.theme.colors.constant.white};
1007
+ font-weight: 500;
1008
+ font-size: 16px;
1009
+ line-height: 20px;
1010
+
1011
+ @media (max-width: 375px) {
1012
+ margin: 0 16px 24px;
1013
+ width: calc(100% - 32px);
1014
+ }
1015
+ `,TGImageStyled=styled(Image)`
1016
+ background-color: transparent;
1017
+ border-radius: ${r=>tgBorders[r.theme.borderRadius]};
1018
+ width: 24px;
1019
+ height: 24px;
1020
+ `,StyledLeftActionButton=styled(IconButton)`
1021
+ position: absolute;
1022
+ top: 16px;
1023
+ left: 16px;
1024
+ `,actionButtonBorderRadius={m:"16px",s:"8px",none:"0"},H1Styled$3=styled(H1)`
1025
+ margin-bottom: 2px;
1026
+ padding: 0 52px;
1027
+ `,H2Styled$1=styled(H2)`
1028
+ margin-bottom: 20px;
1029
+ padding: 0 64px;
1030
+ `,QrCodeWrapper=styled.div`
1031
+ padding: 0 24px 16px;
1032
+ `,ButtonsWrapper=styled.div`
1033
+ display: flex;
1034
+ flex-direction: row;
1035
+ gap: 16px;
1036
+ padding: 0 24px 24px;
1037
+ margin-top: 0;
1038
+ `,ActionButton=styled(Button)`
1039
+ width: 100%;
1040
+ height: 56px;
1041
+ border-radius: ${r=>actionButtonBorderRadius[r.theme.borderRadius]};
1042
+ background-color: ${r=>rgba(r.theme.colors.accent,.12)};
1043
+ color: ${r=>r.theme.colors.accent};
1044
+ font-size: 16px;
1045
+ line-height: 20px;
1046
+ font-weight: 500;
1047
+ padding: 17px 20px 19px 20px;
1048
+ `,MobileUniversalQR=r=>[createComponent(H1Styled$3,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your TON wallet"}),createComponent(H2Styled$1,{translationKey:"walletModal.mobileUniversalModal.scan",children:"Scan with your mobile wallet"}),createComponent(QrCodeWrapper,{get children(){return createComponent(QRCode,{get imageUrl(){return IMG.TON},get sourceUrl(){return addReturnStrategy(r.universalLink,"none")},disableCopy:!0})}}),createComponent(ButtonsWrapper,{get children(){return[createComponent(ActionButton,{appearance:"secondary",onClick:()=>r.onOpenLink(),get children(){return createComponent(Translation,{translationKey:"walletModal.mobileUniversalModal.openLink",children:"Open Link"})}}),createComponent(ActionButton,{appearance:"secondary",onClick:()=>r.onCopy(),get children(){return createComponent(Translation,{get translationKey(){return r.isCopiedShown!==void 0?"common.copied":"common.copyLink"},get children(){return r.isCopiedShown!==void 0?"Copied":"Copy Link"}})}})]}})];function getUniqueBridges(r){const f=new Set(r.filter(isWalletInfoRemote).map(d=>d.bridgeUrl));return Array.from(f).map(d=>({bridgeUrl:d}))}function bridgesIsEqual(r,f){const d=new Set(r==null?void 0:r.map(v=>v.bridgeUrl)),g=new Set(f==null?void 0:f.map(v=>v.bridgeUrl));return d.size===g.size&&[...d].every(v=>g.has(v))}const _tmpl$$1=template$1("<li></li>"),_tmpl$2=template$1('<div data-tc-wallets-modal-universal-mobile="true"></div>'),MobileUniversalModal=r=>{const[f,d]=createSignal(!1),[g,v]=createSignal(!0),[m,w]=createSignal(null),_=appState.connector,S=()=>r.walletsList.filter(se=>supportsMobile(se)&&se.appName!==AT_WALLET_APP_NAME),x=()=>S().length>7,b=createMemo(()=>getUniqueBridges(r.walletsList),null,{equals:bridgesIsEqual}),C=createMemo(()=>{var se,de;return(de=(se=r.walletsList.find(he=>he.appName===AT_WALLET_APP_NAME))==null?void 0:se.isSupportRequiredFeatures)!=null?de:!1},null),E=()=>(m()||w(_.connect(b(),r.additionalRequest)),m());setLastSelectedWalletInfo({openMethod:"universal-link"});const[M,A]=createSignal(void 0),T=()=>__async(void 0,null,function*(){M()!==void 0&&clearTimeout(M()),yield copyToClipboard(E());const se=setTimeout(()=>A(void 0),1500);A(se)}),L=()=>{const se=!g();v(!1),redirectToWallet(E(),void 0,{returnStrategy:appState.returnStrategy,forceRedirect:se},de=>{setLastSelectedWalletInfo({openMethod:de})})},O=()=>{w(null);const se=r.walletsList.find(we=>we.appName===AT_WALLET_APP_NAME);if(!se||!isWalletInfoRemote(se))throw new TonConnectUIError("@wallet bot not found in the wallets list");const de=_.connect({bridgeUrl:se.bridgeUrl,universalLink:se.universalLink},r.additionalRequest),he=!g();v(!1),redirectToTelegram(de,{returnStrategy:appState.returnStrategy,twaReturnUrl:appState.twaReturnUrl,forceRedirect:he})},N=()=>{d(!0),setLastSelectedWalletInfo({openMethod:"qrcode"})},H=()=>{d(!1),setLastSelectedWalletInfo({openMethod:"universal-link"})},V=createMemo(()=>S().filter(se=>se.isSupportRequiredFeatures),null),X=createMemo(()=>V().slice(0,3),null),oe=createMemo(()=>S().filter(se=>!X().find(de=>de.appName===se.appName)).slice(0,4),null);return(()=>{const se=_tmpl$2.cloneNode(!0);return insert(se,createComponent(Show,{get when(){return f()},get children(){return[createComponent(StyledLeftActionButton,{icon:"arrow",onClick:H}),createComponent(MobileUniversalQR,{get universalLink(){return E()},get isCopiedShown(){return M()},onOpenLink:L,onCopy:T})]}}),null),insert(se,createComponent(Show,{get when(){return!f()},get children(){return[createComponent(StyledLeftActionButton,{get icon(){return createComponent(QRIcon,{})},onClick:N}),createComponent(H1Styled$4,{translationKey:"walletModal.mobileUniversalModal.connectYourWallet",children:"Connect your TON wallet"}),createComponent(Show,{get when(){return C()},get children(){return[createComponent(H2Styled$2,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",maxWidth:320,children:"Use Wallet in Telegram or choose other application"}),createComponent(TelegramButtonStyled,{get leftIcon(){return createComponent(AtWalletIcon,{})},get rightIcon(){return createComponent(TGImageStyled,{get src(){return IMG.TG}})},onClick:O,scale:"s",get children(){return createComponent(Translation,{translationKey:"walletModal.mobileUniversalModal.openWalletOnTelegram",children:"Connect Wallet in Telegram"})}})]}}),createComponent(H2Styled$2,{translationKey:"walletModal.mobileUniversalModal.chooseOtherApplication",maxWidth:342,padding:"0 24px 8px 24px",margin:"0",children:"Choose other application"}),createComponent(WalletUlContainer,{get children(){return[createComponent(For,{get each(){return createMemo(()=>!!x())()?X():V()},children:de=>(()=>{const he=_tmpl$$1.cloneNode(!0);return insert(he,createComponent(WalletItem,{get icon(){return de.imageUrl},get name(){return de.name},onClick:()=>r.onSelect(de)})),he})()}),createComponent(Show,{get when(){return x()},get children(){const de=_tmpl$$1.cloneNode(!0);return insert(de,createComponent(FourWalletsItem,{labelLine1:"View all",labelLine2:"wallets",get images(){return oe().map(he=>he.imageUrl)},onClick:()=>r.onSelectAllWallets()})),de}})]}})]}}),null),se})()},borders$1={m:"16px",s:"8px",none:"0"},hoverBorders={m:"8px",s:"4px",none:"0"},DesktopUniversalModalStyled=styled.div`
1049
+ display: flex;
1050
+ flex-direction: column;
1051
+ align-items: center;
1052
+ padding-bottom: 16px;
1053
+ `,H2Styled=styled(H2)`
1054
+ max-width: 320px;
1055
+ margin-top: 2px;
1056
+ margin-bottom: 20px;
1057
+ `,H2AvailableWalletsStyled=styled(H2)`
1058
+ margin-bottom: 16px;
1059
+ `,QRCodeStyled=styled(QRCode)`
1060
+ margin-bottom: 24px;
1061
+ `,WalletsContainerStyled=styled.ul`
1062
+ display: flex;
1063
+ `;styled.div`
1064
+ display: flex;
1065
+ gap: 16px;
1066
+ width: 100%;
1067
+ `,styled(Button)`
1068
+ position: relative;
1069
+ font-size: 16px;
1070
+ line-height: 20px;
1071
+ width: 100%;
1072
+ padding: 0 16px;
1073
+ height: 56px;
1074
+ border-radius: ${r=>borders$1[r.theme.borderRadius]};
1075
+
1076
+ &:hover {
1077
+ ${r=>r.disableEventsAnimation?"transform: unset;":""}
1078
+ }
1079
+
1080
+ &:active {
1081
+ ${r=>r.disableEventsAnimation?"transform: unset;":""}
1082
+ }
1083
+ `,styled.ul`
1084
+ position: absolute;
1085
+ bottom: 100%;
1086
+ left: 0;
1087
+ margin: 0;
1088
+ padding: 8px;
1089
+ width: 188px;
1090
+ transform: translateY(-16px);
1091
+
1092
+ background-color: ${r=>r.theme.colors.background.primary};
1093
+ border-radius: ${r=>borders$1[r.theme.borderRadius]};
1094
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
1095
+ `,styled.li`
1096
+ padding: 8px;
1097
+
1098
+ display: flex;
1099
+ align-items: center;
1100
+ gap: 8px;
1101
+
1102
+ cursor: pointer;
1103
+ border-radius: ${r=>hoverBorders[r.theme.borderRadius]};
1104
+
1105
+ transition: background-color, transform 0.1s ease-in-out;
1106
+
1107
+ &:hover {
1108
+ background-color: ${r=>r.theme.colors.background.secondary};
1109
+ }
1110
+
1111
+ &:active {
1112
+ transform: scale(0.96);
1113
+ }
1114
+ `,styled(Image)`
1115
+ width: 24px;
1116
+ height: 24px;
1117
+
1118
+ border-radius: 6px;
1119
+ `,styled.div`
1120
+ margin-top: 23px;
1121
+ margin-bottom: 1px;
1122
+ width: 100%;
1123
+ display: flex;
1124
+ justify-content: center;
1125
+ align-items: center;
1126
+ `,styled(Text)`
1127
+ color: ${r=>r.theme.colors.text.secondary};
1128
+ font-size: 16px;
1129
+ `;const _tmpl$=template$1("<li></li>"),DesktopUniversalModal=r=>{const[f,d]=createSignal(!1),g=appState.connector,v=createMemo(()=>getUniqueBridges(r.walletsList),null,{equals:bridgesIsEqual});setLastSelectedWalletInfo({openMethod:"qrcode"});const m=createMemo(()=>g.connect(v(),r.additionalRequest)),w=createMemo(()=>r.walletsList.filter(x=>x.isSupportRequiredFeatures),null),_=createMemo(()=>w().slice(0,3),null),S=createMemo(()=>r.walletsList.filter(x=>!_().find(b=>b.appName===x.appName)).slice(0,4),null);return createComponent(DesktopUniversalModalStyled,{onClick:()=>d(!1),"data-tc-wallets-modal-universal-desktop":"true",get children(){return[createComponent(H1,{translationKey:"walletModal.desktopUniversalModal.connectYourWallet",children:"Connect your wallet"}),createComponent(H2Styled,{translationKey:"walletModal.desktopUniversalModal.scan",children:"Scan with your mobile wallet"}),createComponent(QRCodeStyled,{get sourceUrl(){return addReturnStrategy(m(),"none")},get disableCopy(){return f()},get imageUrl(){return IMG.TON}}),createComponent(H2AvailableWalletsStyled,{translationKey:"walletModal.desktopUniversalModal.availableWallets",children:"Available wallets"}),createComponent(WalletsContainerStyled,{get children(){return[createComponent(For,{get each(){return _()},children:x=>(()=>{const b=_tmpl$.cloneNode(!0);return insert(b,createComponent(WalletLabeledItem,{wallet:x,onClick:()=>r.onSelect(x)})),b})()}),createComponent(FourWalletsItem,{labelLine1:"View all",labelLine2:"wallets",get images(){return S().map(x=>x.imageUrl)},onClick:()=>r.onSelectAllWallets()})]}})]}})},borders={m:"16px",s:"8px",none:"0"},H1Styled$2=styled(H1)`
1130
+ max-width: 288px;
1131
+ margin: 0 auto 38px;
1132
+ `,DesktopFeatureNotSupportModalStyled=styled.div`
1133
+ display: flex;
1134
+ flex-direction: column;
1135
+ align-items: center;
1136
+ `,StyledIconButton$1=styled(IconButton)`
1137
+ position: absolute;
1138
+ top: 16px;
1139
+ left: 16px;
1140
+ `,TitleStyled=styled(H1)`
1141
+ text-align: center;
1142
+ font-size: 20px;
1143
+ line-height: 28px;
1144
+ `,DescriptionStyled=styled(Text)`
1145
+ margin-top: 12px;
1146
+ margin-bottom: 24px;
1147
+ text-align: center;
1148
+ max-width: 360px;
1149
+ font-weight: 400;
1150
+ color: ${r=>r.theme.colors.text.secondary};
1151
+ `;styled.button`
1152
+ background: transparent;
1153
+ border: none;
1154
+ padding: 0;
1155
+ margin: 0;
1156
+ color: ${r=>r.theme.colors.accent};
1157
+ text-decoration: underline;
1158
+ cursor: pointer;
1159
+ font: inherit;
1160
+ `;const Spacer=styled.div`
1161
+ margin-bottom: 46px;
1162
+ `,ErrorIconStyled=styled(ErrorIcon)`
1163
+ margin-bottom: 16px;
1164
+ `;styled.ul`
1165
+ display: flex;
1166
+ gap: 8px;
1167
+ margin-bottom: 24px;
1168
+ list-style: none;
1169
+ padding: 0;
1170
+ `;const DisconnectButtonStyled=styled(Button)`
1171
+ max-width: 320px;
1172
+ width: 100%;
1173
+ height: 48px;
1174
+ font-size: 16px;
1175
+ line-height: 20px;
1176
+ border-radius: ${r=>borders[r.theme.borderRadius]};
1177
+ margin-bottom: 28px;
1178
+ `,BodyTextStyled=styled(H2)`
1179
+ color: ${r=>r.theme.colors.text.secondary};
1180
+ text-align: center;
1181
+ margin-bottom: 20px;
1182
+ `,ButtonsContainerStyled=styled.div`
1183
+ display: flex;
1184
+ justify-content: center;
1185
+ gap: 8px;
1186
+ padding-bottom: 31px;
1187
+ `,RestoreInfoModalStyled=styled.div`
1188
+ margin: 0 8px 16px 8px;
1189
+ `,StyledIconButton=styled(IconButton)`
1190
+ position: absolute;
1191
+ top: 16px;
1192
+ left: 16px;
1193
+ `,H1Styled$1=styled(H1)`
1194
+ margin-bottom: 18px;
1195
+ text-align: center;
1196
+ `,StepBlock=styled.div`
1197
+ padding: 16px 0;
1198
+ display: flex;
1199
+ flex-direction: column;
1200
+ align-items: center;
1201
+ `;styled.div`
1202
+ margin-bottom: 12px;
1203
+ `;const H3Styled=styled(H3)`
1204
+ text-align: center;
1205
+ margin-bottom: 4px;
1206
+ `,TextStyled$1=styled(Text)`
1207
+ text-align: center;
1208
+ max-width: 352px;
1209
+ color: ${r=>r.theme.colors.text.secondary};
1210
+ `,CircleNumber=styled.div`
1211
+ width: 44px;
1212
+ height: 44px;
1213
+ border-radius: 20px;
1214
+ background-color: ${r=>{var f;return(f=r.theme)==null?void 0:f.colors.icon.secondary}};
1215
+ display: flex;
1216
+ align-items: center;
1217
+ justify-content: center;
1218
+ margin-bottom: 12px;
1219
+ font-weight: 700;
1220
+ font-size: 22px;
1221
+ color: ${r=>{var f;return(f=r.theme)==null?void 0:f.colors.text.primary}};
1222
+ `,RestoreInfoModal=r=>createComponent(RestoreInfoModalStyled,{"data-tc-wallets-modal-restore":"true",get children(){return[createComponent(StyledIconButton,{icon:"arrow",get onClick(){return r.onBackClick}}),createComponent(H1Styled$1,{translationKey:"walletModal.restoreInfoModal.title",children:"Restore"}),createComponent(ScrollContainer,{get children(){return[createComponent(StepBlock,{get children(){return[createComponent(CircleNumber,{children:"1"}),createComponent(H3Styled,{translationKey:"walletModal.restoreModal.step1.title",children:"Find your current recovery phrase"}),createComponent(TextStyled$1,{translationKey:"walletModal.restoreModal.step1.text",children:"Open your wallet settings and locate the recovery phrase"})]}}),createComponent(StepBlock,{get children(){return[createComponent(CircleNumber,{children:"2"}),createComponent(H3Styled,{translationKey:"walletModal.restoreModal.step2.title",children:"Copy your recovery phrase"}),createComponent(TextStyled$1,{translationKey:"walletModal.restoreModal.step2.text",children:"Write it down or copy it to a safe place"})]}}),createComponent(StepBlock,{get children(){return[createComponent(CircleNumber,{children:"3"}),createComponent(H3Styled,{translationKey:"walletModal.restoreModal.step3.title",children:"Restore in a supported wallet from the list below"}),createComponent(TextStyled$1,{translationKey:"walletModal.restoreModal.step3.text",children:"Enter the recovery phrase to access your wallet"})]}})]}})]}}),DesktopFeatureNotSupportModal=r=>{const[f,d]=createSignal(null),[g,v]=createSignal(!1),m=createMemo(()=>r.walletsList.find(x=>x.appName===r.currentWallet.device.appName||x.name===r.currentWallet.device.appName)),w=createMemo(()=>{var x,b,C,E;return((b=(x=m())==null?void 0:x.appName)!=null?b:r.currentWallet.device.appName)===AT_WALLET_APP_NAME?"Wallet in Telegram":(E=(C=m())==null?void 0:C.name)!=null?E:r.currentWallet.device.appName}),_=createMemo(()=>{const x=m();if(!(x!=null&&x.features))return!1;const b=r.walletsModalState.requiredFeature,C=b?{[b.featureName]:b.value}:{},E=checkRequiredWalletFeatures(x.features,C),M=checkRequiredWalletFeatures(r.currentWallet.device.features,C);return E&&!M}),S=()=>__async(void 0,null,function*(){yield r.onDisconnect(),r.onSelect(f())});return createComponent(DesktopFeatureNotSupportModalStyled,{get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return g()},get children(){return createComponent(RestoreInfoModal,{onBackClick:()=>v(!1)})}}),createComponent(Match,{get when(){return f()},get children(){return[createComponent(Spacer,{}),createComponent(DesktopFeatureNotSupportModalStyled,{get children(){return[createComponent(StyledIconButton$1,{icon:"arrow",onClick:()=>d(null)}),createComponent(TitleStyled,{translationKey:"walletModal.featureNotSupported.disconnect.title",children:"Confirm Disconnect"}),createComponent(DescriptionStyled,{translationKey:"walletModal.featureNotSupported.disconnect.description",get translationValues(){return{name:f().name}},get children(){return["You will be disconnected from your current wallet and redirected to connect ",createMemo(()=>{var x;return(x=f())==null?void 0:x.name}),"."]}}),createComponent(DisconnectButtonStyled,{onClick:()=>S(),get children(){return createComponent(Translation,{translationKey:"walletModal.featureNotSupported.disconnect.button",children:"Disconnect"})}})]}})]}}),createComponent(Match,{get when(){return _()},get children(){return[createComponent(H1Styled$2,{get children(){return w()}}),createComponent(ErrorIconStyled,{size:"s"}),createComponent(BodyTextStyled,{translationKey:"walletModal.featureNotSupported.version.description",get translationValues(){return{name:w()}},get children(){return["Your current version of ",createMemo(()=>w())," or wallet contract type doesn't support the required features. Please update it to continue."]}}),createComponent(ButtonsContainerStyled,{get children(){return[createComponent(Link,{get href(){return m().aboutUrl},blank:!0,get children(){return createComponent(Button,{get leftIcon(){return createComponent(LinkIcon,{})},get children(){return createComponent(Translation,{translationKey:"walletModal.featureNotSupported.version.updateButton",get translationValues(){return{name:w()}},get children(){return["Update ",createMemo(()=>w())]}})}})}}),createComponent(Link,{href:"https://tonkeeper.helpscoutdocs.com/article/102-w5",blank:!0,get children(){return createComponent(Button,{get leftIcon(){return createComponent(LinkIcon,{})},get children(){return createComponent(Translation,{translationKey:"walletModal.featureNotSupported.version.aboutW5",children:"About W5"})}})}})]}})]}}),createComponent(Match,{when:!0,get children(){return[createComponent(Spacer,{}),createComponent(ErrorIconStyled,{size:"s"}),createComponent(TitleStyled,{translationKey:"walletModal.featureNotSupported.wallet.title",get translationValues(){return{name:w()}},get children(){return[createMemo(()=>w())," doesn’t support the requested action"]}}),createComponent(Spacer,{})]}})]}})}})},WalletsModal=()=>{const{locale:r}=useI18n()[1];createEffect(()=>r(appState.language)),createEffect(()=>{getWalletsModalIsOpened()?updateIsMobile():(m(null),x("universal"),C(!1))});const f=useContext(ConnectorContext),d=useContext(TonConnectUiContext),[g]=createResource(()=>d.getWallets()),[v,m]=createSignal(null),[w,_]=createSignal(null),[S,x]=createSignal("universal"),[b,C]=createSignal(!1),E=createMemo(()=>{const oe=walletsModalState();return"type"in oe&&oe.type==="wallet-not-support-feature"}),M=createMemo(()=>{var oe;if(g.state!=="ready")return null;let se=applyWalletsListConfiguration(g(),appState.walletsListConfiguration);const de=se.filter(isWalletInfoCurrentlyInjected),he=se.filter($=>!isWalletInfoCurrentlyInjected($));se=(de||[]).concat(he);const we=appState.preferredWalletAppName,te=se.find($=>eqWalletName($,we)),q=se.filter($=>eqWalletName($,we)).length>=2;we&&te&&!q&&(se=[__spreadProps(__spreadValues({},te),{isPreferred:!0})].concat(se.filter($=>!eqWalletName($,we))));const k=se.find($=>eqWalletName($,AT_WALLET_APP_NAME));k&&(se=[k].concat(se.filter($=>!eqWalletName($,AT_WALLET_APP_NAME))));const y=(oe=d==null?void 0:d.walletsRequiredFeatures)!=null?oe:d==null?void 0:d.walletsPreferredFeatures;return se.map($=>{var I;return __spreadProps(__spreadValues({},$),{isSupportRequiredFeatures:y?checkRequiredWalletFeatures((I=$.features)!=null?I:[],y):!0})})}),A=()=>{var oe;return((oe=appState.connectRequestParameters)==null?void 0:oe.state)==="loading"},T=createMemo(()=>{var oe;if(!A())return(oe=appState.connectRequestParameters)==null?void 0:oe.value}),L=oe=>{d.closeModal(oe)},O=f.onStatusChange(oe=>{oe&&L("wallet-selected")},oe=>{var se;if(oe instanceof WalletMissingRequiredFeaturesError){const de=oe.cause.connectEvent.device.appName.toLowerCase(),he=(se=M())==null?void 0:se.find(te=>te.appName.toLowerCase()===de);if(!he)throw new TonConnectError("Wallet not found");const we=he.isSupportRequiredFeatures?"missing-features":"not-supported";_(we),m(he)}}),N=()=>{x("all-wallets")},H=()=>{x("universal")},V=oe=>{m(oe),widgetController.openWalletsModal()},X=()=>{m(null),_(null)};return onCleanup(()=>{m(null),_(null),C(!1)}),onCleanup(O),createComponent(StyledModal,{get opened(){return getWalletsModalIsOpened()},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>L("action-cancelled"),onClickQuestion:()=>C(oe=>!oe),get showFooter(){return!E()},"data-tc-wallets-modal-container":"true",get children(){return[createComponent(Show,{get when(){return b()},get children(){return createComponent(InfoModal,{onBackClick:()=>C(!1)})}}),createComponent(Show,{get when(){return!b()},get children(){return[createComponent(Show,{get when(){return A()||!M()},get children(){return[createComponent(H1Styled$a,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),createComponent(LoaderContainerStyled,{get children(){return createComponent(LoaderIcon,{size:"m"})}})]}}),createComponent(Show,{get when(){return createMemo(()=>!A())()&&M()},get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return E()},get children(){return createComponent(DesktopFeatureNotSupportModal,{get walletsList(){return M()},get currentWallet(){return d==null?void 0:d.wallet},onSelect:V,onSelectAllWallets:N,onDisconnect:()=>f.disconnect(),get walletsModalState(){return walletsModalState()},onClose:()=>L("action-cancelled")})}}),createComponent(Match,{get when(){return v()},get children(){return createComponent(Dynamic,{get component(){return isMobile()?MobileConnectionModal:DesktopConnectionModal},get wallet(){return v()},get additionalRequest(){return T()},onBackClick:X,get defaultError(){return w()}})}}),createComponent(Match,{get when(){return S()==="universal"},get children(){return createComponent(Dynamic,{get component(){return isMobile()?MobileUniversalModal:DesktopUniversalModal},onSelect:m,get walletsList(){return M()},get additionalRequest(){return T()},onSelectAllWallets:N})}}),createComponent(Match,{get when(){return S()==="all-wallets"},get children(){return createComponent(AllWalletsListModal,{get walletsList(){return M()},get featureCheckMode(){return d!=null&&d.walletsRequiredFeatures?"strict":"soft"},onBack:H,onSelect:m})}})]}})}})]}})]}})},ActionModalStyled=styled.div`
1223
+ display: flex;
1224
+ flex-direction: column;
1225
+ align-items: center;
1226
+ padding-bottom: 8px;
1227
+ `,H1Styled=styled(H1)`
1228
+ margin-top: 16px;
1229
+ `,TextStyled=styled(Text)`
1230
+ font-weight: 510;
1231
+ font-size: 16px;
1232
+ line-height: 20px;
1233
+ text-align: center;
1234
+ max-width: 250px;
1235
+
1236
+ color: ${r=>r.theme.colors.text.secondary};
1237
+ `,LoaderButtonStyled=styled(Button)`
1238
+ min-width: 112px;
1239
+ margin-top: 32px;
1240
+ `,LoaderIconStyled=styled(LoaderIcon)`
1241
+ height: 16px;
1242
+ width: 16px;
1243
+ `,ButtonStyled=styled(Button)`
1244
+ margin-top: 32px;
1245
+ `,ActionModal=r=>{const f=useDataAttributes(r),d=useContext(TonConnectUiContext),[g,v]=createSignal(!0),[m,w]=createSignal(!1),[_,S]=createSignal(!1),[x,b]=createSignal(!1);createEffect(()=>{const A=action();w(!!A&&("sent"in A&&A.sent||A.name==="transaction-sent")),S(!!A&&("signed"in A&&A.signed||A.name==="data-signed")),b(!!A&&(A.name==="transaction-canceled"||A.name==="sign-data-canceled"))});let C;d!=null&&d.wallet&&"universalLink"in d.wallet&&(d.wallet.openMethod==="universal-link"||isTelegramUrl(d.wallet.universalLink)&&isInTMA())&&(C=d.wallet.universalLink);let E;d!=null&&d.wallet&&"deepLink"in d.wallet&&(d.wallet.openMethod==="custom-deeplink"||isTelegramUrl(d.wallet.deepLink)&&isInTMA())&&(E=d.wallet.deepLink);const M=()=>{const A=action(),T="returnStrategy"in A?A.returnStrategy:appState.returnStrategy,L=!g();v(!1),isTelegramUrl(C)?redirectToTelegram(C,{returnStrategy:T,twaReturnUrl:"twaReturnUrl"in A?A.twaReturnUrl:appState.twaReturnUrl,forceRedirect:L}):redirectToWallet(C,E,{returnStrategy:T,forceRedirect:L},()=>{})};return createComponent(ActionModalStyled,mergeProps(f,{get children(){return[createMemo(()=>r.icon),createComponent(H1Styled,{get translationKey(){return r.headerTranslationKey},get translationValues(){return r.headerTranslationValues}}),createComponent(TextStyled,{get translationKey(){return r.textTranslationKey},get translationValues(){return r.textTranslationValues}}),createComponent(Show,{get when(){return!m()&&!_()&&!x()&&(r.showButton==="open-wallet"&&C||r.showButton!=="open-wallet")},get children(){return createComponent(LoaderButtonStyled,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return createComponent(LoaderIconStyled,{})}})}}),createComponent(Show,{get when(){return m()||_()},get children(){return[createComponent(Show,{get when(){return r.showButton!=="open-wallet"},get children(){return createComponent(ButtonStyled,{onClick:()=>r.onClose(),get children(){return createComponent(Translation,{translationKey:"common.close",children:"Close"})}})}}),createComponent(Show,{get when(){return r.showButton==="open-wallet"&&C},get children(){return createComponent(ButtonStyled,{onClick:M,get children(){return createComponent(Translation,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},ConfirmTransactionModal=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),g=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(ActionModal,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:g()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return createComponent(LoaderIcon,{size:"m"})},onClose:()=>r.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},TransactionCanceledModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return createComponent(ErrorIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-transaction-canceled-modal":"true"}),TransactionSentModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return createComponent(SuccessIcon,{size:"m"})},showButton:"open-wallet",onClose:()=>r.onClose(),"data-tc-transaction-sent-modal":"true"}),ConfirmSignDataModal=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),g=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(ActionModal,{headerTranslationKey:"actionModal.signData.header",get headerTranslationValues(){return{name:g()}},textTranslationKey:"actionModal.signData.text",get icon(){return createComponent(LoaderIcon,{size:"m"})},onClose:()=>r.onClose(),showButton:"open-wallet","data-tc-sign-data-confirm-modal":"true"})},SignDataCanceledModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.signDataCanceled.header",get icon(){return createComponent(ErrorIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-sign-data-canceled-modal":"true"}),DataSignedModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.dataSigned.header",get icon(){return createComponent(SuccessIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-data-signed-modal":"true"}),ActionsModal=()=>createComponent(Modal,{get opened(){var r;return createMemo(()=>action()!==null)()&&((r=action())==null?void 0:r.openModal)===!0},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>setAction(null),showFooter:!1,"data-tc-actions-modal-container":"true",get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return action().name==="transaction-sent"},get children(){return createComponent(TransactionSentModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="transaction-canceled"},get children(){return createComponent(TransactionCanceledModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="confirm-transaction"},get children(){return createComponent(ConfirmTransactionModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="data-signed"},get children(){return createComponent(DataSignedModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="sign-data-canceled"},get children(){return createComponent(SignDataCanceledModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="confirm-sign-data"},get children(){return createComponent(ConfirmSignDataModal,{onClose:()=>setAction(null)})}})]}})}}),SingleWalletModal=()=>{const{locale:r}=useI18n()[1];createEffect(()=>r(appState.language)),createEffect(()=>{getSingleWalletModalIsOpened()&&updateIsMobile()});const f=useContext(ConnectorContext),d=useContext(TonConnectUiContext),[g,v]=createSignal(!1),m=()=>{var x;return((x=appState.connectRequestParameters)==null?void 0:x.state)==="loading"},w=createMemo(()=>{var x;if(!m())return(x=appState.connectRequestParameters)==null?void 0:x.value}),_=x=>{d.closeSingleWalletModal(x)},S=f.onStatusChange(x=>{x&&_("wallet-selected")});return onCleanup(S),onCleanup(()=>{v(!1)}),createComponent(StyledModal,{get opened(){return getSingleWalletModalIsOpened()},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>_("action-cancelled"),onClickQuestion:()=>v(x=>!x),showFooter:!0,"data-tc-wallets-modal-container":"true",get children(){return[createComponent(Show,{get when(){return g()},get children(){return createComponent(InfoModal,{onBackClick:()=>v(!1)})}}),createComponent(Show,{get when(){return!g()},get children(){return[createComponent(Show,{get when(){return m()},get children(){return[createComponent(H1Styled$a,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),createComponent(LoaderContainerStyled,{get children(){return createComponent(LoaderIcon,{size:"m"})}})]}}),createComponent(Show,{get when(){return!m()},get children(){return createComponent(Dynamic,{get component(){return isMobile()?MobileConnectionModal:DesktopConnectionModal},get wallet(){return getSingleWalletModalWalletInfo()},get additionalRequest(){return w()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},App=r=>{const f=createI18nContext(i18nDictionary,appState.language);return defineStylesRoot(),fixMobileSafariActiveTransition(),createComponent(I18nContext.Provider,{value:f,get children(){return createComponent(TonConnectUiContext.Provider,{get value(){return r.tonConnectUI},get children(){return createComponent(ConnectorContext.Provider,{get value(){return appState.connector},get children(){return[createComponent(GlobalStyles,{}),createComponent(ThemeProvider,{theme:themeState,get children(){return[createComponent(Show,{get when(){return appState.buttonRootId},get children(){return createComponent(Portal,{get mount(){return document.getElementById(appState.buttonRootId)},get children(){return createComponent(AccountButton,{})}})}}),createComponent(Dynamic,{component:globalStylesTag,get children(){return[createComponent(WalletsModal,{}),createComponent(SingleWalletModal,{}),createComponent(ActionsModal,{})]}})]}})]}})}})}})},widgetController={openWalletsModal:()=>void setTimeout(()=>setWalletsModalState({status:"opened",closeReason:null})),closeWalletsModal:r=>void setTimeout(()=>setWalletsModalState({status:"closed",closeReason:r})),openSingleWalletModal:r=>{setTimeout(()=>setSingleWalletModalState({status:"opened",closeReason:null,walletInfo:r}))},closeSingleWalletModal:r=>void setTimeout(()=>setSingleWalletModalState({status:"closed",closeReason:r})),openWalletNotSupportFeatureModal:r=>void setTimeout(()=>setWalletsModalState({status:"opened",closeReason:null,type:"wallet-not-support-feature",requiredFeature:r.requiredFeature})),setAction:r=>void setTimeout(()=>setAction(r)),clearAction:()=>void setTimeout(()=>setAction(null)),getSelectedWalletInfo:()=>lastSelectedWalletInfo(),removeSelectedWalletInfo:()=>setLastSelectedWalletInfo(null),renderApp:(r,f)=>render(()=>createComponent(App,{tonConnectUI:f}),document.getElementById(r))};class WalletsModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"tracker"),__publicField(this,"state",walletsModalState()),this.connector=f.connector,this.tracker=f.tracker,this.setConnectRequestParametersCallback=f.setConnectRequestParametersCallback,createEffect(()=>{const d=walletsModalState();this.state=d,this.consumers.forEach(g=>g(d))})}open(){return __async(this,null,function*(){this.tracker.trackConnectionStarted();const d=(yield this.connector.getWallets()).find(isWalletInfoCurrentlyEmbedded);return d?this.connectEmbeddedWallet(d):this.openWalletsModal()})}close(f="action-cancelled"){f==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),widgetController.closeWalletsModal(f)}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}connectEmbeddedWallet(f){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},g=appState.connectRequestParameters;(g==null?void 0:g.state)==="loading"?this.setConnectRequestParametersCallback(d):d(g==null?void 0:g.value)}openWalletsModal(){return __async(this,null,function*(){return isInTMA()&&sendExpand(),widgetController.openWalletsModal(),new Promise(f=>{const d=this.onStateChange(g=>{const{status:v}=g;v==="opened"&&(d(),f())})})})}}class TransactionModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"consumers",[]),this.connector=f.connector,createEffect(()=>{const d=action();this.consumers.forEach(g=>g(d))})}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}}class SingleWalletModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"tracker"),__publicField(this,"state",singleWalletModalState()),this.connector=f.connector,this.tracker=f.tracker,this.setConnectRequestParametersCallback=f.setConnectRequestParametersCallback,createEffect(()=>{const d=singleWalletModalState();this.state=d,this.consumers.forEach(g=>g(d))})}open(f){return __async(this,null,function*(){this.tracker.trackConnectionStarted();const d=yield this.connector.getWallets(),g=applyWalletsListConfiguration(d,appState.walletsListConfiguration),v=g.find(isWalletInfoCurrentlyEmbedded);if(!!v)return this.connectEmbeddedWallet(v);const _=g.filter(isWalletInfoRemote).find(b=>eqWalletName(b,f));if(!!_)return this.openSingleWalletModal(_);const x=`Trying to open modal window with unknown wallet "${f}".`;throw this.tracker.trackConnectionError(x),new TonConnectUIError(x)})}close(f="action-cancelled"){f==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),widgetController.closeSingleWalletModal("action-cancelled")}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}connectEmbeddedWallet(f){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},g=appState.connectRequestParameters;(g==null?void 0:g.state)==="loading"?this.setConnectRequestParametersCallback(d):d(g==null?void 0:g.value)}openSingleWalletModal(f){return __async(this,null,function*(){return isInTMA()&&sendExpand(),widgetController.openSingleWalletModal(f),new Promise(d=>{const g=this.onStateChange(v=>{const{status:m}=v;m==="opened"&&(g(),d())})})})}}class TonConnectUITracker{constructor(f){__publicField(this,"eventPrefix","ton-connect-ui-"),__publicField(this,"tonConnectUiVersion"),__publicField(this,"tonConnectSdkVersion",null),__publicField(this,"eventDispatcher");var d;this.eventDispatcher=(d=f==null?void 0:f.eventDispatcher)!=null?d:new BrowserEventDispatcher,this.tonConnectUiVersion=f.tonConnectUiVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __async(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return __async(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>__async(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",createResponseVersionEvent(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return __async(this,null,function*(){return new Promise((f,d)=>__async(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",g=>{f(g.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",createRequestVersionEvent())}catch(g){d(g)}}))})}dispatchUserActionEvent(f){var d;try{(d=this.eventDispatcher)==null||d.dispatchEvent(`${this.eventPrefix}${f.type}`,f).catch()}catch{}}trackConnectionStarted(...f){try{const d=createConnectionStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(...f){try{const d=createConnectionCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(...f){try{const d=createConnectionErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(...f){try{const d=createConnectionRestoringStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(...f){try{const d=createConnectionRestoringCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(...f){try{const d=createConnectionRestoringErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(...f){try{const d=createDisconnectionEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(...f){try{const d=createTransactionSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(...f){try{const d=createTransactionSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(...f){try{const d=createTransactionSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSentForSignature(...f){try{const d=createDataSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigned(...f){try{const d=createDataSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigningFailed(...f){try{const d=createDataSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectUiVersion="2.2.0";class TonConnectUI{constructor(f){if(__publicField(this,"walletInfoStorage",new WalletInfoStorage),__publicField(this,"preferredWalletStorage",new PreferredWalletStorage),__publicField(this,"tracker"),__publicField(this,"walletInfo",null),__publicField(this,"systemThemeChangeUnsubscribe",null),__publicField(this,"actionsConfiguration"),__publicField(this,"walletsList"),__publicField(this,"_walletsRequiredFeatures"),__publicField(this,"_walletsPreferredFeatures"),__publicField(this,"connectRequestParametersCallback"),__publicField(this,"connector"),__publicField(this,"modal"),__publicField(this,"singleWalletModal"),__publicField(this,"transactionModal"),__publicField(this,"connectionRestored",Promise.resolve(!1)),f&&"connector"in f&&f.connector)this.connector=f.connector;else if(f&&"manifestUrl"in f&&f.manifestUrl)this.connector=new TonConnect({manifestUrl:f.manifestUrl,eventDispatcher:f.eventDispatcher,walletsRequiredFeatures:f.walletsRequiredFeatures});else throw new TonConnectUIError("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new TonConnectUITracker({eventDispatcher:f==null?void 0:f.eventDispatcher,tonConnectUiVersion}),this.modal=new WalletsModalManager({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:v=>{this.connectRequestParametersCallback=v}}),this.singleWalletModal=new SingleWalletModalManager({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:v=>{this.connectRequestParametersCallback=v}}),this.transactionModal=new TransactionModalManager({connector:this.connector}),this._walletsRequiredFeatures=f.walletsRequiredFeatures,this._walletsPreferredFeatures=f.walletsPreferredFeatures,this.walletsList=this.getWallets(),this.walletsList.then(v=>preloadImages(uniq(v.map(m=>m.imageUrl))));const d=this.normalizeWidgetRoot(f==null?void 0:f.widgetRootId);this.subscribeToWalletChange(),(f==null?void 0:f.restoreConnection)!==!1&&(this.connectionRestored=createMacrotaskAsync(()=>__async(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=mergeOptions(f,{uiPreferences:{theme:"SYSTEM"}});const g=this.preferredWalletStorage.getPreferredWalletAppName();setAppState({connector:this.connector,preferredWalletAppName:g}),widgetController.renderApp(d,this)}static getWallets(){return TonConnect.getWallets()}get walletsRequiredFeatures(){return this._walletsRequiredFeatures}get walletsPreferredFeatures(){return this._walletsPreferredFeatures}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?__spreadValues(__spreadValues({},this.connector.wallet),this.walletInfo):null}set uiOptions(f){var d,g,v,m,w;this.checkButtonRootExist(f.buttonRootId),this.actionsConfiguration=f.actionsConfiguration,"walletsRequiredFeatures"in f&&(this._walletsRequiredFeatures=f.walletsRequiredFeatures),"walletsPreferredFeatures"in f&&(this._walletsPreferredFeatures=f.walletsPreferredFeatures),(d=f.uiPreferences)!=null&&d.theme?((g=f.uiPreferences)==null?void 0:g.theme)!=="SYSTEM"?((v=this.systemThemeChangeUnsubscribe)==null||v.call(this),setTheme(f.uiPreferences.theme,f.uiPreferences.colorsSet)):(setTheme(getSystemTheme(),f.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=subscribeToThemeChange(setTheme))):(m=f.uiPreferences)!=null&&m.colorsSet&&setColors(f.uiPreferences.colorsSet),(w=f.uiPreferences)!=null&&w.borderRadius&&setBorderRadius(f.uiPreferences.borderRadius),setAppState(_=>{var S,x;const b=mergeOptions(__spreadValues(__spreadValues(__spreadValues(__spreadValues({},f.language&&{language:f.language}),!!((S=f.actionsConfiguration)!=null&&S.returnStrategy)&&{returnStrategy:f.actionsConfiguration.returnStrategy}),!!((x=f.actionsConfiguration)!=null&&x.twaReturnUrl)&&{twaReturnUrl:f.actionsConfiguration.twaReturnUrl}),!!f.walletsListConfiguration&&{walletsListConfiguration:f.walletsListConfiguration}),unwrap(_));return f.buttonRootId!==void 0&&(b.buttonRootId=f.buttonRootId),f.enableAndroidBackHandler!==void 0&&(b.enableAndroidBackHandler=f.enableAndroidBackHandler),b})}setConnectRequestParameters(f){var d;setAppState({connectRequestParameters:f}),((f==null?void 0:f.state)==="ready"||!f)&&((d=this.connectRequestParametersCallback)==null||d.call(this,f==null?void 0:f.value))}getWallets(){return __async(this,null,function*(){return this.connector.getWallets()})}onStatusChange(f,d){return this.connector.onStatusChange(g=>__async(this,null,function*(){if(g){const v=yield this.getSelectedWalletInfo(g);f(__spreadValues(__spreadValues({},g),v||this.walletInfoStorage.getWalletInfo()))}else f(g)}),d)}openModal(){return __async(this,null,function*(){return this.modal.open()})}closeModal(f){this.modal.close(f)}onModalStateChange(f){return this.modal.onStateChange(f)}get modalState(){return this.modal.state}openSingleWalletModal(f){return __async(this,null,function*(){return this.singleWalletModal.open(f)})}closeSingleWalletModal(f){this.singleWalletModal.close(f)}onSingleWalletModalStateChange(f){return this.singleWalletModal.onStateChange(f)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return __async(this,null,function*(){const d=(yield this.getWallets()).find(isWalletInfoCurrentlyEmbedded);return d?yield this.connectEmbeddedWallet(d):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),widgetController.clearAction(),widgetController.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(f,d){return __async(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,f),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,f,"Wallet was not connected"),new TonConnectUIError("Connect wallet to send a transaction.");isInTMA()&&sendExpand();const{notifications:g,modals:v,returnStrategy:m,twaReturnUrl:w}=this.getModalsAndNotificationsConfiguration(d);widgetController.setAction({name:"confirm-transaction",showNotification:g.includes("before"),openModal:v.includes("before"),sent:!1});const _=new AbortController,S=()=>{_.signal.aborted||(widgetController.setAction({name:"confirm-transaction",showNotification:g.includes("before"),openModal:v.includes("before"),sent:!0}),this.redirectAfterRequestSent({returnStrategy:m,twaReturnUrl:w}))},x=this.onTransactionModalStateChange(b=>{b!=null&&b.openModal||(x(),b||_.abort())});try{const b=yield this.waitForSendTransaction({transaction:f,signal:_.signal},S);return this.tracker.trackTransactionSigned(this.wallet,f,b),widgetController.setAction({name:"transaction-sent",showNotification:g.includes("success"),openModal:v.includes("success")}),b}catch(b){throw b instanceof WalletNotSupportFeatureError?(widgetController.clearAction(),widgetController.openWalletNotSupportFeatureModal(b.cause),b):(widgetController.setAction({name:"transaction-canceled",showNotification:g.includes("error"),openModal:v.includes("error")}),b instanceof TonConnectError?b:new TonConnectUIError("Unhandled error:"+b))}finally{x()}})}signData(f){return __async(this,null,function*(){if(this.tracker.trackDataSentForSignature(this.wallet,f),!this.connected)throw this.tracker.trackDataSigningFailed(this.wallet,f,"Wallet was not connected"),new TonConnectUIError("Connect wallet to send a transaction.");isInTMA()&&sendExpand();const{notifications:d,modals:g,returnStrategy:v,twaReturnUrl:m}=this.getModalsAndNotificationsConfiguration();widgetController.setAction({name:"confirm-sign-data",showNotification:d.includes("before"),openModal:g.includes("before"),signed:!1});const w=new AbortController,_=()=>{w.signal.aborted||(widgetController.setAction({name:"confirm-sign-data",showNotification:d.includes("before"),openModal:g.includes("before"),signed:!0}),this.redirectAfterRequestSent({returnStrategy:v,twaReturnUrl:m}))},S=this.onTransactionModalStateChange(x=>{x!=null&&x.openModal||(S(),x||w.abort())});try{const x=yield this.waitForSignData({data:f,signal:new AbortController().signal},_);return this.tracker.trackDataSigned(this.wallet,f,x),widgetController.setAction({name:"data-signed",showNotification:d.includes("success"),openModal:g.includes("success")}),x}catch(x){throw x instanceof WalletNotSupportFeatureError?(widgetController.clearAction(),widgetController.openWalletNotSupportFeatureModal(x.cause),x):(widgetController.setAction({name:"sign-data-canceled",showNotification:d.includes("error"),openModal:g.includes("error")}),x instanceof TonConnectError?x:new TonConnectUIError("Unhandled error:"+x))}finally{S()}})}redirectAfterRequestSent({returnStrategy:f,twaReturnUrl:d}){this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(isTelegramUrl(this.walletInfo.universalLink)?redirectToTelegram(this.walletInfo.universalLink,{returnStrategy:f,twaReturnUrl:d||appState.twaReturnUrl,forceRedirect:!1}):redirectToWallet(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:f,forceRedirect:!1},()=>{}))}connectEmbeddedWallet(f){return __async(this,null,function*(){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},g=appState.connectRequestParameters;return(g==null?void 0:g.state)==="loading"?this.connectRequestParametersCallback=d:d(g==null?void 0:g.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return __async(this,null,function*(){const f=new AbortController;widgetController.openWalletsModal();const d=this.onModalStateChange(g=>{const{status:v,closeReason:m}=g;v!=="opened"&&(d(),m==="action-cancelled"&&f.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:f.signal})})}waitForWalletConnection(f){return __async(this,null,function*(){return new Promise((d,g)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:v=!1,signal:m=null}=f;if(m&&m.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),g(new TonConnectUIError("Wallet was not connected"));const w=x=>__async(this,null,function*(){if(x)this.tracker.trackConnectionCompleted(x),S(),d(x);else{if(this.tracker.trackConnectionError("Connection was cancelled"),v)return;S(),g(new TonConnectUIError("Wallet was not connected"))}}),_=x=>{this.tracker.trackConnectionError(x.message),!v&&(S(),g(x))},S=this.onStatusChange(x=>w(x),x=>_(x));m&&m.addEventListener("abort",()=>{S(),g(new TonConnectUIError("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(f,d){return __async(this,null,function*(){return new Promise((g,v)=>{const{transaction:m,signal:w}=f;if(w.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,m,"Transaction was cancelled"),v(new TonConnectUIError("Transaction was not sent"));const _=b=>__async(this,null,function*(){g(b)}),S=b=>{v(b)},x=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,m,"Transaction was cancelled"),v(new TonConnectUIError("Transaction was not sent"))};w.addEventListener("abort",x,{once:!0}),this.connector.sendTransaction(m,{onRequestSent:d,signal:w}).then(b=>(w.removeEventListener("abort",x),_(b))).catch(b=>(w.removeEventListener("abort",x),S(b)))})})}waitForSignData(f,d){return __async(this,null,function*(){return new Promise((g,v)=>{const{data:m,signal:w}=f;if(w.aborted)return this.tracker.trackDataSigningFailed(this.wallet,m,"SignData was cancelled"),v(new TonConnectUIError("SignData was not sent"));const _=b=>__async(this,null,function*(){g(b)}),S=b=>{v(b)},x=()=>{this.tracker.trackDataSigningFailed(this.wallet,m,"SignData was cancelled"),v(new TonConnectUIError("SignData was not sent"))};w.addEventListener("abort",x,{once:!0}),this.connector.signData(m,{onRequestSent:d,signal:w}).then(b=>_(b)).catch(b=>S(b))})})}onTransactionModalStateChange(f){return this.transactionModal.onStateChange(f)}subscribeToWalletChange(){this.connector.onStatusChange(f=>__async(this,null,function*(){var d;f?(yield this.updateWalletInfo(f),this.setPreferredWalletAppName(((d=this.walletInfo)==null?void 0:d.appName)||f.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(f){this.preferredWalletStorage.setPreferredWalletAppName(f),setAppState({preferredWalletAppName:f})}getSelectedWalletInfo(f){return __async(this,null,function*(){let d=widgetController.getSelectedWalletInfo();if(!d)return null;let g;if("name"in d)g=d;else{const m=applyWalletsListConfiguration(yield this.walletsList,appState.walletsListConfiguration).find(w=>eqWalletName(w,f.device.appName));if(!m)throw new TonConnectUIError(`Cannot find WalletInfo for the '${f.device.appName}' wallet`);g=__spreadValues(__spreadValues({},m),d)}return g})}updateWalletInfo(f){return __async(this,null,function*(){const d=yield this.getSelectedWalletInfo(f);if(d){this.walletInfo=d,this.walletInfoStorage.setWalletInfo(d);return}const g=this.walletInfoStorage.getWalletInfo();if(g){this.walletInfo=g;return}this.walletInfo=(yield this.walletsList).find(v=>eqWalletName(v,f.device.appName))||null})}normalizeWidgetRoot(f){if(!f||!document.getElementById(f)){f="tc-widget-root";const d=document.createElement("div");d.id=f,document.body.appendChild(d)}return f}checkButtonRootExist(f){if(f!=null&&!document.getElementById(f))throw new TonConnectUIError(`${f} element not found in the document.`)}getModalsAndNotificationsConfiguration(f){var d,g,v,m,w,_;const S=["before","success","error"];let x=S;(d=this.actionsConfiguration)!=null&&d.notifications&&((g=this.actionsConfiguration)==null?void 0:g.notifications)!=="all"&&(x=this.actionsConfiguration.notifications),f!=null&&f.notifications&&(f.notifications==="all"?x=S:x=f.notifications);let b=["before"];(v=this.actionsConfiguration)!=null&&v.modals&&(this.actionsConfiguration.modals==="all"?b=S:b=this.actionsConfiguration.modals),f!=null&&f.modals&&(f.modals==="all"?b=S:b=f.modals);const C=(f==null?void 0:f.returnStrategy)||((m=this.actionsConfiguration)==null?void 0:m.returnStrategy)||"back",E=(f==null?void 0:f.twaReturnUrl)||((w=this.actionsConfiguration)==null?void 0:w.twaReturnUrl);let M=(f==null?void 0:f.skipRedirectToWallet)||((_=this.actionsConfiguration)==null?void 0:_.skipRedirectToWallet)||"ios";return isInTMA()&&(M="never"),{notifications:x,modals:b,returnStrategy:C,twaReturnUrl:E,skipRedirectToWallet:M}}}const DEFAULT_MANIFEST_URL="https://miniapp.spinfi.me/tonconnect-manifest.json";let tonConnectUIInstance=null;class DefaultTonWalletProvider{constructor(f){if(this.bindWalletCallback=f,!tonConnectUIInstance)try{tonConnectUIInstance=new TonConnectUI({manifestUrl:DEFAULT_MANIFEST_URL})}catch{throw new Error("创建TonConnectUI实例失败")}this.ui=tonConnectUIInstance}isConnected(){var f;try{return!!((f=this.ui)!=null&&f.connected)}catch{return!1}}async reportWalletAddress(){const f=this.getUserFriendlyAddress();if(f&&this.bindWalletCallback)try{await this.bindWalletCallback(f)}catch{}}async connect(){if(this.isConnected())return await this.reportWalletAddress(),!0;try{return await new Promise((f,d)=>{this.ui.openModal();const g=this.ui.onStatusChange(()=>{this.isConnected()&&(g(),f())});setTimeout(()=>{this.isConnected()||(g(),d(new Error("连接钱包超时")))},3e5)}),await this.reportWalletAddress(),this.isConnected()}catch{return!1}}getUserFriendlyAddress(){var g,v,m;const f=this.ui,d=((v=(g=f==null?void 0:f.wallet)==null?void 0:g.account)==null?void 0:v.address)||((m=f==null?void 0:f.account)==null?void 0:m.address)||null;return d?toUserFriendlyAddress(d):null}async sendTonTransaction(f){if(!this.isConnected()&&!await this.connect())throw new Error("钱包未连接");const d=await this.ui.sendTransaction(f),g=d==null?void 0:d.boc;let v;if(g)try{v=g.substring(0,16)}catch{}return{transferHash:v,boc:g,raw:d}}async sendUsdtTransaction(f){if(!this.isConnected()&&!await this.connect())throw new Error("钱包未连接");const d=await this.ui.sendTransaction(f),g=d==null?void 0:d.boc;let v;if(g)try{v=g.substring(0,16)}catch{}return{transferHash:v,boc:g,raw:d}}async disconnect(){try{const f=this.ui;if(f!=null&&f.disconnect)await f.disconnect();else if(f!=null&&f.onStatusChange){const d=f.onStatusChange(()=>{});d&&d()}}catch{}}}class HmTrackingSDK{constructor(f){this.options=f,this.token=null,this.user=null;const d=this.options||{};this.storage=new NamespacedStorage(d.storageKeyPrefix||"tg_tracking_sdk"),this.token=this.storage.get("token");const g=d.baseURL||PROD_BASE_URL;this.http=new HttpClient({getToken:()=>this.token,onAuthError:()=>this.clearAuth(),baseURL:g}),this.api=new APIService(this.http),this.hmAdManager=new HmAdManager({autoInjectScript:!0}),this.adMonitor=new AdMonitor(v=>this.api.adMonitor(v)),this.tonWallet=new DefaultTonWalletProvider(this.bindWallet.bind(this))}async init(){const f=isTelegramEnv();try{const d=this.options||{},g=f?getTelegramUserUnsafe():null;if(g?this.user=g:d.customUser?this.user=d.customUser:typeof window<"u"?this.user=getAnonymousBrowserUser():this.user=getDefaultMockUser(),!this.user)throw new Error("未获取到用户信息:请在非 Telegram 环境提供 customUser");this.clearAuth(),await this.auth();try{await this.hmAdManager.init()}catch{}}catch(d){throw d}}async auth(){var f;try{const d=await this.api.auth(this.user);if(d.code!==1)throw new Error(d.msg||"鉴权失败");const g=(f=d.data)==null?void 0:f.token;if(!g)throw new Error("鉴权未返回 token");this.token=g,this.storage.set("token",g)}catch(d){throw d}}clearAuth(){this.token=null,this.storage.remove("token")}ensureTelegramEnvOrThrow(){if(!isTelegramEnv())throw new Error("支付相关功能仅支持在 Telegram 环境内使用")}async getAdPositionConfig(f){const d=await this.api.getAdPositionConfig(String(f));if(d.code!==1)throw new Error(d.msg||"获取广告位配置失败");return d.data||[]}async createAd(f){const d=await this.api.createAd(f);if(d.code!==1)throw new Error(d.msg||"创建广告失败");const g=d.data;return g!=null&&g.spaceId&&await this.hmAdManager.setSpace(String(g.spaceId)),g}async showHmAdByPosition(f){const d=await this.getAdPositionConfig(f);if(!d||d.length===0)throw new Error("未找到广告位配置");const g=d[0],v=await this.createAd({adId:g.adId,adPositionId:g.adPositionId}),m={start:v.start,show:v.show,error:v.error,close:v.close,reward:v.reward};await this.showHmAdWithMonitor(m,v.adShowId)}async showHmAdWithMonitor(f,d){const g=d||"";await this.adMonitor.send(f.start,g),await this.adMonitor.send(f.show,g);try{await this.hmAdManager.show(),await this.adMonitor.send(f.close,g),await this.adMonitor.send(f.reward,g)}catch(v){throw await this.adMonitor.send(f.error,g),v}}async showHmPopupAd(f,d){const g=d||"";await this.adMonitor.send(f.start,g),await this.adMonitor.send(f.show,g);try{await this.hmAdManager.showPopup(),await this.adMonitor.send(f.close,g),await this.adMonitor.send(f.reward,g)}catch(v){throw await this.adMonitor.send(f.error,g),v}}async showHmInAppAd(f,d,g){const v=g||"";await this.adMonitor.send(f.start,v),await this.adMonitor.send(f.show,v);try{await this.hmAdManager.showInApp(d),await this.adMonitor.send(f.close,v),await this.adMonitor.send(f.reward,v)}catch(m){throw await this.adMonitor.send(f.error,v),m}}async bindWallet(f){try{if((await this.api.bindWalletReq({wallet:f,forceBind:!0})).code!==1)return}catch(d){throw d}}async disconnectWallet(){try{if(!this.tonWallet)return;await this.tonWallet.disconnect()}catch{}}async connectWallet(){return this.tonWallet?await this.tonWallet.connect():!1}isWalletConnected(){var f;return!!((f=this.tonWallet)!=null&&f.isConnected())}async ensureWalletConnected(){return this.ensureTelegramEnvOrThrow(),this.tonWallet?await this.tonWallet.connect():!1}async getSupportedPayModes(){const f=await this.api.merchantPayModeList();if(f.code!==1)throw new Error(f.msg||"获取支付方式失败");const d=f.data;return Array.isArray(d)?{payModeList:d}:{payModeList:Array.isArray(d==null?void 0:d.payModeList)?d.payModeList:[]}}async merchantPayQueryResult(f){const d=await this.api.merchantPayQueryResult(f);if(d.code!==1)throw new Error(d.msg||"查询支付结果失败");return d.data}async finishPayment(f,d,g=""){const v={orderSn:f,status:d,transferHash:g},m=await this.api.merchantPayFinish(v);if(m.code!==1)throw new Error(m.msg||"支付完成回调失败");return m.data}async payByMerchant(f){var _,S,x;this.ensureTelegramEnvOrThrow();const d=(_=f.currencyName)==null?void 0:_.toUpperCase(),g=await this.api.merchantPayCreate(f);if(g.code!==1)throw new Error(g.msg||"创建支付订单失败");const v=g.data;if(d==="STARS"&&v.payUrl)try{return await new Promise((C,E)=>{WebApp.openInvoice(v.payUrl,M=>{M==="paid"?C():E(new Error(`星币支付未完成: ${M||"未知状态"}`))})}),await this.finishPayment(v.orderSn,"success")}catch{return await this.finishPayment(v.orderSn,"failed")}if(!this.tonWallet||!this.tonWallet.isConnected())throw new Error("请先连接钱包");if(!((x=(S=v.transferData)==null?void 0:S.messages)==null?void 0:x[0]))throw new Error("订单未返回链上消息");let w;try{if(d==="TON")w=await this.tonWallet.sendTonTransaction(v.transferData);else if(d==="USDT")w=await this.tonWallet.sendUsdtTransaction(v.transferData);else throw new Error("暂不支持的币种");const b=w==null?void 0:w.transferHash;return await this.finishPayment(v.orderSn,"success",b||"")}catch{return await this.finishPayment(v.orderSn,"failed")}}}var AdPositionName=(r=>(r.GameRewardedAdPosition="game_rewarded_ad_position",r.TaskRewardedAdPosition="task_rewarded_ad_position",r.TaskListAdPosition="task_list_ad_position",r))(AdPositionName||{});globalThis.Buffer=Buffer$1,globalThis.process=process$1,globalThis.global=globalThis,exports.AdPositionName=AdPositionName,exports.HmTrackingSDK=HmTrackingSDK,exports.getAnonymousBrowserUser=getAnonymousBrowserUser,exports.getDefaultMockUser=getDefaultMockUser,exports.getTelegramUserUnsafe=getTelegramUserUnsafe,exports.isTelegramEnv=isTelegramEnv,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));