apenft-js-tron 1.0.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 (55) hide show
  1. package/README.md +1141 -0
  2. package/babel.config.js +4 -0
  3. package/dist/bundle.js +2 -0
  4. package/dist/bundle.js.LICENSE.txt +28 -0
  5. package/dist/index.d.ts +9 -0
  6. package/dist/src/config.d.ts +57 -0
  7. package/dist/src/queryAPI/graphql/accountApi.d.ts +11 -0
  8. package/dist/src/queryAPI/graphql/assetApi.d.ts +13 -0
  9. package/dist/src/queryAPI/graphql/base.d.ts +37 -0
  10. package/dist/src/queryAPI/graphql/collectionApi.d.ts +10 -0
  11. package/dist/src/queryAPI/graphql/gql/account.d.ts +6 -0
  12. package/dist/src/queryAPI/graphql/gql/asset.d.ts +8 -0
  13. package/dist/src/queryAPI/graphql/gql/collection.d.ts +5 -0
  14. package/dist/src/queryAPI/graphql/gql/fragments.d.ts +8 -0
  15. package/dist/src/queryAPI/graphql/index.d.ts +9 -0
  16. package/dist/src/queryAPI/index.d.ts +45 -0
  17. package/dist/src/queryAPI/restful/base.d.ts +50 -0
  18. package/dist/src/queryAPI/restful/index.d.ts +1 -0
  19. package/dist/src/queryAPI/restful/queryAPI.d.ts +26 -0
  20. package/dist/src/schemas/common/ERC1155/index.d.ts +7 -0
  21. package/dist/src/schemas/common/ERC20/index.d.ts +6 -0
  22. package/dist/src/schemas/common/ERC721/index.d.ts +5 -0
  23. package/dist/src/schemas/common/Element/exchange.d.ts +9 -0
  24. package/dist/src/schemas/common/Element/registry.d.ts +4 -0
  25. package/dist/src/schemas/common/ens.d.ts +7 -0
  26. package/dist/src/schemas/index.d.ts +18 -0
  27. package/dist/src/schemas/schemasFunctions.d.ts +24 -0
  28. package/dist/src/schemas/shasta/index.d.ts +1 -0
  29. package/dist/src/schemas/tron/index.d.ts +1 -0
  30. package/dist/src/tokens/index.d.ts +4 -0
  31. package/dist/src/tokens/shasta/index.d.ts +1 -0
  32. package/dist/src/tokens/tron/index.d.ts +1 -0
  33. package/dist/src/tradeAPI/account.d.ts +33 -0
  34. package/dist/src/tradeAPI/approve.d.ts +3 -0
  35. package/dist/src/tradeAPI/base.d.ts +40 -0
  36. package/dist/src/tradeAPI/contractSchemas.d.ts +28 -0
  37. package/dist/src/tradeAPI/contracts.d.ts +29 -0
  38. package/dist/src/tradeAPI/index.d.ts +25 -0
  39. package/dist/src/tradeAPI/nft.d.ts +42 -0
  40. package/dist/src/tradeAPI/orders.d.ts +69 -0
  41. package/dist/src/tradeAPI/ordersApi.d.ts +54 -0
  42. package/dist/src/utils/Abi.d.ts +18 -0
  43. package/dist/src/utils/PromiEvent.d.ts +21 -0
  44. package/dist/src/utils/check.d.ts +25 -0
  45. package/dist/src/utils/constants.d.ts +22 -0
  46. package/dist/src/utils/error.d.ts +20 -0
  47. package/dist/src/utils/fees.d.ts +40 -0
  48. package/dist/src/utils/helper.d.ts +23 -0
  49. package/dist/src/utils/makeOrder.d.ts +80 -0
  50. package/dist/src/utils/types.d.ts +464 -0
  51. package/dist/src/utils/utils.d.ts +1 -0
  52. package/index.ts +15 -0
  53. package/package.json +58 -0
  54. package/tsconfig.json +18 -0
  55. package/webpack.config.js +33 -0
package/dist/bundle.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see bundle.js.LICENSE.txt */
2
+ (()=>{var e={8794:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});const n="bignumber/5.7.0"},2593:(e,t,r)=>{"use strict";r.d(t,{O$:()=>p,Zm:()=>d,g$:()=>b,t2:()=>w});var n=r(3877),i=r.n(n),o=r(3286),a=r(711),s=r(8794),u=i().BN;const l=new a.Logger(s.i),c={},f=9007199254740991;function d(e){return null!=e&&(p.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||(0,o.isHexString)(e)||"bigint"==typeof e||(0,o.isBytes)(e))}let h=!1;class p{constructor(e,t){e!==c&&l.throwError("cannot call constructor directly; use BigNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return y(g(this).fromTwos(e))}toTwos(e){return y(g(this).toTwos(e))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(e){return y(g(this).add(g(e)))}sub(e){return y(g(this).sub(g(e)))}div(e){return p.from(e).isZero()&&v("division-by-zero","div"),y(g(this).div(g(e)))}mul(e){return y(g(this).mul(g(e)))}mod(e){const t=g(e);return t.isNeg()&&v("division-by-zero","mod"),y(g(this).umod(t))}pow(e){const t=g(e);return t.isNeg()&&v("negative-power","pow"),y(g(this).pow(t))}and(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","and"),y(g(this).and(t))}or(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","or"),y(g(this).or(t))}xor(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","xor"),y(g(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&v("negative-width","mask"),y(g(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&v("negative-width","shl"),y(g(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&v("negative-width","shr"),y(g(this).shrn(e))}eq(e){return g(this).eq(g(e))}lt(e){return g(this).lt(g(e))}lte(e){return g(this).lte(g(e))}gt(e){return g(this).gt(g(e))}gte(e){return g(this).gte(g(e))}isNegative(){return"-"===this._hex[0]}isZero(){return g(this).isZero()}toNumber(){try{return g(this).toNumber()}catch(e){v("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return l.throwError("this platform does not support BigInt",a.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",a.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",a.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof p)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new p(c,m(e)):e.match(/^-?[0-9]+$/)?new p(c,m(new u(e))):l.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&v("underflow","BigNumber.from",e),(e>=f||e<=-f)&&v("overflow","BigNumber.from",e),p.from(String(e));const t=e;if("bigint"==typeof t)return p.from(t.toString());if((0,o.isBytes)(t))return p.from((0,o.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return p.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&((0,o.isHexString)(e)||"-"===e[0]&&(0,o.isHexString)(e.substring(1))))return p.from(e)}return l.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function m(e){if("string"!=typeof e)return m(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&l.throwArgumentError("invalid hex","value",e),"0x00"===(e=m(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function y(e){return p.from(m(e))}function g(e){const t=p.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function v(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),l.throwError(e,a.Logger.errors.NUMERIC_FAULT,n)}function b(e){return new u(e,36).toString(16)}function w(e){return new u(e,16).toString(36)}},335:(e,t,r)=>{"use strict";r.d(t,{Ox:()=>m,S5:()=>p,xO:()=>y,xs:()=>g});var n=r(3286),i=r(711),o=r(8794),a=r(2593);const s=new i.Logger(o.i),u={},l=a.O$.from(0),c=a.O$.from(-1);function f(e,t,r,n){const o={fault:t,operation:r};return void 0!==n&&(o.value=n),s.throwError(e,i.Logger.errors.NUMERIC_FAULT,o)}let d="0";for(;d.length<256;)d+=d;function h(e){if("number"!=typeof e)try{e=a.O$.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+d.substring(0,e):s.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);const r=h(t),n=(e=a.O$.from(e)).lt(l);n&&(e=e.mul(c));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function m(e,t){null==t&&(t=0);const r=h(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||s.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&s.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&s.throwArgumentError("too many decimal points","value",e);let o=i[0],u=i[1];for(o||(o="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&f("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.length<r.length-1;)u+="0";const l=a.O$.from(o),d=a.O$.from(u);let p=l.mul(r).add(d);return n&&(p=p.mul(c)),p}class y{constructor(e,t,r,n){e!==u&&s.throwError("cannot use FixedFormat constructor; use FixedFormat.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=h(n),Object.freeze(this)}static from(e){if(e instanceof y)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||s.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&s.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&s.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&s.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new y(u,t,r,n)}}class g{constructor(e,t,r,n){e!==u&&s.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&s.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return g.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=g.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(v.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=g.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(v.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&s.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=g.from("1"+d.substring(0,e),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&s.throwArgumentError("invalid byte width","width",e);const t=a.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return g.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,a.Zm)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),g.fromString(p(e,t),y.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=y.from(t),i=m(e,r.decimals);!r.signed&&i.lt(l)&&f("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));const a=p(i,r.decimals);return new g(u,o,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=y.from(t);if((0,n.arrayify)(e).length>r.width/8)throw new Error("overflow");let i=a.O$.from(e);r.signed&&(i=i.fromTwos(r.width));const o=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=p(i,r.decimals);return new g(u,o,s,r)}static from(e,t){if("string"==typeof e)return g.fromString(e,t);if((0,n.isBytes)(e))return g.fromBytes(e,t);try{return g.fromValue(e,0,t)}catch(e){if(e.code!==i.Logger.errors.INVALID_ARGUMENT)throw e}return s.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const v=g.from(1),b=g.from("0.5")},833:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BigNumber:()=>n.O$,FixedFormat:()=>i.xO,FixedNumber:()=>i.xs,_base16To36:()=>n.t2,_base36To16:()=>n.g$,formatFixed:()=>i.S5,parseFixed:()=>i.Ox});var n=r(2593),i=r(335)},3877:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8677).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var l=e.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c<s;c+=n)u=l(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=l(e,c,e.length,t),c=0;c<a;c++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){c(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[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];function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var l=1;l<n;l++){for(var c=u>>>26,f=67108863&u,d=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=d;h++){var p=l-h|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=h[e],c=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(c).toString(e);r=(f=f.idivn(c)).isZero()?m+r:d[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,l=0,c=0|a[0],f=8191&c,d=c>>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,v=y>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],S=8191&_,M=_>>>13,x=0|a[5],T=8191&x,E=x>>>13,k=0|a[6],P=8191&k,O=k>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],B=8191&C,F=C>>>13,L=0|a[9],D=8191&L,j=L>>>13,U=0|s[0],$=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,z=0|s[2],G=8191&z,Z=z>>>13,V=0|s[3],J=8191&V,Y=V>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,$))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(d,$)|0))<<13)|0;l=((o=Math.imul(d,q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,q))+Math.imul(m,$)|0,o=Math.imul(m,q);var ge=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;l=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,q))+Math.imul(v,$)|0,o=Math.imul(v,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var ve=(l+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,G)|0))<<13)|0;l=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,q))+Math.imul(A,$)|0,o=Math.imul(A,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var be=(l+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,$),i=(i=Math.imul(S,q))+Math.imul(M,$)|0,o=Math.imul(M,q),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,$),i=(i=Math.imul(T,q))+Math.imul(E,$)|0,o=Math.imul(E,q),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Ae=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,$),i=(i=Math.imul(P,q))+Math.imul(O,$)|0,o=Math.imul(O,q),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(l+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;l=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,q))+Math.imul(N,$)|0,o=Math.imul(N,q),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Se=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((o=o+Math.imul(d,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,q))+Math.imul(F,$)|0,o=Math.imul(F,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var Me=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;l=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(F,H)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;l=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,le)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Te=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Z))+Math.imul(j,G)|0,o=Math.imul(j,Z),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(F,J)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,le)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Ee=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,Y))+Math.imul(j,J)|0,o=Math.imul(j,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,Q)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var ke=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Pe=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(M,pe)|0))<<13)|0;l=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,le)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Oe=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,de)|0;var Ie=(l+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,le))+Math.imul(j,ue)|0,o=Math.imul(j,le),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,fe)|0,o=o+Math.imul(F,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;l=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(j,fe)|0,o=Math.imul(j,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((o=o+Math.imul(F,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(l+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(j,pe)|0))<<13)|0;return l=((o=Math.imul(j,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=_e,u[7]=Se,u[8]=Me,u[9]=xe,u[10]=Te,u[11]=Ee,u[12]=ke,u[13]=Pe,u[14]=Oe,u[15]=Ie,u[16]=Re,u[17]=Ne,u[18]=Ce,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,f=(0|e.words[c])*(0|t.words[l]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?m(this,e,t):r<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var f=u,d=l,h=0;h<a;h++){var p=r[c+h],m=n[c+h],y=r[c+h+a],g=n[c+h+a],v=f*y-d*g;g=f*g+d*y,y=v,r[c+h]=p+y,n[c+h]=m+g,r[c+h+a]=p-y,n[c+h+a]=m-g,h!==s&&(v=u*f-l*d,d=u*d+l*f,f=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),l=new Array(n),c=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,s,u,n,i),this.transform(l,o,c,f,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-o|f>>>o,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(_,A),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,A),i(M,A),i(x,A),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new S;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<p);var g=this.pow(f,new o(1).iushln(p-y-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=y}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3286:(e,t,r)=>{"use strict";r.r(t),r.d(t,{arrayify:()=>l,concat:()=>c,hexConcat:()=>v,hexDataLength:()=>y,hexDataSlice:()=>g,hexStripZeros:()=>w,hexValue:()=>b,hexZeroPad:()=>A,hexlify:()=>m,isBytes:()=>u,isBytesLike:()=>a,isHexString:()=>h,joinSignature:()=>S,splitSignature:()=>_,stripZeros:()=>f,zeroPad:()=>d});const n=new(r(711).Logger)("bytes/5.7.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return h(e)&&!(e.length%2)||u(e)}function s(e){return"number"==typeof e&&e==e&&e%1==0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!s(r)||r<0||r>=256)return!1}return!0}function l(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),h(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;e<r.length;e+=2)i.push(parseInt(r.substring(e,e+2),16));return o(new Uint8Array(i))}return u(e)?o(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function c(e){const t=e.map((e=>l(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),o(n)}function f(e){let t=l(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function d(e,t){(e=l(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function h(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const p="0123456789abcdef";function m(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=p[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=p[(240&n)>>4]+p[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function y(e){if("string"!=typeof e)e=m(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!=typeof e?e=m(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function v(e){let t="0x";return e.forEach((e=>{t+=m(e).substring(2)})),t}function b(e){const t=w(m(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!=typeof e&&(e=m(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function A(e,t){for("string"!=typeof e?e=m(e):h(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function _(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){let r=l(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=m(r.slice(0,32)),t.s=m(r.slice(32,64))):65===r.length?(t.r=m(r.slice(0,32)),t.s=m(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=m(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=d(l(t._vs),32);t._vs=m(r);const i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const o=m(r);null==t.s?t.s=o:t.s!==o&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=A(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=A(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=l(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=m(r);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=A(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function S(e){return m(c([(e=_(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7218:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});const n="0x0000000000000000000000000000000000000000000000000000000000000000"},8197:(e,t,r)=>{"use strict";r.r(t),r.d(t,{keccak256:()=>a});var n=r(1094),i=r.n(n),o=r(3286);function a(e){return"0x"+i().keccak_256((0,o.arrayify)(e))}},711:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorCode:()=>f,LogLevel:()=>c,Logger:()=>h});var n=r(5108);let i=!1,o=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=a.default,u=null;const l=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var c,f;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(c||(c={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));const d="0123456789abcdef";class h{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",e),s>a[r]||n.log.apply(n,t)}debug(...e){this._log(h.levels.DEBUG,e)}info(...e){this._log(h.levels.INFO,e)}warn(...e){this._log(h.levels.WARNING,e)}makeError(e,t,r){if(o)return this.makeError("censored error",t,{});t||(t=h.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=d[t[e]>>4],r+=d[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let a="";switch(t){case f.NUMERIC_FAULT:{a="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":a+="-"+t;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result"}break}case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:a=t}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,h.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),l&&this.throwError("platform missing String.prototype.normalize",h.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:l})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,h.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,h.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",h.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",h.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",h.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return u||(u=new h("logger/5.7.0")),u}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!e)return;this.globalLogger().throwError("error censorship permanent",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!e,i=!!t}static setLogLevel(e){const t=a[e.toLowerCase()];null!=t?s=t:h.globalLogger().warn("invalid log level - "+e)}static from(e){return new h(e)}}h.errors=f,h.levels=c},3587:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Description:()=>m,checkProperties:()=>l,deepCopy:()=>p,defineReadOnly:()=>a,getStatic:()=>s,resolveProperties:()=>u,shallowCopy:()=>c});var n=r(711),i=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const o=new n.Logger("properties/5.7.0");function a(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function u(e){return i(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function l(e,t){e&&"object"==typeof e||o.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||o.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function c(e){const t={};for(const r in e)t[r]=e[r];return t}const f={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function d(e){if(null==e||f[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!d(n))return!1}return!0}return o.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function h(e){if(d(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>p(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&a(t,r,p(n))}return t}return o.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function p(e){return h(e)}class m{constructor(e){for(const t in e)this[t]=p(e[t])}}},2500:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2808).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var l=e.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c<s;c+=n)u=l(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=l(e,c,e.length,t),c=0;c<a;c++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){c(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[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];function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var l=1;l<n;l++){for(var c=u>>>26,f=67108863&u,d=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=d;h++){var p=l-h|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=h[e],c=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(c).toString(e);r=(f=f.idivn(c)).isZero()?m+r:d[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,l=0,c=0|a[0],f=8191&c,d=c>>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,v=y>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],S=8191&_,M=_>>>13,x=0|a[5],T=8191&x,E=x>>>13,k=0|a[6],P=8191&k,O=k>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],B=8191&C,F=C>>>13,L=0|a[9],D=8191&L,j=L>>>13,U=0|s[0],$=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,z=0|s[2],G=8191&z,Z=z>>>13,V=0|s[3],J=8191&V,Y=V>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,$))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(d,$)|0))<<13)|0;l=((o=Math.imul(d,q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,q))+Math.imul(m,$)|0,o=Math.imul(m,q);var ge=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;l=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,q))+Math.imul(v,$)|0,o=Math.imul(v,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var ve=(l+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,G)|0))<<13)|0;l=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,q))+Math.imul(A,$)|0,o=Math.imul(A,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var be=(l+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,$),i=(i=Math.imul(S,q))+Math.imul(M,$)|0,o=Math.imul(M,q),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,$),i=(i=Math.imul(T,q))+Math.imul(E,$)|0,o=Math.imul(E,q),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Ae=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,$),i=(i=Math.imul(P,q))+Math.imul(O,$)|0,o=Math.imul(O,q),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(l+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;l=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,q))+Math.imul(N,$)|0,o=Math.imul(N,q),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Se=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((o=o+Math.imul(d,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,q))+Math.imul(F,$)|0,o=Math.imul(F,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var Me=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;l=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(F,H)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;l=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,le)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Te=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Z))+Math.imul(j,G)|0,o=Math.imul(j,Z),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(F,J)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,le)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Ee=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,Y))+Math.imul(j,J)|0,o=Math.imul(j,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,Q)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var ke=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Pe=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(M,pe)|0))<<13)|0;l=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,le)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Oe=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,de)|0;var Ie=(l+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,le))+Math.imul(j,ue)|0,o=Math.imul(j,le),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,fe)|0,o=o+Math.imul(F,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;l=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(j,fe)|0,o=Math.imul(j,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((o=o+Math.imul(F,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(l+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(j,pe)|0))<<13)|0;return l=((o=Math.imul(j,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=_e,u[7]=Se,u[8]=Me,u[9]=xe,u[10]=Te,u[11]=Ee,u[12]=ke,u[13]=Pe,u[14]=Oe,u[15]=Ie,u[16]=Re,u[17]=Ne,u[18]=Ce,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,f=(0|e.words[c])*(0|t.words[l]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?m(this,e,t):r<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var f=u,d=l,h=0;h<a;h++){var p=r[c+h],m=n[c+h],y=r[c+h+a],g=n[c+h+a],v=f*y-d*g;g=f*g+d*y,y=v,r[c+h]=p+y,n[c+h]=m+g,r[c+h+a]=p-y,n[c+h+a]=m-g,h!==s&&(v=u*f-l*d,d=u*d+l*f,f=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),l=new Array(n),c=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,s,u,n,i),this.transform(l,o,c,f,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-o|f>>>o,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(_,A),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,A),i(M,A),i(x,A),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new S;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<p);var g=this.pow(f,new o(1).iushln(p-y-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=y}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6237:(e,t,r)=>{"use strict";r.d(t,{F:()=>s,s:()=>a});var n=r(7218),i=r(3286),o=r(4242);function a(e){const t=(0,o.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,n.R]).slice(0,32))}function s(e){const t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,o.ZN)(t.slice(0,r))}},5637:(e,t,r)=>{"use strict";r.d(t,{Ll:()=>p});var n=r(4242);function i(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function o(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function a(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const s=o("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),u="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),l=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],c=i("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),f=i("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),d=i("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),h=o("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function p(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=(0,n.XL)(e);var r;r=t.map((e=>{if(u.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=a(e,l);if(t)return[e+t.s];let r=c[e];if(r)return r;let n=f[e];return n?[e+n[0]]:d[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,n.XL)((0,n.uu)(t),n.Uj.NFKC),t.forEach((e=>{if(a(e,h))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(a(e,s))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let i=(0,n.uu)(t);if("-"===i.substring(0,1)||"--"===i.substring(2,4)||"-"===i.substring(i.length-1))throw new Error("invalid hyphen");return i}},2741:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:()=>o.Uj,Utf8ErrorFuncs:()=>o.te,Utf8ErrorReason:()=>o.Uw,_toEscapedUtf8String:()=>o.U$,formatBytes32String:()=>n.s,nameprep:()=>i.Ll,parseBytes32String:()=>n.F,toUtf8Bytes:()=>o.Y0,toUtf8CodePoints:()=>o.XL,toUtf8String:()=>o.ZN});var n=r(6237),i=r(5637),o=r(4242)},4242:(e,t,r)=>{"use strict";r.d(t,{Uj:()=>o,te:()=>u,Uw:()=>a,U$:()=>d,uu:()=>h,Y0:()=>c,XL:()=>m,ZN:()=>p});var n=r(3286);const i=new(r(711).Logger)("strings/5.7.0");var o,a;function s(e,t,r,n,i){if(e===a.BAD_PREFIX||e===a.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===a.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(o||(o={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(a||(a={}));const u=Object.freeze({error:function(e,t,r,n,o){return i.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:s,replace:function(e,t,r,n,i){return e===a.OVERLONG?(n.push(i),0):(n.push(65533),s(e,t,r))}});function l(e,t){null==t&&(t=u.error),e=(0,n.arrayify)(e);const r=[];let i=0;for(;i<e.length;){const n=e[i++];if(n>>7==0){r.push(n);continue}let o=null,s=null;if(192==(224&n))o=1,s=127;else if(224==(240&n))o=2,s=2047;else{if(240!=(248&n)){i+=t(128==(192&n)?a.UNEXPECTED_CONTINUE:a.BAD_PREFIX,i-1,e,r);continue}o=3,s=65535}if(i-1+o>=e.length){i+=t(a.OVERRUN,i-1,e,r);continue}let u=n&(1<<8-o-1)-1;for(let n=0;n<o;n++){let n=e[i];if(128!=(192&n)){i+=t(a.MISSING_CONTINUE,i,e,r),u=null;break}u=u<<6|63&n,i++}null!==u&&(u>1114111?i+=t(a.OUT_OF_RANGE,i-1-o,e,r,u):u>=55296&&u<=57343?i+=t(a.UTF16_SURROGATE,i-1-o,e,r,u):u<=s?i+=t(a.OVERLONG,i-1-o,e,r,u):r.push(u))}return r}function c(e,t=o.current){t!=o.current&&(i.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function f(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function d(e,t){return'"'+l(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?f(e):f(55296+((e-=65536)>>10&1023))+f(56320+(1023&e))})).join("")+'"'}function h(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function p(e,t){return h(l(e,t))}function m(e,t=o.current){return l(c(e,t))}},8826:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},l=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(s[(240&n)>>4]+s[15&n])}return t.join("")}}),c={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],y=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],v=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],A=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],M=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],x=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function T(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var E=function(e){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};E.prototype._prepare=function(){var e=c[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,o=T(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,u=i;u<n;){if(a=o[i-1],o[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^f[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];for(a=o[i/2-1],o[i/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&u<n;)l=u>>2,h=u%4,this._Ke[l][h]=o[t],this._Kd[e-l][h]=o[t++],u++}for(var l=1;l<e;l++)for(var h=0;h<4;h++)a=this._Kd[l][h],this._Kd[l][h]=_[a>>24&255]^S[a>>16&255]^M[a>>8&255]^x[255&a]},E.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=T(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a<t;a++){for(i=0;i<4;i++)r[i]=p[n[i]>>24&255]^m[n[(i+1)%4]>>16&255]^y[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,u=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(d[n[i]>>24&255]^s>>24),u[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return u},E.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=T(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a<t;a++){for(i=0;i<4;i++)r[i]=v[n[i]>>24&255]^b[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,u=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(h[n[i]>>24&255]^s>>24),u[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return u};var k=function(e){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(e)};k.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.encrypt(r),t,n);return t},k.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.decrypt(r),t,n);return t};var P=function(e,t){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastCipherblock=i(t,!0),this._aes=new E(e)};P.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,t,n)}return t},P.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[n+s]=r[s]^this._lastCipherblock[s];a(e,this._lastCipherblock,0,n,n+16)}return t};var O=function(e,t,r){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=o(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new E(e)};O.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},O.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var I=function(e,t){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new E(e)};I.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},I.prototype.decrypt=I.prototype.encrypt;var R=function(e){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=o(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");for(var t=15;t>=0;--t)this._counter[t]=e%256,e>>=8},R.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var N=function(e,t){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new E(e)};N.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},N.prototype.decrypt=N.prototype.encrypt;var C={AES:E,Counter:R,ModeOfOperation:{ecb:k,cbc:P,cfb:O,ofb:I,ctr:N},utils:{hex:l,utf8:u},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);a(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var s=o(r);return a(e,s,0,0,r),s}}},_arrayTest:{coerceArray:i,createArray:o,copyArray:a}};e.exports=C}()},9282:(e,t,r)=>{"use strict";var n=r(4155),i=r(5108);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a,s,u=r(2136).codes,l=u.ERR_AMBIGUOUS_ARGUMENT,c=u.ERR_INVALID_ARG_TYPE,f=u.ERR_INVALID_ARG_VALUE,d=u.ERR_INVALID_RETURN_VALUE,h=u.ERR_MISSING_ARGS,p=r(5961),m=r(9539).inspect,y=r(9539).types,g=y.isPromise,v=y.isRegExp,b=Object.assign?Object.assign:r(8091).assign,w=Object.is?Object.is:r(609);function A(){var e=r(9158);a=e.isDeepEqual,s=e.isDeepStrictEqual}new Map;var _=!1,S=e.exports=E,M={};function x(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function T(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.apply(void 0,[E,t.length].concat(t))}S.fail=function e(t,r,o,a,s){var u,l=arguments.length;if(0===l?u="Failed":1===l?(o=t,t=void 0):(!1===_&&(_=!0,(n.emitWarning?n.emitWarning:i.warn.bind(i))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===l&&(a="!=")),o instanceof Error)throw o;var c={actual:t,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||e};void 0!==o&&(c.message=o);var f=new p(c);throw u&&(f.message=u,f.generatedMessage=!0),f},S.AssertionError=p,S.ok=E,S.equal=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");t!=r&&x({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},S.notEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");t==r&&x({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},S.deepEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");void 0===a&&A(),a(t,r)||x({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},S.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");void 0===a&&A(),a(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},S.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");void 0===a&&A(),s(t,r)||x({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},S.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");void 0===a&&A(),s(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},S.strictEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");w(t,r)||x({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},S.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new h("actual","expected");w(t,r)&&x({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var k=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function P(e,t,r,n){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new c("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new p({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var u=Object.keys(t);if(t instanceof Error)u.push("name","message");else if(0===u.length)throw new f("error",t,"may not be an empty object");return void 0===a&&A(),u.forEach((function(i){"string"==typeof e[i]&&v(t[i])&&t[i].test(e[i])||function(e,t,r,n,i,o){if(!(r in e)||!s(e[r],t[r])){if(!n){var a=new k(e,i),u=new k(t,i,e),l=new p({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw l.actual=e,l.expected=t,l.operator=o.name,l}x({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,i,r,u,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function O(e){if("function"!=typeof e)throw new c("fn","Function",e);try{e()}catch(e){return e}return M}function I(e){return g(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function R(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!I(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!I(e))throw new c("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return M})).catch((function(e){return e}))}))}function N(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new l("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new l("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new c("error",["Object","Error","Function","RegExp"],r);if(t===M){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";x({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:e})}if(r&&!P(t,r,n,e))throw t}function C(e,t,r,n){if(t!==M){if("string"==typeof r&&(n=r,r=void 0),!r||P(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";x({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function B(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.apply(void 0,[B,t.length].concat(t))}S.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];N.apply(void 0,[e,O(t)].concat(n))},S.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return R(t).then((function(t){return N.apply(void 0,[e,t].concat(n))}))},S.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];C.apply(void 0,[e,O(t)].concat(n))},S.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return R(t).then((function(t){return C.apply(void 0,[e,t].concat(n))}))},S.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=m(t);var n=new p({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var l=s.indexOf(a[u]);if(-1!==l){s=s.slice(0,l);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},S.strict=b(B,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},5961:(e,t,r)=>{"use strict";var n=r(4155);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},u(e)}function l(e,t,r){return l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i},l.apply(null,arguments)}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var h=r(9539).inspect,p=r(2136).codes.ERR_INVALID_ARG_TYPE;function m(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var y="",g="",v="",b="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},A=10;function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function S(e){return h(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var M=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==d(e)||null===e)throw new p("options","Object",e);var i=e.message,o=e.operator,u=e.stackStartFn,l=e.actual,c=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,f(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(y="",g="",b="",v=""):(y="",g="",b="",v="")),"object"===d(l)&&null!==l&&"object"===d(c)&&null!==c&&"stack"in l&&l instanceof Error&&"stack"in c&&c instanceof Error&&(l=_(l),c=_(c)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,f(t).call(this,function(e,t,r){var i="",o="",a=0,s="",u=!1,l=S(e),c=l.split("\n"),f=S(t).split("\n"),h=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===f.length&&c[0]!==f[0]){var _=c[0].length+f[0].length;if(_<=A){if(!("object"===d(e)&&null!==e||"object"===d(t)&&null!==t||0===e&&0===t))return"".concat(w[r],"\n\n")+"".concat(c[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&_<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;c[0][h]===f[0][h];)h++;h>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var M=c[c.length-1],x=f[f.length-1];M===x&&(h++<2?s="\n ".concat(M).concat(s):i=M,c.pop(),f.pop(),0!==c.length&&0!==f.length);)M=c[c.length-1],x=f[f.length-1];var T=Math.max(c.length,f.length);if(0===T){var E=l.split("\n");if(E.length>30)for(E[26]="".concat(y,"...").concat(b);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}h>3&&(s="\n".concat(y,"...").concat(b).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var k=0,P=w[r]+"\n".concat(g,"+ actual").concat(b," ").concat(v,"- expected").concat(b),O=" ".concat(y,"...").concat(b," Lines skipped");for(h=0;h<T;h++){var I=h-a;if(c.length<h+1)I>1&&h>2&&(I>4?(o+="\n".concat(y,"...").concat(b),u=!0):I>3&&(o+="\n ".concat(f[h-2]),k++),o+="\n ".concat(f[h-1]),k++),a=h,i+="\n".concat(v,"-").concat(b," ").concat(f[h]),k++;else if(f.length<h+1)I>1&&h>2&&(I>4?(o+="\n".concat(y,"...").concat(b),u=!0):I>3&&(o+="\n ".concat(c[h-2]),k++),o+="\n ".concat(c[h-1]),k++),a=h,o+="\n".concat(g,"+").concat(b," ").concat(c[h]),k++;else{var R=f[h],N=c[h],C=N!==R&&(!m(N,",")||N.slice(0,-1)!==R);C&&m(R,",")&&R.slice(0,-1)===N&&(C=!1,N+=","),C?(I>1&&h>2&&(I>4?(o+="\n".concat(y,"...").concat(b),u=!0):I>3&&(o+="\n ".concat(c[h-2]),k++),o+="\n ".concat(c[h-1]),k++),a=h,o+="\n".concat(g,"+").concat(b," ").concat(N),i+="\n".concat(v,"-").concat(b," ").concat(R),k+=2):(o+=i,i="",1!==I&&0!==h||(o+="\n ".concat(N),k++))}if(k>20&&h<T-2)return"".concat(P).concat(O,"\n").concat(o,"\n").concat(y,"...").concat(b).concat(i,"\n")+"".concat(y,"...").concat(b)}return"".concat(P).concat(u?O:"","\n").concat(o).concat(i).concat(s).concat(p)}(l,c,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var M=w[o],x=S(l).split("\n");if("notStrictEqual"===o&&"object"===d(l)&&null!==l&&(M=w.notStrictEqualObject),x.length>30)for(x[26]="".concat(y,"...").concat(b);x.length>27;)x.pop();r=1===x.length?a(this,f(t).call(this,"".concat(M," ").concat(x[0]))):a(this,f(t).call(this,"".concat(M,"\n\n").concat(x.join("\n"),"\n")))}else{var T=S(l),E="",k=w[o];"notDeepEqual"===o||"notEqual"===o?(T="".concat(w[o],"\n\n").concat(T)).length>1024&&(T="".concat(T.slice(0,1021),"...")):(E="".concat(S(c)),T.length>512&&(T="".concat(T.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?T="".concat(k,"\n\n").concat(T,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=a(this,f(t).call(this,"".concat(T).concat(E)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=l,r.expected=c,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),u),r.stack,r.name="AssertionError",a(r)}var r,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(t,e),r=t,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(e,t){return h(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],u&&o(r.prototype,u),t}(u(Error));e.exports=M},2136:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var a,s,u={};function l(e,t,r){r||(r=Error);var a=function(r){function a(r,o,s){var u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),u=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(a).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,s))),u.code=e,u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,r),a}(r);u[e]=a}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,u,l,f;if(void 0===a&&(a=r(9282)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,s.length)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(o," ").concat(c(t,"type"));else{var d=("number"!=typeof f&&(f=0),f+".".length>(l=e).length||-1===l.indexOf(".",f)?"argument":"property");u='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(c(t,"type"))}return u+". Received type ".concat(n(i))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(9539));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===a&&(a=r(9282)),a(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=u},9158:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},u=Object.is?Object.is:r(609),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},c=Number.isNaN?Number.isNaN:r(360);function f(e){return e.call.bind(e)}var d=f(Object.prototype.hasOwnProperty),h=f(Object.prototype.propertyIsEnumerable),p=f(Object.prototype.toString),m=r(9539).types,y=m.isAnyArrayBuffer,g=m.isArrayBufferView,v=m.isDate,b=m.isMap,w=m.isRegExp,A=m.isSet,_=m.isNativeError,S=m.isBoxedPrimitive,M=m.isNumberObject,x=m.isStringObject,T=m.isBooleanObject,E=m.isBigIntObject,k=m.isSymbolObject,P=m.isFloat32Array,O=m.isFloat64Array;function I(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(I).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function N(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}var C=0,B=1,F=2,L=3;function D(e,t,r,n){if(e===t)return 0!==e||!r||u(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&c(e)&&c(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var a,s,l,f,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var h=R(e),m=R(t);return h.length===m.length&&U(e,t,r,n,B,h)}if("[object Object]"===d&&(!b(e)&&b(t)||!A(e)&&A(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(l=e,f=t,!(o?l.source===f.source&&l.flags===f.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(f))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(g(e)){if(r||!P(e)&&!O(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===N(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var I=R(e),D=R(t);return I.length===D.length&&U(e,t,r,n,C,I)}if(A(e))return!(!A(t)||e.size!==t.size)&&U(e,t,r,n,F);if(b(e))return!(!b(t)||e.size!==t.size)&&U(e,t,r,n,L);if(y(e)){if(s=t,(a=e).byteLength!==s.byteLength||0!==N(new Uint8Array(a),new Uint8Array(s)))return!1}else if(S(e)&&!function(e,t){return M(e)?M(t)&&u(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):x(e)?x(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):T(e)?T(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):E(e)?E(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):k(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return U(e,t,r,n,C)}function j(e,t){return t.filter((function(t){return h(e,t)}))}function U(e,t,r,o,u,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var p=0;p<c.length;p++)if(!d(t,c[p]))return!1;if(r&&5===arguments.length){var m=l(e);if(0!==m.length){var y=0;for(p=0;p<m.length;p++){var g=m[p];if(h(e,g)){if(!h(t,g))return!1;c.push(g),y++}else if(h(t,g))return!1}var v=l(t);if(m.length!==v.length&&j(t,v).length!==y)return!1}else{var b=l(t);if(0!==b.length&&0!==j(t,b).length)return!1}}if(0===c.length&&(u===C||u===B&&0===e.length||0===e.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(e);if(void 0!==w){var A=o.val2.get(t);if(void 0!==A)return w===A}o.position++}o.val1.set(e,o.position),o.val2.set(t,o.position);var _=function(e,t,r,o,u,l){var c=0;if(l===F){if(!function(e,t,r,n){for(var o=null,s=a(e),u=0;u<s.length;u++){var l=s[u];if("object"===i(l)&&null!==l)null===o&&(o=new Set),o.add(l);else if(!t.has(l)){if(r)return!1;if(!K(e,t,l))return!1;null===o&&(o=new Set),o.add(l)}}if(null!==o){for(var c=a(t),f=0;f<c.length;f++){var d=c[f];if("object"===i(d)&&null!==d){if(!$(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!$(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,u))return!1}else if(l===L){if(!function(e,t,r,o){for(var a=null,u=s(e),l=0;l<u.length;l++){var c=n(u[l],2),f=c[0],d=c[1];if("object"===i(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var h=t.get(f);if(void 0===h&&!t.has(f)||!D(d,h,r,o)){if(r)return!1;if(!H(e,t,f,d,o))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var p=s(t),m=0;m<p.length;m++){var y=n(p[m],2),g=(f=y[0],y[1]);if("object"===i(f)&&null!==f){if(!W(a,e,f,g,r,o))return!1}else if(!(r||e.has(f)&&D(e.get(f),g,!1,o)||W(a,e,f,g,!1,o)))return!1}return 0===a.size}return!0}(e,t,r,u))return!1}else if(l===B)for(;c<e.length;c++){if(!d(e,c)){if(d(t,c))return!1;for(var f=Object.keys(e);c<f.length;c++){var h=f[c];if(!d(t,h)||!D(e[h],t[h],r,u))return!1}return f.length===Object.keys(t).length}if(!d(t,c)||!D(e[c],t[c],r,u))return!1}for(c=0;c<o.length;c++){var p=o[c];if(!D(e[p],t[p],r,u))return!1}return!0}(e,t,r,c,o,u);return o.val1.delete(e),o.val2.delete(t),_}function $(e,t,r,n){for(var i=a(e),o=0;o<i.length;o++){var s=i[o];if(D(t,s,r,n))return e.delete(s),!0}return!1}function q(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(c(e))return!1}return!0}function K(e,t,r){var n=q(r);return null!=n?n:t.has(n)&&!e.has(n)}function H(e,t,r,n,i){var o=q(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!D(n,a,!1,i))&&!e.has(o)&&D(n,a,!1,i)}function W(e,t,r,n,i,o){for(var s=a(e),u=0;u<s.length;u++){var l=s[u];if(D(r,l,i,o)&&D(n,t.get(l),i,o))return e.delete(l),!0}return!1}e.exports={isDeepEqual:function(e,t){return D(e,t,false)},isDeepStrictEqual:function(e,t){return D(e,t,true)}}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),a=o[0],s=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(l(e,s,s+a>u?u:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2882:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<t.length;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(t=o(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=o(t)^31&i}return t}function s(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var u=e.slice(0,s),l=e.slice(s+1);if(l.length<6)return"Data too short";var c=a(u);if("string"==typeof c)return c;for(var f=[],d=0;d<l.length;++d){var h=l.charAt(d),p=r[h];if(void 0===p)return"Unknown character "+h;c=o(c)^p,d+6>=l.length||f.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=s.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=s.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var s=e+"1",u=0;u<r.length;++u){var l=r[u];if(l>>5!=0)throw new Error("Non 5-bit word");i=o(i)^l,s+=t.charAt(l)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){s+=t.charAt(i>>5*(5-u)&31)}return s},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},4431:function(e,t,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,l="[BigNumber Error] ",c=l+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,y=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,u=e.e,l=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==l,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>l^r?1:-1;for(s=(u=i.length)<(l=o.length)?u:l,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return u==l?0:u>l^r?1:-1}function w(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(l+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return g(e.e/d)==t&&e.c[t]%2!=0}function _(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function S(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,i,o,M,x,T,E,k,P,O=H.prototype={constructor:H,toString:null,valueOf:null},I=new H(1),R=20,N=4,C=-7,B=21,F=-1e7,L=1e7,D=!1,j=1,U=0,$={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz",K=!0;function H(e,t){var r,o,s,l,f,p,m,y,g=this;if(!(g instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>L?g.c=g.e=null:e.e<F?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,f=e;f>=10;f/=10,l++);return void(l>L?g.c=g.e=null:(g.e=l,g.c=[e]))}y=String(e)}else{if(!a.test(y=String(e)))return i(g,y,p);g.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(l=y.indexOf("."))>-1&&(y=y.replace(".","")),(f=y.search(/e/i))>0?(l<0&&(l=f),l+=+y.slice(f+1),y=y.substring(0,f)):l<0&&(l=y.length)}else{if(w(t,2,q.length,"Base"),10==t&&K)return Z(g=new H(e),R+g.e+1,N);if(y=String(e),p="number"==typeof e){if(0*e!=0)return i(g,y,p,t);if(g.s=1/e<0?(y=y.slice(1),-1):1,H.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(c+e)}else g.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=q.slice(0,t),l=f=0,m=y.length;f<m;f++)if(r.indexOf(o=y.charAt(f))<0){if("."==o){if(f>l){l=m;continue}}else if(!s&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){s=!0,f=-1,l=0;continue}return i(g,String(e),p,t)}p=!1,(l=(y=n(y,t,10,g.s)).indexOf("."))>-1?y=y.replace(".",""):l=y.length}for(f=0;48===y.charCodeAt(f);f++);for(m=y.length;48===y.charCodeAt(--m););if(y=y.slice(f,++m)){if(m-=f,p&&H.DEBUG&&m>15&&(e>h||e!==u(e)))throw Error(c+g.s*e);if((l=l-f-1)>L)g.c=g.e=null;else if(l<F)g.c=[g.e=0];else{if(g.e=l,g.c=[],f=(l+1)%d,l<0&&(f+=d),f<m){for(f&&g.c.push(+y.slice(0,f)),m-=d;f<m;)g.c.push(+y.slice(f,f+=d));f=d-(y=y.slice(f)).length}else f-=m;for(;f--;y+="0");g.c.push(+y)}}else g.c=[g.e=0]}function W(e,t,r,n){var i,o,a,s,u;if(null==r?r=N:w(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=v(e.c),u=1==n||2==n&&(a<=C||a>=B)?_(u,a):S(u,a,"0");else if(o=(e=Z(new H(e),t,r)).e,s=(u=v(e.c)).length,1==n||2==n&&(t<=o||o<=C)){for(;s<t;u+="0",s++);u=_(u,o)}else if(t-=a,u=S(u,o,"0"),o+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function z(e,t){for(var r,n=1,i=new H(e[0]);n<e.length;n++){if(!(r=new H(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function G(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>L?e.c=e.e=null:r<F?e.c=[e.e=0]:(e.e=r,e.c=t),e}function Z(e,t,r,n){var i,o,a,l,c,h,m,y=e.c,g=p;if(y){e:{for(i=1,l=y[0];l>=10;l/=10,i++);if((o=t-i)<0)o+=d,a=t,m=(c=y[h=0])/g[i-a-1]%10|0;else if((h=s((o+1)/d))>=y.length){if(!n)break e;for(;y.length<=h;y.push(0));c=m=0,i=1,a=(o%=d)-d+1}else{for(c=l=y[h],i=1;l>=10;l/=10,i++);m=(a=(o%=d)-d+i)<0?0:c/g[i-a-1]%10|0}if(n=n||t<0||null!=y[h+1]||(a<0?c:c%g[i-a-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(o>0?a>0?c/g[i-a]:0:y[h-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=g[(d-t%d)%d],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=h,l=1,h--):(y.length=h+1,l=g[d-o],y[h]=a>0?u(c/g[i-a]%g[a])*l:0),n)for(;;){if(0==h){for(o=1,a=y[0];a>=10;a/=10,o++);for(a=y[0]+=l,l=1;a>=10;a/=10,l++);o!=l&&(e.e++,y[0]==f&&(y[0]=1));break}if(y[h]+=l,y[h]!=f)break;y[h--]=0,l=1}for(o=y.length;0===y[--o];y.pop());}e.e>L?e.c=e.e=null:e.e<F&&(e.c=[e.e=0])}return e}function V(e){var t,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=C||r>=B?_(t,r):S(t,r,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(l+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,y,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),N=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-y,0,t),w(r[1],0,y,t),C=r[0],B=r[1]):(w(r,-y,y,t),C=-(B=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-y,-1,t),w(r[1],1,y,t),F=r[0],L=r[1];else{if(w(r,-y,y,t),!r)throw Error(l+t+" cannot be zero: "+r);F=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(l+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!r,Error(l+"crypto unavailable");D=r}else D=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),j=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,y,t),U=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(l+t+" not an object: "+r);$=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(l+t+" invalid: "+r);K="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:N,EXPONENTIAL_AT:[C,B],RANGE:[F,L],CRYPTO:D,MODULO_MODE:j,POW_PRECISION:U,FORMAT:$,ALPHABET:q}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-y&&i<=y&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(l+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return z(arguments,O.lt)},H.minimum=H.min=function(){return z(arguments,O.gt)},H.random=(o=9007199254740992,M=Math.random()*o&2097151?function(){return u(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,a=0,c=[],f=new H(I);if(null==e?e=R:w(e,0,y),i=s(e/d),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*t[a]+(t[a+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(c.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw D=!1,Error(l+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&t[a])+1099511627776*t[a+1]+4294967296*t[a+2]+16777216*t[a+3]+(t[a+4]<<16)+(t[a+5]<<8)+t[a+6])>=9e15?crypto.randomBytes(7).copy(t,a):(c.push(o%1e14),a+=7);a=i/7}if(!D)for(;a<i;)(o=M())<9e15&&(c[a++]=o%1e14);for(i=c[--a],e%=d,i&&e&&(o=p[d-e],c[a]=u(i/o)*o);0===c[a];c.pop(),a--);if(a<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=d);for(a=1,o=c[0];o>=10;o/=10,a++);a<d&&(n-=d-a)}return f.e=n,f.c=c,f}),H.sum=function(){for(var e=1,t=arguments,r=new H(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],s=0,u=e.length;s<u;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var u,l,c,f,d,h,p,m,y=n.indexOf("."),g=R,b=N;for(y>=0&&(f=U,U=0,n=n.replace(".",""),h=(m=new H(i)).pow(n.length-y),U=f,m.c=t(S(v(h.c),h.e,"0"),10,o,e),m.e=m.c.length),c=f=(p=t(n,i,o,s?(u=q,e):(u=e,q))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(y<0?--c:(h.c=p,h.e=c,h.s=a,p=(h=r(h,m,g,b,o)).c,d=h.r,c=h.e),y=p[l=c+g+1],f=o/2,d=d||l<0||null!=p[l+1],d=b<4?(null!=y||d)&&(0==b||b==(h.s<0?3:2)):y>f||y==f&&(4==b||d||6==b&&1&p[l-1]||b==(h.s<0?8:7)),l<1||!p[0])n=d?S(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(p.length=l,d)for(--o;++p[--l]>o;)p[l]=0,l||(++c,p=[1].concat(p));for(f=p.length;!p[--f];);for(y=0,n="";y<=f;n+=u.charAt(p[y++]));n=S(n,c,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,u=e.length,l=t%m,c=t/m|0;for(e=e.slice();u--;)s=((i=l*(o=e[u]%m)+(n=c*o+(a=e[u]/m|0)*l)%m*m+s)/r|0)+(n/m|0)+c*a,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var l,c,h,p,m,y,v,b,w,A,_,S,M,x,T,E,k,P=n.s==i.s?1:-1,O=n.c,I=i.c;if(!(O&&O[0]&&I&&I[0]))return new H(n.s&&i.s&&(O?!I||O[0]!=I[0]:I)?O&&0==O[0]||!I?0*P:P/0:NaN);for(w=(b=new H(P)).c=[],P=o+(c=n.e-i.e)+1,s||(s=f,c=g(n.e/d)-g(i.e/d),P=P/d|0),h=0;I[h]==(O[h]||0);h++);if(I[h]>(O[h]||0)&&c--,P<0)w.push(1),p=!0;else{for(x=O.length,E=I.length,h=0,P+=2,(m=u(s/(I[0]+1)))>1&&(I=e(I,m,s),O=e(O,m,s),E=I.length,x=O.length),M=E,_=(A=O.slice(0,E)).length;_<E;A[_++]=0);k=I.slice(),k=[0].concat(k),T=I[0],I[1]>=s/2&&T++;do{if(m=0,(l=t(I,A,E,_))<0){if(S=A[0],E!=_&&(S=S*s+(A[1]||0)),(m=u(S/T))>1)for(m>=s&&(m=s-1),v=(y=e(I,m,s)).length,_=A.length;1==t(y,A,v,_);)m--,r(y,E<v?k:I,v,s),v=y.length,l=1;else 0==m&&(l=m=1),v=(y=I.slice()).length;if(v<_&&(y=[0].concat(y)),r(A,y,_,s),_=A.length,-1==l)for(;t(I,A,E,_)<1;)m++,r(A,E<_?k:I,_,s),_=A.length}else 0===l&&(m++,A=[0]);w[h++]=m,A[0]?A[_++]=O[M]||0:(A=[O[M]],_=1)}while((M++<x||null!=A[0])&&P--);p=null!=A[0],w[0]||w.splice(0,1)}if(s==f){for(h=1,P=w[0];P>=10;P/=10,h++);Z(b,o+(b.e=h+c*d-1)+1,a,p)}else b.e=c,b.r=+p;return b}}(),x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,E=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(P,"");if(k.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(x,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(T,"$1").replace(E,"0.$1")),t!=o))return new H(o,i);if(H.DEBUG)throw Error(l+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},O.absoluteValue=O.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},O.comparedTo=function(e,t){return b(this,new H(e,t))},O.decimalPlaces=O.dp=function(e,t){var r,n,i,o=this;if(null!=e)return w(e,0,y),null==t?t=N:w(t,0,8),Z(new H(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-g(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},O.dividedBy=O.div=function(e,t){return r(this,new H(e,t),R,N)},O.dividedToIntegerBy=O.idiv=function(e,t){return r(this,new H(e,t),0,1)},O.exponentiatedBy=O.pow=function(e,t){var r,n,i,o,a,c,f,h,p=this;if((e=new H(e)).c&&!e.isInteger())throw Error(l+"Exponent not an integer: "+V(e));if(null!=t&&(t=new H(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new H(Math.pow(+V(p),a?e.s*(2-A(e)):+V(e))),t?h.mod(t):h;if(c=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(n=!c&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&A(e)?-0:0,p.e>-1&&(o=1/o),new H(c?1/o:o);U&&(o=s(U/d+2))}for(a?(r=new H(.5),c&&(e.s=1),f=A(e)):f=(i=Math.abs(+V(e)))%2,h=new H(I);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(Z(e=e.times(r),e.e+1,1),e.e>14)f=A(e);else{if(0==(i=+V(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(c&&(h=I.div(h)),t?h.mod(t):o?Z(h,U,N,void 0):h)},O.integerValue=function(e){var t=new H(this);return null==e?e=N:w(e,0,8),Z(t,t.e+1,e)},O.isEqualTo=O.eq=function(e,t){return 0===b(this,new H(e,t))},O.isFinite=function(){return!!this.c},O.isGreaterThan=O.gt=function(e,t){return b(this,new H(e,t))>0},O.isGreaterThanOrEqualTo=O.gte=function(e,t){return 1===(t=b(this,new H(e,t)))||0===t},O.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},O.isLessThan=O.lt=function(e,t){return b(this,new H(e,t))<0},O.isLessThanOrEqualTo=O.lte=function(e,t){return-1===(t=b(this,new H(e,t)))||0===t},O.isNaN=function(){return!this.s},O.isNegative=function(){return this.s<0},O.isPositive=function(){return this.s>0},O.isZero=function(){return!!this.c&&0==this.c[0]},O.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/d,l=e.e/d,c=a.c,h=e.c;if(!u||!l){if(!c||!h)return c?(e.s=-t,e):new H(h?a:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new H(c[0]?a:3==N?-0:0)}if(u=g(u),l=g(l),c=c.slice(),s=u-l){for((o=s<0)?(s=-s,i=c):(l=u,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=c.length)<(t=h.length))?s:t,s=t=0;t<n;t++)if(c[t]!=h[t]){o=c[t]<h[t];break}if(o&&(i=c,c=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=c.length))>0)for(;t--;c[r++]=0);for(t=f-1;n>s;){if(c[--n]<h[n]){for(r=n;r&&!c[--r];c[r]=t);--c[r],c[n]+=f}c[n]-=h[n]}for(;0==c[0];c.splice(0,1),--l);return c[0]?G(e,c,l):(e.s=3==N?-1:1,e.c=[e.e=0],e)},O.modulo=O.mod=function(e,t){var n,i,o=this;return e=new H(e,t),!o.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||o.c&&!o.c[0]?new H(o):(9==j?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,j),(e=o.minus(n.times(e))).c[0]||1!=j||(e.s=o.s),e)},O.multipliedBy=O.times=function(e,t){var r,n,i,o,a,s,u,l,c,h,p,y,v,b,w,A=this,_=A.c,S=(e=new H(e,t)).c;if(!(_&&S&&_[0]&&S[0]))return!A.s||!e.s||_&&!_[0]&&!S||S&&!S[0]&&!_?e.c=e.e=e.s=null:(e.s*=A.s,_&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=g(A.e/d)+g(e.e/d),e.s*=A.s,(u=_.length)<(h=S.length)&&(v=_,_=S,S=v,i=u,u=h,h=i),i=u+h,v=[];i--;v.push(0));for(b=f,w=m,i=h;--i>=0;){for(r=0,p=S[i]%w,y=S[i]/w|0,o=i+(a=u);o>i;)r=((l=p*(l=_[--a]%w)+(s=y*l+(c=_[a]/w|0)*p)%w*w+v[o]+r)/b|0)+(s/w|0)+y*c,v[o--]=l%b;v[o]=r}return r?++n:v.splice(0,1),G(e,v,n)},O.negated=function(){var e=new H(this);return e.s=-e.s||null,e},O.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new H(e,t)).s,!i||!t)return new H(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,a=e.e/d,s=n.c,u=e.c;if(!o||!a){if(!s||!u)return new H(i/0);if(!s[0]||!u[0])return u[0]?e:new H(s[0]?n:0*i)}if(o=g(o),a=g(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/f|0,s[t]=f===s[t]?0:s[t]%f;return i&&(s=[i].concat(s),++a),G(e,s,a)},O.precision=O.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return w(e,1,y),null==t?t=N:w(t,0,8),Z(new H(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},O.shiftedBy=function(e){return w(e,-h,h),this.times("1e"+e)},O.squareRoot=O.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,u=a.s,l=a.e,c=R+4,f=new H("0.5");if(1!==u||!s||!s[0])return new H(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+V(a)))||u==1/0?(((t=v(s)).length+l)%2==0&&(t+="0"),u=Math.sqrt(+t),l=g((l+1)/2)-(l<0||l%2),n=new H(t=u==1/0?"5e"+l:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new H(u+""),n.c[0])for((u=(l=n.e)+c)<3&&(u=0);;)if(o=n,n=f.times(o.plus(r(a,o,c,1))),v(o.c).slice(0,u)===(t=v(n.c)).slice(0,u)){if(n.e<l&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Z(n,n.e+R+2,1),e=!n.times(n).eq(a));break}if(!i&&(Z(o,o.e+R+2,0),o.times(o).eq(a))){n=o;break}c+=4,u+=4,i=1}return Z(n,n.e+R+1,N,e)},O.toExponential=function(e,t){return null!=e&&(w(e,0,y),e++),W(this,e,t,1)},O.toFixed=function(e,t){return null!=e&&(w(e,0,y),e=e+this.e+1),W(this,e,t)},O.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=$;else if("object"!=typeof r)throw Error(l+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",f=a[0],d=a[1],h=i.s<0,p=h?f.slice(1):f,m=p.length;if(u&&(o=s,s=u,u=o,m-=o),s>0&&m>0){for(o=m%s||s,f=p.substr(0,o);o<m;o+=s)f+=c+p.substr(o,s);u>0&&(f+=c+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},O.toFraction=function(e){var t,n,i,o,a,s,u,c,f,h,m,y,g=this,b=g.c;if(null!=e&&(!(u=new H(e)).isInteger()&&(u.c||1!==u.s)||u.lt(I)))throw Error(l+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+V(u));if(!b)return new H(g);for(t=new H(I),f=n=new H(I),i=c=new H(I),y=v(b),a=t.e=y.length-g.e-1,t.c[0]=p[(s=a%d)<0?d+s:s],e=!e||u.comparedTo(t)>0?a>0?t:f:u,s=L,L=1/0,u=new H(y),c.c[0]=0;h=r(u,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,f=c.plus(h.times(o=f)),c=o,t=u.minus(h.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(f)),n=n.plus(o.times(i)),c.s=f.s=g.s,m=r(f,i,a*=2,N).minus(g).abs().comparedTo(r(c,n,a,N).minus(g).abs())<1?[f,i]:[c,n],L=s,m},O.toNumber=function(){return+V(this)},O.toPrecision=function(e,t){return null!=e&&w(e,1,y),W(this,e,t,2)},O.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=C||o>=B?_(v(r.c),o):S(v(r.c),o,"0"):10===e&&K?t=S(v((r=Z(new H(r),R+o+1,N)).c),r.e,"0"):(w(e,2,q.length,"Base"),t=n(S(v(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},O.valueOf=O.toJSON=function(){return V(this)},O._isBigNumber=!0,null!=t&&H.set(t),H}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},9931:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(9214);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},8764:(e,t,r)=>{"use strict";var n=r(5108);const i=r(9742),o=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=u(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const i=function(e){if(l.isBuffer(e)){const t=0|m(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?u(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return f(e),u(e<0?0:0|m(e))}function h(e){const t=e.length<0?0:0|m(e.length),r=u(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function m(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function A(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Y(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return V(G(t,e.length-r),e,r,n)}function S(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function M(e,t,r,n){return V(Z(t),e,r,n)}function x(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(J(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},l.byteLength=y,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<s;++e)if(u[e]!==c[e]){o=u[e],a=c[e];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return A(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){K(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function F(e,t,r,n,i){K(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Q((function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Q((function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const U={};function $(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function K(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,i,o)}function H(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}$("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),$("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),$("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=s(n,a,arguments);return u&&l&&u(t,"length").configurable&&l(t,"length",{value:1+c(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,o,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},1027:(e,t,r)=>{var n=r(9509).Buffer,i=r(2830).Transform,o=r(2553).s;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5717)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},5108:(e,t,r)=>{var n=r(9539),i=r(9282);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var l=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(e){u[e]=o()},"time"],[function(e){var t=u[e];if(!t)throw new Error("No such label: "+e);delete u[e];var r=o()-t;a.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),a.error(e.stack)},"trace"],[function(e){a.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=s.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],c=0;c<l.length;c++){var f=l[c],d=f[0],h=f[1];a[h]||(a[h]=d)}e.exports=a},3482:(e,t,r)=>{"use strict";var n=r(5717),i=r(2318),o=r(9785),a=r(9072),s=r(1027);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},4098:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function f(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=o(e),t=a(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},u.prototype.delete=function(e){delete this.map[o(e)]},u.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},u.prototype.set=function(e,t){this.map[o(e)]=a(t)},u.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),s(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),s(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),s(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function m(e,t){var r,n,i=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new u(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})},h.call(m.prototype),h.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];g.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function b(e,n){return new Promise((function(i,o){var a=new m(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new u,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var n="response"in s?s.response:s.responseText;i(new g(n,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&r.blob&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}b.polyfill=!0,e.fetch||(e.fetch=b,e.Headers=u,e.Request=m,e.Response=g),t.Headers=u,t.Request=m,t.Response=g,t.fetch=b,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},4289:(e,t,r)=>{"use strict";var n=r(2215),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=r(1044)(),l=s&&u,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;l?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},f=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)c(e,o[s],t[o[s]],r[o[s]])};f.supportsDescriptors=!!l,e.exports=f},6266:(e,t,r)=>{"use strict";var n=t;n.version=r(8597).i8,n.utils=r(953),n.rand=r(9931),n.curve=r(8254),n.curves=r(5427),n.ec=r(7954),n.eddsa=r(5980)},4918:(e,t,r)=>{"use strict";var n=r(3785),i=r(953),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,u,l=[];for(a=0;a<n.length;a+=r.step){u=0;for(var c=a+r.step-1;c>=a;c--)u=(u<<1)+n[c];l.push(u)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a<l.length;a++)(u=l[a])===h?d=d.mixedAdd(r.points[a]):u===-h&&(d=d.mixedAdd(r.points[a].neg()));f=f.add(d)}return f.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r,this._bitLength),u=this.jpoint(null,null,null),l=a.length-1;l>=0;l--){for(var c=0;l>=0&&0===a[l];l--)c++;if(l>=0&&c++,u=u.dblp(c),l<0)break;var f=a[l];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,l,c=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(l=t[s])._getNAFPoints(e);c[s]=p.wnd,f[s]=p.points}for(s=n-1;s>=1;s-=2){var m=s-1,y=s;if(1===c[m]&&1===c[y]){var g=[t[m],null,null,t[y]];0===t[m].y.cmp(t[y].y)?(g[1]=t[m].add(t[y]),g[2]=t[m].toJ().mixedAdd(t[y].neg())):0===t[m].y.cmp(t[y].y.redNeg())?(g[1]=t[m].toJ().mixedAdd(t[y]),g[2]=t[m].add(t[y].neg())):(g[1]=t[m].toJ().mixedAdd(t[y]),g[2]=t[m].toJ().mixedAdd(t[y].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=a(r[m],r[y]);for(h=Math.max(b[0].length,h),d[m]=new Array(h),d[y]=new Array(h),u=0;u<h;u++){var w=0|b[0][u],A=0|b[1][u];d[m][u]=v[3*(w+1)+(A+1)],d[y][u]=0,f[m]=g}}else d[m]=o(r[m],c[m],this._bitLength),d[y]=o(r[y],c[y],this._bitLength),h=Math.max(d[m].length,h),h=Math.max(d[y].length,h)}var _=this.jpoint(null,null,null),S=this._wnafT4;for(s=h;s>=0;s--){for(var M=0;s>=0;){var x=!0;for(u=0;u<n;u++)S[u]=0|d[u][s],0!==S[u]&&(x=!1);if(!x)break;M++,s--}if(s>=0&&M++,_=_.dblp(M),s<0)break;for(u=0;u<n;u++){var T=S[u];0!==T&&(T>0?l=f[u][T-1>>1]:T<0&&(l=f[u][-T-1>>1].neg()),_="affine"===l.type?_.mixedAdd(l):_.add(l))}}for(s=0;s<n;s++)f[s]=null;return i?_:_.toP()},u.BasePoint=l,l.prototype.eq=function(){throw new Error("Not implemented")},l.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},l.prototype.encodeCompressed=function(e){return this.encode(e,!0)},l.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},l.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},l.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},l.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},l.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},l.prototype._getBeta=function(){return null},l.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1138:(e,t,r)=>{"use strict";var n=r(953),i=r(3785),o=r(5717),a=r(4918),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function l(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(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 i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(l,a.BasePoint),u.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new l(this,e,t,r,n)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.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)+">"},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),l=o.redMul(s),c=i.redMul(s),f=a.redMul(o);return this.curve.point(u,l,f,c)},l.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(u)),r=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),o=l.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=l.redMul(n.redSub(u)),r=l.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),l=o.redMul(a),c=s.redMul(u),f=o.redMul(u),d=a.redMul(s);return this.curve.point(l,c,d,f)},l.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),l=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(u).redMul(c);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(l)):(t=n.redMul(l).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(l)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},8254:(e,t,r)=>{"use strict";var n=t;n.base=r(4918),n.short=r(6673),n.mont=r(2881),n.edwards=r(1138)},2881:(e,t,r)=>{"use strict";var n=r(3785),i=r(5717),o=r(4918),a=r(953);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.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)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:(e,t,r)=>{"use strict";var n=r(953),i=r(3785),o=r(5717),a=r(4918),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(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)}function c(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,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}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,l,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),m=new i(0),y=new i(0),g=new i(1),v=0;0!==d.cmpn(0);){var b=h.div(d);l=h.sub(b.mul(d)),c=y.sub(b.mul(p));var w=g.sub(b.mul(m));if(!n&&l.cmp(f)<0)t=u.neg(),r=p,n=l.neg(),o=c;else if(n&&2==++v)break;u=l,h=d,d=l,y=p,p=c,g=m,m=w}a=l.neg(),s=c;var A=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(A)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(l).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return l},o(l,a.BasePoint),u.prototype.point=function(e,t,r){return new l(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return l.fromJSON(this,e,t)},l.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},l.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]},l.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},l.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)+">"},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},l.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),c=l.redMul(s),f=n.redMul(l),d=u.redSqr().redIAdd(c).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=r.redMul(u),f=s.redSqr().redIAdd(l).redISub(c).redISub(c),d=s.redMul(c.redISub(f)).redISub(i.redMul(l)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var c=o.redSqr(),f=l.redSqr(),d=f.redSqr(),h=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=o.redMul(f),m=h.redSqr().redISub(p.redAdd(p)),y=p.redISub(m),g=h.redMul(y);g=g.redIAdd(g).redISub(d);var v=l.redMul(s);t+1<e&&(u=u.redMul(d)),o=m,s=v,l=g}return this.curve.jpoint(o,l.redMul(i),s)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=s.redMul(a.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(c).redISub(d);h=h.redIAdd(h);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=s.redMul(a.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(c).redMul(this.x.redAdd(c));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(c);var y=f.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=h.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(a),c=s.redSqr().redISub(l.redAdd(l)),f=l.redISub(c),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,h,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),c=t.redMul(l);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.x.redMul(s).redISub(c);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(l.redMul(u.redISub(l)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,d,h)},c.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.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)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:(e,t,r)=>{"use strict";var n,i=t,o=r(3715),a=r(8254),s=r(953).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,l("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("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:o.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"]}),l("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:o.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"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),l("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(1037)}catch(e){n=void 0}l("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7954:(e,t,r)=>{"use strict";var n=r(3785),i=r(2156),o=r(953),a=r(5427),s=r(9931),u=o.assert,l=r(1251),c=r(611);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=f,f.prototype.keyPair=function(e){return new l(this,e)},f.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),l=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(l.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var m=p.getX(),y=m.umod(this.n);if(0!==y.cmpn(0)){var g=h.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==m.cmp(y)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new c({r:y,s:g,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),l=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(l,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(l,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,a=new n(e),s=t.r,l=t.s,f=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),m=l.mul(h).umod(o);return this.g.mulAdd(p,s,m)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},1251:(e,t,r)=>{"use strict";var n=r(3785),i=r(953).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},611:(e,t,r)=>{"use strict";var n=r(3785),i=r(953),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function l(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var l=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var c=u(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(l),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=l(t),r=l(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,t.length),(n=n.concat(t)).push(2),c(n,r.length);var o=n.concat(r),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,e)}},5980:(e,t,r)=>{"use strict";var n=r(3715),i=r(5427),o=r(953),a=o.assert,s=o.parseBytes,u=r(9087),l=r(3622);function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof l?e:new l(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return o.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},9087:(e,t,r)=>{"use strict";var n=r(953),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},3622:(e,t,r)=>{"use strict";var n=r(3785),i=r(953),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},1037:e=>{e.exports={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"]]}}},953:(e,t,r)=>{"use strict";var n=t,i=r(3785),o=r(9746),a=r(4504);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,l=t.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==l?u:-u,r[0].push(a),s=0==(1&l)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?l:-l,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},3785:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5568).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c<s;c+=n)u=l(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=l(e,c,e.length,t),c=0;c<a;c++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],d=[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];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var l=1;l<n;l++){for(var c=u>>>26,f=67108863&u,d=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=d;h++){var p=l-h|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?m+r:c[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,l=new e(o),c=this.clone();if(u){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[s]=a;for(;s<o;s++)l[s]=0}else{for(s=0;s<o-i;s++)l[s]=0;for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),l[o-s-1]=a}return l},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,l=0,c=0|a[0],f=8191&c,d=c>>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,v=y>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],S=8191&_,M=_>>>13,x=0|a[5],T=8191&x,E=x>>>13,k=0|a[6],P=8191&k,O=k>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],B=8191&C,F=C>>>13,L=0|a[9],D=8191&L,j=L>>>13,U=0|s[0],$=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,z=0|s[2],G=8191&z,Z=z>>>13,V=0|s[3],J=8191&V,Y=V>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,$))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(d,$)|0))<<13)|0;l=((o=Math.imul(d,q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,q))+Math.imul(m,$)|0,o=Math.imul(m,q);var ge=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;l=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,q))+Math.imul(v,$)|0,o=Math.imul(v,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var ve=(l+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,G)|0))<<13)|0;l=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,q))+Math.imul(A,$)|0,o=Math.imul(A,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var be=(l+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,$),i=(i=Math.imul(S,q))+Math.imul(M,$)|0,o=Math.imul(M,q),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,$),i=(i=Math.imul(T,q))+Math.imul(E,$)|0,o=Math.imul(E,q),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Ae=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,$),i=(i=Math.imul(P,q))+Math.imul(O,$)|0,o=Math.imul(O,q),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(l+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;l=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,q))+Math.imul(N,$)|0,o=Math.imul(N,q),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Se=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((o=o+Math.imul(d,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,q))+Math.imul(F,$)|0,o=Math.imul(F,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var Me=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;l=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(F,H)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;l=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,le)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Te=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Z))+Math.imul(j,G)|0,o=Math.imul(j,Z),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(F,J)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,le)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Ee=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,Y))+Math.imul(j,J)|0,o=Math.imul(j,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,Q)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var ke=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Pe=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(M,pe)|0))<<13)|0;l=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,le)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Oe=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,de)|0;var Ie=(l+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,le))+Math.imul(j,ue)|0,o=Math.imul(j,le),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,fe)|0,o=o+Math.imul(F,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;l=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(j,fe)|0,o=Math.imul(j,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((o=o+Math.imul(F,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(l+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(j,pe)|0))<<13)|0;return l=((o=Math.imul(j,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=_e,u[7]=Se,u[8]=Me,u[9]=xe,u[10]=Te,u[11]=Ee,u[12]=ke,u[13]=Pe,u[14]=Oe,u[15]=Ie,u[16]=Re,u[17]=Ne,u[18]=Ce,0!==l&&(u[19]=l,r.length++),r};function m(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,f=(0|e.words[c])*(0|t.words[l]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},y.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},y.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},y.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var f=u,d=l,h=0;h<a;h++){var p=r[c+h],m=n[c+h],y=r[c+h+a],g=n[c+h+a],v=f*y-d*g;g=f*g+d*y,y=v,r[c+h]=p+y,n[c+h]=m+g,r[c+h+a]=p-y,n[c+h+a]=m-g,h!==s&&(v=u*f-l*d,d=u*d+l*f,f=v)}},y.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},y.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},y.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},y.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},y.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),l=new Array(n),c=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,s,u,n,i),this.transform(l,o,c,f,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-o|f>>>o,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(b,v),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,v),i(A,v),i(_,v),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<p);var g=this.pow(f,new o(1).iushln(p-y-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=y}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},8091:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var u=o[a],l=Object.getOwnPropertyDescriptor(i,u);void 0!==l&&l.enumerable&&(r[u]=i[u])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},5443:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createHashFunction=function(e){return function(t){var r=e();return r.update(t),n.from(r.digest())}}},2192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5443),i=r(5811);t.keccak224=n.createHashFunction((function(){return i("keccak224")})),t.keccak256=n.createHashFunction((function(){return i("keccak256")})),t.keccak384=n.createHashFunction((function(){return i("keccak384")})),t.keccak512=n.createHashFunction((function(){return i("keccak512")}))},472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1798);t.getRandomBytes=function(e){return new Promise((function(t,r){n(e,(function(e,n){e?r(e):t(n)}))}))},t.getRandomBytesSync=function(e){return n(e)}},5053:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(7221),a=r(472);t.createPrivateKey=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return[4,a.getRandomBytes(32)];case 1:return e=t.sent(),o.privateKeyVerify(e)?[2,e]:[3,0];case 2:return[2]}}))}))},t.createPrivateKeySync=function(){for(;;){var e=a.getRandomBytesSync(32);if(o.privateKeyVerify(e))return e}},function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7221))},8670:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var a=o(r(9282)),s=r(4538),u=r(5053),l=r(4846),c=r(6861),f=r(4651),d=r(5641),h=r(3746),p=r(2971),m=function(){function e(e,t,r,n){void 0===e&&(e=new s.BN(0)),void 0===t&&(t=new s.BN(0)),void 0===r&&(r=c.KECCAK256_RLP),void 0===n&&(n=c.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,i=t.stateRoot,o=t.codeHash;return new e(r?new s.BN((0,f.toBuffer)(r)):void 0,n?new s.BN((0,f.toBuffer)(n)):void 0,i?(0,f.toBuffer)(i):void 0,o?(0,f.toBuffer)(o):void 0)},e.fromRlpSerializedAccount=function(e){var t=s.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=i(t,4),n=r[0],o=r[1],a=r[2],u=r[3];return new e(new s.BN(n),new s.BN(o),a,u)},e.prototype._validate=function(){if(this.nonce.lt(new s.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new s.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,p.bnToUnpaddedBuffer)(this.nonce),(0,p.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return s.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(c.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(c.KECCAK256_NULL)},e}();t.Account=m,t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e);var r=(0,l.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,p.toType)(t,p.TypeOutput.BN).toString()+"0x");for(var i=(0,d.keccakFromString)(n+r).toString("hex"),o="0x",a=0;a<r.length;a++)parseInt(i[a],16)>=8?o+=r[a].toUpperCase():o+=r[a];return o},t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e},t.generateAddress=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new s.BN(t);return r.isZero()?(0,d.rlphash)([e,null]).slice(-20):(0,d.rlphash)([e,n.from(r.toArray())]).slice(-20)},t.generateAddress2=function(e,t,r){return(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,a.default)(20===e.length),(0,a.default)(32===t.length),(0,d.keccak256)(n.concat([n.from("ff","hex"),e,t,(0,d.keccak256)(r)])).slice(-20)},t.isValidPrivate=function(e){return(0,u.privateKeyVerify)(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,u.publicKeyVerify)(n.concat([n.from([4]),e])):!!t&&(0,u.publicKeyVerify)(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=n.from((0,u.publicKeyConvert)(e,!1).slice(1))),(0,a.default)(64===e.length),(0,d.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return(0,h.assertIsBuffer)(e),n.from((0,u.publicKeyCreate)(e,!1)).slice(1)},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=n.from((0,u.publicKeyConvert)(e,!1).slice(1))),e},t.zeroAddress=function(){var e=(0,f.zeros)(20);return(0,f.bufferToHex)(e)},t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}},6871:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var o=i(r(9282)),a=r(4538),s=r(4651),u=r(8670),l=function(){function e(e){(0,o.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,s.zeros)(20))},e.fromString=function(t){return(0,o.default)((0,u.isValidAddress)(t),"Invalid address"),new e((0,s.toBuffer)(t))},e.fromPublicKey=function(t){return(0,o.default)(n.isBuffer(t),"Public key should be Buffer"),new e((0,u.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,o.default)(n.isBuffer(t),"Private key should be Buffer"),new e((0,u.privateToAddress)(t))},e.generate=function(t,r){return(0,o.default)(a.BN.isBN(r)),new e((0,u.generateAddress)(t.buf,r.toArrayLike(n)))},e.generate2=function(t,r,i){return(0,o.default)(n.isBuffer(r)),(0,o.default)(n.isBuffer(i)),new e((0,u.generateAddress2)(t.buf,r,i))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new a.BN(this.buf),t=new a.BN(0),r=new a.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return n.from(this.buf)},e}();t.Address=l},4651:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var a=r(4538),s=r(4846),u=r(3746);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))},t.intToBuffer=function(e){var r=(0,t.intToHex)(e);return n.from((0,s.padToEven)(r.slice(2)),"hex")},t.zeros=function(e){return n.allocUnsafe(e).fill(0)};var l=function(e,r,n){var i=(0,t.zeros)(r);return n?e.length<r?(e.copy(i),i):e.slice(0,r):e.length<r?(e.copy(i,r-e.length),i):e.slice(-r)};t.setLengthLeft=function(e,t){return(0,u.assertIsBuffer)(e),l(e,t,!1)},t.setLengthRight=function(e,t){return(0,u.assertIsBuffer)(e),l(e,t,!0)};var c=function(e){for(var t=e[0];e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,u.assertIsBuffer)(e),c(e)},t.unpadArray=function(e){return(0,u.assertIsArray)(e),c(e)},t.unpadHexString=function(e){return(0,u.assertIsHexString)(e),e=(0,s.stripHexPrefix)(e),c(e)},t.toBuffer=function(e){if(null==e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"==typeof e){if(!(0,s.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return n.from((0,s.padToEven)((0,s.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if(a.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(n)}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")},t.bufferToInt=function(e){return new a.BN((0,t.toBuffer)(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")},t.fromSigned=function(e){return new a.BN(e).fromTwos(256)},t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||(0,s.isHexPrefixed)(e)?e:"0x"+e},t.toUtf8=function(e){if((e=(0,s.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},t.baToJSON=function(e){if(n.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],i=0;i<e.length;i++)r.push((0,t.baToJSON)(e[i]));return r}},t.validateNoLeadingZeroes=function(e){var t,r;try{for(var n=i(Object.entries(e)),a=n.next();!a.done;a=n.next()){var s=o(a.value,2),u=s[0],l=s[1];if(void 0!==l&&l.length>0&&0===l[0])throw new Error("".concat(u," cannot have leading zeroes, received: ").concat(l.toString("hex")))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}},6861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(8764),i=r(4538);t.MAX_UINT64=new i.BN("ffffffffffffffff",16),t.MAX_INTEGER=new i.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new i.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},4538:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var s=a(r(361));t.BN=s.default;var u=o(r(1675));t.rlp=u},5641:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var i=r(2192),o=r(3482),a=r(4538),s=r(4651),u=r(3746);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,u.assertIsBuffer)(e),t){case 224:return(0,i.keccak224)(e);case 256:return(0,i.keccak256)(e);case 384:return(0,i.keccak384)(e);case 512:return(0,i.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}},t.keccak256=function(e){return(0,t.keccak)(e)},t.keccakFromString=function(e,r){void 0===r&&(r=256),(0,u.assertIsString)(e);var i=n.from(e,"utf8");return(0,t.keccak)(i,r)},t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,u.assertIsHexString)(e),(0,t.keccak)((0,s.toBuffer)(e),r)},t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,u.assertIsArray)(e),(0,t.keccak)((0,s.toBuffer)(e),r)};var l=function(e){return e=(0,s.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,u.assertIsBuffer)(e),l(e)},t.sha256FromString=function(e){return(0,u.assertIsString)(e),l(e)},t.sha256FromArray=function(e){return(0,u.assertIsArray)(e),l(e)};var c=function(e,t){e=(0,s.toBuffer)(e);var r=o("rmd160").update(e).digest();return!0===t?(0,s.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,u.assertIsBuffer)(e),c(e,t)},t.ripemd160FromString=function(e,t){return(0,u.assertIsString)(e),c(e,t)},t.ripemd160FromArray=function(e,t){return(0,u.assertIsArray)(e),c(e,t)},t.rlphash=function(e){return(0,t.keccak)(a.rlp.encode(e))}},3746:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var i=r(4846);t.assertIsHexString=function(e){if(!(0,i.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}},t.assertIsBuffer=function(e){if(!n.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}},t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}},t.assertIsString=function(e){if("string"!=typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},2751:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,i(r(6861),t),i(r(8670),t),i(r(6871),t),i(r(5641),t),i(r(7112),t),i(r(4651),t),i(r(867),t),i(r(4538),t),i(r(2971),t);var o=r(4846);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}})},4846:(e,t,r)=>{"use strict";var n=r(8764).Buffer;function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}function o(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=i,t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return i(e)?e.slice(2):e},t.padToEven=o,t.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return n.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t},t.fromUtf8=function(e){var t=n.from(e,"utf8");return"0x".concat(o(t.toString("hex")).replace(/^0+|0+$/g,""))},t.fromAscii=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0".concat(n):n}return"0x".concat(t)},t.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof e));if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof e));for(var n=[],i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi - expected type 'string', received ".concat(typeof o));n.push(o)}return n},t.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}},867:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0;var o=i(r(9282)),a=r(4846),s=r(4538),u=r(4651);t.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x".concat(e[t].toString("hex"))})),r}return(0,u.baToJSON)(e.raw)},e.serialize=function(){return s.rlp.encode(e.raw)},t.forEach((function(t,r){function i(){return e.raw[r]}function a(i){"00"!==(i=(0,u.toBuffer)(i)).toString("hex")||t.allowZero||(i=n.allocUnsafe(0)),t.allowLess&&t.length?(i=(0,u.unpadBuffer)(i),(0,o.default)(t.length>=i.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===i.length||!t.length||(0,o.default)(t.length===i.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[r]=i}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:i,set:a}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:a,get:i})})),r)if("string"==typeof r&&(r=n.from((0,a.stripHexPrefix)(r),"hex")),n.isBuffer(r)&&(r=s.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,u.toBuffer)(t)}))}else{if("object"!=typeof r)throw new Error("invalid data");var i=Object.keys(r);t.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},7112:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var i=r(5053),o=r(4538),a=r(4651),s=r(5641),u=r(3746),l=r(2971);function c(e,t){var r=(0,l.toType)(e,l.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,l.toType)(e,l.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,l.toType)(t,l.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function f(e){var t=new o.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,r){var o=(0,i.ecdsaSign)(e,t),a=o.signature,s=o.recid,u=n.from(a.slice(0,32)),c=n.from(a.slice(32,64));if(!r||"number"==typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:u,s:c,v:r?s+(2*r+35):s+27}}return{r:u,s:c,v:(0,l.toType)(r,l.TypeOutput.BN).muln(2).addn(35).addn(s).toArrayLike(n)}},t.ecrecover=function(e,t,r,o,s){var u=n.concat([(0,a.setLengthLeft)(r,32),(0,a.setLengthLeft)(o,32)],64),l=c(t,s);if(!f(l))throw new Error("Invalid signature v value");var d=(0,i.ecdsaRecover)(u,l.toNumber(),e);return n.from((0,i.publicKeyConvert)(d,!1).slice(1))},t.toRpcSig=function(e,t,r,i){if(!f(c(e,i)))throw new Error("Invalid signature v value");return(0,a.bufferToHex)(n.concat([(0,a.setLengthLeft)(t,32),(0,a.setLengthLeft)(r,32),(0,a.toBuffer)(e)]))},t.toCompactSig=function(e,t,r,i){if(!f(c(e,i)))throw new Error("Invalid signature v value");var o=(0,l.toType)(e,l.TypeOutput.Number),s=r;return(o>28&&o%2==1||1===o||28===o)&&((s=n.from(r))[0]|=128),(0,a.bufferToHex)(n.concat([(0,a.setLengthLeft)(t,32),(0,a.setLengthLeft)(s,32)]))},t.fromRpcSig=function(e){var t,r,n,i=(0,a.toBuffer)(e);if(i.length>=65)t=i.slice(0,32),r=i.slice(32,64),n=(0,a.bufferToInt)(i.slice(64));else{if(64!==i.length)throw new Error("Invalid signature length");t=i.slice(0,32),r=i.slice(32,64),n=(0,a.bufferToInt)(i.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}},t.isValidSignature=function(e,t,r,n,i){void 0===n&&(n=!0);var a=new o.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new o.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!f(c(e,i)))return!1;var u=new o.BN(t),l=new o.BN(r);return!(u.isZero()||u.gt(s)||l.isZero()||l.gt(s)||n&&1===l.cmp(a))},t.hashPersonalMessage=function(e){(0,u.assertIsBuffer)(e);var t=n.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,s.keccak)(n.concat([t,e]))}},2971:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var i,o=r(4538),a=r(4846),s=r(4651);function u(e){return(0,s.unpadBuffer)(e.toArrayLike(n))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=u,t.bnToRlp=function(e){return u(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(i=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"==typeof e&&!(0,a.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,s.toBuffer)(e);if(t===i.Buffer)return r;if(t===i.BN)return new o.BN(r);if(t===i.Number){var n=new o.BN(r),u=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(n.gt(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return n.toNumber()}return"0x".concat(r.toString("hex"))}}},361:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var l=e.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c<s;c+=n)u=l(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=l(e,c,e.length,t),c=0;c<a;c++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){c(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[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];function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var l=1;l<n;l++){for(var c=u>>>26,f=67108863&u,d=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=d;h++){var p=l-h|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=h[e],c=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(c).toString(e);r=(f=f.idivn(c)).isZero()?m+r:d[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,l=0,c=0|a[0],f=8191&c,d=c>>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,v=y>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],S=8191&_,M=_>>>13,x=0|a[5],T=8191&x,E=x>>>13,k=0|a[6],P=8191&k,O=k>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],B=8191&C,F=C>>>13,L=0|a[9],D=8191&L,j=L>>>13,U=0|s[0],$=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,z=0|s[2],G=8191&z,Z=z>>>13,V=0|s[3],J=8191&V,Y=V>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,$))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(d,$)|0))<<13)|0;l=((o=Math.imul(d,q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,q))+Math.imul(m,$)|0,o=Math.imul(m,q);var ge=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;l=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,q))+Math.imul(v,$)|0,o=Math.imul(v,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var ve=(l+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,G)|0))<<13)|0;l=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,q))+Math.imul(A,$)|0,o=Math.imul(A,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var be=(l+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,$),i=(i=Math.imul(S,q))+Math.imul(M,$)|0,o=Math.imul(M,q),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,$),i=(i=Math.imul(T,q))+Math.imul(E,$)|0,o=Math.imul(E,q),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Ae=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,$),i=(i=Math.imul(P,q))+Math.imul(O,$)|0,o=Math.imul(O,q),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(l+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;l=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,q))+Math.imul(N,$)|0,o=Math.imul(N,q),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Se=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((o=o+Math.imul(d,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,q))+Math.imul(F,$)|0,o=Math.imul(F,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var Me=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;l=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(F,H)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;l=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,le)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Te=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Z))+Math.imul(j,G)|0,o=Math.imul(j,Z),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(F,J)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,le)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Ee=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,Y))+Math.imul(j,J)|0,o=Math.imul(j,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,Q)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var ke=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Pe=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(M,pe)|0))<<13)|0;l=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,le)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Oe=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,de)|0;var Ie=(l+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,le))+Math.imul(j,ue)|0,o=Math.imul(j,le),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,fe)|0,o=o+Math.imul(F,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;l=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(j,fe)|0,o=Math.imul(j,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((o=o+Math.imul(F,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(l+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(j,pe)|0))<<13)|0;return l=((o=Math.imul(j,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=_e,u[7]=Se,u[8]=Me,u[9]=xe,u[10]=Te,u[11]=Ee,u[12]=ke,u[13]=Pe,u[14]=Oe,u[15]=Ie,u[16]=Re,u[17]=Ne,u[18]=Ce,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,f=(0|e.words[c])*(0|t.words[l]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?m(this,e,t):r<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var f=u,d=l,h=0;h<a;h++){var p=r[c+h],m=n[c+h],y=r[c+h+a],g=n[c+h+a],v=f*y-d*g;g=f*g+d*y,y=v,r[c+h]=p+y,n[c+h]=m+g,r[c+h+a]=p-y,n[c+h+a]=m-g,h!==s&&(v=u*f-l*d,d=u*d+l*f,f=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),l=new Array(n),c=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,s,u,n,i),this.transform(l,o,c,f,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-o|f>>>o,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(_,A),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,A),i(M,A),i(x,A),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new S;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<p);var g=this.pow(f,new o(1).iushln(p-y-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=y}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},3467:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>Mr,BigNumber:()=>c.O$,Contract:()=>xr,ContractFactory:()=>Tr,FixedNumber:()=>Er.xs,Signer:()=>Qe,VoidSigner:()=>et,Wallet:()=>ti,Wordlist:()=>rn,constants:()=>i,errors:()=>d.ErrorCode,ethers:()=>u,getDefaultProvider:()=>Ja,logger:()=>ys,providers:()=>o,utils:()=>s,version:()=>ms,wordlists:()=>un});var n={};r.r(n),r.d(n,{decode:()=>E,encode:()=>M});var i={};r.r(i),r.d(i,{AddressZero:()=>ii,EtherSymbol:()=>ai,HashZero:()=>oi.R,MaxInt256:()=>oe,MaxUint256:()=>ne,MinInt256:()=>ie,NegativeOne:()=>X,One:()=>ee,Two:()=>te,WeiPerEther:()=>re,Zero:()=>Q});var o={};r.r(o),r.d(o,{AlchemyProvider:()=>ia,AlchemyWebSocketProvider:()=>na,AnkrProvider:()=>ua,BaseProvider:()=>Ro,CloudflareProvider:()=>ca,EtherscanProvider:()=>va,FallbackProvider:()=>Na,Formatter:()=>no,InfuraProvider:()=>Da,InfuraWebSocketProvider:()=>La,IpcProvider:()=>Ca,JsonRpcBatchProvider:()=>ja,JsonRpcProvider:()=>Wo,JsonRpcSigner:()=>qo,NodesmithProvider:()=>$a,PocketProvider:()=>Ha,Provider:()=>Ze,Resolver:()=>Po,StaticJsonRpcProvider:()=>Qo,UrlJsonRpcProvider:()=>ea,Web3Provider:()=>Za,WebSocketProvider:()=>Yo,getDefaultProvider:()=>Ja,getNetwork:()=>pi,isCommunityResourcable:()=>io,isCommunityResource:()=>oo,showThrottleMessage:()=>so});var a={};r.r(a),r.d(a,{decode:()=>mi,encode:()=>yi});var s={};r.r(s),r.d(s,{AbiCoder:()=>Fe,ConstructorFragment:()=>xe,ErrorFragment:()=>ke,EventFragment:()=>Ae,FormatTypes:()=>ye,Fragment:()=>we,FunctionFragment:()=>Te,HDNode:()=>bn,Indexed:()=>qe,Interface:()=>We,LogDescription:()=>je,Logger:()=>d.Logger,ParamType:()=>ve,RLP:()=>n,SigningKey:()=>Ht,SupportedAlgorithm:()=>Zr,TransactionDescription:()=>Ue,TransactionTypes:()=>Zt,UnicodeNormalizationForm:()=>j.Uj,Utf8ErrorFuncs:()=>j.te,Utf8ErrorReason:()=>j.Uw,_TypedDataEncoder:()=>Wr,_fetchData:()=>Vi,_toEscapedUtf8String:()=>j.U$,accessListify:()=>nr,arrayify:()=>l.arrayify,base58:()=>Gr,base64:()=>a,checkProperties:()=>f.checkProperties,checkResultErrors:()=>m,commify:()=>cs,computeAddress:()=>Qt,computeHmac:()=>Qr,computePublicKey:()=>zt,concat:()=>l.concat,deepCopy:()=>f.deepCopy,defaultAbiCoder:()=>Le,defaultPath:()=>vn,defineReadOnly:()=>f.defineReadOnly,dnsEncode:()=>qi,entropyToMnemonic:()=>_n,fetchJson:()=>Ji,formatBytes32String:()=>ss.s,formatEther:()=>hs,formatUnits:()=>fs,getAccountPath:()=>Mn,getAddress:()=>C,getContractAddress:()=>L,getCreate2Address:()=>D,getIcapAddress:()=>F,getJsonWalletAddress:()=>Xn,getStatic:()=>f.getStatic,hashMessage:()=>Pr,hexConcat:()=>l.hexConcat,hexDataLength:()=>l.hexDataLength,hexDataSlice:()=>l.hexDataSlice,hexStripZeros:()=>l.hexStripZeros,hexValue:()=>l.hexValue,hexZeroPad:()=>l.hexZeroPad,hexlify:()=>l.hexlify,id:()=>U,isAddress:()=>B,isBytes:()=>l.isBytes,isBytesLike:()=>l.isBytesLike,isHexString:()=>l.isHexString,isValidMnemonic:()=>Sn,isValidName:()=>Ui,joinSignature:()=>l.joinSignature,keccak256:()=>b.keccak256,mnemonicToEntropy:()=>An,mnemonicToSeed:()=>wn,namehash:()=>$i,nameprep:()=>as.Ll,parseBytes32String:()=>ss.F,parseEther:()=>ps,parseTransaction:()=>lr,parseUnits:()=>ds,poll:()=>Yi,randomBytes:()=>kn,recoverAddress:()=>er,recoverPublicKey:()=>Wt,resolveProperties:()=>f.resolveProperties,ripemd160:()=>Jr,serializeTransaction:()=>sr,sha256:()=>Yr,sha512:()=>Xr,shallowCopy:()=>f.shallowCopy,shuffled:()=>ba,solidityKeccak256:()=>is,solidityPack:()=>ns,soliditySha256:()=>os,splitSignature:()=>l.splitSignature,stripZeros:()=>l.stripZeros,toUtf8Bytes:()=>j.Y0,toUtf8CodePoints:()=>j.XL,toUtf8String:()=>j.ZN,verifyMessage:()=>ri,verifyTypedData:()=>ni,zeroPad:()=>l.zeroPad});var u={};r.r(u),r.d(u,{BaseContract:()=>Mr,BigNumber:()=>c.O$,Contract:()=>xr,ContractFactory:()=>Tr,FixedNumber:()=>Er.xs,Signer:()=>Qe,VoidSigner:()=>et,Wallet:()=>ti,Wordlist:()=>rn,constants:()=>i,errors:()=>d.ErrorCode,getDefaultProvider:()=>Ja,logger:()=>ys,providers:()=>o,utils:()=>s,version:()=>ms,wordlists:()=>un});var l=r(3286),c=r(2593),f=r(3587),d=r(711);const h="abi/5.7.0",p=new d.Logger(h);function m(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class y{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){p.throwArgumentError(e,this.localName,t)}}class g{constructor(e){(0,f.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,l.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,l.concat)(e._data))}writeBytes(e){let t=(0,l.arrayify)(e);const r=t.length%this.wordSize;return r&&(t=(0,l.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,l.arrayify)(c.O$.from(e));return t.length>this.wordSize&&p.throwError("value out-of-bounds",d.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,l.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class v{constructor(e,t,r,n){(0,f.defineReadOnly)(this,"_data",(0,l.arrayify)(e)),(0,f.defineReadOnly)(this,"wordSize",t||32),(0,f.defineReadOnly)(this,"_coerceFunc",r),(0,f.defineReadOnly)(this,"allowLoose",n),this._offset=0}get data(){return(0,l.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):v.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:p.throwError("data out-of-bounds",d.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new v(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return c.O$.from(this.readBytes(this.wordSize))}}var b=r(8197);const w=new d.Logger("rlp/5.7.0");function A(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function _(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function S(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(S(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=A(t.length);return r.unshift(247+r.length),r.concat(t)}(0,l.isBytesLike)(e)||w.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call((0,l.arrayify)(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=A(t.length);return r.unshift(183+r.length),r.concat(t)}function M(e){return(0,l.hexlify)(S(e))}function x(e,t,r,n){const i=[];for(;r<t+1+n;){const o=T(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&w.throwError("child data too short",d.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function T(e,t){if(0===e.length&&w.throwError("data too short",d.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&w.throwError("data short segment too short",d.Logger.errors.BUFFER_OVERRUN,{});const n=_(e,t+1,r);return t+1+r+n>e.length&&w.throwError("data long segment too short",d.Logger.errors.BUFFER_OVERRUN,{}),x(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{}),x(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{});const n=_(e,t+1,r);return t+1+r+n>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+r+n,result:(0,l.hexlify)(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&w.throwError("data too short",d.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:(0,l.hexlify)(e.slice(t+1,t+1+r))}}return{consumed:1,result:(0,l.hexlify)(e[t])}}function E(e){const t=(0,l.arrayify)(e),r=T(t,0);return r.consumed!==t.length&&w.throwArgumentError("invalid rlp data","data",e),r.result}const k=new d.Logger("address/5.7.0");function P(e){(0,l.isHexString)(e,20)||k.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=(0,l.arrayify)((0,b.keccak256)(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const O={};for(let e=0;e<10;e++)O[String(e)]=String(e);for(let e=0;e<26;e++)O[String.fromCharCode(65+e)]=String(10+e);const I=Math.floor((R=9007199254740991,Math.log10?Math.log10(R):Math.log(R)/Math.LN10));var R;function N(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>O[e])).join("");for(;t.length>=I;){let e=t.substring(0,I);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function C(e){let t=null;if("string"!=typeof e&&k.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=P(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&k.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==N(e)&&k.throwArgumentError("bad icap checksum","address",e),t=(0,c.g$)(e.substring(4));t.length<40;)t="0"+t;t=P("0x"+t)}else k.throwArgumentError("invalid address","address",e);return t}function B(e){try{return C(e),!0}catch(e){}return!1}function F(e){let t=(0,c.t2)(C(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+N("XE00"+t)+t}function L(e){let t=null;try{t=C(e.from)}catch(t){k.throwArgumentError("missing from address","transaction",e)}const r=(0,l.stripZeros)((0,l.arrayify)(c.O$.from(e.nonce).toHexString()));return C((0,l.hexDataSlice)((0,b.keccak256)(M([t,r])),12))}function D(e,t,r){return 32!==(0,l.hexDataLength)(t)&&k.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,l.hexDataLength)(r)&&k.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),C((0,l.hexDataSlice)((0,b.keccak256)((0,l.concat)(["0xff",C(e),t,r])),12))}var j=r(4242);function U(e){return(0,b.keccak256)((0,j.Y0)(e))}class $ extends y{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=C(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return C((0,l.hexZeroPad)(e.readValue().toHexString(),20))}}class q extends y{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const K=new d.Logger(h);function H(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||K.throwError("cannot encode object for signature with missing names",d.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&K.throwError("cannot encode object for signature with duplicate names",d.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else K.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&K.throwArgumentError("types/value length mismatch","tuple",r);let i=new g(e.wordSize),o=new g(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function W(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===d.Logger.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===d.Logger.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class z extends y{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),K.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return H(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&K.throwError("insufficient data length",d.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new q(this.coder));return e.coerce(this.name,W(e,r))}}class G extends y{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Z extends y{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,l.arrayify)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class V extends Z{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,(0,l.hexlify)(super.decode(e)))}}class J extends y{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,l.arrayify)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,(0,l.hexlify)(e.readBytes(this.size)))}}class Y extends y{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const X=c.O$.from(-1),Q=c.O$.from(0),ee=c.O$.from(1),te=c.O$.from(2),re=c.O$.from("1000000000000000000"),ne=c.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ie=c.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),oe=c.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ae extends y{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=c.O$.from(t),n=ne.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(ee).mul(X)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Q)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}class se extends Z{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,j.Y0)(t))}decode(e){return(0,j.ZN)(super.decode(e))}}class ue extends y{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)})),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return H(e,this.coders,t)}decode(e){return e.coerce(this.name,W(e,this.coders))}}var le=r(5108);const ce=new d.Logger(h),fe={};let de={calldata:!0,memory:!0,storage:!0},he={calldata:!0,memory:!0};function pe(e,t){if("bytes"===e||"string"===e){if(de[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&he[t])return!0;return(de[t]||"payable"===t)&&ce.throwArgumentError("invalid modifier","name",t),!1}function me(e,t){for(let r in t)(0,f.defineReadOnly)(e,r,t[r])}const ye=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ge=new RegExp(/^(.*)\[([0-9]*)\]$/);class ve{constructor(e,t){e!==fe&&ce.throwError("use fromString",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),me(this,t);let r=this.type.match(ge);me(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ve.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ye.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===ye.full?", ":",")+")"):t+=this.type,e!==ye.sighash&&(!0===this.indexed&&(t+=" indexed"),e===ye.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?ve.fromString(e,t):ve.fromObject(e)}static fromObject(e){return ve.isParamType(e)?e:new ve(fe,{name:e.name||null,type:Pe(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ve.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){ce.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;r<e.length;r++){let o=e[r];switch(o){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(r),a.state.allowType=!1,a.type=Pe(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(r),a.indexed=!0,a.name=""),pe(a.type,a.name)&&(a.name=""),a.type=Pe(a.type);let e=a;a=a.parent,a||n(r),delete e.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(r),a.indexed=!0,a.name=""),pe(a.type,a.name)&&(a.name=""),a.type=Pe(a.type);let s=i(a.parent);a.parent.components.push(s),delete a.parent,a=s;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Pe(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(r),a.indexed&&n(r),a.indexed=!0,a.name=""):pe(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(r),a.type+=o,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(r),a.type+=o,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=o,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=o,delete a.state.allowArray):a.state.readArray?a.type+=o:n(r)}}return a.parent&&ce.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):pe(a.type,a.name)&&(a.name=""),o.type=Pe(o.type),o}(e,!!t),ve.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function be(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&ce.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}(e).map((e=>ve.fromString(e,t)))}class we{constructor(e,t){e!==fe&&ce.throwError("use a static from method",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),me(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return we.isFragment(e)?e:"string"==typeof e?we.fromString(e):we.fromObject(e)}static fromObject(e){if(we.isFragment(e))return e;switch(e.type){case"function":return Te.fromObject(e);case"event":return Ae.fromObject(e);case"constructor":return xe.fromObject(e);case"error":return ke.fromObject(e);case"fallback":case"receive":return null}return ce.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Ae.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Te.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?xe.fromString(e.trim()):"error"===e.split(" ")[0]?ke.fromString(e.substring(5).trim()):ce.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Ae extends we{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Ae.fromString(e):Ae.fromObject(e)}static fromObject(e){if(Ae.isEventFragment(e))return e;"event"!==e.type&&ce.throwArgumentError("invalid event object","value",e);const t={name:Ie(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ve.fromObject):[],type:"event"};return new Ae(fe,t)}static fromString(e){let t=e.match(Re);t||ce.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ce.warn("unknown modifier: "+e)}})),Ae.fromObject({name:t[1].trim(),anonymous:r,inputs:be(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function _e(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&ce.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ce.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=c.O$.from(r[1]),r[0]):e}function Se(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:le.log("unknown modifier: "+e)}}))}function Me(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ce.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ce.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ce.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ce.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ce.throwArgumentError("unable to determine stateMutability","value",e),t}class xe extends we{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===ye.sighash&&ce.throwError("cannot format a constructor for sighash",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?xe.fromString(e):xe.fromObject(e)}static fromObject(e){if(xe.isConstructorFragment(e))return e;"constructor"!==e.type&&ce.throwArgumentError("invalid constructor object","value",e);let t=Me(e);t.constant&&ce.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ve.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?c.O$.from(e.gas):null};return new xe(fe,r)}static fromString(e){let t={type:"constructor"},r=(e=_e(e,t)).match(Re);return r&&"constructor"===r[1].trim()||ce.throwArgumentError("invalid constructor string","value",e),t.inputs=be(r[2].trim(),!1),Se(r[3].trim(),t),xe.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Te extends xe{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Te.fromString(e):Te.fromObject(e)}static fromObject(e){if(Te.isFunctionFragment(e))return e;"function"!==e.type&&ce.throwArgumentError("invalid function object","value",e);let t=Me(e);const r={type:e.type,name:Ie(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ve.fromObject):[],outputs:e.outputs?e.outputs.map(ve.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?c.O$.from(e.gas):null};return new Te(fe,r)}static fromString(e){let t={type:"function"},r=(e=_e(e,t)).split(" returns ");r.length>2&&ce.throwArgumentError("invalid function string","value",e);let n=r[0].match(Re);if(n||ce.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ie(t.name),t.inputs=be(n[2],!1),Se(n[3].trim(),t),r.length>1){let n=r[1].match(Re);""==n[1].trim()&&""==n[3].trim()||ce.throwArgumentError("unexpected tokens","value",e),t.outputs=be(n[2],!1)}else t.outputs=[];return Te.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ee(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ce.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class ke extends we{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?ke.fromString(e):ke.fromObject(e)}static fromObject(e){if(ke.isErrorFragment(e))return e;"error"!==e.type&&ce.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ie(e.name),inputs:e.inputs?e.inputs.map(ve.fromObject):[]};return Ee(new ke(fe,t))}static fromString(e){let t={type:"error"},r=e.match(Re);return r||ce.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ie(t.name),t.inputs=be(r[2],!1),Ee(ke.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Pe(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Oe=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ie(e){return e&&e.match(Oe)||ce.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Re=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),Ne=new d.Logger(h),Ce=new RegExp(/^bytes([0-9]*)$/),Be=new RegExp(/^(u?int)([0-9]*)$/);class Fe{constructor(e){(0,f.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new $(e.name);case"bool":return new G(e.name);case"string":return new se(e.name);case"bytes":return new V(e.name);case"array":return new z(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ue((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Y(e.name)}let t=e.type.match(Be);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&Ne.throwArgumentError("invalid "+t[1]+" bit length","param",e),new ae(r/8,"int"===t[1],e.name)}if(t=e.type.match(Ce),t){let r=parseInt(t[1]);return(0===r||r>32)&&Ne.throwArgumentError("invalid bytes length","param",e),new J(r,e.name)}return Ne.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new v(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new g(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ve.from(e))));return new ue(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Ne.throwError("types/values length mismatch",d.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(ve.from(e)))),n=new ue(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(ve.from(e))));return new ue(n,"_").decode(this._getReader((0,l.arrayify)(t),r))}}const Le=new Fe,De=new d.Logger(h);class je extends f.Description{}class Ue extends f.Description{}class $e extends f.Description{}class qe extends f.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const Ke={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function He(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class We{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,f.defineReadOnly)(this,"fragments",t.map((e=>we.from(e))).filter((e=>null!=e))),(0,f.defineReadOnly)(this,"_abiCoder",(0,f.getStatic)(new.target,"getAbiCoder")()),(0,f.defineReadOnly)(this,"functions",{}),(0,f.defineReadOnly)(this,"errors",{}),(0,f.defineReadOnly)(this,"events",{}),(0,f.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void De.warn("duplicate definition - constructor"):void(0,f.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?De.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,f.defineReadOnly)(this,"deploy",xe.from({payable:!1,type:"constructor"})),(0,f.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=ye.full),e===ye.sighash&&De.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===ye.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Le}static getAddress(e){return C(e)}static getSighash(e){return(0,l.hexDataSlice)(U(e.format()),0,4)}static getEventTopic(e){return U(e.format())}getFunction(e){if((0,l.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];De.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?De.throwArgumentError("no matching function","name",t):r.length>1&&De.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Te.fromString(e).format()];return t||De.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,l.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];De.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?De.throwArgumentError("no matching event","name",t):r.length>1&&De.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Ae.fromString(e).format()];return t||De.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,l.isHexString)(e)){const t=(0,f.getStatic)(this.constructor,"getSighash");for(const r in this.errors)if(e===t(this.errors[r]))return this.errors[r];De.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?De.throwArgumentError("no matching error","name",t):r.length>1&&De.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Te.fromString(e).format()];return t||De.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return(0,f.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,f.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=(0,l.arrayify)(t);return(0,l.hexlify)(r.slice(0,4))!==this.getSighash(e)&&De.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,l.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,l.hexlify)((0,l.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=(0,l.arrayify)(t);return(0,l.hexlify)(r.slice(0,4))!==this.getSighash(e)&&De.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,l.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,l.hexlify)((0,l.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,l.arrayify)(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=(0,l.hexlify)(r.slice(0,4)),t=Ke[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return De.throwError("call revert exception"+i,d.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,l.hexlify)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,l.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&De.throwError("too many arguments for "+e.format(),d.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?U(t):"bytes"===e.type?(0,b.keccak256)((0,l.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=c.O$.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,l.hexZeroPad)((0,l.hexlify)(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?De.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&De.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&De.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(U(a));else if("bytes"===e.type)r.push((0,b.keccak256)(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,l.isHexString)(r[0],32)&&r[0].toLowerCase()===t||De.throwError("fragment/topic mismatch",d.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ve.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,l.concat)(r)):null,s=this._abiCoder.decode(i,t,!0),u=[],c=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new qe({_isIndexed:!0,hash:null});else if(o[t])u[t]=new qe({_isIndexed:!0,hash:a[f++]});else try{u[t]=a[f++]}catch(e){u[t]=e}else try{u[t]=s[c++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){const r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw He(`property ${JSON.stringify(e.name)}`,r)}}):u[e.name]=r}}));for(let e=0;e<u.length;e++){const t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:()=>{throw He(`index ${e}`,t)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Ue({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:c.O$.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new je({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,l.hexlify)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new $e({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}const ze=new d.Logger("abstract-provider/5.7.0");class Ge extends f.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Ze{constructor(){ze.checkAbstract(new.target,Ze),(0,f.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return e=this,t=void 0,n=function*(){const{block:e,gasPrice:t}=yield(0,f.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=c.O$.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}},new((r=void 0)||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}));var e,t,r,n}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Ve=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Je=new d.Logger("abstract-signer/5.7.0"),Ye=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Xe=[d.Logger.errors.INSUFFICIENT_FUNDS,d.Logger.errors.NONCE_EXPIRED,d.Logger.errors.REPLACEMENT_UNDERPRICED];class Qe{constructor(){Je.checkAbstract(new.target,Qe),(0,f.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return Ve(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Ve(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Ve(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,f.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Ve(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,f.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Ve(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Ve(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Ve(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Ve(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Ve(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Ye.indexOf(t)&&Je.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=(0,f.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Je.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Ve(this,void 0,void 0,(function*(){const t=yield(0,f.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Ve(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Je.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Je.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Je.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Je.throwError("network does not support EIP-1559",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Je.throwError("failed to get consistent fee data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Xe.indexOf(e.code)>=0)throw e;return Je.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Je.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,f.resolveProperties)(t)}))}_checkProvider(e){this.provider||Je.throwError("missing provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class et extends Qe{constructor(e,t){super(),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Je.throwError(e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new et(this.address,e)}}var tt=r(2500),rt=r.n(tt),nt=r(3715),it=r.n(nt);function ot(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var at=st;function st(e,t){if(!e)throw new Error(t||"Assertion failed")}st.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ut=ot((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),lt=ot((function(e,t){var r=t;r.assert=at,r.toArray=ut.toArray,r.zero2=ut.zero2,r.toHex=ut.toHex,r.encode=ut.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,l=t.andln(3)+o&3;3===u&&(u=-1),3===l&&(l=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==l?u:-u,r[0].push(a),s=0==(1&l)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?l:-l,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(rt())(e,"hex","le")}})),ct=lt.getNAF,ft=lt.getJSF,dt=lt.assert;function ht(e,t){this.type=e,this.p=new(rt())(t.p,16),this.red=t.prime?rt().red(t.prime):rt().mont(this.p),this.zero=new(rt())(0).toRed(this.red),this.one=new(rt())(1).toRed(this.red),this.two=new(rt())(2).toRed(this.red),this.n=t.n&&new(rt())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var pt=ht;function mt(e,t){this.curve=e,this.type=t,this.precomputed=null}ht.prototype.point=function(){throw new Error("Not implemented")},ht.prototype.validate=function(){throw new Error("Not implemented")},ht.prototype._fixedNafMul=function(e,t){dt(e.precomputed);var r=e._getDoubles(),n=ct(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var u=o+r.step-1;u>=o;u--)a=(a<<1)+n[u];s.push(a)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o<s.length;o++)(a=s[o])===f?c=c.mixedAdd(r.points[o]):a===-f&&(c=c.mixedAdd(r.points[o].neg()));l=l.add(c)}return l.toP()},ht.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=ct(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var l=o[s];dt(0!==l),a="affine"===e.type?l>0?a.mixedAdd(i[l-1>>1]):a.mixedAdd(i[-l-1>>1].neg()):l>0?a.add(i[l-1>>1]):a.add(i[-l-1>>1].neg())}return"affine"===e.type?a.toP():a},ht.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,f=0;for(o=0;o<n;o++){var d=(s=t[o])._getNAFPoints(e);u[o]=d.wnd,l[o]=d.points}for(o=n-1;o>=1;o-=2){var h=o-1,p=o;if(1===u[h]&&1===u[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=ft(r[h],r[p]);for(f=Math.max(g[0].length,f),c[h]=new Array(f),c[p]=new Array(f),a=0;a<f;a++){var v=0|g[0][a],b=0|g[1][a];c[h][a]=y[3*(v+1)+(b+1)],c[p][a]=0,l[h]=m}}else c[h]=ct(r[h],u[h],this._bitLength),c[p]=ct(r[p],u[p],this._bitLength),f=Math.max(c[h].length,f),f=Math.max(c[p].length,f)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(o=f;o>=0;o--){for(var _=0;o>=0;){var S=!0;for(a=0;a<n;a++)A[a]=0|c[a][o],0!==A[a]&&(S=!1);if(!S)break;_++,o--}if(o>=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a<n;a++){var M=A[a];0!==M&&(M>0?s=l[a][M-1>>1]:M<0&&(s=l[a][-M-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)l[o]=null;return i?w:w.toP()},ht.BasePoint=mt,mt.prototype.eq=function(){throw new Error("Not implemented")},mt.prototype.validate=function(){return this.curve.validate(this)},ht.prototype.decodePoint=function(e,t){e=lt.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?dt(e[e.length-1]%2==0):7===e[0]&&dt(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},mt.prototype.encodeCompressed=function(e){return this.encode(e,!0)},mt.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},mt.prototype.encode=function(e,t){return lt.encode(this._encode(t),e)},mt.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},mt.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},mt.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},mt.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},mt.prototype._getBeta=function(){return null},mt.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var yt=ot((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),gt=lt.assert;function vt(e){pt.call(this,"short",e),this.a=new(rt())(e.a,16).toRed(this.red),this.b=new(rt())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}yt(vt,pt);var bt=vt;function wt(e,t,r,n){pt.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(rt())(t,16),this.y=new(rt())(r,16),n&&(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)}function At(e,t,r,n){pt.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(rt())(0)):(this.x=new(rt())(t,16),this.y=new(rt())(r,16),this.z=new(rt())(n,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}vt.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(rt())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(rt())(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],gt(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(rt())(e.a,16),b:new(rt())(e.b,16)}})):this._getEndoBasis(r)}}},vt.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:rt().mont(e),r=new(rt())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(rt())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},vt.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,u,l,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),h=new(rt())(1),p=new(rt())(0),m=new(rt())(0),y=new(rt())(1),g=0;0!==f.cmpn(0);){var v=d.div(f);u=d.sub(v.mul(f)),l=m.sub(v.mul(h));var b=y.sub(v.mul(p));if(!n&&u.cmp(c)<0)t=s.neg(),r=h,n=u.neg(),i=l;else if(n&&2==++g)break;s=u,d=f,f=u,m=h,h=l,y=p,p=b}o=u.neg(),a=l;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},vt.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(l).neg()}},vt.prototype.pointFromX=function(e,t){(e=new(rt())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},vt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},vt.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return l},yt(wt,pt.BasePoint),vt.prototype.point=function(e,t,r){return new wt(this,e,t,r)},vt.prototype.pointFromJSON=function(e,t){return wt.fromJSON(this,e,t)},wt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},wt.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]},wt.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},wt.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)+">"},wt.prototype.isInfinity=function(){return this.inf},wt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},wt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},wt.prototype.getX=function(){return this.x.fromRed()},wt.prototype.getY=function(){return this.y.fromRed()},wt.prototype.mul=function(e){return e=new(rt())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},wt.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},wt.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},wt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},wt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},wt.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},yt(At,pt.BasePoint),vt.prototype.jpoint=function(e,t,r){return new At(this,e,t,r)},At.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},At.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},At.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),c=l.redMul(s),f=n.redMul(l),d=u.redSqr().redIAdd(c).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},At.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=r.redMul(u),f=s.redSqr().redIAdd(l).redISub(c).redISub(c),d=s.redMul(c.redISub(f)).redISub(i.redMul(l)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},At.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var c=o.redSqr(),f=l.redSqr(),d=f.redSqr(),h=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=o.redMul(f),m=h.redSqr().redISub(p.redAdd(p)),y=p.redISub(m),g=h.redMul(y);g=g.redIAdd(g).redISub(d);var v=l.redMul(s);t+1<e&&(u=u.redMul(d)),o=m,s=v,l=g}return this.curve.jpoint(o,l.redMul(i),s)},At.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},At.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=u,t=s.redMul(a.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(c).redISub(d);h=h.redIAdd(h);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},At.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=s.redMul(a.redISub(u)).redISub(l),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(c).redMul(this.x.redAdd(c));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(c);var y=f.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=h.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,r)},At.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),l=(u=u.redIAdd(u)).redMul(a),c=s.redSqr().redISub(l.redAdd(l)),f=l.redISub(c),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,h,p)},At.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),c=t.redMul(l);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.x.redMul(s).redISub(c);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(l.redMul(u.redISub(l)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,d,h)},At.prototype.mul=function(e,t){return e=new(rt())(e,t),this.curve._wnafMul(this,e)},At.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},At.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},At.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)+">"},At.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var _t=ot((function(e,t){var r=t;r.base=pt,r.short=bt,r.mont=null,r.edwards=null})),St=ot((function(e,t){var r,n=t,i=lt.assert;function o(e){"short"===e.type?this.curve=new _t.short(e):"edwards"===e.type?this.curve=new _t.edwards(e):this.curve=new _t.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:it().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:it().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:it().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:it().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"]}),a("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:it().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:it().sha256,gRed:!1,g:["9"]}),a("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:it().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:it().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Mt(e){if(!(this instanceof Mt))return new Mt(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ut.toArray(e.entropy,e.entropyEnc||"hex"),r=ut.toArray(e.nonce,e.nonceEnc||"hex"),n=ut.toArray(e.pers,e.persEnc||"hex");at(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var xt=Mt;Mt.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Mt.prototype._hmac=function(){return new(it().hmac)(this.hash,this.K)},Mt.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Mt.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=ut.toArray(e,t),r=ut.toArray(r,n),at(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Mt.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ut.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,ut.encode(o,t)};var Tt=lt.assert;function Et(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var kt=Et;Et.fromPublic=function(e,t,r){return t instanceof Et?t:new Et(e,{pub:t,pubEnc:r})},Et.fromPrivate=function(e,t,r){return t instanceof Et?t:new Et(e,{priv:t,privEnc:r})},Et.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},Et.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Et.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Et.prototype._importPrivate=function(e,t){this.priv=new(rt())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Et.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Tt(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Tt(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Et.prototype.derive=function(e){return e.validate()||Tt(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Et.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Et.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Et.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Pt=lt.assert;function Ot(e,t){if(e instanceof Ot)return e;this._importDER(e,t)||(Pt(e.r&&e.s,"Signature without r or s"),this.r=new(rt())(e.r,16),this.s=new(rt())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var It=Ot;function Rt(){this.place=0}function Nt(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function Ct(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Bt(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Ot.prototype._importDER=function(e,t){e=lt.toArray(e,t);var r=new Rt;if(48!==e[r.place++])return!1;var n=Nt(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=Nt(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=Nt(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(rt())(o),this.s=new(rt())(s),this.recoveryParam=null,!0},Ot.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Ct(t),r=Ct(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Bt(n,t.length),(n=n.concat(t)).push(2),Bt(n,r.length);var i=n.concat(r),o=[48];return Bt(o,i.length),o=o.concat(i),lt.encode(o,e)};var Ft=function(){throw new Error("unsupported")},Lt=lt.assert;function Dt(e){if(!(this instanceof Dt))return new Dt(e);"string"==typeof e&&(Lt(Object.prototype.hasOwnProperty.call(St,e),"Unknown curve "+e),e=St[e]),e instanceof St.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var jt=Dt;Dt.prototype.keyPair=function(e){return new kt(this,e)},Dt.prototype.keyFromPrivate=function(e,t){return kt.fromPrivate(this,e,t)},Dt.prototype.keyFromPublic=function(e,t){return kt.fromPublic(this,e,t)},Dt.prototype.genKeyPair=function(e){e||(e={});for(var t=new xt({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Ft(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(rt())(2));;){var i=new(rt())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Dt.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Dt.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(rt())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new xt({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(rt())(1)),l=0;;l++){var c=n.k?n.k(l):new(rt())(s.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(u)>=0)){var f=this.g.mul(c);if(!f.isInfinity()){var d=f.getX(),h=d.umod(this.n);if(0!==h.cmpn(0)){var p=c.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(f.getY().isOdd()?1:0)|(0!==d.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new It({r:h,s:p,recoveryParam:m})}}}}}},Dt.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(rt())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new It(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),l=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),l)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Dt.prototype.recoverPubKey=function(e,t,r,n){Lt((3&r)===r,"The recovery param is more than two bits"),t=new It(t,n);var i=this.n,o=new(rt())(e),a=t.r,s=t.s,u=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var c=t.r.invm(i),f=i.sub(o).mul(c).umod(i),d=s.mul(c).umod(i);return this.g.mulAdd(f,a,d)},Dt.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new It(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Ut=ot((function(e,t){var r=t;r.version="6.5.4",r.utils=lt,r.rand=function(){throw new Error("unsupported")},r.curve=_t,r.curves=St,r.ec=jt,r.eddsa=null})).ec;const $t=new d.Logger("signing-key/5.7.0");let qt=null;function Kt(){return qt||(qt=new Ut("secp256k1")),qt}class Ht{constructor(e){(0,f.defineReadOnly)(this,"curve","secp256k1"),(0,f.defineReadOnly)(this,"privateKey",(0,l.hexlify)(e)),32!==(0,l.hexDataLength)(this.privateKey)&&$t.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Kt().keyFromPrivate((0,l.arrayify)(this.privateKey));(0,f.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,f.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,f.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=Kt().keyFromPublic((0,l.arrayify)(this.publicKey)),r=Kt().keyFromPublic((0,l.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Kt().keyFromPrivate((0,l.arrayify)(this.privateKey)),r=(0,l.arrayify)(e);32!==r.length&&$t.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return(0,l.splitSignature)({recoveryParam:n.recoveryParam,r:(0,l.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,l.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Kt().keyFromPrivate((0,l.arrayify)(this.privateKey)),r=Kt().keyFromPublic((0,l.arrayify)(zt(e)));return(0,l.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Wt(e,t){const r=(0,l.splitSignature)(t),n={r:(0,l.arrayify)(r.r),s:(0,l.arrayify)(r.s)};return"0x"+Kt().recoverPubKey((0,l.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function zt(e,t){const r=(0,l.arrayify)(e);if(32===r.length){const e=new Ht(r);return t?"0x"+Kt().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,l.hexlify)(r):"0x"+Kt().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Kt().keyFromPublic(r).getPublic(!0,"hex"):(0,l.hexlify)(r):$t.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Gt=new d.Logger("transactions/5.7.0");var Zt;function Vt(e){return"0x"===e?null:C(e)}function Jt(e){return"0x"===e?Q:c.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Zt||(Zt={}));const Yt=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Xt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Qt(e){const t=zt(e);return C((0,l.hexDataSlice)((0,b.keccak256)((0,l.hexDataSlice)(t,1)),12))}function er(e,t){return Qt(Wt((0,l.arrayify)(e),t))}function tr(e,t){const r=(0,l.stripZeros)(c.O$.from(e).toHexString());return r.length>32&&Gt.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function rr(e,t){return{address:C(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,l.hexDataLength)(t)&&Gt.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function nr(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Gt.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),rr(e[0],e[1])):rr(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return rr(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function ir(e){return nr(e).map((e=>[e.address,e.storageKeys]))}function or(e,t){if(null!=e.gasPrice){const t=c.O$.from(e.gasPrice),r=c.O$.from(e.maxFeePerGas||0);t.eq(r)||Gt.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[tr(e.chainId||0,"chainId"),tr(e.nonce||0,"nonce"),tr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),tr(e.maxFeePerGas||0,"maxFeePerGas"),tr(e.gasLimit||0,"gasLimit"),null!=e.to?C(e.to):"0x",tr(e.value||0,"value"),e.data||"0x",ir(e.accessList||[])];if(t){const e=(0,l.splitSignature)(t);r.push(tr(e.recoveryParam,"recoveryParam")),r.push((0,l.stripZeros)(e.r)),r.push((0,l.stripZeros)(e.s))}return(0,l.hexConcat)(["0x02",M(r)])}function ar(e,t){const r=[tr(e.chainId||0,"chainId"),tr(e.nonce||0,"nonce"),tr(e.gasPrice||0,"gasPrice"),tr(e.gasLimit||0,"gasLimit"),null!=e.to?C(e.to):"0x",tr(e.value||0,"value"),e.data||"0x",ir(e.accessList||[])];if(t){const e=(0,l.splitSignature)(t);r.push(tr(e.recoveryParam,"recoveryParam")),r.push((0,l.stripZeros)(e.r)),r.push((0,l.stripZeros)(e.s))}return(0,l.hexConcat)(["0x01",M(r)])}function sr(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Gt.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,f.checkProperties)(e,Xt);const r=[];Yt.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=(0,l.arrayify)((0,l.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&Gt.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,l.stripZeros)(n),n.length>t.maxLength&&Gt.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push((0,l.hexlify)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&Gt.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,l.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,l.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return M(r);const i=(0,l.splitSignature)(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Gt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Gt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,l.hexlify)(o)),r.push((0,l.stripZeros)((0,l.arrayify)(i.r))),r.push((0,l.stripZeros)((0,l.arrayify)(i.s))),M(r)}(e,t);switch(e.type){case 1:return ar(e,t);case 2:return or(e,t)}return Gt.throwError(`unsupported transaction type: ${e.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function ur(e,t,r){try{const r=Jt(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Gt.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,l.hexZeroPad)(t[1],32),e.s=(0,l.hexZeroPad)(t[2],32);try{const t=(0,b.keccak256)(r(e));e.from=er(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function lr(e){const t=(0,l.arrayify)(e);if(t[0]>127)return function(e){const t=E(e);9!==t.length&&6!==t.length&&Gt.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Jt(t[0]).toNumber(),gasPrice:Jt(t[1]),gasLimit:Jt(t[2]),to:Vt(t[3]),value:Jt(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=c.O$.from(t[6]).toNumber()}catch(e){return r}if(r.r=(0,l.hexZeroPad)(t[7],32),r.s=(0,l.hexZeroPad)(t[8],32),c.O$.from(r.r).isZero()&&c.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push((0,l.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=(0,b.keccak256)(M(i));try{r.from=er(o,{r:(0,l.hexlify)(r.r),s:(0,l.hexlify)(r.s),recoveryParam:n})}catch(e){}r.hash=(0,b.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=E(e.slice(1));8!==t.length&&11!==t.length&&Gt.throwArgumentError("invalid component count for transaction type: 1","payload",(0,l.hexlify)(e));const r={type:1,chainId:Jt(t[0]).toNumber(),nonce:Jt(t[1]).toNumber(),gasPrice:Jt(t[2]),gasLimit:Jt(t[3]),to:Vt(t[4]),value:Jt(t[5]),data:t[6],accessList:nr(t[7])};return 8===t.length||(r.hash=(0,b.keccak256)(e),ur(r,t.slice(8),ar)),r}(t);case 2:return function(e){const t=E(e.slice(1));9!==t.length&&12!==t.length&&Gt.throwArgumentError("invalid component count for transaction type: 2","payload",(0,l.hexlify)(e));const r=Jt(t[2]),n=Jt(t[3]),i={type:2,chainId:Jt(t[0]).toNumber(),nonce:Jt(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Jt(t[4]),to:Vt(t[5]),value:Jt(t[6]),data:t[7],accessList:nr(t[8])};return 9===t.length||(i.hash=(0,b.keccak256)(e),ur(i,t.slice(9),or)),i}(t)}return Gt.throwError(`unsupported transaction type: ${t[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var cr=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const fr=new d.Logger("contracts/5.7.0"),dr={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function hr(e,t){return cr(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&fr.throwArgumentError("invalid address or ENS name","name",r);try{return C(r)}catch(e){}e||fr.throwError("a provider or signer is needed to resolve ENS names",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&fr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function pr(e,t,r){return cr(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>pr(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield hr(e,t):"tuple"===r.type?yield pr(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>pr(e,t,r.arrayChildren)))):Promise.reject(fr.makeError("invalid value for array",d.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function mr(e,t,r){return cr(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,f.shallowCopy)(r.pop())),fr.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,f.resolveProperties)({override:hr(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>cr(this,void 0,void 0,(function*(){return C(e.signer)!==e.override&&fr.throwError("Contract with a Signer cannot override from",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=hr(e.provider,n.from));const i=yield(0,f.resolveProperties)({args:pr(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,f.resolveProperties)(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=c.O$.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=c.O$.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=c.O$.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=c.O$.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=c.O$.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=nr(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=(0,l.arrayify)(o);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);a.gasLimit=c.O$.from(t.gas).add(e)}if(s.value){const e=c.O$.from(s.value);e.isZero()||t.payable||fr.throwError("non-payable method cannot override value",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),a.value=e}s.customData&&(a.customData=(0,f.shallowCopy)(s.customData)),s.ccipReadEnabled&&(a.ccipReadEnabled=!!s.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const u=Object.keys(n).filter((e=>null!=n[e]));return u.length&&fr.throwError(`cannot override ${u.map((e=>JSON.stringify(e))).join(",")}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function yr(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=(0,f.deepCopy)(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function gr(e,t,r){const n=e.signer||e.provider;return function(...i){return cr(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=(0,f.shallowCopy)(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield mr(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===d.Logger.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function vr(e,t,r){return t.constant?gr(e,t,r):function(e,t){return function(...r){return cr(this,void 0,void 0,(function*(){e.signer||fr.throwError("sending a transaction requires a signer",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield mr(e,t,r),i=yield e.signer.sendTransaction(n);return yr(e,i),i}))}}(e,t)}function br(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class wr{constructor(e,t){(0,f.defineReadOnly)(this,"tag",e),(0,f.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e&&(t=!0,1))))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Ar extends wr{constructor(){super("error",null)}}class _r extends wr{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&fr.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(br(i),i),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"interface",t),(0,f.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=m(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Sr extends wr{constructor(e,t){super("*",{address:e}),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Mr{constructor(e,t,r){(0,f.defineReadOnly)(this,"interface",(0,f.getStatic)(new.target,"getInterface")(t)),null==r?((0,f.defineReadOnly)(this,"provider",null),(0,f.defineReadOnly)(this,"signer",null)):Qe.isSigner(r)?((0,f.defineReadOnly)(this,"provider",r.provider||null),(0,f.defineReadOnly)(this,"signer",r)):Ze.isProvider(r)?((0,f.defineReadOnly)(this,"provider",r),(0,f.defineReadOnly)(this,"signer",null)):fr.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,f.defineReadOnly)(this,"callStatic",{}),(0,f.defineReadOnly)(this,"estimateGas",{}),(0,f.defineReadOnly)(this,"functions",{}),(0,f.defineReadOnly)(this,"populateTransaction",{}),(0,f.defineReadOnly)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];(0,f.defineReadOnly)(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?(0,f.defineReadOnly)(this.filters,t,this.filters[r[0]]):fr.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if((0,f.defineReadOnly)(this,"_runningEvents",{}),(0,f.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&fr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,f.defineReadOnly)(this,"address",e),this.provider)(0,f.defineReadOnly)(this,"resolvedAddress",hr(this.provider,e));else try{(0,f.defineReadOnly)(this,"resolvedAddress",Promise.resolve(C(e)))}catch(e){fr.throwError("provider is required to use ENS name as contract address",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])fr.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&(0,f.defineReadOnly)(this,e,vr(this,t,!0)),null==this.functions[e]&&(0,f.defineReadOnly)(this.functions,e,vr(this,t,!1)),null==this.callStatic[e]&&(0,f.defineReadOnly)(this.callStatic,e,gr(this,t,!0)),null==this.populateTransaction[e]&&(0,f.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(...r){return mr(e,t,r)}}(this,t)),null==this.estimateGas[e]&&(0,f.defineReadOnly)(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return cr(this,void 0,void 0,(function*(){r||fr.throwError("estimate require a provider or signer",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield mr(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&(0,f.defineReadOnly)(this,e,this[r])}catch(e){}null==this.functions[e]&&(0,f.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,f.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,f.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,f.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return L(e)}static getInterface(e){return We.isInterface(e)?e:new We(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&fr.throwError("contract not deployed",d.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||fr.throwError("sending a transactions require a signer",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,f.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&fr.throwError("cannot override "+e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new et(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,f.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return qe.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Ar);if("event"===e)return this._normalizeRunningEvent(new wr("event",null));if("*"===e)return this._normalizeRunningEvent(new Sr(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new _r(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new _r(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new wr(br(t),t))}return this._normalizeRunningEvent(new Sr(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=(0,f.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||fr.throwError("events require a provider or a signer with a provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=(0,f.shallowCopy)(n.filter);return"string"==typeof t&&(0,l.isHexString)(t,32)?(null!=r&&fr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class xr extends Mr{}class Tr{constructor(e,t,r){let n=null;n="string"==typeof t?t:(0,l.isBytes)(t)?(0,l.hexlify)(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,l.isHexString)(n)||n.length%2)&&fr.throwArgumentError("invalid bytecode","bytecode",t),r&&!Qe.isSigner(r)&&fr.throwArgumentError("invalid signer","signer",r),(0,f.defineReadOnly)(this,"bytecode",n),(0,f.defineReadOnly)(this,"interface",(0,f.getStatic)(new.target,"getInterface")(e)),(0,f.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=(0,f.shallowCopy)(e.pop());for(const e in t)if(!dr[e])throw new Error("unknown transaction override "+e)}return["data","from","to"].forEach((e=>{null!=t[e]&&fr.throwError("cannot override "+e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value&&(c.O$.from(t.value).isZero()||this.interface.deploy.payable||fr.throwError("non-payable constructor cannot override value",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})),fr.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,l.hexlify)((0,l.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return cr(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),fr.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield pr(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,f.getStatic)(this.constructor,"getContractAddress")(i),a=(0,f.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return yr(a,i),(0,f.defineReadOnly)(a,"deployTransaction",i),a}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&fr.throwError("missing compiler output",d.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return xr.getInterface(e)}static getContractAddress(e){return L(e)}static getContract(e,t,r){return new xr(e,t,r)}}var Er=r(335);const kr="Ethereum Signed Message:\n";function Pr(e){return"string"==typeof e&&(e=(0,j.Y0)(e)),(0,b.keccak256)((0,l.concat)([(0,j.Y0)(kr),(0,j.Y0)(String(e.length)),e]))}const Or="hash/5.7.0";const Ir=new d.Logger(Or),Rr=new Uint8Array(32);Rr.fill(0);const Nr=c.O$.from(-1),Cr=c.O$.from(0),Br=c.O$.from(1),Fr=c.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Lr=(0,l.hexZeroPad)(Br.toHexString(),32),Dr=(0,l.hexZeroPad)(Cr.toHexString(),32),jr={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Ur=["name","version","chainId","verifyingContract","salt"];function $r(e){return function(t){return"string"!=typeof t&&Ir.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const qr={name:$r("name"),version:$r("version"),chainId:function(e){try{return c.O$.from(e).toString()}catch(e){}return Ir.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return C(e).toLowerCase()}catch(e){}return Ir.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=(0,l.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,l.hexlify)(t)}catch(e){}return Ir.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Kr(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Ir.throwArgumentError("invalid numeric width","type",e);const i=Fr.mask(r?n-1:n),o=r?i.add(Br).mul(Nr):Cr;return function(t){const r=c.O$.from(t);return(r.lt(o)||r.gt(i))&&Ir.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,l.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Ir.throwArgumentError("invalid bytes width","type",e),function(t){return(0,l.arrayify)(t).length!==r&&Ir.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=(0,l.arrayify)(e),r=t.length%32;return r?(0,l.hexConcat)([t,Rr.slice(r)]):(0,l.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,l.hexZeroPad)(C(e),32)};case"bool":return function(e){return e?Lr:Dr};case"bytes":return function(e){return(0,b.keccak256)(e)};case"string":return function(e){return U(e)}}return null}function Hr(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Wr{constructor(e){(0,f.defineReadOnly)(this,"types",Object.freeze((0,f.deepCopy)(e))),(0,f.defineReadOnly)(this,"_encoderCache",{}),(0,f.defineReadOnly)(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Ir.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Ir.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),Kr(a)||(r[a]||Ir.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Ir.throwArgumentError("missing primary type","types",e):i.length>1&&Ir.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,f.defineReadOnly)(this,"primaryType",i[0]),function i(o,a){a[o]&&Ir.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=Hr(t,e[t])+r.map((t=>Hr(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Kr(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Ir.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(b.keccak256)),(0,b.keccak256)((0,l.hexConcat)(i))}}const r=this.types[e];if(r){const t=U(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?(0,b.keccak256)(n):n}));return n.unshift(t),(0,l.hexConcat)(n)}}return Ir.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Ir.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,b.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Kr(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Ir.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Ir.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Wr(e)}static getPrimaryType(e){return Wr.from(e).primaryType}static hashStruct(e,t,r){return Wr.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=jr[r];n||Ir.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>Ur.indexOf(e.name)-Ur.indexOf(t.name))),Wr.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,l.hexConcat)(["0x1901",Wr.hashDomain(e),Wr.from(t).hash(r)])}static hash(e,t,r){return(0,b.keccak256)(Wr.encode(e,t,r))}static resolveNames(e,t,r,n){return i=this,o=void 0,s=function*(){e=(0,f.shallowCopy)(e);const i={};e.verifyingContract&&!(0,l.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=Wr.from(t);o.visit(r,((e,t)=>("address"!==e||(0,l.isHexString)(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{u(s.next(e))}catch(e){t(e)}}function n(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}u((s=s.apply(i,o||[])).next())}));var i,o,a,s}static getPayload(e,t,r){Wr.hashDomain(e);const n={},i=[];Ur.forEach((t=>{const r=e[t];null!=r&&(n[t]=qr[t](r),i.push({name:t,type:jr[t]}))}));const o=Wr.from(t),a=(0,f.shallowCopy)(t);return a.EIP712Domain?Ir.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,l.hexlify)((0,l.arrayify)(t));if(e.match(/^u?int/))return c.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Ir.throwArgumentError("invalid string","value",t),t}return Ir.throwArgumentError("unsupported type","type",e)}))}}}class zr{constructor(e){(0,f.defineReadOnly)(this,"alphabet",e),(0,f.defineReadOnly)(this,"base",e.length),(0,f.defineReadOnly)(this,"_alphabetMap",{}),(0,f.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=(0,l.arrayify)(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return(0,l.arrayify)(new Uint8Array(t.reverse()))}}new zr("abcdefghijklmnopqrstuvwxyz234567");const Gr=new zr("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Zr;!function(e){e.sha256="sha256",e.sha512="sha512"}(Zr||(Zr={}));const Vr=new d.Logger("sha2/5.7.0");function Jr(e){return"0x"+it().ripemd160().update((0,l.arrayify)(e)).digest("hex")}function Yr(e){return"0x"+it().sha256().update((0,l.arrayify)(e)).digest("hex")}function Xr(e){return"0x"+it().sha512().update((0,l.arrayify)(e)).digest("hex")}function Qr(e,t,r){return Zr[e]||Vr.throwError("unsupported algorithm "+e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+it().hmac(it()[e],(0,l.arrayify)(t)).update((0,l.arrayify)(r)).digest("hex")}function en(e,t,r,n,i){let o;e=(0,l.arrayify)(e),t=(0,l.arrayify)(t);let a=1;const s=new Uint8Array(n),u=new Uint8Array(t.length+4);let c,f;u.set(t);for(let d=1;d<=a;d++){u[t.length]=d>>24&255,u[t.length+1]=d>>16&255,u[t.length+2]=d>>8&255,u[t.length+3]=255&d;let h=(0,l.arrayify)(Qr(i,e,u));o||(o=h.length,f=new Uint8Array(o),a=Math.ceil(n/o),c=n-(a-1)*o),f.set(h);for(let t=1;t<r;t++){h=(0,l.arrayify)(Qr(i,e,h));for(let e=0;e<o;e++)f[e]^=h[e]}const p=(d-1)*o,m=d===a?c:o;s.set((0,l.arrayify)(f).slice(0,m),p)}return(0,l.hexlify)(s)}const tn=new d.Logger("wordlists/5.7.0");class rn{constructor(e){tn.checkAbstract(new.target,rn),(0,f.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return U(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}const nn="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let on=null;function an(e){if(null==on&&(on=nn.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==rn.check(e)))throw on=null,new Error("BIP39 Wordlist for en (English) FAILED")}const sn=new class extends rn{constructor(){super("en")}getWord(e){return an(this),on[e]}getWordIndex(e){return an(this),on.indexOf(e)}};rn.register(sn);const un={en:sn},ln=new d.Logger("hdnode/5.7.0"),cn=c.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),fn=(0,j.Y0)("Bitcoin seed"),dn=2147483648;function hn(e){return(1<<e)-1<<8-e}function pn(e){return(0,l.hexZeroPad)((0,l.hexlify)(e),32)}function mn(e){return Gr.encode((0,l.concat)([e,(0,l.hexDataSlice)(Yr(Yr(e)),0,4)]))}function yn(e){if(null==e)return un.en;if("string"==typeof e){const t=un[e];return null==t&&ln.throwArgumentError("unknown locale","wordlist",e),t}return e}const gn={},vn="m/44'/60'/0'/0/0";class bn{constructor(e,t,r,n,i,o,a,s){if(e!==gn)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new Ht(t);(0,f.defineReadOnly)(this,"privateKey",e.privateKey),(0,f.defineReadOnly)(this,"publicKey",e.compressedPublicKey)}else(0,f.defineReadOnly)(this,"privateKey",null),(0,f.defineReadOnly)(this,"publicKey",(0,l.hexlify)(r));(0,f.defineReadOnly)(this,"parentFingerprint",n),(0,f.defineReadOnly)(this,"fingerprint",(0,l.hexDataSlice)(Jr(Yr(this.publicKey)),0,4)),(0,f.defineReadOnly)(this,"address",Qt(this.publicKey)),(0,f.defineReadOnly)(this,"chainCode",i),(0,f.defineReadOnly)(this,"index",o),(0,f.defineReadOnly)(this,"depth",a),null==s?((0,f.defineReadOnly)(this,"mnemonic",null),(0,f.defineReadOnly)(this,"path",null)):"string"==typeof s?((0,f.defineReadOnly)(this,"mnemonic",null),(0,f.defineReadOnly)(this,"path",s)):((0,f.defineReadOnly)(this,"mnemonic",s),(0,f.defineReadOnly)(this,"path",s.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return mn((0,l.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,l.hexlify)(this.depth),this.parentFingerprint,(0,l.hexZeroPad)((0,l.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,l.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new bn(gn,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(e&~dn));const r=new Uint8Array(37);if(e&dn){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,l.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,l.arrayify)(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=(0,l.arrayify)(Qr(Zr.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;this.privateKey?a=pn(c.O$.from(i).add(this.privateKey).mod(cn)):s=new Ht((0,l.hexlify)(i))._addPoint(this.publicKey);let u=t;const f=this.mnemonic;return f&&(u=Object.freeze({phrase:f.phrase,path:t,locale:f.locale||"en"})),new bn(gn,a,s,this.fingerprint,pn(o),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const n=t[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=dn)throw new Error("invalid path index - "+n);r=r._derive(dn+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=dn)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=(0,l.arrayify)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,l.arrayify)(Qr(Zr.sha512,fn,r));return new bn(gn,pn(n.slice(0,32)),null,"0x00000000",pn(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=_n(An(e,r=yn(r)),r),bn._fromSeed(wn(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return bn._fromSeed(e,null)}static fromExtendedKey(e){const t=Gr.decode(e);82===t.length&&mn(t.slice(0,78))===e||ln.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=(0,l.hexlify)(t.slice(5,9)),i=parseInt((0,l.hexlify)(t.slice(9,13)).substring(2),16),o=(0,l.hexlify)(t.slice(13,45)),a=t.slice(45,78);switch((0,l.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new bn(gn,null,(0,l.hexlify)(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new bn(gn,(0,l.hexlify)(a.slice(1)),null,n,o,i,r,null)}return ln.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function wn(e,t){t||(t="");const r=(0,j.Y0)("mnemonic"+t,j.Uj.NFKD);return en((0,j.Y0)(e,j.Uj.NFKD),r,2048,64,"sha512")}function An(e,t){t=yn(t),ln.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=(0,l.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e<r.length;e++){let o=t.getWordIndex(r[e].normalize("NFKD"));if(-1===o)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)o&1<<10-e&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=hn(r.length/3);if(((0,l.arrayify)(Yr(n.slice(0,o/8)))[0]&a)!=(n[n.length-1]&a))throw new Error("invalid checksum");return(0,l.hexlify)(n.slice(0,o/8))}function _n(e,t){if(t=yn(t),(e=(0,l.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=(0,l.arrayify)(Yr(e))[0]&hn(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}function Sn(e,t){try{return An(e,t),!0}catch(e){}return!1}function Mn(e){return("number"!=typeof e||e<0||e>=dn||e%1)&&ln.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}const xn=new d.Logger("random/5.7.0"),Tn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let En=Tn.crypto||Tn.msCrypto;function kn(e){(e<=0||e>1024||e%1||e!=e)&&xn.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return En.getRandomValues(t),(0,l.arrayify)(t)}En&&En.getRandomValues||(xn.warn("WARNING: Missing strong random number source"),En={getRandomValues:function(e){return xn.throwError("no secure random source avaialble",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Pn=r(8826),On=r.n(Pn),In=r(7635),Rn=r.n(In);function Nn(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,l.arrayify)(e)}function Cn(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function Bn(e){return"string"==typeof e?(0,j.Y0)(e,j.Uj.NFKC):(0,l.arrayify)(e)}function Fn(e,t){let r=e;const n=t.toLowerCase().split("/");for(let e=0;e<n.length;e++){let t=null;for(const i in r)if(i.toLowerCase()===n[e]){t=r[i];break}if(null===t)return null;r=t}return r}function Ln(e){const t=(0,l.arrayify)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,l.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const Dn="json-wallets/5.7.0";var jn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Un=new d.Logger(Dn);function $n(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class qn extends f.Description{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function Kn(e,t){const r=Nn(Fn(e,"crypto/ciphertext"));if((0,l.hexlify)((0,b.keccak256)((0,l.concat)([t.slice(16,32),r]))).substring(2)!==Fn(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Fn(e,"crypto/cipher")){const n=Nn(Fn(e,"crypto/cipherparams/iv")),i=new(On().Counter)(n),o=new(On().ModeOfOperation.ctr)(t,i);return(0,l.arrayify)(o.decrypt(r))}return null}(e,t.slice(0,16),r);n||Un.throwError("unsupported cipher",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Qt(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),C(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:(0,l.hexlify)(n)};if("0.1"===Fn(e,"x-ethers/version")){const t=Nn(Fn(e,"x-ethers/mnemonicCiphertext")),r=Nn(Fn(e,"x-ethers/mnemonicCounter")),n=new(On().Counter)(r),o=new(On().ModeOfOperation.ctr)(i,n),s=Fn(e,"x-ethers/path")||vn,u=Fn(e,"x-ethers/locale")||"en",c=(0,l.arrayify)(o.decrypt(t));try{const e=_n(c,u),t=bn.fromMnemonic(e,null,u).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==d.Logger.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new qn(a)}function Hn(e,t,r,n,i){return(0,l.arrayify)(en(e,t,r,n,i))}function Wn(e,t,r,n,i){return Promise.resolve(Hn(e,t,r,n,i))}function zn(e,t,r,n,i){const o=Bn(t),a=Fn(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return Un.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Nn(Fn(e,"crypto/kdfparams/salt")),s=parseInt(Fn(e,"crypto/kdfparams/n")),u=parseInt(Fn(e,"crypto/kdfparams/r")),l=parseInt(Fn(e,"crypto/kdfparams/p"));s&&u&&l||t("kdf",a),0!=(s&s-1)&&t("N",s);const c=parseInt(Fn(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),n(o,r,s,u,l,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Nn(Fn(e,"crypto/kdfparams/salt"));let i=null;const a=Fn(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Fn(e,"crypto/kdfparams/c")),u=parseInt(Fn(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),r(o,n,s,u,i)}}return Un.throwArgumentError("unsupported key-derivation function","kdf",a)}const Gn=new d.Logger(Dn);class Zn extends f.Description{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function Vn(e,t){const r=JSON.parse(e);t=Bn(t);const n=C(Fn(r,"ethaddr")),i=Nn(Fn(r,"encseed"));i&&i.length%16==0||Gn.throwArgumentError("invalid encseed","json",e);const o=(0,l.arrayify)(en(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),u=new(On().ModeOfOperation.cbc)(o,a),c=On().padding.pkcs7.strip((0,l.arrayify)(u.decrypt(s)));let f="";for(let e=0;e<c.length;e++)f+=String.fromCharCode(c[e]);const d=(0,j.Y0)(f),h=(0,b.keccak256)(d);return new Zn({_isCrowdsaleAccount:!0,address:n,privateKey:h})}function Jn(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function Yn(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function Xn(e){if(Jn(e))try{return C(JSON.parse(e).ethaddr)}catch(e){return null}if(Yn(e))try{return C(JSON.parse(e).address)}catch(e){return null}return null}var Qn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ei=new d.Logger("wallet/5.7.0");class ti extends Qe{constructor(e,t){if(super(),null!=(r=e)&&(0,l.isHexString)(r.privateKey,32)&&null!=r.address){const t=new Ht(e.privateKey);if((0,f.defineReadOnly)(this,"_signingKey",(()=>t)),(0,f.defineReadOnly)(this,"address",Qt(this.publicKey)),this.address!==C(e.address)&&ei.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,f.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||vn,locale:t.locale||"en"})));const r=this.mnemonic;Qt(bn.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ei.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,f.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(Ht.isSigningKey(e))"secp256k1"!==e.curve&&ei.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,f.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new Ht(e);(0,f.defineReadOnly)(this,"_signingKey",(()=>t))}(0,f.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,f.defineReadOnly)(this,"address",Qt(this.publicKey))}var r;t&&!Ze.isProvider(t)&&ei.throwArgumentError("invalid provider","provider",t),(0,f.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new ti(this,e)}signTransaction(e){return(0,f.resolveProperties)(e).then((t=>{null!=t.from&&(C(t.from)!==this.address&&ei.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest((0,b.keccak256)(sr(t)));return sr(t,r)}))}signMessage(e){return Qn(this,void 0,void 0,(function*(){return(0,l.joinSignature)(this._signingKey().signDigest(Pr(e)))}))}_signTypedData(e,t,r){return Qn(this,void 0,void 0,(function*(){const n=yield Wr.resolveNames(e,t,r,(e=>(null==this.provider&&ei.throwError("cannot resolve ENS names without a provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,l.joinSignature)(this._signingKey().signDigest(Wr.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(C(e.address)!==Qt(e.privateKey))throw new Error("address/privateKey mismatch");if($n(e)){const t=e.mnemonic;if(bn.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||vn).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=(0,l.arrayify)(e.privateKey),o=Bn(t);let a=null,s=null,u=null;if($n(e)){const t=e.mnemonic;a=(0,l.arrayify)(An(t.phrase,t.locale||"en")),s=t.path||vn,u=t.locale||"en"}let c=r.client;c||(c="ethers.js");let f=null;f=r.salt?(0,l.arrayify)(r.salt):kn(32);let d=null;if(r.iv){if(d=(0,l.arrayify)(r.iv),16!==d.length)throw new Error("invalid iv")}else d=kn(16);let h=null;if(r.uuid){if(h=(0,l.arrayify)(r.uuid),16!==h.length)throw new Error("invalid uuid")}else h=kn(16);let p=1<<17,m=8,y=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(m=r.scrypt.r),r.scrypt.p&&(y=r.scrypt.p)),Rn().scrypt(o,f,p,m,y,64,n).then((t=>{const r=(t=(0,l.arrayify)(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new(On().Counter)(d),v=new(On().ModeOfOperation.ctr)(r,g),w=(0,l.arrayify)(v.encrypt(i)),A=(0,b.keccak256)((0,l.concat)([n,w])),_={address:e.address.substring(2).toLowerCase(),id:Ln(h),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,l.hexlify)(d).substring(2)},ciphertext:(0,l.hexlify)(w).substring(2),kdf:"scrypt",kdfparams:{salt:(0,l.hexlify)(f).substring(2),n:p,dklen:32,p:y,r:m},mac:A.substring(2)}};if(a){const e=kn(16),t=new(On().Counter)(e),r=new(On().ModeOfOperation.ctr)(o,t),n=(0,l.arrayify)(r.encrypt(a)),i=new Date,f=i.getUTCFullYear()+"-"+Cn(i.getUTCMonth()+1,2)+"-"+Cn(i.getUTCDate(),2)+"T"+Cn(i.getUTCHours(),2)+"-"+Cn(i.getUTCMinutes(),2)+"-"+Cn(i.getUTCSeconds(),2)+".0Z";_["x-ethers"]={client:c,gethFilename:"UTC--"+f+"--"+_.address,mnemonicCounter:(0,l.hexlify)(e).substring(2),mnemonicCiphertext:(0,l.hexlify)(n).substring(2),path:s,locale:u,version:"0.1"}}return JSON.stringify(_)}))}(this,e,t,r)}static createRandom(e){let t=kn(16);e||(e={}),e.extraEntropy&&(t=(0,l.arrayify)((0,l.hexDataSlice)((0,b.keccak256)((0,l.concat)([t,e.extraEntropy])),0,16)));const r=_n(t,e.locale);return ti.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return function(e,t,r){if(Jn(e)){r&&r(0);const n=Vn(e,t);return r&&r(1),Promise.resolve(n)}return Yn(e)?function(e,t,r){return jn(this,void 0,void 0,(function*(){const n=JSON.parse(e);return Kn(n,yield zn(n,t,Wn,Rn().scrypt,r))}))}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}(e,t,r).then((e=>new ti(e)))}static fromEncryptedJsonSync(e,t){return new ti(function(e,t){if(Jn(e))return Vn(e,t);if(Yn(e))return function(e,t){const r=JSON.parse(e);return Kn(r,zn(r,t,Hn,Rn().syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}(e,t))}static fromMnemonic(e,t,r){return t||(t=vn),new ti(bn.fromMnemonic(e,null,r).derivePath(t))}}function ri(e,t){return er(Pr(e),t)}function ni(e,t,r,n){return er(Wr.hash(e,t,r),n)}const ii="0x0000000000000000000000000000000000000000";var oi=r(7218);const ai="Ξ",si=new d.Logger("networks/5.7.1");function ui(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return ui(e)},t}function li(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return li(e,t)},r}const ci={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ui("homestead")},fi={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ui("ropsten")},di={chainId:63,name:"classicMordor",_defaultProvider:li("https://www.ethercluster.com/mordor","classicMordor")},hi={unspecified:{chainId:0,name:"unspecified"},homestead:ci,mainnet:ci,morden:{chainId:2,name:"morden"},ropsten:fi,testnet:fi,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ui("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ui("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ui("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ui("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:li("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:di,classicTestnet:di,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:li("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ui("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ui("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function pi(e){if(null==e)return null;if("number"==typeof e){for(const t in hi){const r=hi[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=hi[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=hi[e.name];if(!t)return"number"!=typeof e.chainId&&si.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&si.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function mi(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,l.arrayify)(t)}function yi(e){e=(0,l.arrayify)(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function gi(e,t){null==t&&(t=1);const r=[],n=r.forEach,i=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function vi(e){return 1&e?~e>>1:e>>1}function bi(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function wi(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=vi(t());return r}function Ai(e,t){let r=bi(e(),e),n=e(),i=bi(n,e),o=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<o[e];t++)r.push(i[e]+t);return t?r.map((e=>t[e])):r}function _i(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<t;i++)wi(e,r).forEach(((e,t)=>n[t].push(e)));return n}function Si(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return gi(_i(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function Mi(e,t){return _i(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const xi=function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e<n;e++)o.push(i+=r());let a=r(),s=t;t+=a;let u=0,l=0;function c(){return 0==u&&(l=l<<8|e[t++],u=8),l>>--u&1}const f=Math.pow(2,31),d=f>>>1,h=d>>1,p=f-1;let m=0;for(let e=0;e<31;e++)m=m<<1|c();let y=[],g=0,v=f;for(;;){let e=Math.floor(((m-g+1)*i-1)/v),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<o[n]?r=n:t=n}if(0==t)break;y.push(t);let a=g+Math.floor(v*o[t]/i),s=g+Math.floor(v*o[t+1]/i)-1;for(;0==((a^s)&d);)m=m<<1&p|c(),a=a<<1&p,s=s<<1&p|1;for(;a&~s&h;)m=m&d|m<<1&p>>>1|c(),a=a<<1^d,s=(s^d)<<1|d|1;g=a,v=1+s-a}let b=n-4;return y.map((t=>{switch(t-b){case 3:return b+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return b+256+(e[s++]<<8|e[s++]);case 1:return b+e[s++];default:return t-1}}))}(mi("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))),Ti=new Set(Ai(xi)),Ei=new Set(Ai(xi)),ki=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Si(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Mi(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(gi(t))}(xi),Pi=function(e){let t=Ai(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let i=Ai(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(xi),Oi=45,Ii=95;function Ri(e){return(0,j.XL)(e)}function Ni(e){return e.filter((e=>65039!=e))}function Ci(e){for(let t of e.split(".")){let e=Ri(t);try{for(let t=e.lastIndexOf(Ii)-1;t>=0;t--)if(e[t]!==Ii)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Oi&&e[3]===Oi)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Bi(e,t){var r;let n,i,o=Pi,a=[],s=e.length;for(t&&(t.length=0);s;){let u=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(u))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const Fi=new d.Logger(Or),Li=new Uint8Array(32);function Di(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function ji(e){const t=(0,j.Y0)(function(e){return Ci(function(e,t){let r=Ri(e).reverse(),n=[];for(;r.length;){let e=Bi(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Ti.has(i)){n.push(i);continue}if(Ei.has(i))continue;let o=ki[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Ci(String.fromCodePoint(...n).normalize("NFC"))}(e,Ni))}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(Di(t.slice(n,e))),n=e+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Di(t.slice(n))),r}function Ui(e){try{return 0!==ji(e).length}catch(e){}return!1}function $i(e){"string"!=typeof e&&Fi.throwArgumentError("invalid ENS name; not a string","name",e);let t=Li;const r=ji(e);for(;r.length;)t=(0,b.keccak256)((0,l.concat)([t,(0,b.keccak256)(r.pop())]));return(0,l.hexlify)(t)}function qi(e){return(0,l.hexlify)((0,l.concat)(ji(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}Li.fill(0);var Ki=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Hi(e,t){return Ki(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:(0,l.arrayify)(new Uint8Array(i))}}))}var Wi=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const zi=new d.Logger("web/5.7.1");function Gi(e){return new Promise((t=>{setTimeout(t,e)}))}function Zi(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,l.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,j.ZN)(e)}catch(e){}return(0,l.hexlify)(e)}return e}function Vi(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;zi.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;zi.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let u=null;const l={method:"GET"};let c=!1,h=12e4;if("string"==typeof e)u=e;else if("object"==typeof e){if(null!=e&&null!=e.url||zi.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"==typeof e.timeout&&e.timeout>0&&(h=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(c=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&zi.throwError("basic authentication requires a secure https url",d.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+yi((0,j.Y0)(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=(0,f.shallowCopy)(e.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),m=u?u.match(p):null;if(m)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":m[1]||"text/plain"},body:m[2]?mi(m[3]):(y=m[3],(0,j.Y0)(y.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){zi.throwError("processing response error",d.Logger.errors.SERVER_ERROR,{body:Zi(m[1],m[2]),error:e,requestBody:null,requestMethod:"GET",url:u})}var y;t&&(l.method="POST",l.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const g={};Object.keys(s).forEach((e=>{const t=s[e];g[t.key]=t.value})),l.headers=g;const v=function(){let e=null;return{promise:new Promise((function(t,r){h&&(e=setTimeout((()=>{null!=e&&(e=null,r(zi.makeError("timeout",d.Logger.errors.TIMEOUT,{requestBody:Zi(l.body,g["content-type"]),requestMethod:l.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),b=function(){return Wi(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield Hi(u,l),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===l.method&&e.match(/^https:/)){u=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(i&&(r=yield i(e,u)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,e))),yield Gi(r);continue}}}catch(e){t=e.response,null==t&&(v.cancel(),zi.throwError("missing response",d.Logger.errors.SERVER_ERROR,{requestBody:Zi(l.body,g["content-type"]),requestMethod:l.method,serverError:e,url:u}))}let s=t.body;if(c&&304===t.statusCode?s=null:!a&&(t.statusCode<200||t.statusCode>=300)&&(v.cancel(),zi.throwError("bad response",d.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Zi(s,t.headers?t.headers["content-type"]:null),requestBody:Zi(l.body,g["content-type"]),requestMethod:l.method,url:u})),r)try{const e=yield r(s,t);return v.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(i&&(t=yield i(e,u)),t){const t=o*parseInt(String(Math.random()*Math.pow(2,e)));yield Gi(t);continue}}v.cancel(),zi.throwError("processing response error",d.Logger.errors.SERVER_ERROR,{body:Zi(s,t.headers?t.headers["content-type"]:null),error:r,requestBody:Zi(l.body,g["content-type"]),requestMethod:l.method,url:u})}return v.cancel(),s}return zi.throwError("failed response",d.Logger.errors.SERVER_ERROR,{requestBody:Zi(l.body,g["content-type"]),requestMethod:l.method,url:u})}))}();return Promise.race([v.promise,b])}function Ji(e,t,r){let n=null;if(null!=t){n=(0,j.Y0)(t);const r="string"==typeof e?{url:e}:(0,f.shallowCopy)(e);r.headers?0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=(0,f.shallowCopy)(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return Vi(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,j.ZN)(e))}catch(t){zi.throwError("invalid JSON",d.Logger.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Yi(e,t){return t||(t={}),null==(t=(0,f.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(u++,u>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}var Xi=r(2882),Qi=r.n(Xi);const eo="providers/5.7.2";var to=r(5108);const ro=new d.Logger(eo);class no{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:o,type:u,accessList:no.allowNull(this.accessList.bind(this),null),blockHash:no.allowNull(o,null),blockNumber:no.allowNull(s,null),transactionIndex:no.allowNull(s,null),confirmations:no.allowNull(s,null),from:t,gasPrice:no.allowNull(r),maxPriorityFeePerGas:no.allowNull(r),maxFeePerGas:no.allowNull(r),gasLimit:r,to:no.allowNull(t,null),value:r,nonce:s,data:i,r:no.allowNull(this.uint256),s:no.allowNull(this.uint256),v:no.allowNull(s),creates:no.allowNull(t,null),raw:no.allowNull(i)},e.transactionRequest={from:no.allowNull(t),nonce:no.allowNull(s),gasLimit:no.allowNull(r),gasPrice:no.allowNull(r),maxPriorityFeePerGas:no.allowNull(r),maxFeePerGas:no.allowNull(r),to:no.allowNull(t),value:no.allowNull(r),data:no.allowNull((e=>this.data(e,!0))),type:no.allowNull(s),accessList:no.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:no.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:no.allowNull(this.address,null),from:no.allowNull(this.address,null),contractAddress:no.allowNull(t,null),transactionIndex:s,root:no.allowNull(a),gasUsed:r,logsBloom:no.allowNull(i),blockHash:o,transactionHash:o,logs:no.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:no.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:no.allowNull(r),status:no.allowNull(s),type:u},e.block={hash:no.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:no.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:no.allowNull(t),extraData:i,transactions:no.allowNull(no.arrayOf(o)),baseFeePerGas:no.allowNull(r)},e.blockWithTransactions=(0,f.shallowCopy)(e.block),e.blockWithTransactions.transactions=no.allowNull(no.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:no.allowNull(n,void 0),toBlock:no.allowNull(n,void 0),blockHash:no.allowNull(o,void 0),address:no.allowNull(t,void 0),topics:no.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:no.allowNull(s),blockHash:no.allowNull(o),transactionIndex:s,removed:no.allowNull(this.boolean.bind(this)),address:t,data:no.allowFalsish(i,"0x"),topics:no.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return nr(e||[])}number(e){return"0x"===e?0:c.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:c.O$.from(e).toNumber()}bigNumber(e){return c.O$.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,l.isHexString)(e))?e.toLowerCase():ro.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return C(e)}callAddress(e){if(!(0,l.isHexString)(e,32))return null;const t=C((0,l.hexDataSlice)(e,12));return t===ii?null:t}contractAddress(e){return L(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,l.isHexString)(e))return(0,l.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==(0,l.hexDataLength)(r)?ro.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=c.O$.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!(0,l.isHexString)(e))throw new Error("invalid uint256");return(0,l.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=no.check(t,e);return n._difficulty=null==r?null:c.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return no.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&c.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=no.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,l.isHexString)(r)&&(r=c.O$.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,l.isHexString)(r)&&(r=c.O$.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return lr(e)}receiptLog(e){return no.check(this.formats.receiptLog,e)}receipt(e){const t=no.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=c.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ro.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ro.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ro.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return no.check(this.formats.filter,e)}filterLog(e){return no.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function io(e){return e&&"function"==typeof e.isCommunityResource}function oo(e){return io(e)&&e.isCommunityResource()}let ao=!1;function so(){ao||(ao=!0,to.log("========= NOTICE ========="),to.log("Request-Rate Exceeded (this message will not be repeated)"),to.log(""),to.log("The default API keys for each service are provided as a highly-throttled,"),to.log("community resource for low-traffic projects and early prototyping."),to.log(""),to.log("While your application will continue to function, we highly recommended"),to.log("signing up for your own API keys to improve performance, increase your"),to.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),to.log(""),to.log("For more details: https://docs.ethers.io/api-keys/"),to.log("=========================="))}var uo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const lo=new d.Logger(eo);function co(e){return null==e?"null":(32!==(0,l.hexDataLength)(e)&&lo.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function fo(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[co(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return co(e)})).join("&")}function ho(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,l.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+fo(e);if(Ge.isForkEvent(e))throw lo.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+fo(e.topics||[])}throw new Error("invalid event - "+e)}function po(){return(new Date).getTime()}function mo(e){return new Promise((t=>{setTimeout(t,e)}))}const yo=["block","network","pending","poll"];class go{constructor(e,t,r){(0,f.defineReadOnly)(this,"tag",e),(0,f.defineReadOnly)(this,"listener",t),(0,f.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||yo.indexOf(this.tag)>=0}}const vo={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bo(e){return(0,l.hexZeroPad)(c.O$.from(e).toHexString(),32)}function wo(e){return Gr.encode((0,l.concat)([e,(0,l.hexDataSlice)(Yr(Yr(e)),0,4)]))}const Ao=new RegExp("^(ipfs)://(.*)$","i"),_o=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Ao,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function So(e,t){try{return(0,j.ZN)(Mo(e,t))}catch(e){}return null}function Mo(e,t){if("0x"===e)return null;const r=c.O$.from((0,l.hexDataSlice)(e,t,t+32)).toNumber(),n=c.O$.from((0,l.hexDataSlice)(e,r,r+32)).toNumber();return(0,l.hexDataSlice)(e,r+32,r+32+n)}function xo(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):lo.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function To(e){const t=(0,l.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Eo(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function ko(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const i=(0,l.arrayify)(e[n]);t[n]=To(r),t.push(To(i.length)),t.push(Eo(i)),r+=32+32*Math.ceil(i.length/32)}return(0,l.hexConcat)(t)}class Po{constructor(e,t,r,n){(0,f.defineReadOnly)(this,"provider",e),(0,f.defineReadOnly)(this,"name",r),(0,f.defineReadOnly)(this,"address",e.formatter.address(t)),(0,f.defineReadOnly)(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>c.O$.from(e).eq(1))).catch((e=>{if(e.code===d.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return uo(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,l.hexConcat)([e,$i(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,l.hexConcat)(["0x9061b923",ko([qi(this.name),r.data])]));try{let e=yield this.provider.call(r);return(0,l.arrayify)(e).length%32==4&&lo.throwError("resolver threw error",d.Logger.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Mo(e,0)),e}catch(e){if(e.code===d.Logger.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return uo(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Mo(r,0):null}))}_getAddress(e,t){const r=vo[String(e)];if(null==r&&lo.throwError(`unsupported coin type: ${e}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=(0,l.arrayify)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return wo((0,l.concat)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return wo((0,l.concat)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Qi().toWords(n.slice(2));return e.unshift(t),Qi().encode(r.prefix,e)}}return null}getAddress(e){return uo(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===oi.R?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===d.Logger.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",bo(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&lo.throwError("invalid or unsupported coin data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return uo(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<_o.length;r++){const n=t.match(_o[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:xo(t)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),a=(n[2]||"").split("/");if(2!==a.length)return null;const s=yield this.provider.formatter.address(a[0]),u=(0,l.hexZeroPad)(c.O$.from(a[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:s,data:(0,l.hexConcat)(["0x6352211e",u])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=c.O$.from(yield this.provider.call({to:s,data:(0,l.hexConcat)(["0x00fdd58e",(0,l.hexZeroPad)(o,32),u])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const f={to:this.provider.formatter.address(a[0]),data:(0,l.hexConcat)([r,u])};let d=So(yield this.provider.call(f),0);if(null==d)return null;e.push({type:"metadata-url-base",content:d}),"erc1155"===i&&(d=d.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:d})),d.match(/^ipfs:/i)&&(d=xo(d)),e.push({type:"metadata-url",content:d});const h=yield Ji(d);if(!h)return null;e.push({type:"metadata",content:JSON.stringify(h)});let p=h.image;if("string"!=typeof p)return null;if(p.match(/^(https:\/\/|data:)/i));else{if(null==p.match(Ao))return null;e.push({type:"url-ipfs",content:p}),p=xo(p)}return e.push({type:"url",content:p}),{linkage:e,url:p}}}}}catch(e){}return null}))}getContentHash(){return uo(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+Gr.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+Gr.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+yi("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return lo.throwError("invalid or unsupported content hash data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return uo(this,void 0,void 0,(function*(){let t=(0,j.Y0)(e);t=(0,l.concat)([bo(64),bo(t.length),t]),t.length%32!=0&&(t=(0,l.concat)([t,(0,l.hexZeroPad)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,l.hexlify)(t));return null==r||"0x"===r?null:(0,j.ZN)(r)}))}}let Oo=null,Io=1;class Ro extends Ze{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,f.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,f.getStatic)(new.target,"getNetwork")(e);t?((0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):lo.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return uo(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||lo.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,f.defineReadOnly)(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Yi((()=>this._ready().then((e=>e),(e=>{if(e.code!==d.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Oo&&(Oo=new no),Oo}static getNetwork(e){return pi(null==e?"homestead":e)}ccipReadFetch(e,t,r){return uo(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],a=t.replace("{sender}",n).replace("{data}",i),s=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),u=yield Ji({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const l=u.message||"unknown error";if(u.status>=400&&u.status<500)return lo.throwError(`response not found during CCIP fetch: ${l}`,d.Logger.errors.SERVER_ERROR,{url:t,errorMessage:l});o.push(l)}return lo.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,d.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return uo(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(po()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=po(),r=(0,f.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=po();return(e=c.O$.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:i}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return uo(this,void 0,void 0,(function*(){const e=Io++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)lo.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",lo.makeError("network block skew detected",d.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return uo(this,void 0,void 0,(function*(){return lo.throwError("provider does not support network detection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return uo(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield mo(0),this._network;const r=lo.makeError("underlying network changed",d.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=po();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=po(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return uo(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return uo(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},l=e=>{e.confirmations<t||u()||i(e)};if(this.on(e,l),a.push((()=>{this.removeListener(e,l)})),n){let r=n.startBlock,i=null;const l=a=>uo(this,void 0,void 0,(function*(){s||(yield mo(1e3),this.getTransactionCount(n.from).then((c=>uo(this,void 0,void 0,(function*(){if(!s){if(c<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=a;){if(s)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const a=r.transactions[i];if(a.hash===e)return;if(a.from===n.from&&a.nonce===n.nonce){if(s)return;const r=yield this.waitForTransaction(a.hash,t);if(u())return;let i="replaced";return a.data===n.data&&a.to===n.to&&a.value.eq(n.value)?i="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(i="cancelled"),void o(lo.makeError("transaction was replaced",d.Logger.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(a),hash:e,receipt:r}))}}i++}}s||this.once("block",l)}}))),(e=>{s||this.once("block",l)})))}));if(s)return;this.once("block",l),a.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{u()||o(lo.makeError("timeout exceeded",d.Logger.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return uo(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return c.O$.from(e)}catch(t){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return c.O$.from(n)}catch(e){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return c.O$.from(n).toNumber()}catch(e){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,l.hexlify)(n)}catch(e){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>(0,l.hexValue)(e)))}),i=yield this.perform("getStorageAt",n);try{return(0,l.hexlify)(i)}catch(e){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,l.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&lo.throwError("Transaction hash mismatch from Provider.sendTransaction.",d.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>uo(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&lo.throwError("transaction failed",d.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,l.hexlify)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return uo(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?c.O$.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?(0,l.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,f.resolveProperties)(r))}))}_getFilter(e){return uo(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield(0,f.resolveProperties)(t))}))}_call(e,t,r){return uo(this,void 0,void 0,(function*(){r>=10&&lo.throwError("CCIP read exceeded maximum redirections",d.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,l.hexDataLength)(i)%32==4)try{const o=(0,l.hexDataSlice)(i,4),a=(0,l.hexDataSlice)(o,0,32);c.O$.from(a).eq(n)||lo.throwError("CCIP Read sender did not match",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],u=c.O$.from((0,l.hexDataSlice)(o,32,64)).toNumber(),f=c.O$.from((0,l.hexDataSlice)(o,u,u+32)).toNumber(),h=(0,l.hexDataSlice)(o,u+32);for(let t=0;t<f;t++){const r=So(h,32*t);null==r&&lo.throwError("CCIP Read contained corrupt URL string",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),s.push(r)}const p=Mo(o,64);c.O$.from((0,l.hexDataSlice)(o,100,128)).isZero()||lo.throwError("CCIP Read callback selector included junk",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const m=(0,l.hexDataSlice)(o,96,100),y=Mo(o,128),g=yield this.ccipReadFetch(e,p,s);null==g&&lo.throwError("CCIP Read disabled or provided no URLs",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const v={to:n,data:(0,l.hexConcat)([m,ko([g,y])])};return this._call(v,t,r+1)}catch(e){if(e.code===d.Logger.errors.SERVER_ERROR)throw e}try{return(0,l.hexlify)(i)}catch(r){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:r})}}))}call(e,t){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,f.resolveProperties)({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return c.O$.from(r)}catch(e){return lo.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return uo(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&lo.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&lo.throwError("ENS name not configured",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return uo(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if((0,l.isHexString)(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),(0,l.isHexString)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){lo.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Yi((()=>uo(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return uo(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Yi((()=>uo(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return uo(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Yi((()=>uo(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return uo(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,f.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),no.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return uo(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return uo(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&lo.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return uo(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Po(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return uo(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||lo.throwError("network does not support ENS",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+$i(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return uo(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,l.isHexString)(e))throw t}"string"!=typeof e&&lo.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return uo(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=So(yield this.call({to:r,data:"0x691f3431"+$i(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return uo(this,void 0,void 0,(function*(){let t=null;if((0,l.isHexString)(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new Po(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==d.Logger.errors.CALL_EXCEPTION)throw e}try{const e=So(yield this.call({to:n,data:"0x691f3431"+$i(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==d.Logger.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return lo.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new go(ho(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=ho(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=ho(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=ho(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=ho(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=ho(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var No=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Co=new d.Logger(eo),Bo=["call","estimateGas"];function Fo(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=(0,l.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=Fo(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return Fo(JSON.parse(e),t)}catch(e){}return null}function Lo(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Fo(t,!0);if(e)return e.data;Co.throwError("missing revert data in call exception; Transaction reverted without a reason string",d.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Fo(t.body,!1);null==r&&(r=Fo(t,!1)),r&&Co.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Co.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&Co.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Co.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&Co.throwError("legacy pre-eip-155 transactions not supported",d.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Bo.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Co.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Do(e){return new Promise((function(t){setTimeout(t,e)}))}function jo(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Uo(e){return e?e.toLowerCase():e}const $o={};class qo extends Qe{constructor(e,t,r){if(super(),e!==$o)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,f.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,f.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,f.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,f.defineReadOnly)(this,"_index",r),(0,f.defineReadOnly)(this,"_address",null)):Co.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return Co.throwError("cannot alter JSON-RPC Signer connection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Ko($o,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&Co.throwError("unknown account #"+this._index,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,f.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=(0,f.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>No(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Co.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,f.resolveProperties)({tx:(0,f.resolveProperties)(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&Co.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&Co.throwError("user rejected transaction",d.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),Lo("sendTransaction",e,n))))}))}signTransaction(e){return Co.throwError("signing transactions is unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return No(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Yi((()=>No(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return No(this,void 0,void 0,(function*(){const t="string"==typeof e?(0,j.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,l.hexlify)(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Co.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return No(this,void 0,void 0,(function*(){const t="string"==typeof e?(0,j.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,l.hexlify)(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Co.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return No(this,void 0,void 0,(function*(){const n=yield Wr.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Wr.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&Co.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return No(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Ko extends qo{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Ho={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Wo extends Ro{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=(0,f.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,f.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,f.defineReadOnly)(this,"connection",Object.freeze((0,f.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return No(this,void 0,void 0,(function*(){yield Do(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=(0,f.getStatic)(this.constructor,"getNetwork");try{return t(c.O$.from(e).toNumber())}catch(t){return Co.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Co.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new qo($o,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,f.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Ji(this.connection,JSON.stringify(r),jo).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Uo(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Uo(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Uo(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Uo(t.address),(0,l.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,f.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,f.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Uo(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return No(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&c.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,f.shallowCopy)(t)).transaction=(0,f.shallowCopy)(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&Co.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return Lo(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return Do(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=(0,f.shallowCopy)(Ho);if(t)for(const e in t)t[e]&&(r[e]=!0);(0,f.checkProperties)(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=(0,l.hexValue)(c.O$.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=(0,l.hexlify)(e[t]))})),e.accessList&&(n.accessList=nr(e.accessList)),n}}let zo=null;try{if(zo=WebSocket,null==zo)throw new Error("inject please")}catch(e){const t=new d.Logger(eo);zo=function(){t.throwError("WebSockets not supported in this environment",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Go=r(5108),Zo=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Vo=new d.Logger(eo);let Jo=1;class Yo extends Wo{constructor(e,t){"any"===t&&Vo.throwError("WebSocketProvider does not support 'any' network yet",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof e?(0,f.defineReadOnly)(this,"_websocket",new zo(this.connection.url)):(0,f.defineReadOnly)(this,"_websocket",e),(0,f.defineReadOnly)(this,"_requests",{}),(0,f.defineReadOnly)(this,"_subs",{}),(0,f.defineReadOnly)(this,"_subIds",{}),(0,f.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),(0,f.defineReadOnly)(e,"code",r.error.code||null),(0,f.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else Go.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Vo.throwError("cannot reset events block on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Vo.throwError("cannot set polling interval on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Zo(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Vo.throwError("cannot set polling on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=Jo++;return new Promise(((n,i)=>{const o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return Zo(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const i=yield n;this._subs[i]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=c.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:Go.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Zo(this,void 0,void 0,(function*(){this.websocket.readyState===zo.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}const Xo=new d.Logger(eo);class Qo extends Wo{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return t=this,r=void 0,i=function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||Xo.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}u((i=i.apply(t,r||[])).next())}));var t,r,n,i}}class ea extends Qo{constructor(e,t){Xo.checkAbstract(new.target,ea),e=(0,f.getStatic)(new.target,"getNetwork")(e),t=(0,f.getStatic)(new.target,"getApiKey")(t),super((0,f.getStatic)(new.target,"getUrl")(e,t),e),"string"==typeof t?(0,f.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,f.defineReadOnly)(this,e,t[e])}))}_startPending(){Xo.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return Xo.throwError("API provider does not support signing",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return Xo.throwError("not implemented; sub-classes must override getUrl",d.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const ta=new d.Logger(eo),ra="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class na extends Yo{constructor(e,t){const r=new ia(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,f.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===ra}}class ia extends ea{static getWebSocketProvider(e,t){return new na(e,t)}static getApiKey(e){return null==e?ra:(e&&"string"!=typeof e&&ta.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:ta.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===ra&&so(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===ra}}const oa=new d.Logger(eo),aa="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function sa(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return oa.throwArgumentError("unsupported network","name",e)}class ua extends ea{isCommunityResource(){return this.apiKey===aa}static getApiKey(e){return null==e?aa:e}static getUrl(e,t){null==t&&(t=aa);const r={allowGzip:!0,url:"https://"+sa(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===aa&&so(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}const la=new d.Logger(eo);class ca extends ea{static getApiKey(e){return null!=e&&la.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":la.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return n=this,i=void 0,a=function*(){return"getBlockNumber"===e?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,e,t)},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}u((a=a.apply(n,i||[])).next())}));var n,i,o,a}}var fa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const da=new d.Logger(eo);function ha(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,l.hexValue)((0,l.hexlify)(n)):"accessList"===r?"["+nr(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,l.hexlify)(n),t[r]=n)}return t}function pa(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function ma(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function ya(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function ga(e,t,r){if("call"===e&&t.code===d.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,l.isHexString)(r))return r;da.throwError("missing revert data in call exception",d.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&da.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&da.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&da.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&da.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class va extends Ro{constructor(e,t){super(e),(0,f.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,f.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return da.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return fa(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?ma:pa;this.emit("debug",{action:"request",request:n,provider:this});const a={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&so(),Promise.resolve(!0))};let s=null;i&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const u=yield Ji(a,s,o||ma);return this.emit("debug",{action:"response",request:n,response:(0,f.deepCopy)(u),provider:this}),u}))}detectNetwork(){return fa(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return fa(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>ga("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=ha(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(e){return ga("call",e,t.transaction)}}case"estimateGas":{const e=ha(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(e){return ga("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=ya(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=ya(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&da.throwError("unsupported topic count",d.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||da.throwError("unsupported topic format",d.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let e=0;e<r.length;e++){const t=r[e];if(null==t.blockHash){if(null==n[t.blockNumber]){const e=yield this.getBlock(t.blockNumber);e&&(n[t.blockNumber]=e.hash)}t.blockHash=n[t.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,e,t)}))}getHistory(e,t,r){return fa(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(e),startblock:null==t?0:t,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}function ba(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var wa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Aa=new d.Logger(eo);function _a(){return(new Date).getTime()}function Sa(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||Aa.throwArgumentError("provider mismatch","networks",e):t=n}return t}function Ma(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function xa(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(c.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>xa(e))));if("object"==typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"==typeof r?"[function]":xa(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Ta=1;function Ea(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const ka=[d.Logger.errors.CALL_EXCEPTION,d.Logger.errors.INSUFFICIENT_FUNDS,d.Logger.errors.NONCE_EXPIRED,d.Logger.errors.REPLACEMENT_UNDERPRICED,d.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Pa=["address","args","errorArgs","errorSignature","method","transaction"];function Oa(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Ia(e,t){return wa(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:Yi((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Ra(e,t,r,n){return wa(this,void 0,void 0,(function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,l.isHexString)(n.blockTag)&&(i=yield Ia(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,l.isHexString)(n.blockTag)&&(i=yield Ia(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,l.isHexString)(n.blockTag)&&(i=yield Ia(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,l.isHexString)(n.blockTag)&&(i=yield Ia(e,t)),"call"===r&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,l.isHexString)(r.fromBlock)||r.toBlock&&(0,l.isHexString)(r.toBlock))&&(i=yield Ia(e,t)),i.getLogs(r)}}return Aa.throwError("unknown method error",d.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Na extends Ro{constructor(e,t){0===e.length&&Aa.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(Ze.isProvider(e)){const t=oo(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=(0,f.shallowCopy)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=oo(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Aa.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&Aa.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=Sa(r.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),(0,f.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,f.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return wa(this,void 0,void 0,(function*(){return Sa(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return wa(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;t<e.length;t++){const r=e[t];if("string"==typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());const r=function(e,t,r){let n=xa;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=Ma(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Ma(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).confirmations=-1,xa(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,f.shallowCopy)(e)).confirmations=-1,e))),xa(e))}:function(e){return null==e?null:xa(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const i=Object.keys(n);for(let e=0;e<i.length;e++){const r=n[i[e]];if(r.count>=t)return r.result}}}(n,e.quorum)}(this,e,t),n=ba(this.providerConfigs.map(f.shallowCopy));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let o=0,a=!0;for(;;){const s=_a();let u=n.filter((e=>e.runner&&s-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;u<this.quorum&&o<n.length;){const r=n[o++],a=Ta++;r.start=_a(),r.staller=Ea(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=Ra(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Oa(r,_a()),request:{method:e,params:(0,f.deepCopy)(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Oa(r,_a()),request:{method:e,params:(0,f.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Oa(r,null),request:{method:e,params:(0,f.deepCopy)(t)},provider:this}),u+=r.weight}const l=[];n.forEach((e=>{!e.done&&e.runner&&(l.push(e.runner),e.staller&&l.push(e.staller.getPromise()))})),l.length&&(yield Promise.race(l));const c=n.filter((e=>e.done&&null==e.error));if(c.length>=this.quorum){const e=r(c);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;a||(yield Ea(100).getPromise()),a=!1}const d=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return ka.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};Pa.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),Aa.throwError(r.reason||r.message,e,i)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),Aa.throwError("failed to meet quorum",d.Logger.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Oa(e))),provider:this})}))}}const Ca=null,Ba=new d.Logger(eo),Fa="84842078b09946638c03157f83405213";class La extends Yo{constructor(e,t){const r=new Da(e,t),n=r.connection;n.password&&Ba.throwError("INFURA WebSocket project secrets unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,f.defineReadOnly)(this,"apiKey",r.projectId),(0,f.defineReadOnly)(this,"projectId",r.projectId),(0,f.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Fa}}class Da extends ea{static getWebSocketProvider(e,t){return new La(e,t)}static getApiKey(e){const t={apiKey:Fa,projectId:Fa,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Ba.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Ba.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:Ba.throwError("unsupported network",d.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===Fa&&so(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===Fa}}class ja extends Wo{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:(0,f.deepCopy)(t),provider:this}),Ji(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const Ua=new d.Logger(eo);class $a extends ea{static getApiKey(e){return e&&"string"!=typeof e&&Ua.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Ua.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ua.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const qa=new d.Logger(eo),Ka="62e1ad51b37b8e00394bda3b";class Ha extends ea{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Ka:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:qa.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:qa.throwError("unsupported network",d.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={headers:{},url:`https://${r}/v1/lb/${t.applicationId}`};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===Ka}}const Wa=new d.Logger(eo);let za=1;function Ga(e,t){const r="Web3LegacyFetcher";return function(e,n){const i={method:e,params:n,id:za++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,f.deepCopy)(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,n(e)}e(o.result)}))}))}}class Za extends Wo{constructor(e,t){null==e&&Wa.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),i=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,f.deepCopy)(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=Ga(0,e.sendAsync.bind(e)):e.send?n=Ga(0,e.send.bind(e)):Wa.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,f.defineReadOnly)(this,"jsonRpcFetchFunc",n),(0,f.defineReadOnly)(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Va=new d.Logger(eo);function Ja(e,t){if(null==e&&(e="homestead"),"string"==typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new Wo(e);case"ws":case"wss":return new Yo(e);default:Va.throwArgumentError("unsupported URL scheme","network",e)}}const r=pi(e);return r&&r._defaultProvider||Va.throwError("unsupported getDefaultProvider network",d.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Na,AlchemyProvider:ia,AnkrProvider:ua,CloudflareProvider:ca,EtherscanProvider:va,InfuraProvider:Da,JsonRpcProvider:Wo,NodesmithProvider:$a,PocketProvider:Ha,Web3Provider:Za,IpcProvider:Ca},t)}const Ya=new RegExp("^bytes([0-9]+)$"),Xa=new RegExp("^(u?int)([0-9]*)$"),Qa=new RegExp("^(.*)\\[([0-9]*)\\]$"),es="0000000000000000000000000000000000000000000000000000000000000000",ts=new d.Logger("solidity/5.7.0");function rs(e,t,r){switch(e){case"address":return r?(0,l.zeroPad)(t,32):(0,l.arrayify)(t);case"string":return(0,j.Y0)(t);case"bytes":return(0,l.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,l.zeroPad)(t,32):(0,l.arrayify)(t)}let n=e.match(Xa);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&ts.throwArgumentError("invalid number type","type",e),r&&(i=256),t=c.O$.from(t).toTwos(i),(0,l.zeroPad)(t,i/8)}if(n=e.match(Ya),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&ts.throwArgumentError("invalid bytes type","type",e),(0,l.arrayify)(t).byteLength!==i&&ts.throwArgumentError(`invalid value for ${e}`,"value",t),r?(0,l.arrayify)((t+es).substring(0,66)):t}if(n=e.match(Qa),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&ts.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(rs(r,e,!0))})),(0,l.concat)(i)}return ts.throwArgumentError("invalid type","type",e)}function ns(e,t){e.length!=t.length&&ts.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(rs(e,t[n]))})),(0,l.hexlify)((0,l.concat)(r))}function is(e,t){return(0,b.keccak256)(ns(e,t))}function os(e,t){return Yr(ns(e,t))}var as=r(5637),ss=r(6237);const us=new d.Logger("units/5.7.0"),ls=["wei","kwei","mwei","gwei","szabo","finney","ether"];function cs(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&us.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i}function fs(e,t){if("string"==typeof t){const e=ls.indexOf(t);-1!==e&&(t=3*e)}return(0,Er.S5)(e,null!=t?t:18)}function ds(e,t){if("string"!=typeof e&&us.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=ls.indexOf(t);-1!==e&&(t=3*e)}return(0,Er.Ox)(e,null!=t?t:18)}function hs(e){return fs(e,18)}function ps(e){return ds(e,18)}const ms="ethers/5.7.2",ys=new d.Logger(ms);try{const e=window;null==e._ethers&&(e._ethers=u)}catch(e){}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,o||e,a),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i<o;i++)a[i]=n[i].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var u,l,c=this._events[s],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,o),!0;case 6:return c.fn.call(c.context,t,n,i,o,a),!0}for(l=1,u=new Array(f-1);l<f;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,h=c.length;for(l=0;l<h;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,i);break;default:if(!u)for(d=1,u=new Array(f-1);d<f;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||a(this,o);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==t||i&&!s[u].once||n&&s[u].context!==n)&&l.push(s[u]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s},7187:(e,t,r)=>{"use strict";var n,i=r(5108),o="object"==typeof Reflect?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var o,a,s,u;if(c(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=f(e))>0&&s.length>o&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,i&&i.warn&&i.warn(u)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function m(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):g(i,i.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function v(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=g(u,l);for(r=0;r<l;++r)a(c[r],this,t)}return!0},u.prototype.addListener=function(e,t){return d(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return d(this,e,t,!0)},u.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},u.prototype.listeners=function(e){return m(this,e,!0)},u.prototype.rawListeners=function(e){return m(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},2445:e=>{"use strict";e.exports=function(e){var t=e.uri,r=e.name,n=e.type;this.uri=t,this.name=r,this.type=n}},804:(e,t,r)=>{"use strict";var n=r(1268);e.exports=function e(t,r,i){var o;void 0===r&&(r=""),void 0===i&&(i=n);var a=new Map;function s(e,t){var r=a.get(t);r?r.push.apply(r,e):a.set(t,e)}if(i(t))o=null,s([r],t);else{var u=r?r+".":"";if("undefined"!=typeof FileList&&t instanceof FileList)o=Array.prototype.map.call(t,(function(e,t){return s([""+u+t],e),null}));else if(Array.isArray(t))o=t.map((function(t,r){var n=e(t,""+u+r,i);return n.files.forEach(s),n.clone}));else if(t&&t.constructor===Object)for(var l in o={},t){var c=e(t[l],""+u+l,i);c.files.forEach(s),o[l]=c.clone}else o=t}return{clone:o,files:a}}},4823:(e,t,r)=>{"use strict";t.ReactNativeFile=r(2445),t.extractFiles=r(804),t.isExtractableFile=r(1268)},1268:(e,t,r)=>{"use strict";var n=r(2445);e.exports=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof n}},4029:(e,t,r)=>{"use strict";var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},u=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?a(e,t,o):"string"==typeof e?s(e,t,o):u(e,t,o)}},6230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},7648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var a,s=r.call(arguments,1),u=Math.max(0,o.length-s.length),l=[],c=0;c<u;c++)l.push("$"+c);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var t=o.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(r.call(arguments)))})),o.prototype){var f=function(){};f.prototype=o.prototype,a.prototype=new f,f.prototype=null}return a}},8612:(e,t,r)=>{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var l=function(){throw new a},c=u?function(){try{return l}catch(e){try{return u(arguments,"callee").get}catch(e){return l}}}():l,f=r(1405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?d(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var y=d(d(e));m["%Error.prototype%"]=y}var g=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return m[t]=r,r},v={"%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"]},b=r(8612),w=r(7642),A=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),S=b.call(Function.call,String.prototype.replace),M=b.call(Function.call,String.prototype.slice),x=b.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,k=function(e){var t=M(e,0,1),r=M(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return S(e,T,(function(e,t,r,i){n[n.length]=r?S(i,E,"$1"):t||e})),n},P=function(e,t){var r,n=e;if(w(v,n)&&(n="%"+(r=v[n])[0]+"%"),w(m,n)){var o=m[n];if(o===h&&(o=g(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=k(e),n=r.length>0?r[0]:"",o=P("%"+n+"%",t),s=o.name,l=o.value,c=!1,f=o.alias;f&&(n=f[0],_(r,A([0,1],f)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],y=M(p,0,1),g=M(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===g||"'"===g||"`"===g)&&y!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&h||(c=!0),w(m,s="%"+(n+="."+p)+"%"))l=m[s];else if(null!=l){if(!(p in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&d+1>=r.length){var v=u(l,p);l=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[p]}else h=w(l,p),l=l[p];h&&!c&&(m[s]=l)}}return l}},7296:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8458:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(4823),o=n(r(6230)),a=function(e){return i.isExtractableFile(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe};t.default=function(e,t,r){var n=i.extractFiles({query:e,variables:t,operationName:r},"",a),s=n.clone,u=n.files;if(0===u.size){if(!Array.isArray(e))return JSON.stringify(s);if(void 0!==t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var l=e.reduce((function(e,r,n){return e.push({query:r,variables:t?t[n]:void 0}),e}),[]);return JSON.stringify(l)}var c=new("undefined"==typeof FormData?o.default:FormData);c.append("operations",JSON.stringify(s));var f={},d=0;return u.forEach((function(e){f[++d]=e})),c.append("map",JSON.stringify(f)),d=0,u.forEach((function(e,t){c.append(""+ ++d,t)})),c}},8687:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},l=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.gql=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var f=a(r(4098)),d=f,h=r(3033),p=c(r(8458)),m=r(8308);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return m.ClientError}});var y=function(e){var t={};return e&&("undefined"!=typeof Headers&&e instanceof Headers||e instanceof d.Headers?t=function(e){var t={};return e.forEach((function(e,r){t[r]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){var r=e[0],n=e[1];t[r]=n})):t=e),t},g=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},v=function(e){var t=e.url,r=e.query,i=e.variables,o=e.operationName,a=e.headers,l=e.fetch,c=e.fetchOptions;return s(void 0,void 0,void 0,(function(){var e;return u(this,(function(s){switch(s.label){case 0:return e=p.default(r,i,o),[4,l(t,n({method:"POST",headers:n(n({},"string"==typeof e?{"Content-Type":"application/json"}:{}),a),body:e},c))];case 1:return[2,s.sent()]}}))}))},b=function(e){var t=e.url,r=e.query,i=e.variables,o=e.operationName,a=e.headers,l=e.fetch,c=e.fetchOptions;return s(void 0,void 0,void 0,(function(){var e;return u(this,(function(s){switch(s.label){case 0:return e=function(e){var t=e.query,r=e.variables,n=e.operationName;if(!Array.isArray(t)){var i=["query="+encodeURIComponent(g(t))];return r&&i.push("variables="+encodeURIComponent(JSON.stringify(r))),n&&i.push("operationName="+encodeURIComponent(n)),i.join("&")}if(void 0!==r&&!Array.isArray(r))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,n){return e.push({query:g(t),variables:r?JSON.stringify(r[n]):void 0}),e}),[]);return"query="+encodeURIComponent(JSON.stringify(o))}({query:r,variables:i,operationName:o}),[4,l(t+"?"+e,n({method:"GET",headers:a},c))];case 1:return[2,s.sent()]}}))}))},w=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,r){var i=this.options,o=i.headers,a=i.fetch,s=void 0===a?f.default:a,u=i.method,c=void 0===u?"POST":u,d=l(i,["headers","fetch","method"]);return A({url:this.url,query:e,variables:t,headers:n(n({},y(o)),y(r)),operationName:void 0,fetch:s,method:c,fetchOptions:d})},e.prototype.request=function(e,t,r){return s(this,void 0,void 0,(function(){var i,o,a,s,c,d,h,p,m,g,v;return u(this,(function(u){switch(u.label){case 0:return i=this.options,o=i.headers,a=i.fetch,s=void 0===a?f.default:a,c=i.method,d=void 0===c?"POST":c,h=l(i,["headers","fetch","method"]),p=this.url,m=M(e),g=m.query,v=m.operationName,[4,A({url:p,query:g,variables:t,headers:n(n({},y(o)),y(r)),operationName:v,fetch:s,method:d,fetchOptions:h})];case 1:return[2,u.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return s(this,void 0,void 0,(function(){var r,i,o,a,s,c,d,h,p,m;return u(this,(function(u){switch(u.label){case 0:return r=this.options,i=r.headers,o=r.fetch,a=void 0===o?f.default:o,s=r.method,c=void 0===s?"POST":s,d=l(r,["headers","fetch","method"]),h=this.url,p=e.map((function(e){return M(e.document).query})),m=e.map((function(e){return e.variables})),[4,A({url:h,query:p,variables:m,headers:n(n({},y(i)),y(t)),operationName:void 0,fetch:a,method:c,fetchOptions:d})];case 1:return[2,u.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var r,n=this.options.headers;return n?n[e]=t:this.options.headers=((r={})[e]=t,r),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function A(e){var t=e.url,r=e.query,i=e.variables,o=e.headers,a=e.operationName,l=e.fetch,c=e.method,f=void 0===c?"POST":c,d=e.fetchOptions;return s(this,void 0,void 0,(function(){var e,s,c,h,p,y,g,w;return u(this,(function(u){switch(u.label){case 0:return e="POST"===f.toUpperCase()?v:b,s=Array.isArray(r),[4,e({url:t,query:r,variables:i,operationName:a,headers:o,fetch:l,fetchOptions:d})];case 1:return[4,S(c=u.sent())];case 2:if(h=u.sent(),p=s&&Array.isArray(h)?!h.some((function(e){return!e.data})):!!h.data,c.ok&&!h.errors&&p)return y=c.headers,g=c.status,[2,n(n({},s?{data:h}:h),{headers:y,status:g})];throw w="string"==typeof h?{error:h}:h,new m.ClientError(n(n({},w),{status:c.status,headers:c.headers}),{query:r,variables:i})}}))}))}function _(e,t,r,n){return s(this,void 0,void 0,(function(){return u(this,(function(i){return[2,new w(e).request(t,r,n)]}))}))}function S(e){var t=e.headers.get("Content-Type");return t&&t.startsWith("application/json")?e.json():e.text()}function M(e){var t;if("string"==typeof e)return{query:e};var r=void 0,n=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===n.length&&(r=null===(t=n[0].name)||void 0===t?void 0:t.value),{query:h.print(e),operationName:r}}t.GraphQLClient=w,t.rawRequest=function(e,t,r,n){return s(this,void 0,void 0,(function(){return u(this,(function(i){return[2,new w(e).rawRequest(t,r,n)]}))}))},t.request=_,t.batchRequests=function(e,t,r){return s(this,void 0,void 0,(function(){return u(this,(function(n){return[2,new w(e).batchRequests(t,r)]}))}))},t.default=_,t.gql=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return e.reduce((function(e,r,n){return""+e+r+(n in t?t[n]:"")}),"")}},8308:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var i=function(e){function t(r,n){var i=this,o=t.extractMessage(r)+": "+JSON.stringify({response:r,request:n});return i=e.call(this,o)||this,Object.setPrototypeOf(i,t.prototype),i.response=r,i.request=n,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,t),i}return n(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=i},972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=o(r(7706)),i=o(r(8554));function o(e){return e&&e.__esModule?e:{default:e}}},8002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return u(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=10,s=2;function u(e,t){switch(o(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var o=n.call(e);if(o!==e)return"string"==typeof o?o:u(o,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>s)return"[Array]";for(var r=Math.min(a,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(u(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>s?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+u(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n},o=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=o,(0,i.default)(o);var a=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=a,(0,i.default)(a)},849:(e,t)=>{"use strict";function r(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function n(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}Object.defineProperty(t,"__esModule",{value:!0}),t.dedentBlockStringValue=function(e){var t=e.split(/\r\n|[\n\r]/g),i=n(e);if(0!==i)for(var o=1;o<t.length;o++)t[o]=t[o].slice(i);for(var a=0;a<t.length&&r(t[a]);)++a;for(var s=t.length;s>a&&r(t[s-1]);)--s;return t.slice(a,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!n||o||a||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}},3033:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,n.visit)(e,{leave:o})};var n=r(285),i=r(849),o={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=l("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),o=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+l(" = ",n)+l(" ",s(i," "))},SelectionSet:function(e){return u(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,o=e.selectionSet,a=l("",t,": ")+r,u=a+l("(",s(n,", "),")");return u.length>80&&(u=a+l("(\n",c(s(n,"\n")),"\n)")),s([u,s(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+l(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",l("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(l("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(l("",s(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+l("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:a((function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),u(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:a((function(e){return s(["scalar",e.name,s(e.directives," ")]," ")})),ObjectTypeDefinition:a((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,l("implements ",s(r," & ")),s(n," "),u(i)]," ")})),FieldDefinition:a((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(d(r)?l("(\n",c(s(r,"\n")),"\n)"):l("(",s(r,", "),")"))+": "+n+l(" ",s(i," "))})),InputValueDefinition:a((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,l("= ",n),s(i," ")]," ")})),InterfaceTypeDefinition:a((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,l("implements ",s(r," & ")),s(n," "),u(i)]," ")})),UnionTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")})),EnumTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),u(n)]," ")})),EnumValueDefinition:a((function(e){return s([e.name,s(e.directives," ")]," ")})),InputObjectTypeDefinition:a((function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),u(n)]," ")})),DirectiveDefinition:a((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(d(r)?l("(\n",c(s(r,"\n")),"\n)"):l("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),u(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,l("implements ",s(r," & ")),s(n," "),u(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,l("implements ",s(r," & ")),s(n," "),u(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),u(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),u(n)]," ")}};function a(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function u(e){return l("{\n",c(s(e,"\n")),"\n}")}function l(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function c(e){return l(" ",e.replace(/\n/g,"\n "))}function f(e){return-1!==e.indexOf("\n")}function d(e){return null!=e&&e.some(f)}},285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,n=void 0,l=Array.isArray(e),c=[e],f=-1,d=[],h=void 0,p=void 0,m=void 0,y=[],g=[],v=e;do{var b=++f===c.length,w=b&&0!==d.length;if(b){if(p=0===g.length?void 0:y[y.length-1],h=m,m=g.pop(),w){if(l)h=h.slice();else{for(var A={},_=0,S=Object.keys(h);_<S.length;_++){var M=S[_];A[M]=h[M]}h=A}for(var x=0,T=0;T<d.length;T++){var E=d[T][0],k=d[T][1];l&&(E-=x),l&&null===k?(h.splice(E,1),x++):h[E]=k}}f=n.index,c=n.keys,d=n.edits,l=n.inArray,n=n.prev}else{if(p=m?l?f:c[f]:void 0,null==(h=m?m[p]:v))continue;m&&y.push(p)}var P,O=void 0;if(!Array.isArray(h)){if(!(0,o.isNode)(h))throw new Error("Invalid AST Node: ".concat((0,i.default)(h),"."));var I=u(t,h.kind,b);if(I){if((O=I.call(t,h,p,m,y,g))===s)break;if(!1===O){if(!b){y.pop();continue}}else if(void 0!==O&&(d.push([p,O]),!b)){if(!(0,o.isNode)(O)){y.pop();continue}h=O}}}void 0===O&&w&&d.push([p,h]),b?y.pop():(n={inArray:l,index:f,keys:c,edits:d,prev:n},c=(l=Array.isArray(h))?h:null!==(P=r[h.kind])&&void 0!==P?P:[],f=-1,d=[],m&&g.push(m),m=h)}while(void 0!==n);return 0!==d.length&&(v=d[d.length-1][1]),v},t.visitInParallel=function(e){var t=new Array(e.length);return{enter:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!1);if(i){var o=i.apply(e[n],arguments);if(!1===o)t[n]=r;else if(o===s)t[n]=s;else if(void 0!==o)return o}}},leave:function(r){for(var n=0;n<e.length;n++)if(null==t[n]){var i=u(e[n],r.kind,!0);if(i){var o=i.apply(e[n],arguments);if(o===s)t[n]=s;else if(void 0!==o&&!1!==o)return o}}else t[n]===r&&(t[n]=null)}}},t.getVisitFn=u,t.BREAK=t.QueryDocumentKeys=void 0;var n,i=(n=r(8002))&&n.__esModule?n:{default:n},o=r(1807),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};t.QueryDocumentKeys=a;var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var o=r?e.leave:e.enter;if(o){if("function"==typeof o)return o;var a=o[t];if("function"==typeof a)return a}}}t.BREAK=s},1044:(e,t,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(e,t,r)=>{"use strict";var n=r(5419);e.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3349:(e,t,r)=>{"use strict";var n=r(9509).Buffer,i=r(8473).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5717)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},3715:(e,t,r)=>{var n=t;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:(e,t,r)=>{"use strict";var n=r(6436),i=r(9746);function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},2344:(e,t,r)=>{"use strict";var n=r(6436),i=r(9746);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},2949:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,l=i.BlockHash;function c(){if(!(this instanceof c))return new c;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(c,l),t.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],l=this.h[3],c=this.h[4],v=r,b=n,w=i,A=l,_=c,S=0;S<80;S++){var M=a(o(u(r,f(S,n,i,l),e[p[S]+t],d(S)),y[S]),c);r=c,c=l,l=o(i,10),i=n,n=M,M=a(o(u(v,f(79-S,b,w,A),e[m[S]+t],h(S)),g[S]),_),v=_,_=A,A=o(w,10),w=b,b=M}M=s(this.h[1],i,A),this.h[1]=s(this.h[2],l,_),this.h[2]=s(this.h[3],c,v),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,w),this.h[0]=M},c.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],y=[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],g=[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]},9041:(e,t,r)=>{"use strict";t.sha1=r(4761),t.sha224=r(799),t.sha256=r(9344),t.sha384=r(772),t.sha512=r(5900)},4761:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(7038),a=n.rotl32,s=n.sum32,u=n.sum32_5,l=o.ft_1,c=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=u(a(i,5),l(p,o,c,d),h,r[n],f[p]);h=d,d=c,c=a(o,30),o=i,i=m}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],c),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},799:(e,t,r)=>{"use strict";var n=r(6436),i=r(9344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},9344:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(7038),a=r(9746),s=n.sum32,u=n.sum32_4,l=n.sum32_5,c=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,m=o.g1_256,y=i.BlockHash,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];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,y),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],g=this.h[3],v=this.h[4],b=this.h[5],w=this.h[6],A=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var _=l(A,h(v),c(v,b,w),this.k[n],r[n]),S=s(d(i),f(i,o,y));A=w,w=b,b=v,v=s(g,_),g=y,y=o,o=i,i=s(_,S)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],y),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],v),this.h[5]=s(this.h[5],b),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],A)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},772:(e,t,r)=>{"use strict";var n=r(6436),i=r(5900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5900:(e,t,r)=>{"use strict";var n=r(6436),i=r(5772),o=r(9746),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,l=n.shr64_lo,c=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,y=n.sum64_5_lo,g=i.BlockHash,v=[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 b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function A(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function _(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function S(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function M(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function E(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,1)^s(e,t,8)^l(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,19)^s(t,e,29)^l(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(b,g),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(y=r[n-4],g=r[n-3],v=void 0,(v=a(y,g,19)^a(g,y,29)^u(y,g,6))<0&&(v+=4294967296),v),o=P(r[n-4],r[n-3]),s=r[n-14],l=r[n-13],c=E(r[n-30],r[n-29]),f=k(r[n-30],r[n-29]),d=r[n-32],m=r[n-31];r[n]=h(i,o,s,l,c,f,d,m),r[n+1]=p(i,o,s,l,c,f,d,m)}var y,g,v},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,s=this.W,u=this.h[0],l=this.h[1],h=this.h[2],p=this.h[3],g=this.h[4],v=this.h[5],b=this.h[6],E=this.h[7],k=this.h[8],P=this.h[9],O=this.h[10],I=this.h[11],R=this.h[12],N=this.h[13],C=this.h[14],B=this.h[15];o(this.k.length===s.length);for(var F=0;F<s.length;F+=2){var L=C,D=B,j=(i=void 0,(i=a(r=k,n=P,14)^a(r,n,18)^a(n,r,9))<0&&(i+=4294967296),i),U=T(k,P),$=w(k,0,O,0,R),q=A(0,P,0,I,0,N),K=this.k[F],H=this.k[F+1],W=s[F],z=s[F+1],G=m(L,D,j,U,$,q,K,H,W,z),Z=y(L,D,j,U,$,q,K,H,W,z);L=M(u,l),D=x(u,l),j=_(u,0,h,0,g),U=S(0,l,0,p,0,v);var V=f(L,D,j,U),J=d(L,D,j,U);C=R,B=N,R=O,N=I,O=k,I=P,k=f(b,E,G,Z),P=d(E,E,G,Z),b=g,E=v,g=h,v=p,h=u,p=l,u=f(G,Z,V,J),l=d(G,Z,V,J)}c(this.h,0,u,l),c(this.h,2,h,p),c(this.h,4,g,v),c(this.h,6,b,E),c(this.h,8,k,P),c(this.h,10,O,I),c(this.h,12,R,N),c(this.h,14,C,B)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7038:(e,t,r)=>{"use strict";var n=r(6436).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},6436:(e,t,r)=>{"use strict";var n=r(9746),i=r(5717);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var l;l="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=l>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,l=t;return u+=(l=l+n>>>0)<t?1:0,u+=(l=l+o>>>0)<o?1:0,e+r+i+a+(u+=(l=l+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,l){var c=0,f=t;return c+=(f=f+n>>>0)<t?1:0,c+=(f=f+o>>>0)<o?1:0,c+=(f=f+s>>>0)<s?1:0,e+r+i+a+u+(c+=(f=f+l>>>0)<l?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,l){return t+n+o+s+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2156:(e,t,r)=>{"use strict";var n=r(3715),i=r(4504),o=r(9746);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=p,a/=256,l-=8);e[r+h-p]|=128*m}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7832:e=>{e.exports=function(e){return(t,...r)=>function(e,...t){return new Promise(((r,n)=>{e(...t,((e,t)=>{e?n(e):r(t)}))}))}(t.bind(e),...r)}},2584:(e,t,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},5320:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(f=function(e){if((c||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},8662:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(6410)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},8611:e=>{"use strict";e.exports=function(e){return e!=e}},360:(e,t,r)=>{"use strict";var n=r(5559),i=r(4289),o=r(8611),a=r(9415),s=r(3194),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},9415:(e,t,r)=>{"use strict";var n=r(8611);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:(e,t,r)=>{"use strict";var n=r(4289),i=r(9415);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5692:(e,t,r)=>{"use strict";var n=r(4029),i=r(3083),o=r(1924),a=o("Object.prototype.toString"),s=r(6410)(),u=r(7296),l="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),h={},p=Object.getPrototypeOf;s&&u&&p&&n(c,(function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=p(t),n=u(r,Symbol.toStringTag);if(!n){var i=p(r);n=u(i,Symbol.toStringTag)}h[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=d(a(e),8,-1);return f(c,t)>-1}return!!u&&function(e){var t=!1;return n(h,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},204:(e,t,r)=>{e.exports=self.fetch||(self.fetch=r(5869).default||r(5869))},1094:(e,t,r)=>{var n,i=r(4155);!function(){"use strict";var o="input is invalid type",a="object"==typeof window,s=a?window:{};s.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?s=r.g:u&&(s=self);var l=!s.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,f=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),h=[4,1024,262144,67108864],p=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],g=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!f||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},A=function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}},_=function(e,t,r){return function(t,n,i,o){return E["cshake"+e].update(t,n,i,o)[r]()}},S=function(e,t,r){return function(t,n,i,o){return E["kmac"+e].update(t,n,i,o)[r]()}},M=function(e,t,r,n){for(var i=0;i<v.length;++i){var o=v[i];e[o]=t(r,n,o)}return e},x=function(e,t){var r=w(e,t,"hex");return r.create=function(){return new B(e,t,e)},r.update=function(e){return r.create().update(e)},M(r,w,e,t)},T=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:x},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:x},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=A(e,t,"hex");return r.create=function(r){return new B(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},M(r,A,e,t)}},{name:"cshake",padding:h,bits:g,createMethod:function(e,t){var r=b[e],n=_(e,0,"hex");return n.create=function(n,i,o){return i||o?new B(e,t,n).bytepad([i,o],r):E["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},M(n,_,e,t)}},{name:"kmac",padding:h,bits:g,createMethod:function(e,t){var r=b[e],n=S(e,0,"hex");return n.create=function(n,i,o){return new F(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},M(n,S,e,t)}}],E={},k=[],P=0;P<T.length;++P)for(var O=T[P],I=O.bits,R=0;R<I.length;++R){var N=O.name+"_"+I[R];if(k.push(N),E[N]=O.createMethod(I[R],O.padding),"sha3"!==O.name){var C=O.name+I[R];k.push(C),E[C]=E[N]}}function B(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function F(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var n,i,a=this.blocks,s=this.byteCount,u=e.length,l=this.blockCount,c=0,d=this.s;c<u;){if(this.reset)for(this.reset=!1,a[0]=this.block,n=1;n<l+1;++n)a[n]=0;if(t)for(n=this.start;c<u&&n<s;++c)a[n>>2]|=e[c]<<p[3&n++];else for(n=this.start;c<u&&n<s;++c)(i=e.charCodeAt(c))<128?a[n>>2]|=i<<p[3&n++]:i<2048?(a[n>>2]|=(192|i>>6)<<p[3&n++],a[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(a[n>>2]|=(224|i>>12)<<p[3&n++],a[n>>2]|=(128|i>>6&63)<<p[3&n++],a[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++c)),a[n>>2]|=(240|i>>18)<<p[3&n++],a[n>>2]|=(128|i>>12&63)<<p[3&n++],a[n>>2]|=(128|i>>6&63)<<p[3&n++],a[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=a[l],n=0;n<l;++n)d[n]^=a[n];L(d),this.reset=!0}else this.start=n}return this},B.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(o);t=!0}var n=0,i=e.length;if(t)n=i;else for(var a=0;a<e.length;++a){var s=e.charCodeAt(a);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];L(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],s+=d[e>>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];a%t==0&&(L(r),o=0)}return i&&(e=r[o],s+=d[e>>4&15]+d[15&e],i>1&&(s+=d[e>>12&15]+d[e>>8&15]),i>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)u[a]=r[o];a%t==0&&L(r)}return i&&(u[o]=r[o],e=e.slice(0,s)),e},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&L(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},F.prototype=new B,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,o,a,s,u,l,c,f,d,h,p,y,g,v,b,w,A,_,S,M,x,T,E,k,P,O,I,R,N,C,B,F,L,D,j,U,$,q,K,H,W,z,G,Z,V,J,Y,X,Q,ee,te,re,ne,ie,oe,ae,se,ue,le,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|l>>>31),r=o^(l<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(c<<1|f>>>31),r=s^(f<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|h>>>31),r=l^(h<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],y=e[1],G=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,O=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,K=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,F=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,T=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,k=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,$=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,M=e[49]<<14|e[48]>>>18,e[0]=p^~g&b,e[1]=y^~v&w,e[10]=x^~E&P,e[11]=T^~k&O,e[20]=B^~L&j,e[21]=F^~D&U,e[30]=W^~G&V,e[31]=z^~Z&J,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~b&A,e[3]=v^~w&_,e[12]=E^~P&I,e[13]=k^~O&R,e[22]=L^~j&$,e[23]=D^~U&q,e[32]=G^~V&Y,e[33]=Z^~J&X,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=b^~A&S,e[5]=w^~_&M,e[14]=P^~I&N,e[15]=O^~R&C,e[24]=j^~$&K,e[25]=U^~q&H,e[34]=V^~Y&Q,e[35]=J^~X&ee,e[44]=oe^~se&le,e[45]=ae^~ue&ce,e[6]=A^~S&p,e[7]=_^~M&y,e[16]=I^~N&x,e[17]=R^~C&T,e[26]=$^~K&B,e[27]=q^~H&F,e[36]=Y^~Q&W,e[37]=X^~ee&z,e[46]=se^~le&te,e[47]=ue^~ce&re,e[8]=S^~p&g,e[9]=M^~y&v,e[18]=N^~x&E,e[19]=C^~T&k,e[28]=K^~B&L,e[29]=H^~F&D,e[38]=Q^~W&G,e[39]=ee^~z&Z,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=m[n],e[1]^=m[n+1]};if(l)e.exports=E;else{for(P=0;P<k.length;++P)s[k[P]]=E[k[P]];c&&(void 0===(n=function(){return E}.call(t,r,t,e))||(e.exports=n))}}()},5811:(e,t,r)=>{e.exports=r(6066)(r(9653))},6066:(e,t,r)=>{const n=r(7016),i=r(5675);e.exports=function(e){const t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},7016:(e,t,r)=>{var n=r(8764).Buffer;const{Transform:i}=r(8473);e.exports=e=>class t extends i{constructor(t,r,n,i,o){super(o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},5675:(e,t,r)=>{var n=r(8764).Buffer;const{Transform:i}=r(8473);e.exports=e=>class t extends i{constructor(t,r,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},4040:(e,t)=>{const r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=f^(o<<1|a>>>31),p=d^(a<<1|o>>>31);const m=e[0]^h,y=e[1]^p,g=e[10]^h,v=e[11]^p,b=e[20]^h,w=e[21]^p,A=e[30]^h,_=e[31]^p,S=e[40]^h,M=e[41]^p;h=n^(s<<1|u>>>31),p=i^(u<<1|s>>>31);const x=e[2]^h,T=e[3]^p,E=e[12]^h,k=e[13]^p,P=e[22]^h,O=e[23]^p,I=e[32]^h,R=e[33]^p,N=e[42]^h,C=e[43]^p;h=o^(l<<1|c>>>31),p=a^(c<<1|l>>>31);const B=e[4]^h,F=e[5]^p,L=e[14]^h,D=e[15]^p,j=e[24]^h,U=e[25]^p,$=e[34]^h,q=e[35]^p,K=e[44]^h,H=e[45]^p;h=s^(f<<1|d>>>31),p=u^(d<<1|f>>>31);const W=e[6]^h,z=e[7]^p,G=e[16]^h,Z=e[17]^p,V=e[26]^h,J=e[27]^p,Y=e[36]^h,X=e[37]^p,Q=e[46]^h,ee=e[47]^p;h=l^(n<<1|i>>>31),p=c^(i<<1|n>>>31);const te=e[8]^h,re=e[9]^p,ne=e[18]^h,ie=e[19]^p,oe=e[28]^h,ae=e[29]^p,se=e[38]^h,ue=e[39]^p,le=e[48]^h,ce=e[49]^p,fe=m,de=y,he=v<<4|g>>>28,pe=g<<4|v>>>28,me=b<<3|w>>>29,ye=w<<3|b>>>29,ge=_<<9|A>>>23,ve=A<<9|_>>>23,be=S<<18|M>>>14,we=M<<18|S>>>14,Ae=x<<1|T>>>31,_e=T<<1|x>>>31,Se=k<<12|E>>>20,Me=E<<12|k>>>20,xe=P<<10|O>>>22,Te=O<<10|P>>>22,Ee=R<<13|I>>>19,ke=I<<13|R>>>19,Pe=N<<2|C>>>30,Oe=C<<2|N>>>30,Ie=F<<30|B>>>2,Re=B<<30|F>>>2,Ne=L<<6|D>>>26,Ce=D<<6|L>>>26,Be=U<<11|j>>>21,Fe=j<<11|U>>>21,Le=$<<15|q>>>17,De=q<<15|$>>>17,je=H<<29|K>>>3,Ue=K<<29|H>>>3,$e=W<<28|z>>>4,qe=z<<28|W>>>4,Ke=Z<<23|G>>>9,He=G<<23|Z>>>9,We=V<<25|J>>>7,ze=J<<25|V>>>7,Ge=Y<<21|X>>>11,Ze=X<<21|Y>>>11,Ve=ee<<24|Q>>>8,Je=Q<<24|ee>>>8,Ye=te<<27|re>>>5,Xe=re<<27|te>>>5,Qe=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=ae<<7|oe>>>25,rt=oe<<7|ae>>>25,nt=se<<8|ue>>>24,it=ue<<8|se>>>24,ot=le<<14|ce>>>18,at=ce<<14|le>>>18;e[0]=fe^~Se&Be,e[1]=de^~Me&Fe,e[10]=$e^~Qe&me,e[11]=qe^~et&ye,e[20]=Ae^~Ne&We,e[21]=_e^~Ce&ze,e[30]=Ye^~he&xe,e[31]=Xe^~pe&Te,e[40]=Ie^~Ke&tt,e[41]=Re^~He&rt,e[2]=Se^~Be&Ge,e[3]=Me^~Fe&Ze,e[12]=Qe^~me&Ee,e[13]=et^~ye&ke,e[22]=Ne^~We&nt,e[23]=Ce^~ze&it,e[32]=he^~xe&Le,e[33]=pe^~Te&De,e[42]=Ke^~tt&ge,e[43]=He^~rt&ve,e[4]=Be^~Ge&ot,e[5]=Fe^~Ze&at,e[14]=me^~Ee&je,e[15]=ye^~ke&Ue,e[24]=We^~nt&be,e[25]=ze^~it&we,e[34]=xe^~Le&Ve,e[35]=Te^~De&Je,e[44]=tt^~ge&Pe,e[45]=rt^~ve&Oe,e[6]=Ge^~ot&fe,e[7]=Ze^~at&de,e[16]=Ee^~je&$e,e[17]=ke^~Ue&qe,e[26]=nt^~be&Ae,e[27]=it^~we&_e,e[36]=Le^~Ve&Ye,e[37]=De^~Je&Xe,e[46]=ge^~Pe&Ie,e[47]=ve^~Oe&Re,e[8]=ot^~fe&Se,e[9]=at^~de&Me,e[18]=je^~$e&Qe,e[19]=Ue^~qe&et,e[28]=be^~Ae&Ne,e[29]=we^~_e&Ce,e[38]=Ve^~Ye&he,e[39]=Je^~Xe&pe,e[48]=Pe^~Ie&Ke,e[49]=Oe^~Re&He,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},9653:(e,t,r)=>{var n=r(8764).Buffer;const i=r(4040);function o(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}o.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0)},o.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&i.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,i.p1600(this.state),this.count=0,this.squeezing=!0},o.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=n.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return t},o.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=o},2318:(e,t,r)=>{"use strict";var n=r(5717),i=r(3349),o=r(9509).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function l(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function c(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=l(r,n,i,o,e[0],3614090360,7),o=l(o,r,n,i,e[1],3905402710,12),i=l(i,o,r,n,e[2],606105819,17),n=l(n,i,o,r,e[3],3250441966,22),r=l(r,n,i,o,e[4],4118548399,7),o=l(o,r,n,i,e[5],1200080426,12),i=l(i,o,r,n,e[6],2821735955,17),n=l(n,i,o,r,e[7],4249261313,22),r=l(r,n,i,o,e[8],1770035416,7),o=l(o,r,n,i,e[9],2336552879,12),i=l(i,o,r,n,e[10],4294925233,17),n=l(n,i,o,r,e[11],2304563134,22),r=l(r,n,i,o,e[12],1804603682,7),o=l(o,r,n,i,e[13],4254626195,12),i=l(i,o,r,n,e[14],2792965006,17),r=c(r,n=l(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=c(o,r,n,i,e[6],3225465664,9),i=c(i,o,r,n,e[11],643717713,14),n=c(n,i,o,r,e[0],3921069994,20),r=c(r,n,i,o,e[5],3593408605,5),o=c(o,r,n,i,e[10],38016083,9),i=c(i,o,r,n,e[15],3634488961,14),n=c(n,i,o,r,e[4],3889429448,20),r=c(r,n,i,o,e[9],568446438,5),o=c(o,r,n,i,e[14],3275163606,9),i=c(i,o,r,n,e[3],4107603335,14),n=c(n,i,o,r,e[8],1163531501,20),r=c(r,n,i,o,e[13],2850285829,5),o=c(o,r,n,i,e[2],4243563512,9),i=c(i,o,r,n,e[7],1735328473,14),r=f(r,n=c(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,r,n,i,e[8],2272392833,11),i=f(i,o,r,n,e[11],1839030562,16),n=f(n,i,o,r,e[14],4259657740,23),r=f(r,n,i,o,e[1],2763975236,4),o=f(o,r,n,i,e[4],1272893353,11),i=f(i,o,r,n,e[7],4139469664,16),n=f(n,i,o,r,e[10],3200236656,23),r=f(r,n,i,o,e[13],681279174,4),o=f(o,r,n,i,e[0],3936430074,11),i=f(i,o,r,n,e[3],3572445317,16),n=f(n,i,o,r,e[6],76029189,23),r=f(r,n,i,o,e[9],3654602809,4),o=f(o,r,n,i,e[12],3873151461,11),i=f(i,o,r,n,e[15],530742520,16),r=d(r,n=f(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.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 e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},9746:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4504:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},4244:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},609:(e,t,r)=>{"use strict";var n=r(4289),i=r(5559),o=r(4244),a=r(5624),s=r(2281),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},5624:(e,t,r)=>{"use strict";var n=r(4244);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(e,t,r)=>{"use strict";var n=r(5624),i=r(4289);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8987:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(1414),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),l=s.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(s&&e.length>0&&!i.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var g in e)p&&"prototype"===g||!i.call(e,g)||d.push(String(g));if(u)for(var v=function(e){if("undefined"==typeof window||!h)return f(e);try{return f(e)}catch(e){return!1}}(e),b=0;b<c.length;++b)v&&"constructor"===c[b]||!i.call(e,c[b])||d.push(c[b]);return d}}e.exports=n},2215:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(1414),o=Object.keys,a=o?function(e){return o(e)}:r(8987),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1414:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,u=[],l=!1,c=-1;function f(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},2587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u=e.length;s>0&&u>s&&(u=s);for(var l=0;l<u;++l){var c,f,d,h,p=e[l].replace(a,"%20"),m=p.indexOf(n);m>=0?(c=p.substr(0,m),f=p.substr(m+1)):(c=p,f=""),d=decodeURIComponent(c),h=decodeURIComponent(f),t(o,d)?Array.isArray(o[d])?o[d].push(h):o[d]=[o[d],h]:o[d]=h}return o}},2361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):""}},7673:(e,t,r)=>{"use strict";t.decode=t.parse=r(2587),t.encode=t.stringify=r(2361)},1798:(e,t,r)=>{"use strict";var n=r(4155),i=65536,o=r(9509).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>i)for(var s=0;s<e;s+=i)a.getRandomValues(r.slice(s,s+i));else a.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},4281:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,a,s,u;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=("number"!=typeof u&&(u=0),u+".".length>(s=e).length||-1===s.indexOf(".",u)?"argument":"property");a='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var n=r(4155),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r(9481),a=r(4229);r(5717)(c,o);for(var s=i(a.prototype),u=0;u<s.length;u++){var l=s[u];c.prototype[l]||(c.prototype[l]=a.prototype[l])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2725:(e,t,r)=>{"use strict";e.exports=i;var n=r(4605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(5717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var n,i=r(4155);e.exports=x,x.ReadableState=M,r(7187).EventEmitter;var o,a=function(e,t){return e.listeners(t).length},s=r(2503),u=r(8764).Buffer,l=r.g.Uint8Array||function(){},c=r(4616);o=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(7327),m=r(1195),y=r(2457).getHighWaterMark,g=r(4281).q,v=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(x,s);var _=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function M(e,t,i){n=n||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new p,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=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(2553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function x(e){if(n=n||r(6753),!(this instanceof x))return new x(e);var t=this instanceof n;this._readableState=new M(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function T(e,t,r,n,i){o("readableAddChunk",t);var a,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}}(e,s);else if(i||(a=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)_(e,a);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?_(e,new A):E(e,s,t,!0);else if(s.ended)_(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?E(e,s,t,!1):R(e,s)):E(e,s,t,!1)}else n||(s.reading=!1,R(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function E(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),R(e,t)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=m.destroy,x.prototype._undestroy=m.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),T(this,e,t,!1,r)},x.prototype.unshift=function(e){return T(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(e){f||(f=r(2553).s);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var k=1073741824;function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(I,e))}function I(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function R(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function C(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){o("readable nexttick read 0"),e.read(0)}function F(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(U,t,e))}function U(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function $(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}x.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&j(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){_(this,new w("_read()"))},x.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===i.stdout||e===i.stderr?m:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",(function t(i,a){o("onunpipe"),i===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",f),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var c=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==$(n.pipes,e))&&!c&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){o("onerror",t),m(),e.removeListener("error",d),0===a(e,"error")&&_(e,t)}function h(){e.removeListener("finish",p),m()}function p(){o("onfinish"),e.removeListener("close",h),m()}function m(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=$(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},x.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?O(this):n.reading||i.nextTick(B,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(C,this),r},x.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(C,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(F,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(5850)),d(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=D,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(e,t){return void 0===h&&(h=r(5167)),h(x,e,t)})},4605:(e,t,r)=>{"use strict";e.exports=c;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(5717)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},4229:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=x,x.WritableState=M;var a,s={deprecate:r(4927)},u=r(2503),l=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(1195),d=r(2457).getHighWaterMark,h=r(4281).q,p=h.ERR_INVALID_ARG_TYPE,m=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_MULTIPLE_CALLBACK,g=h.ERR_STREAM_CANNOT_PIPE,v=h.ERR_STREAM_DESTROYED,b=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,A=h.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function S(){}function M(e,t,a){n=n||r(6753),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,e,t),e._writableState.errorEmitted=!0,_(e,n)):(o(n),e._writableState.errorEmitted=!0,_(e,n),I(e,t))}(e,r,n,t,o);else{var a=P(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),n?i.nextTick(E,e,r,a,o):E(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function x(e){var t=this instanceof(n=n||r(6753));if(!t&&!a.call(x,this))return new x(e);this._writableState=new M(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function T(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function E(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,T(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(T(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(r){t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var r=P(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(x,u),M.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(M.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===x&&e&&e._writableState instanceof M}})):a=function(e){return e instanceof this},x.prototype.pipe=function(){_(this,new g)},x.prototype.write=function(e,t,r){var n,o=this._writableState,a=!1,s=!o.objectMode&&(n=e,l.isBuffer(n)||n instanceof c);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(e,t){var r=new w;_(e,r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(_(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,s,n,i,o);return u}(this,o,s,e,t,r)),a},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new m("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=f.destroy,x.prototype._undestroy=f.undestroy,x.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var n,i=r(4155);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(8610),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var r=e[h].read();null!==r&&(e[f]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function y(e){i.nextTick(m,e)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((o(n={get stream(){return this[h]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[l]?r(e[l]):t(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[d](r,n)}),n)}}(n,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[d])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),g);e.exports=function(e){var t,r=Object.create(v,(o(t={},h,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,d,{value:function(e,t){var n=r[h].read();n?(r[f]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[f]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[f]=null,r[s]=null,r[u]=null,t(e)),void(r[l]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",y.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(8764).Buffer,s=r(6854).inspect,u=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),e}()},1195:(e,t,r)=>{"use strict";var n=r(4155);function i(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},l=t._writableState&&t._writableState.finished,c=function(){s=!1,l=!0,a||o.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,f=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},m=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",p),t.req?m():t.on("request",m)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",d),t.on("finish",c),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",m),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},5167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var c,f=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var d=t.map((function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(8610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}(e,o,i>0,(function(e){c||(c=e),e&&d.forEach(u),o||(d.forEach(u),f(c))}))}));return t.reduce(l)}},2457:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},9785:(e,t,r)=>{"use strict";var n=r(8764).Buffer,i=r(5717),o=r(3349),a=new Array(16),s=[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],u=[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],l=[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],c=[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],f=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function m(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,A=0|this._b,_=0|this._c,S=0|this._d,M=0|this._e,x=0;x<80;x+=1){var T,E;x<16?(T=m(r,n,i,o,h,e[s[x]],f[0],l[x]),E=b(w,A,_,S,M,e[u[x]],d[0],c[x])):x<32?(T=y(r,n,i,o,h,e[s[x]],f[1],l[x]),E=v(w,A,_,S,M,e[u[x]],d[1],c[x])):x<48?(T=g(r,n,i,o,h,e[s[x]],f[2],l[x]),E=g(w,A,_,S,M,e[u[x]],d[2],c[x])):x<64?(T=v(r,n,i,o,h,e[s[x]],f[3],l[x]),E=y(w,A,_,S,M,e[u[x]],d[3],c[x])):(T=b(r,n,i,o,h,e[s[x]],f[4],l[x]),E=m(w,A,_,S,M,e[u[x]],d[4],c[x])),r=h,h=o,o=p(i,10),i=n,n=T,w=M,M=S,S=p(_,10),_=A,A=E}var k=this._b+i+S|0;this._b=this._c+o+M|0,this._c=this._d+h+w|0,this._d=this._e+r+A|0,this._e=this._a+n+_|0,this._a=k},h.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 e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},1675:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var o=i(r(3493));function a(e,t){if("0"===e[0]&&"0"===e[1])throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function s(e,t){if(e<56)return n.from([e+t]);var r=c(e),i=c(t+55+r.length/2);return n.from(i+r,"hex")}function u(e){var t,r,i,o,s,l=[],c=e[0];if(c<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(c<=183){if(t=c-127,i=128===c?n.from([]):e.slice(1,t),2===t&&i[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:i,remainder:e.slice(t)}}if(c<=191){if(r=c-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if((t=a(e.slice(1,r).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((i=e.slice(r,t+r)).length<t)throw new Error("invalid RLP: not enough bytes for string");return{data:i,remainder:e.slice(t+r)}}if(c<=247){for(t=c-191,o=e.slice(1,t);o.length;)s=u(o),l.push(s.data),o=s.remainder;return{data:l,remainder:e.slice(t)}}var f=(r=c-246)+(t=a(e.slice(1,r).toString("hex"),16));if(f>e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=e.slice(r,f)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)s=u(o),l.push(s.data),o=s.remainder;return{data:l,remainder:e.slice(f)}}function l(e){return"0x"===e.slice(0,2)}function c(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function f(e){if(!n.isBuffer(e)){if("string"==typeof e)return l(e)?n.from((r="string"!=typeof(i=e)?i:l(i)?i.slice(2):i).length%2?"0"+r:r,"hex"):n.from(e);if("number"==typeof e||"bigint"==typeof e)return e?(t=c(e),n.from(t,"hex")):n.from([]);if(null==e)return n.from([]);if(e instanceof Uint8Array)return n.from(e);if(o.default.isBN(e))return n.from(e.toArray());throw new Error("invalid type")}var t,r,i;return e}t.encode=function e(t){if(Array.isArray(t)){for(var r=[],i=0;i<t.length;i++)r.push(e(t[i]));var o=n.concat(r);return n.concat([s(o.length,192),o])}var a=f(t);return 1===a.length&&a[0]<128?a:n.concat([s(a.length,128),a])},t.decode=function(e,t){if(void 0===t&&(t=!1),!e||0===e.length)return n.from([]);var r=u(f(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid remainder");return r.data},t.getLength=function(e){if(!e||0===e.length)return n.from([]);var t=f(e),r=t[0];if(r<=127)return t.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var i=r-246;return i+a(t.slice(1,i).toString("hex"),16)}},3493:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6567).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var l=e.charCodeAt(u)-48;o*=i,a=l>=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a<i,"Invalid character"),o+=a}return o}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c<s;c+=n)u=l(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=l(e,c,e.length,t),c=0;c<a;c++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){c(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],p=[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];function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var l=1;l<n;l++){for(var c=u>>>26,f=67108863&u,d=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=d;h++){var p=l-h|0;c+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=h[e],c=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(c).toString(e);r=(f=f.idivn(c)).isZero()?m+r:d[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,l=0,c=0|a[0],f=8191&c,d=c>>>13,h=0|a[1],p=8191&h,m=h>>>13,y=0|a[2],g=8191&y,v=y>>>13,b=0|a[3],w=8191&b,A=b>>>13,_=0|a[4],S=8191&_,M=_>>>13,x=0|a[5],T=8191&x,E=x>>>13,k=0|a[6],P=8191&k,O=k>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],B=8191&C,F=C>>>13,L=0|a[9],D=8191&L,j=L>>>13,U=0|s[0],$=8191&U,q=U>>>13,K=0|s[1],H=8191&K,W=K>>>13,z=0|s[2],G=8191&z,Z=z>>>13,V=0|s[3],J=8191&V,Y=V>>>13,X=0|s[4],Q=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,$))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(d,$)|0))<<13)|0;l=((o=Math.imul(d,q))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,q))+Math.imul(m,$)|0,o=Math.imul(m,q);var ge=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(d,H)|0))<<13)|0;l=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,q))+Math.imul(v,$)|0,o=Math.imul(v,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var ve=(l+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(d,G)|0))<<13)|0;l=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,q))+Math.imul(A,$)|0,o=Math.imul(A,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Z)|0;var be=(l+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;l=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,$),i=(i=Math.imul(S,q))+Math.imul(M,$)|0,o=Math.imul(M,q),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,$),i=(i=Math.imul(T,q))+Math.imul(E,$)|0,o=Math.imul(E,q),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Ae=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;l=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,$),i=(i=Math.imul(P,q))+Math.imul(O,$)|0,o=Math.imul(O,q),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(l+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;l=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,q))+Math.imul(N,$)|0,o=Math.imul(N,q),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Se=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(d,ue)|0))<<13)|0;l=((o=o+Math.imul(d,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,q))+Math.imul(F,$)|0,o=Math.imul(F,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,le)|0;var Me=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;l=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(F,H)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,de)|0;var xe=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(d,pe)|0))<<13)|0;l=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,le)|0,n=n+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Te=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Z))+Math.imul(j,G)|0,o=Math.imul(j,Z),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(F,J)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,le)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Ee=(l+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,me)|0)+Math.imul(v,pe)|0))<<13)|0;l=((o=o+Math.imul(v,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,Y))+Math.imul(j,J)|0,o=Math.imul(j,Y),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(F,Q)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,de)|0;var ke=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;l=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,le)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Pe=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(M,pe)|0))<<13)|0;l=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,le)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,le)|0,n=n+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Oe=(l+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(E,pe)|0))<<13)|0;l=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,le)|0,n=n+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(N,fe)|0,o=o+Math.imul(N,de)|0;var Ie=(l+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(O,pe)|0))<<13)|0;l=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,le))+Math.imul(j,ue)|0,o=Math.imul(j,le),n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(F,fe)|0,o=o+Math.imul(F,de)|0;var Re=(l+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;l=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(j,fe)|0,o=Math.imul(j,de);var Ne=(l+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((o=o+Math.imul(F,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(l+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,me))+Math.imul(j,pe)|0))<<13)|0;return l=((o=Math.imul(j,me))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=ye,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=_e,u[7]=Se,u[8]=Me,u[9]=xe,u[10]=Te,u[11]=Ee,u[12]=ke,u[13]=Pe,u[14]=Oe,u[15]=Ie,u[16]=Re,u[17]=Ne,u[18]=Ce,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=u;l++){var c=o-l,f=(0|e.words[c])*(0|t.words[l]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?m(this,e,t):r<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var f=u,d=l,h=0;h<a;h++){var p=r[c+h],m=n[c+h],y=r[c+h+a],g=n[c+h+a],v=f*y-d*g;g=f*g+d*y,y=v,r[c+h]=p+y,n[c+h]=m+g,r[c+h+a]=p-y,n[c+h+a]=m-g,h!==s&&(v=u*f-l*d,d=u*d+l*f,f=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),l=new Array(n),c=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,s,u,n,i),this.transform(l,o,c,f,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*f[h];u[h]=s[h]*f[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),v(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var l=0;l<a;l++)u.words[l]=this.words[l];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,l=0;l<this.length;l++)this.words[l]=this.words[l+a];else this.words[0]=0,this.length=1;var c=0;for(l=this.length-1;l>=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-o|f>>>o,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function A(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){T.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(_,A),_.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,A),i(M,A),i(x,A),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new S;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,y=0;0!==m.cmp(s);y++)m=m.redSqr();n(y<p);var g=this.pow(f,new o(1).iushln(p-y-1));d=d.redMul(g),f=g.redSqr(),h=h.redMul(f),p=y}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,T),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9509:(e,t,r)=>{var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7635:function(e){"use strict";!function(t){const r=2147483647;function n(e){const t=new Uint32Array([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]);let r=1779033703,n=3144134277,i=1013904242,o=2773480762,a=1359893119,s=2600822924,u=528734635,l=1541459225;const c=new Uint32Array(64);function f(e){let f=0,d=e.length;for(;d>=64;){let h,p,m,y,g,v=r,b=n,w=i,A=o,_=a,S=s,M=u,x=l;for(p=0;p<16;p++)m=f+4*p,c[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=c[p-2],y=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=c[p-15],g=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,c[p]=(y+c[p-7]|0)+(g+c[p-16]|0)|0;for(p=0;p<64;p++)y=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&S^~_&M)|0)+(x+(t[p]+c[p]|0)|0)|0,g=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&w^b&w)|0,x=M,M=S,S=_,_=A+y|0,A=w,w=b,b=v,v=y+g|0;r=r+v|0,n=n+b|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+S|0,u=u+M|0,l=l+x|0,f+=64,d-=64}}f(e);let d,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,y=h<56?56:120,g=e.slice(e.length-h,e.length);for(g.push(128),d=h+1;d<y;d++)g.push(0);return g.push(p>>>24&255),g.push(p>>>16&255),g.push(p>>>8&255),g.push(p>>>0&255),g.push(m>>>24&255),g.push(m>>>16&255),g.push(m>>>8&255),g.push(m>>>0&255),f(g),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,u=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s<e.length;s++)o[s]^=e[s];for(s=0;s<t.length;s++)o[64+s]=t[s];for(s=i-4;s<i;s++)o[s]=0;for(s=0;s<64;s++)a[s]=92;for(s=0;s<e.length;s++)a[s]^=e[s];function l(){for(let e=i-1;e>=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)l(),u=u.concat(n(a.concat(n(o)))),r-=32;return r>0&&(l(),u=u.concat(n(a.concat(n(o))).slice(0,r))),u}function o(e,t,r,n,i){let o;for(l(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(e,16*o,i,16),s(i,n),l(i,0,e,t+16*o,16);for(o=0;o<r;o++)l(e,t+2*o*16,e,16*o,16);for(o=0;o<r;o++)l(e,t+16*(2*o+1),e,16*(o+r),16)}function a(e,t){return e<<t|e>>>32-t}function s(e,t){l(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function u(e,t,r,n){for(let i=0;i<n;i++)r[i]^=e[t+i]}function l(e,t,r,n,i){for(;i--;)r[n++]=e[t++]}function c(e){if(!e||"number"!=typeof e.length)return!1;for(let t=0;t<e.length;t++){const r=e[t];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function f(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function d(e,t,n,a,s,d,h){if(n=f(n,"N"),a=f(a,"r"),s=f(s,"p"),d=f(d,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!c(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;e<m.length;e++){const t=4*e;m[e]=(255&p[t+3])<<24|(255&p[t+2])<<16|(255&p[t+1])<<8|(255&p[t+0])<<0}const y=new Uint32Array(64*a),g=new Uint32Array(32*a*n),v=32*a,b=new Uint32Array(16),w=new Uint32Array(16),A=s*n*2;let _,S,M=0,x=null,T=!1,E=0,k=0;const P=h?parseInt(1e3/a):4294967295,O="undefined"!=typeof setImmediate?setImmediate:setTimeout,I=function(){if(T)return h(new Error("cancelled"),M/A);let t;switch(E){case 0:S=32*k*a,l(m,S,y,0,v),E=1,_=0;case 1:t=n-_,t>P&&(t=P);for(let e=0;e<t;e++)l(y,0,g,(_+e)*v,v),o(y,v,a,b,w);if(_+=t,M+=t,h){const e=parseInt(1e3*M/A);if(e!==x){if(T=h(null,M/A),T)break;x=e}}if(_<n)break;_=0,E=2;case 2:t=n-_,t>P&&(t=P);for(let e=0;e<t;e++){const e=y[16*(2*a-1)]&n-1;u(g,e*v,y,v),o(y,v,a,b,w)}if(_+=t,M+=t,h){const e=parseInt(1e3*M/A);if(e!==x){if(T=h(null,M/A),T)break;x=e}}if(_<n)break;if(l(y,0,m,S,v),k++,k<s){E=0;break}p=[];for(let e=0;e<m.length;e++)p.push(m[e]>>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,d);return h&&h(null,1,r),r}h&&O(I)};if(!h)for(;;){const e=I();if(null!=e)return e}I()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,u){let l=0;a&&a(0),d(e,t,r,n,i,o,(function(e,t,r){if(e)u(e);else if(r)a&&1!==l&&a(1),s(new Uint8Array(r));else if(a&&t!==l)return l=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(d(e,t,r,n,i,o))}};e.exports=h}()},7221:(e,t,r)=>{e.exports=r(9119)(r(8573))},8573:(e,t,r)=>{const n=new(0,r(6266).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function a(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let a=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let a=new o(t),s=new o(r);if(a.cmp(i.p)>=0||s.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),s=s.toRed(i.red),(6===e||7===e)&&s.isOdd()!==(7===e))return null;const u=a.redSqr().redIMul(a);return s.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:s}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function s(e,t){const r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}e.exports={contextRandomize:()=>0,privateKeyVerify(e){const t=new o(e);return t.cmp(i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new o(t);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===a(e)?1:0,publicKeyCreate(e,t){const r=new o(t);return r.cmp(i.n)>=0||r.isZero()?1:(s(e,n.keyFromPrivate(t).getPublic()),0)},publicKeyConvert(e,t){const r=a(t);return null===r?1:(s(e,r.getPublic()),0)},publicKeyNegate(e,t){const r=a(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),s(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=a(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(s(e,n),0)},publicKeyTweakAdd(e,t,r){const n=a(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(s(e,u),0)},publicKeyTweakMul(e,t,r){const n=a(t);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(s(e,n.getPublic().mul(r)),0)},signatureNormalize(e){const t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:a}=e;let s=a.subarray(4,37);s[0]=0,s.set(r,1);let u=33,l=0;for(;u>1&&0===s[l]&&!(128&s[l+1]);--u,++l);if(s=s.subarray(l),128&s[0])return 1;if(u>1&&0===s[0]&&!(128&s[1]))return 1;let c=a.subarray(39,72);c[0]=0,c.set(n,1);let f=33,d=0;for(;f>1&&0===c[d]&&!(128&c[d+1]);--f,++d);return c=c.subarray(d),128&c[0]||f>1&&0===c[0]&&!(128&c[1])?1:(e.outputlen=6+u+f,a[0]=48,a[1]=e.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+u]=2,a[5+u]=c.length,a.set(c,6+u),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let a=t.subarray(4,4+r);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=t.subarray(6+r);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let u=new o(a);u.cmp(i.n)>=0&&(u=new o(0));let l=new o(t.subarray(6+r));return l.cmp(i.n)>=0&&(l=new o(0)),e.set(u.toArrayLike(Uint8Array,"be",32),0),e.set(l.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,a,s){if(s){const e=s;s=n=>{const i=e(t,r,null,a,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let l;try{l=n.sign(t,r,{canonical:!0,k:s,pers:a})}catch(e){return 1}return e.signature.set(l.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(l.s.toArrayLike(Uint8Array,"be",32),32),e.recid=l.recoveryParam,0},ecdsaVerify(e,t,r){const s={r:e.subarray(0,32),s:e.subarray(32,64)},u=new o(s.r),l=new o(s.s);if(u.cmp(i.n)>=0||l.cmp(i.n)>=0)return 1;if(1===l.cmp(n.nh)||u.isZero()||l.isZero())return 3;const c=a(r);if(null===c)return 2;const f=c.getPublic();return n.verify(t,s,f)?0:3},ecdsaRecover(e,t,r,a){const u={r:t.slice(0,32),s:t.slice(32,64)},l=new o(u.r),c=new o(u.s);if(l.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(l.isZero()||c.isZero())return 2;let f;try{f=n.recoverPubKey(a,u,r)}catch(e){return 2}return s(e,f),0},ecdh(e,t,r,s,u,l,c){const f=a(t);if(null===f)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const h=f.getPublic().mul(d);if(void 0===u){const t=h.encode(null,!0),r=n.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{l||(l=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)l[e]=t[e];c||(c=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)c[e]=r[e];const n=u(l,c,s);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},9119:e=>{const t="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Public Key could not be parsed",o="Public Key serialization error",a="Signature could not be parsed";function s(e,t){if(!e)throw new Error(t)}function u(e,t,r){if(s(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${e} to be an Uint8Array with length [${r.join(", ")}]`;s(r.includes(t.length),n)}else{const n=`Expected ${e} to be an Uint8Array with length ${r}`;s(t.length===r,n)}}function l(e){s("Boolean"===f(e),"Expected compressed to be a Boolean")}function c(e=(e=>new Uint8Array(e)),t){return"function"==typeof e&&(e=e(t)),u("output",e,t),e}function f(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){if(s(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&u("seed",t,32),1===e.contextRandomize(t))throw new Error("Unknow error on context randomization")},privateKeyVerify:t=>(u("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(r){switch(u("private key",r,32),e.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(t)}},privateKeyTweakAdd(t,n){switch(u("private key",t,32),u("tweak",n,32),e.privateKeyTweakAdd(t,n)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakMul(t,r){switch(u("private key",t,32),u("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(n)}},publicKeyVerify:t=>(u("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t,r=!0,n){switch(u("private key",t,32),l(r),n=c(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(o)}},publicKeyConvert(t,r=!0,n){switch(u("public key",t,[33,65]),l(r),n=c(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error(o)}},publicKeyNegate(r,n=!0,a){switch(u("public key",r,[33,65]),l(n),a=c(a,n?33:65),e.publicKeyNegate(a,r)){case 0:return a;case 1:throw new Error(i);case 2:throw new Error(t);case 3:throw new Error(o)}},publicKeyCombine(t,r=!0,n){s(Array.isArray(t),"Expected public keys to be an Array"),s(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)u("public key",e,[33,65]);switch(l(r),n=c(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(i);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(o)}},publicKeyTweakAdd(t,n,o=!0,a){switch(u("public key",t,[33,65]),u("tweak",n,32),l(o),a=c(a,o?33:65),e.publicKeyTweakAdd(a,t,n)){case 0:return a;case 1:throw new Error(i);case 2:throw new Error(r)}},publicKeyTweakMul(t,r,o=!0,a){switch(u("public key",t,[33,65]),u("tweak",r,32),l(o),a=c(a,o?33:65),e.publicKeyTweakMul(a,t,r)){case 0:return a;case 1:throw new Error(i);case 2:throw new Error(n)}},signatureNormalize(t){switch(u("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(a)}},signatureExport(r,n){u("signature",r,64);const i={output:n=c(n,72),outputlen:72};switch(e.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(a);case 2:throw new Error(t)}},signatureImport(r,n){switch(u("signature",r),n=c(n,64),e.signatureImport(n,r)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(t)}},ecdsaSign(r,n,i={},o){u("message",r,32),u("private key",n,32),s("Object"===f(i),"Expected options to be an Object"),void 0!==i.data&&u("options.data",i.data),void 0!==i.noncefn&&s("Function"===f(i.noncefn),"Expected options.noncefn to be a Function");const a={signature:o=c(o,64),recid:null};switch(e.ecdsaSign(a,r,n,i.data,i.noncefn)){case 0:return a;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(t)}},ecdsaVerify(t,r,n){switch(u("signature",t,64),u("message",r,32),u("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(a);case 2:throw new Error(i)}},ecdsaRecover(r,n,i,o=!0,d){switch(u("signature",r,64),s("Number"===f(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),u("message",i,32),l(o),d=c(d,o?33:65),e.ecdsaRecover(d,r,n,i)){case 0:return d;case 1:throw new Error(a);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(t)}},ecdh(t,r,n={},o){switch(u("public key",t,[33,65]),u("private key",r,32),s("Object"===f(n),"Expected options to be an Object"),void 0!==n.data&&u("options.data",n.data),void 0!==n.hashfn?(s("Function"===f(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&u("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&u("options.ybuf",n.ybuf,32),u("output",o)):o=c(o,32),e.ecdh(o,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return o;case 1:throw new Error(i);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},4189:(e,t,r)=>{var n=r(9509).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,l=Math.min(o-s,i-u),c=0;c<l;c++)r[u+c]=e[s+c];s+=l,(a+=l)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},9072:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:(e,t,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function l(e){return e<<30|e>>>2}function c(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+c(h,i,o,s)+u+r[d]+a[h];u=s,s=o,o=l(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8336:(e,t,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function l(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),m=l(n)+f(p,i,o,s)+u+r[h]+a[p]|0;u=s,s=o,o=c(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8432:(e,t,r)=>{var n=r(5717),i=r(7499),o=r(4189),a=r(9509).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.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},u.prototype._hash=function(){var e=a.allocUnsafe(28);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},e.exports=u},7499:(e,t,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,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],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function l(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.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},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,y=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+h(r[g-15])+r[g-16];for(var v=0;v<64;++v){var b=y+d(u)+l(u,p,m)+a[v]+r[v]|0,w=f(n)+c(n,i,o)|0;y=m,m=p,p=u,u=s+b|0,s=o,o=i,i=n,n=b+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var e=o.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},e.exports=u},1686:(e,t,r)=>{var n=r(5717),i=r(7816),o=r(4189),a=r(9509).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.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},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},7816:(e,t,r)=>{var n=r(5717),i=r(4189),o=r(9509).Buffer,a=[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],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function l(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.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},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,A=0|this._bl,_=0|this._cl,S=0|this._dl,M=0|this._el,x=0|this._fl,T=0|this._gl,E=0|this._hl,k=0;k<32;k+=2)t[k]=e.readInt32BE(4*k),t[k+1]=e.readInt32BE(4*k+4);for(;k<160;k+=2){var P=t[k-30],O=t[k-30+1],I=h(P,O),R=p(O,P),N=m(P=t[k-4],O=t[k-4+1]),C=y(O,P),B=t[k-14],F=t[k-14+1],L=t[k-32],D=t[k-32+1],j=R+F|0,U=I+B+g(j,R)|0;U=(U=U+N+g(j=j+C|0,C)|0)+L+g(j=j+D|0,D)|0,t[k]=U,t[k+1]=j}for(var $=0;$<160;$+=2){U=t[$],j=t[$+1];var q=c(r,n,i),K=c(w,A,_),H=f(r,w),W=f(w,r),z=d(s,M),G=d(M,s),Z=a[$],V=a[$+1],J=l(s,u,v),Y=l(M,x,T),X=E+G|0,Q=b+z+g(X,E)|0;Q=(Q=(Q=Q+J+g(X=X+Y|0,Y)|0)+Z+g(X=X+V|0,V)|0)+U+g(X=X+j|0,j)|0;var ee=W+K|0,te=H+q+g(ee,W)|0;b=v,E=T,v=u,T=x,u=s,x=M,s=o+Q+g(M=S+X|0,S)|0,o=i,S=_,i=n,_=A,n=r,A=w,r=Q+te+g(w=X+ee|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+A|0,this._cl=this._cl+_|0,this._dl=this._dl+S|0,this._el=this._el+M|0,this._fl=this._fl+x|0,this._gl=this._gl+T|0,this._hl=this._hl+E|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,A)|0,this._ch=this._ch+i+g(this._cl,_)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+s+g(this._el,M)|0,this._fh=this._fh+u+g(this._fl,x)|0,this._gh=this._gh+v+g(this._gl,T)|0,this._hh=this._hh+b+g(this._hl,E)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},2830:(e,t,r)=>{e.exports=i;var n=r(7187).EventEmitter;function i(){n.call(this)}r(5717)(i,n),i.Readable=r(9481),i.Writable=r(4229),i.Duplex=r(6753),i.Transform=r(4605),i.PassThrough=r(2725),i.finished=r(8610),i.pipeline=r(9946),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},2553:(e,t,r)=>{"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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 o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3666:(e,t,r)=>{var n=r(5108),i=r(8764).Buffer;e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){e.exports=r(4687)},function(e,t){e.exports=r(7156)},function(e,t){e.exports=r(6690)},function(e,t){e.exports=r(9728)},function(e,t){e.exports=r(8416)},function(e,t){e.exports=r(3467)},function(e,t){e.exports=r(3286)},function(e,t){e.exports=r(7832)},function(e,t){e.exports=r(8698)},function(e,t){e.exports=r(861)},function(e,t){e.exports=r(833)},function(e,t){e.exports=r(7424)},function(e,t){e.exports=r(8197)},function(e,t){e.exports=r(4431)},function(e,t){e.exports=r(6115)},function(e,t){e.exports=r(3587)},function(e,t){e.exports=r(7898)},function(e,t){e.exports=r(6266)},function(e,t){e.exports=r(3808)},function(e,t){e.exports=r(1655)},function(e,t){e.exports=r(4993)},function(e,t){e.exports=r(5650)},function(e,t){e.exports=r(2741)},function(e,t){e.exports=r(711)},function(e,t){e.exports=r(8966)},function(e,t){e.exports=r(6729)},function(e){e.exports=JSON.parse('{"a":"4.4.0"}')},function(e,t){e.exports=r(7673)},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return pr}));var o={};r.r(o),r.d(o,"byte2hexStr",(function(){return F})),r.d(o,"bytesToString",(function(){return L})),r.d(o,"hextoString",(function(){return D})),r.d(o,"byteArray2hexStr",(function(){return j})),r.d(o,"base64DecodeFromString",(function(){return U})),r.d(o,"base64EncodeToString",(function(){return $}));var a={};r.r(a),r.d(a,"bin2String",(function(){return W})),r.d(a,"arrayEquals",(function(){return z})),r.d(a,"stringToBytes",(function(){return G})),r.d(a,"byte2hexStr",(function(){return F})),r.d(a,"bytesToString",(function(){return L})),r.d(a,"hextoString",(function(){return D})),r.d(a,"byteArray2hexStr",(function(){return j})),r.d(a,"base64DecodeFromString",(function(){return U})),r.d(a,"base64EncodeToString",(function(){return $})),r.d(a,"hexChar2byte",(function(){return Z})),r.d(a,"isHexChar",(function(){return V})),r.d(a,"hexStr2byteArray",(function(){return J})),r.d(a,"strToDate",(function(){return Y})),r.d(a,"isNumber",(function(){return X})),r.d(a,"getStringType",(function(){return Q}));var s={};r.r(s),r.d(s,"encode58",(function(){return ne})),r.d(s,"decode58",(function(){return ie}));var u={};r.r(u),r.d(u,"keccak256",(function(){return se})),r.d(u,"sha256",(function(){return ue})),r.d(u,"toUtf8Bytes",(function(){return le})),r.d(u,"toUtf8String",(function(){return ce})),r.d(u,"recoverAddress",(function(){return fe})),r.d(u,"SigningKey",(function(){return de})),r.d(u,"AbiCoder",(function(){return he})),r.d(u,"Interface",(function(){return pe})),r.d(u,"FormatTypes",(function(){return me})),r.d(u,"splitSignature",(function(){return ge})),r.d(u,"joinSignature",(function(){return ve})),r.d(u,"arrayify",(function(){return ye})),r.d(u,"ethersWallet",(function(){return ae.Wallet})),r.d(u,"concat",(function(){return be})),r.d(u,"id",(function(){return we})),r.d(u,"isValidMnemonic",(function(){return Ae}));var l={};r.r(l),r.d(l,"getBase58CheckAddress",(function(){return He})),r.d(l,"decodeBase58Address",(function(){return We})),r.d(l,"signTransaction",(function(){return ze})),r.d(l,"arrayToBase64String",(function(){return Ge})),r.d(l,"signBytes",(function(){return Ze})),r.d(l,"_signTypedData",(function(){return Ve})),r.d(l,"getRowBytesFromTransactionBase64",(function(){return Je})),r.d(l,"genPriKey",(function(){return Ye})),r.d(l,"computeAddress",(function(){return Xe})),r.d(l,"getAddressFromPriKey",(function(){return Qe})),r.d(l,"decode58Check",(function(){return et})),r.d(l,"isAddressValid",(function(){return tt})),r.d(l,"getBase58CheckAddressFromPriKeyBase64String",(function(){return rt})),r.d(l,"getHexStrAddressFromPriKeyBase64String",(function(){return nt})),r.d(l,"getAddressFromPriKeyBase64String",(function(){return it})),r.d(l,"getPubKeyFromPriKey",(function(){return ot})),r.d(l,"ECKeySign",(function(){return at})),r.d(l,"SHA256",(function(){return st})),r.d(l,"passwordToAddress",(function(){return ut})),r.d(l,"pkToAddress",(function(){return lt}));var c={};r.r(c),r.d(c,"generateAccount",(function(){return ct})),r.d(c,"generateRandom",(function(){return ft})),r.d(c,"generateAccountWithMnemonic",(function(){return dt}));var f={};r.r(f),r.d(f,"decodeParams",(function(){return yt})),r.d(f,"encodeParams",(function(){return gt})),r.d(f,"encodeParamsV2ByABI",(function(){return wt})),r.d(f,"decodeParamsV2ByABI",(function(){return At}));var d={};r.r(d),r.d(d,"TRON_MESSAGE_PREFIX",(function(){return _t})),r.d(d,"hashMessage",(function(){return St})),r.d(d,"signMessage",(function(){return Mt})),r.d(d,"verifyMessage",(function(){return xt}));var h=r(1),p=r.n(h),m=r(8),y=r.n(m),g=r(2),v=r.n(g),b=r(3),w=r.n(b),A=r(14),_=r.n(A),S=r(19),M=r.n(S),x=r(20),T=r.n(x),E=r(18),k=r.n(E),P=r(4),O=r.n(P),I=r(0),R=r.n(I),N=r(21),C=r.n(N);function B(){var e=this;this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",this.encode=function(t){for(var r,n,i,o,a,s,u,l="",c=0;c<t.length;)o=(r=t.charCodeAt(c++))>>2,a=(3&r)<<4|(n=t.charCodeAt(c++))>>4,s=(15&n)<<2|(i=t.charCodeAt(c++))>>6,u=63&i,isNaN(n)?s=u=64:isNaN(i)&&(u=64),l=l+e._keyStr.charAt(o)+e._keyStr.charAt(a)+e._keyStr.charAt(s)+e._keyStr.charAt(u);return l},this.encodeIgnoreUtf8=function(t){for(var r,n,i,o,a,s,u,l="",c=0;c<t.length;)o=(r=t[c++])>>2,a=(3&r)<<4|(n=t[c++])>>4,s=(15&n)<<2|(i=t[c++])>>6,u=63&i,isNaN(n)?s=u=64:isNaN(i)&&(u=64),l=l+e._keyStr.charAt(o)+e._keyStr.charAt(a)+e._keyStr.charAt(s)+e._keyStr.charAt(u);return l},this.decode=function(t){var r,n,i,o,a,s,u="",l=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<t.length;)r=e._keyStr.indexOf(t.charAt(l++))<<2|(o=e._keyStr.indexOf(t.charAt(l++)))>>4,n=(15&o)<<4|(a=e._keyStr.indexOf(t.charAt(l++)))>>2,i=(3&a)<<6|(s=e._keyStr.indexOf(t.charAt(l++))),u+=String.fromCharCode(r),64!=a&&(u+=String.fromCharCode(n)),64!=s&&(u+=String.fromCharCode(i));return e._utf8_decode(u)},this.decodeToByteArray=function(t){var r,n,i,o,a,s,u="",l=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<t.length;)r=e._keyStr.indexOf(t.charAt(l++))<<2|(o=e._keyStr.indexOf(t.charAt(l++)))>>4,n=(15&o)<<4|(a=e._keyStr.indexOf(t.charAt(l++)))>>2,i=(3&a)<<6|(s=e._keyStr.indexOf(t.charAt(l++))),u+=String.fromCharCode(r),64!=a&&(u+=String.fromCharCode(n)),64!=s&&(u+=String.fromCharCode(i));return e._out2ByteArray(u)},this._out2ByteArray=function(e){for(var t=new Array(e.length),r=0,n=0;r<e.length;)n=e.charCodeAt(r),t[r]=n,r++;return t},this._utf8_encode=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},this._utf8_decode=function(e){for(var t="",r=0,n=0,i=0,o=0;r<e.length;)(n=e.charCodeAt(r))<128?(t+=String.fromCharCode(n),r++):n>191&&n<224?(i=e.charCodeAt(r+1),t+=String.fromCharCode((31&n)<<6|63&i),r+=2):(i=e.charCodeAt(r+1),o=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&o),r+=3);return t}}function F(e){if("number"!=typeof e)throw new Error("Input must be a number");if(e<0||e>255)throw new Error("Input must be a byte");var t="";return(t+="0123456789ABCDEF".charAt(e>>4))+"0123456789ABCDEF".charAt(15&e)}function L(e){if("string"==typeof e)return e;for(var t="",r=0;r<e.length;r++){var n=e[r].toString(2),i=n.match(/^1+?(?=0)/);if(i&&8===n.length){for(var o=i[0].length,a=e[r].toString(2).slice(7-o),s=1;s<o;s++)a+=e[s+r].toString(2).slice(2);t+=String.fromCharCode(parseInt(a,2)),r+=o-1}else t+=String.fromCharCode(e[r])}return t}function D(e){for(var t=e.replace(/^0x/,"").split(""),r="",n=0;n<t.length/2;n++){var i="0x".concat(t[2*n]).concat(t[2*n+1]);r+=String.fromCharCode(i)}return r}function j(e){for(var t="",r=0;r<e.length;r++)t+=F(e[r]);return t}function U(e){return(new B).decodeToByteArray(e)}function $(e){return(new B).encodeIgnoreUtf8(e)}var q=r(9),K=r.n(q),H=/^(41)/;function W(e){return L(e)}function z(e,t,r){if(e.length!=t.length)return!1;var n;for(n=0;n<e.length;n++)if(r){if(e[n]!=t[n])return!1}else if(JSON.stringify(e[n])!=JSON.stringify(t[n]))return!1;return!0}function G(e){if("string"!=typeof e)throw new Error("The passed string is not a string");var t,r,n=new Array;t=e.length;for(var i=0;i<t;i++)(r=e.charCodeAt(i))>=65536&&r<=1114111?(n.push(r>>18&7|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)):r>=2048&&r<=65535?(n.push(r>>12&15|224),n.push(r>>6&63|128),n.push(63&r|128)):r>=128&&r<=2047?(n.push(r>>6&31|192),n.push(63&r|128)):n.push(255&r);return n}function Z(e){var t;if(e>="A"&&e<="F"?t=e.charCodeAt(0)-"A".charCodeAt(0)+10:e>="a"&&e<="f"?t=e.charCodeAt(0)-"a".charCodeAt(0)+10:e>="0"&&e<="9"&&(t=e.charCodeAt(0)-"0".charCodeAt(0)),"number"==typeof t)return t;throw new Error("The passed hex char is not a valid hex char")}function V(e){return e>="A"&&e<="F"||e>="a"&&e<="f"||e>="0"&&e<="9"?1:0}function J(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("The passed string is not a string");var r=e.length;t&&r%2&&(e="0".concat(e),r++);for(var n=Array(),i=0,o=0,a=0,s=0;s<r;s++){var u=e.charAt(s);if(!V(u))throw new Error("The passed hex char is not a valid hex string");i<<=4,i+=Z(u),0==++o%2&&(n[a++]=i,i=0)}return n}function Y(e){if(!/^\d{4}-\d{2}-\d{2}( \d{2}-\d{2}-\d{2}|)/.test(e))throw new Error("The passed date string is not valid");var t=e.split(" "),r=t[0].split("-"),n=parseInt(r[0],10),i=parseInt(r[1],10)-1,o=parseInt(r[2],10);if(t.length>1){var a=t[1].split("-"),s=parseInt(a[0],10),u=parseInt(a[1],10),l=parseInt(a[2],10);return new Date(n,i,o,s,u,l)}return new Date(n,i,o)}function X(e){return e>="0"&&e<="9"?1:0}function Q(e){if(null==e)return-1;if("string"!=typeof e)return-1;if(0==e.length||""==e)return-1;var t=0;if(40==e.length)for(;t<40&&V(e.charAt(t));t++);if(40==t)return 1;for(t=0;t<e.length&&X(e.charAt(t));t++);if(t==e.length)return 2;for(t=0;t<e.length;t++)if(e.charAt(t)>" ")return 3;return-1}for(var ee="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",te={},re=0;re<ee.length;re++)te[ee.charAt(re)]=re;function ne(e){if(0===e.length)return"";var t,r,n=[0];for(t=0;t<e.length;t++){for(r=0;r<n.length;r++)n[r]<<=8;n[0]+=e[t];var i=0;for(r=0;r<n.length;++r)n[r]+=i,i=n[r]/58|0,n[r]%=58;for(;i;)n.push(i%58),i=i/58|0}for(t=0;0===e[t]&&t<e.length-1;t++)n.push(0);return n.reverse().map((function(e){return ee[e]})).join("")}function ie(e){if(0===e.length)return[];var t,r,n=[0];for(t=0;t<e.length;t++){var i=e[t];if(!(i in te))throw new Error("Non-base58 character");for(r=0;r<n.length;r++)n[r]*=58;n[0]+=te[i];var o=0;for(r=0;r<n.length;++r)n[r]+=o,o=n[r]>>8,n[r]&=255;for(;o;)n.push(255&o),o>>=8}for(t=0;"1"===e[t]&&t<e.length-1;t++)n.push(0);return n.reverse()}var oe=r(17),ae=r(5),se=ae.utils.keccak256,ue=ae.utils.sha256,le=ae.utils.toUtf8Bytes,ce=ae.utils.toUtf8String,fe=ae.utils.recoverAddress,de=ae.utils.SigningKey,he=ae.utils.AbiCoder,pe=ae.utils.Interface,me=ae.utils.FormatTypes,ye=ae.utils.arrayify,ge=ae.utils.splitSignature,ve=ae.utils.joinSignature,be=ae.utils.concat,we=ae.utils.id,Ae=ae.utils.isValidMnemonic,_e=r(10),Se=r(6),Me=r(12),xe=r(15),Te=r(22),Ee=new(r(23).Logger)("tronweb/hash/5.4.0");function ke(e){return pr.address.toHex(e)}function Pe(e){return Object(Me.keccak256)(Object(Te.toUtf8Bytes)(e))}var Oe=new Uint8Array(32);Oe.fill(0);var Ie=_e.BigNumber.from(-1),Re=_e.BigNumber.from(0),Ne=_e.BigNumber.from(1),Ce=_e.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Be=Object(Se.hexZeroPad)(Ne.toHexString(),32),Fe=Object(Se.hexZeroPad)(Re.toHexString(),32),Le={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},De=["name","version","chainId","verifyingContract","salt"];function je(e){return function(t){return"string"!=typeof t&&Ee.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var Ue={name:je("name"),version:je("version"),chainId:function(e){try{return _e.BigNumber.from(e).toString()}catch(e){}return Ee.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return ke(e).toLowerCase()}catch(e){}return Ee.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=Object(Se.arrayify)(e);if(32!==t.length)throw new Error("bad length");return Object(Se.hexlify)(t)}catch(e){}return Ee.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function $e(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Ee.throwArgumentError("invalid numeric width","type",e);var i=Ce.mask(r?n-1:n),o=r?i.add(Ne).mul(Ie):Re;return function(t){var r=_e.BigNumber.from(t);return(r.lt(o)||r.gt(i))&&Ee.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(Se.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&Ee.throwArgumentError("invalid bytes width","type",e),function(t){return Object(Se.arrayify)(t).length!==s&&Ee.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(Se.arrayify)(e),r=t.length%32;return r?Object(Se.hexConcat)([t,Oe.slice(r)]):Object(Se.hexlify)(t)}(t)}}switch(e){case"trcToken":return $e("uint256");case"address":return function(e){return Object(Se.hexZeroPad)((t=e,pr.address.toHex(t).replace(H,"0x")),32);var t};case"bool":return function(e){return e?Be:Fe};case"bytes":return function(e){return Object(Me.keccak256)(e)};case"string":return function(e){return Pe(e)}}return null}function qe(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var Ke=function(){function e(t){v()(this,e),Object(xe.defineReadOnly)(this,"types",Object.freeze(Object(xe.deepCopy)(t))),Object(xe.defineReadOnly)(this,"_encoderCache",{}),Object(xe.defineReadOnly)(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&Ee.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&Ee.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),$e(a)||(n[a]||Ee.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var u in 0===s.length?Ee.throwArgumentError("missing primary type","types",t):s.length>1&&Ee.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),Object(xe.defineReadOnly)(this,"primaryType",s[0]),function e(o,a){a[o]&&Ee.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var l=Object.keys(i[u]);l.sort(),this._types[u]=qe(u,t[u])+l.map((function(e){return qe(e,t[e])})).join("")}}return w()(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=$e(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&Ee.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(Me.keccak256)),Object(Me.keccak256)(Object(Se.hexConcat)(r))}}var s=this.types[e];if(s){var u=Pe(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?Object(Me.keccak256)(o):o}));return r.unshift(u),Object(Se.hexConcat)(r)}}return Ee.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||Ee.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return Object(Me.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if($e(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&Ee.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):Ee.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=Le[n];i||Ee.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return De.indexOf(e.name)-De.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(Se.hexConcat)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return Object(Me.keccak256)(e.encode(t,r,n))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];De.forEach((function(e){var r=t[e];null!=r&&(i[e]=Ue[e](r),o.push({name:e,type:Le[e]}))}));var a=e.from(r),s=Object(xe.shallowCopy)(r);return s.EIP712Domain?Ee.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(Se.hexlify)(Object(Se.arrayify)(t));if(e.match(/^u?int/))return _e.BigNumber.from(t).toString();switch(e){case"trcToken":return _e.BigNumber.from(t).toString();case"address":return ke(t).toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Ee.throwArgumentError("invalid string","value",t),t}return Ee.throwArgumentError("unsupported type","type",e)}))}}}]),e}();function He(e){var t=st(e),r=st(t).slice(0,4);return ne(r=e.concat(r))}function We(e){if("string"!=typeof e)return!1;if(e.length<=4)return!1;var t=ie(e);if(e.length<=4)return!1;var r=t.length-4,n=t.slice(r),i=st(t=t.slice(0,r)),o=st(i).slice(0,4);if(n[0]==o[0]&&n[1]==o[1]&&n[2]==o[2]&&n[3]==o[3])return t;throw new Error("Invalid address provided")}function ze(e,t){"string"==typeof e&&(e=J(e));var r=at(J(t.txID),e);return Array.isArray(t.signature)?t.signature.includes(r)||t.signature.push(r):t.signature=[r],t}function Ge(e){return btoa(String.fromCharCode.apply(String,K()(e)))}function Ze(e,t){return"string"==typeof e&&(e=J(e)),at(st(t),e)}function Ve(e,t,r,n){var i=new de({toHexString:function(){return"0x"+n},value:n}),o=Ke.hash(e,t,r),a=i.signDigest(o);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}function Je(e){var t=U(e);return proto.protocol.Transaction.deserializeBinary(t).getRawData().serializeBinary()}function Ye(){for(var e=new oe.ec("secp256k1").genKeyPair().getPrivate().toString("hex");e.length<64;)e="0".concat(e);return J(e)}function Xe(e){return 65===e.length&&(e=e.slice(1)),J("41"+se(e).toString().substring(2).substring(24))}function Qe(e){return Xe(ot(e))}function et(e){var t=ie(e);if(t.length<=4)return!1;var r=t.slice(0,t.length-4),n=st(r),i=st(n);return i[0]===t[r.length]&&i[1]===t[r.length+1]&&i[2]===t[r.length+2]&&i[3]===t[r.length+3]&&r}function tt(e){if("string"!=typeof e)return!1;if(34!==e.length)return!1;var t=ie(e);if(25!==t.length)return!1;if(65!==t[0])return!1;var r=t.slice(21),n=st(t=t.slice(0,21)),i=st(n).slice(0,4);return r[0]==i[0]&&r[1]==i[1]&&r[2]==i[2]&&r[3]==i[3]}function rt(e){return He(Xe(ot(U(e))))}function nt(e){return j(Xe(ot(U(e))))}function it(e){return $(Xe(ot(U(e))))}function ot(e){for(var t=new oe.ec("secp256k1").keyFromPrivate(e,"bytes").getPublic(),r=t.x,n=t.y,i=r.toString("hex");i.length<64;)i="0".concat(i);for(var o=n.toString("hex");o.length<64;)o="0".concat(o);return J("04".concat(i).concat(o))}function at(e,t){for(var r=new oe.ec("secp256k1").keyFromPrivate(t,"bytes").sign(e),n=r.r,i=r.s,o=r.recoveryParam,a=n.toString("hex");a.length<64;)a="0".concat(a);for(var s=i.toString("hex");s.length<64;)s="0".concat(s);return a+s+F(o)}function st(e){var t=j(e);return J(ue("0x"+t).replace(/^0x/,""))}function ut(e){return He(Qe(U(e)))}function lt(e){return He(Qe(J(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1])))}function ct(){var e=Ye(),t=ot(e),r=Qe(e);return{privateKey:j(e),publicKey:j(t),address:{base58:He(r),hex:j(r)}}}function ft(e){if(Rt.isObject(e)||(e={}),e.path||(e.path="m/44'/195'/0'/0/0"),!String(e.path).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");var t=ae.Wallet.createRandom(e);return{mnemonic:t.mnemonic,privateKey:t.privateKey,publicKey:t.publicKey,address:lt(t.privateKey.replace(/^0x/,""))}}function dt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";if(t||(t="m/44'/195'/0'/0/0"),!String(t).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");var n=ae.Wallet.fromMnemonic(e,t,r);return{mnemonic:n.mnemonic,privateKey:n.privateKey,publicKey:n.publicKey,address:lt(n.privateKey.replace(/^0x/,""))}}var ht=new he;function pt(e){return pr.address.toHex(e).replace(H,"0x")}function mt(e){if("[object Object]"!==Object.prototype.toString.call(e)&&"[object Array]"!==Object.prototype.toString.call(e))return e;var t,r=(t=e,Array.isArray(t)?[]:{});return Object.keys(e).forEach((function(t){return r[t]=e[t]instanceof Object&&!e[t]._isBigNumber?mt(e[t]):e[t]})),r}function yt(e,t,r,n){if(r&&"boolean"!=typeof r||(n=r,r=t,t=e,e=[]),n&&r.replace(/^0x/,"").length%64==8&&(r="0x"+r.replace(/^0x/,"").substring(8)),r.replace(/^0x/,"").length%64)throw new Error("The encoded string is not valid. Its length must be a multiple of 64.");return t=t.map((function(e){return/trcToken/.test(e)&&(e=e.replace(/trcToken/,"uint256")),e})),ht.decode(t,r).reduce((function(r,n,i){return"address"==t[i]&&(n="41"+n.substr(2).toLowerCase()),e.length?r[e[i]]=n:r.push(n),r}),e.length?{}:[])}function gt(e,t){for(var r=0;r<e.length;r++)"address"===e[r]&&(t[r]=pr.address.toHex(t[r]).replace(H,"0x"));return ht.encode(e,t)}function vt(e){var t=e.match(/([a-zA-Z0-9])(\[.*\])/);return t?t[2]:""}function bt(e){return(vt(e).match(/\]\[/g)||[]).length+1}function wt(e,t){var r=[],n=function e(t){if(t&&0===t.type.indexOf("tuple")&&t.components){var r=t.components.map((function(t){return e(t)}));return"tuple(".concat(r.join(","),")").concat(vt(t.type))}return/trcToken/.test(t.type)?t.type.replace(/trcToken/,"uint256"):t.type},i=function e(t){return Array.isArray(t)?(t.forEach((function(r,n){t[n]=e(r)})),t):pt(t)},o=function e(t,r,n){n>1?r.length&&r.forEach((function(r){e(t,r,n-1)})):r.length&&n&&r.forEach((function(e){a(t,e)}))},a=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;t.length&&t.forEach((function(t,n){var a=t.type;if(r[n])if("address"===a)r[n]=pt(r[n]);else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])i(r[n]);else if(0===a.indexOf("tuple"))if(vt(a)){var s=bt(a);o(t.components,r[n],s)}else e(t.components,r[n])}))};if(e.inputs&&e.inputs.length)for(var s=0;s<e.inputs.length;s++){var u=e.inputs[s].type;"bool"===u&&"false"===t[s]&&(t[s]=!1),r.push(0===u.indexOf("tuple")?n(e.inputs[s]):u),t.length<r.length&&t.push("")}return a(e.inputs,t),function(e){for(var t=0;t<e.length;t++){var r=e[t];/trcToken/.test(r)&&(e[t]=r.replace(/trcToken/,"uint256"))}}(r),ht.encode(r,t)}function At(e,t){var r=function e(t){return Array.isArray(t)?(t.forEach((function(r,n){t[n]=e(r)})),t):pr.address.toHex(t)},n=function e(t,r,n){n>1?r.length&&r.forEach((function(r){e(t,r,n-1)})):r.length&&n&&r.forEach((function(e){o(t,e)}))},i=function e(t){var r=t.name?" ".concat(t.name):"";if(t&&0===t.type.indexOf("tuple")&&t.components){var n=t.components.map((function(t){return e(t)}));return"tuple(".concat(n.join(","),")").concat(vt(t.type)).concat(r)}return/trcToken/.test(t.type)?t.type.replace(/trcToken/,"uint256")+r:t.type+r},o=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;t.length&&t.forEach((function(t,o){var a=t.type,s=t.name;if(i[o])if("address"===a)i[o]=pr.address.toHex(i[o]),s&&(i[s]=pr.address.toHex(i[s]));else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])r(i[o]),s&&r(i[s]);else if(0===a.indexOf("tuple")){if(vt(a)){var u=bt(a);n(t.components,i[o],u)}else e(t.components,i[o]);s&&(i[s]=i[o])}}))};if(e.outputs&&e.outputs.length>0){for(var a=[],s=0;s<e.outputs.length;s++){var u=e.outputs[s].type,l=e.outputs[s].name?" ".concat(e.outputs[s].name):"";a.push(0===u.indexOf("tuple")?i(e.outputs[s]):u+l)}!function(e){for(var t=0;t<e.length;t++){var r=e[t];/^trcToken/.test(r)&&(e[t]=r.replace(/^trcToken/,"uint256"))}}(a),t&&t.length||(t=new Uint8Array(32*e.outputs.length));var c=mt(ht.decode(a,t));return o(e.outputs,c),c}return[]}var _t="TRON Signed Message:\n";function St(e){return"string"==typeof e&&(e=le(e)),se(be([le(_t),le(String(e.length)),e]))}function Mt(e,t){t.match(/^0x/)||(t="0x"+t);var r=new de(t),n=St(e),i=r.signDigest(n);return ve(i)}function xt(e,t){return t.match(/^0x/)||(t="0x"+t),He(J(fe(St(e),t).replace(/^0x/,"41")))}var Tt=r(24),Et=r.n(Tt),kt=r(13),Pt=r.n(kt);function Ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){O()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Rt=It(It({},{isValidURL:function(e){return"string"==typeof e&&Et.a.isURL(e.toString(),{protocols:["http","https"],require_tld:!1})},isObject:function(e){return e===Object(e)&&"[object Array]"!==Object.prototype.toString.call(e)},isArray:function(e){return Array.isArray(e)},isJson:function(e){try{return!!JSON.parse(e)}catch(e){return!1}},isBoolean:function(e){return"boolean"==typeof e},isBigNumber:function(e){return e&&(e instanceof Pt.a||e.constructor&&"BigNumber"===e.constructor.name)},isString:function(e){return"string"==typeof e||e&&e.constructor&&"String"===e.constructor.name},isFunction:function(e){return"function"==typeof e},isHex:function(e){return"string"==typeof e&&!isNaN(parseInt(e,16))&&/^(0x|)[a-fA-F0-9]+$/.test(e)},isInteger:function(e){return null!==e&&Number.isInteger(Number(e))},hasProperty:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},hasProperties:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.length&&!n.map((function(r){return t.hasProperty(e,r)})).includes(!1)},mapEvent:function(e){var t={block:e.block_number,timestamp:e.block_timestamp,contract:e.contract_address,name:e.event_name,transaction:e.transaction_id,result:e.result,resourceNode:e.resource_Node||(e._unconfirmed?"fullNode":"solidityNode")};return e._unconfirmed&&(t.unconfirmed=e._unconfirmed),e._fingerprint&&(t.fingerprint=e._fingerprint),t},parseEvent:function(e,t){var r=t.inputs;if(!e.result)return e;if(this.isObject(e.result))for(var n=0;n<r.length;n++){var i=r[n];"address"==i.type&&i.name in e.result&&(e.result[i.name]="41"+e.result[i.name].substr(2).toLowerCase())}else this.isArray(e.result)&&(e.result=e.result.reduce((function(e,t,n){var i=r[n],o=i.name;return"address"==i.type&&(t="41"+t.substr(2).toLowerCase()),e[o]=t,e}),{}));return e},padLeft:function(e,t,r){for(var n=e.toString();n.length<r;)n=t+n;return n},isNotNullOrUndefined:function(e){return null!=e},sleep:function(){var e=arguments;return p()(R.a.mark((function t(){var r;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.length>0&&void 0!==e[0]?e[0]:1e3,t.abrupt("return",new Promise((function(e){return setTimeout(e,r)})));case 2:case"end":return t.stop()}}),t)})))()}}),{},{code:a,accounts:c,base58:s,bytes:o,crypto:l,abi:f,message:d,_TypedDataEncoder:Ke,ethersUtils:u}),Nt={HttpProvider:function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e4,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"/";if(v()(this,e),!Rt.isValidURL(t))throw new Error("Invalid URL provided to HttpProvider");if(isNaN(r)||r<0)throw new Error("Invalid timeout duration provided");if(!Rt.isObject(o))throw new Error("Invalid headers object provided");t=t.replace(/\/+$/,""),this.host=t,this.timeout=r,this.user=n,this.password=i,this.headers=o,this.statusPage=a,this.instance=C.a.create({baseURL:t,timeout:r,headers:o,auth:n&&{user:n,password:i}})}var t;return w()(e,[{key:"setStatusPage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";this.statusPage=e}},{key:"isConnected",value:(t=p()(R.a.mark((function e(){var t,r=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:this.statusPage,e.abrupt("return",this.request(t).then((function(e){return Rt.hasProperties(e,"blockID","block_header")})).catch((function(){return!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"request",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get";return r=r.toLowerCase(),this.instance.request({data:"post"==r&&Object.keys(t).length?t:null,params:"get"==r&&t,url:e,method:r}).then((function(e){return e.data}))}}]),e}()},Ct=r(25),Bt=r.n(Ct),Ft=r(26),Lt=r(16),Dt=r.n(Lt),jt=r(7),Ut=r.n(jt),$t=r(11),qt=r.n($t);function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ht,Wt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,e),!t||!t instanceof pr)throw new Error("Expected instance of TronWeb");this.tronWeb=t}return w()(e,[{key:"invalid",value:function(e){return e.msg||"Invalid ".concat(e.name).concat("address"===e.type?" address":""," provided")}},{key:"notPositive",value:function(e){return"".concat(e.name," must be a positive integer")}},{key:"notEqual",value:function(e){return e.msg||"".concat(e.names[0]," can not be equal to ").concat(e.names[1])}},{key:"notValid",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Function,n={},i=!1,o=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Kt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kt(e,t):void 0}}(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=a.name,u=a.names,l=a.value,c=a.type,f=a.gt,d=a.lt,h=a.gte,p=a.lte;if(a.se,!a.optional||Rt.isNotNullOrUndefined(l)&&("boolean"===c||!1!==l)){switch(n[a.name]=a.value,c){case"address":this.tronWeb.isAddress(l)?n[s]=this.tronWeb.address.toHex(l):i=!0;break;case"integer":(!Rt.isInteger(l)||"number"==typeof f&&l<=a.gt||"number"==typeof d&&l>=a.lt||"number"==typeof h&&l<a.gte||"number"==typeof p&&l>a.lte)&&(i=!0);break;case"positive-integer":if(!Rt.isInteger(l)||l<=0)return void r(this.notPositive(a));break;case"tokenId":case"not-empty-string":Rt.isString(l)&&l.length||(i=!0);break;case"notEmptyObject":Rt.isObject(l)&&Object.keys(l).length||(i=!0);break;case"notEqual":if(n[u[0]]===n[u[1]])return r(this.notEqual(a)),!0;break;case"resource":["BANDWIDTH","ENERGY"].includes(l)||(i=!0);break;case"url":Rt.isValidURL(l)||(i=!0);break;case"hex":Rt.isHex(l)||(i=!0);break;case"array":Array.isArray(l)||(i=!0);break;case"boolean":Rt.isBoolean(l)||(i=!0);break;case"string":(!Rt.isString(l)||"number"==typeof f&&l.length<=a.gt||"number"==typeof d&&l.length>=a.lt||"number"==typeof h&&l.length<a.gte||"number"==typeof p&&l.length>a.lte)&&(i=!0)}if(i)return r(this.invalid(a)),!0}}}catch(e){o.e(e)}finally{o.f()}return!1}}]),e}();function zt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Gt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zt(e){return pr.address.toHex(e)}function Vt(e){return Ht.tronWeb.fromUtf8(e)}function Jt(e,t){return e.Error?t(e.Error):e.result&&e.result.message?t(Ht.tronWeb.toUtf8(e.result.message)):t(null,e)}var Yt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,e),!t||!t instanceof pr)throw new Error("Expected instance of TronWeb");Ht=this,this.tronWeb=t,this.injectPromise=Ut()(this),this.validator=new Wt(t)}var t,r,n,i;return w()(e,[{key:"sendTrx",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)?(i=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.sendTrx,e,t,r,n);if(t=parseInt(t),!this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:r},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer TRX to the same account"},{name:"amount",type:"integer",gt:0,value:t}],i)){var o={to_address:Zt(e),owner_address:Zt(r),amount:t};n&&n.permissionId&&(o.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/createtransaction",o,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}}},{key:"sendToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(i)&&(o=i,i={}),Rt.isFunction(n)?(o=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(i=n,n=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.sendToken,e,t,r,n,i);if(t=parseInt(t),!this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:n},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer tokens to the same account"},{name:"amount",type:"integer",gt:0,value:t},{name:"token ID",type:"tokenId",value:r}],o)){var a={to_address:Zt(e),owner_address:Zt(n),asset_name:Vt(r),amount:parseInt(t)};i&&i.permissionId&&(a.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/transferasset",a,"post").then((function(e){return Jt(e,o)})).catch((function(e){return o(e)}))}}},{key:"purchaseToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(i)&&(o=i,i={}),Rt.isFunction(n)?(o=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(i=n,n=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.purchaseToken,e,t,r,n,i);if(!this.validator.notValid([{name:"buyer",type:"address",value:n},{name:"issuer",type:"address",value:e},{names:["buyer","issuer"],type:"notEqual",msg:"Cannot purchase tokens from same account"},{name:"amount",type:"integer",gt:0,value:r},{name:"token ID",type:"tokenId",value:t}],o)){var a={to_address:Zt(e),owner_address:Zt(n),asset_name:Vt(t),amount:parseInt(r)};i&&i.permissionId&&(a.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/participateassetissue",a,"post").then((function(e){return Jt(e,o)})).catch((function(e){return o(e)}))}}},{key:"freezeBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BANDWIDTH",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Rt.isFunction(o)&&(a=o,o={}),Rt.isFunction(i)?(a=i,i=void 0):Rt.isObject(i)&&(o=i,i=void 0),Rt.isFunction(n)?(a=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(o=n,n=this.tronWeb.defaultAddress.hex),Rt.isFunction(t)&&(a=t,t=3),Rt.isFunction(r)&&(a=r,r="BANDWIDTH"),!a)return this.injectPromise(this.freezeBalance,e,t,r,n,i,o);if(!this.validator.notValid([{name:"origin",type:"address",value:n},{name:"receiver",type:"address",value:i,optional:!0},{name:"amount",type:"integer",gt:0,value:e},{name:"duration",type:"integer",gte:3,value:t},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY'}],a)){var s={owner_address:Zt(n),frozen_balance:parseInt(e),frozen_duration:parseInt(t),resource:r};Rt.isNotNullOrUndefined(i)&&Zt(i)!==Zt(n)&&(s.receiver_address=Zt(i)),o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/freezebalance",s,"post").then((function(e){return Jt(e,a)})).catch((function(e){return a(e)}))}}},{key:"unfreezeBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BANDWIDTH",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)?(i=r,r=void 0):Rt.isObject(r)&&(n=r,r=void 0),Rt.isFunction(t)?(i=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(n=t,t=this.tronWeb.defaultAddress.hex),Rt.isFunction(e)&&(i=e,e="BANDWIDTH"),!i)return this.injectPromise(this.unfreezeBalance,e,t,r,n);if(!this.validator.notValid([{name:"origin",type:"address",value:t},{name:"receiver",type:"address",value:r,optional:!0},{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY'}],i)){var o={owner_address:Zt(t),resource:e};Rt.isNotNullOrUndefined(r)&&Zt(r)!==Zt(t)&&(o.receiver_address=Zt(r)),n&&n.permissionId&&(o.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/unfreezebalance",o,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}}},{key:"withdrawBlockRewards",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t={}),Rt.isFunction(e)?(r=e,e=this.tronWeb.defaultAddress.hex):Rt.isObject(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.withdrawBlockRewards,e,t);if(!this.validator.notValid([{name:"origin",type:"address",value:e}],r)){var n={owner_address:Zt(e)};t&&t.permissionId&&(n.Permission_id=t.permissionId),this.tronWeb.fullNode.request("wallet/withdrawbalance",n,"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}}},{key:"applyForSR",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isObject(t)&&Rt.isValidURL(e)&&(r=t,t=e,e=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.applyForSR,e,t,r);if(!this.validator.notValid([{name:"origin",type:"address",value:e},{name:"url",type:"url",value:t,msg:"Invalid url provided"}],n)){var i={owner_address:Zt(e),url:Vt(t)};r&&r.permissionId&&(i.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/createwitness",i,"post").then((function(e){return Jt(e,n)})).catch((function(e){return n(e)}))}}},{key:"vote",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)?(i=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.vote,t,r,n);if(!this.validator.notValid([{name:"voter",type:"address",value:r},{name:"votes",type:"notEmptyObject",value:t}],i)){var o=!1;if(t=Object.entries(t).map((function(t){var r=qt()(t,2),n=r[0],i=r[1];if(!o)return e.validator.notValid([{name:"SR",type:"address",value:n},{name:"vote count",type:"integer",gt:0,value:i,msg:"Invalid vote count provided for SR: "+n}])?o=!0:{vote_address:Zt(n),vote_count:parseInt(i)}})),!o){var a={owner_address:Zt(r),votes:t};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/votewitnessaccount",a,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}}}},{key:"createSmartContract",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.createSmartContract,e,t);var n=e.feeLimit||this.tronWeb.feeLimit,i=e.userFeePercentage;"number"==typeof i||i||(i=100);var o=e.originEnergyLimit||1e7,a=e.callValue||0,s=e.tokenValue,u=e.tokenId||e.token_id,l=e.abi,c=void 0!==l&&l,f=e.bytecode,d=void 0!==f&&f,h=e.parameters,p=void 0===h?[]:h,m=e.name,y=void 0===m?"":m;if(c&&Rt.isString(c))try{c=JSON.parse(c)}catch(e){return r("Invalid options.abi provided")}if(c.entrys&&(c=c.entrys),!Rt.isArray(c))return r("Invalid options.abi provided");var g=c.some((function(e){return"constructor"===e.type&&"payable"===e.stateMutability.toLowerCase()}));if(!this.validator.notValid([{name:"bytecode",type:"hex",value:d},{name:"feeLimit",type:"integer",value:n,gt:0},{name:"callValue",type:"integer",value:a,gte:0},{name:"userFeePercentage",type:"integer",value:i,gte:0,lte:100},{name:"originEnergyLimit",type:"integer",value:o,gte:0,lte:1e7},{name:"parameters",type:"array",value:p},{name:"issuer",type:"address",value:t},{name:"tokenValue",type:"integer",value:s,gte:0,optional:!0},{name:"tokenId",type:"integer",value:u,gte:0,optional:!0}],r)){if(g&&0==a&&0==s)return r("When contract is payable, options.callValue or options.tokenValue must be a positive integer");if(!g&&(a>0||s>0))return r("When contract is not payable, options.callValue and options.tokenValue must be 0");if(e.rawParameter&&Rt.isString(e.rawParameter))p=e.rawParameter.replace(/^(0x)/,"");else if(e.funcABIV2)p=wt(e.funcABIV2,e.parametersV2).replace(/^(0x)/,"");else{var v=c.find((function(e){return"constructor"===e.type}));if(void 0!==v&&v){var b=new he,w=[],A=[];if(v=v.inputs,p.length!=v.length)return r("constructor needs ".concat(v.length," but ").concat(p.length," provided"));for(var _=0;_<p.length;_++){var S=v[_].type,M=p[_];if(!S||!Rt.isString(S)||!S.length)return r("Invalid parameter type provided: "+S);"address"===S?M=Zt(M).replace(H,"0x"):"address["===S.match(/^([^\x5b]*)(\x5b|$)/)[0]?M=M.map((function(e){return Zt(e).replace(H,"0x")})):/trcToken/.test(S)&&(S=S.replace(/trcToken/,"uint256")),w.push(S),A.push(M)}try{p=b.encode(w,A).replace(/^(0x)/,"")}catch(e){return r(e)}}else p=""}var x={owner_address:Zt(t),fee_limit:parseInt(n),call_value:parseInt(a),consume_user_resource_percent:i,origin_energy_limit:o,abi:JSON.stringify(c),bytecode:d,parameter:p,name:y};Rt.isNotNullOrUndefined(s)&&(x.call_token_value=parseInt(s)),Rt.isNotNullOrUndefined(u)&&(x.token_id=parseInt(u)),e&&e.permissionId&&(x.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/deploycontract",x,"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}}},{key:"triggerSmartContract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return"object"!==y()(t[2])&&(t[2]={feeLimit:t[2],callValue:t[3]},t.splice(3,1)),this._triggerSmartContract.apply(this,t)}},{key:"triggerConstantContract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[2]._isConstant=!0,this.triggerSmartContract.apply(this,t)}},{key:"triggerConfirmedConstantContract",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t[2]._isConstant=!0,t[2].confirmed=!0,this.triggerSmartContract.apply(this,t)}},{key:"_triggerSmartContract",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(i)&&(o=i,i=this.tronWeb.defaultAddress.hex),Rt.isFunction(n)&&(o=n,n=[]),!o)return this.injectPromise(this._triggerSmartContract,e,t,r,n,i);var a=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},r),s=a.tokenValue,u=a.tokenId,l=a.callValue,c=a.feeLimit;if(!this.validator.notValid([{name:"feeLimit",type:"integer",value:c,gt:0},{name:"callValue",type:"integer",value:l,gte:0},{name:"parameters",type:"array",value:n},{name:"contract",type:"address",value:e},{name:"issuer",type:"address",value:i,optional:!0},{name:"tokenValue",type:"integer",value:s,gte:0,optional:!0},{name:"tokenId",type:"integer",value:u,gte:0,optional:!0}],o)){var f={contract_address:Zt(e),owner_address:Zt(i)};if(t&&Rt.isString(t)){if(t=t.replace("/s*/g",""),n.length){for(var d=new he,h=[],p=[],m=0;m<n.length;m++){var y=n[m],g=y.type,v=y.value;if(!g||!Rt.isString(g)||!g.length)return o("Invalid parameter type provided: "+g);"address"===g?v=Zt(v).replace(H,"0x"):"address["===g.match(/^([^\x5b]*)(\x5b|$)/)[0]&&(v=v.map((function(e){return Zt(e).replace(H,"0x")}))),h.push(g),p.push(v)}try{h=h.map((function(e){return/trcToken/.test(e)&&(e=e.replace(/trcToken/,"uint256")),e})),n=d.encode(h,p).replace(/^(0x)/,"")}catch(e){return o(e)}}else n="";r.funcABIV2&&(n=wt(r.funcABIV2,r.parametersV2).replace(/^(0x)/,"")),r.shieldedParameter&&Rt.isString(r.shieldedParameter)&&(n=r.shieldedParameter.replace(/^(0x)/,"")),r.rawParameter&&Rt.isString(r.rawParameter)&&(n=r.rawParameter.replace(/^(0x)/,"")),f.function_selector=t,f.parameter=n}f.call_value=parseInt(l),Rt.isNotNullOrUndefined(s)&&(f.call_token_value=parseInt(s)),Rt.isNotNullOrUndefined(u)&&(f.token_id=parseInt(u)),r._isConstant||(f.fee_limit=parseInt(c)),r.permissionId&&(f.Permission_id=r.permissionId),this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/trigger").concat(r._isConstant?"constant":"smart","contract"),f,"post").then((function(e){return Jt(e,o)})).catch((function(e){return o(e)}))}}},{key:"clearABI",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this.clearABI,e,t);if(!this.tronWeb.isAddress(e))return r("Invalid contract address provided");if(!this.tronWeb.isAddress(t))return r("Invalid owner address provided");var n={contract_address:Zt(e),owner_address:Zt(t)};this.tronWeb.trx.cache.contracts[e]&&delete this.tronWeb.trx.cache.contracts[e],this.tronWeb.fullNode.request("wallet/clearabi",n,"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}},{key:"updateBrokerage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this.updateBrokerage,e,t);if(!Rt.isNotNullOrUndefined(e))return r("Invalid brokerage provided");if(!Rt.isInteger(e)||e<0||e>100)return r("Brokerage must be an integer between 0 and 100");if(!this.tronWeb.isAddress(t))return r("Invalid owner address provided");var n={brokerage:parseInt(e),owner_address:Zt(t)};this.tronWeb.fullNode.request("wallet/updateBrokerage",n,"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}},{key:"createToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.createToken,e,t);var n=e.name,i=void 0!==n&&n,o=e.abbreviation,a=void 0!==o&&o,s=e.description,u=void 0!==s&&s,l=e.url,c=void 0!==l&&l,f=e.totalSupply,d=void 0===f?0:f,h=e.trxRatio,p=void 0===h?1:h,m=e.tokenRatio,y=void 0===m?1:m,g=e.saleStart,v=void 0===g?Date.now():g,b=e.saleEnd,w=void 0!==b&&b,A=e.freeBandwidth,_=void 0===A?0:A,S=e.freeBandwidthLimit,M=void 0===S?0:S,x=e.frozenAmount,T=void 0===x?0:x,E=e.frozenDuration,k=void 0===E?0:E,P=e.voteScore,O=e.precision;if(!this.validator.notValid([{name:"Supply amount",type:"positive-integer",value:d},{name:"TRX ratio",type:"positive-integer",value:p},{name:"Token ratio",type:"positive-integer",value:y},{name:"token abbreviation",type:"not-empty-string",value:a},{name:"token name",type:"not-empty-string",value:i},{name:"token description",type:"not-empty-string",value:u},{name:"token url",type:"url",value:c},{name:"issuer",type:"address",value:t},{name:"sale start timestamp",type:"integer",value:v,gte:Date.now()},{name:"sale end timestamp",type:"integer",value:w,gt:v},{name:"Free bandwidth amount",type:"integer",value:_,gte:0},{name:"Free bandwidth limit",type:"integer",value:M,gte:0},{name:"Frozen supply",type:"integer",value:T,gte:0},{name:"Frozen duration",type:"integer",value:k,gte:0}],r)){if(Rt.isNotNullOrUndefined(P)&&(!Rt.isInteger(P)||P<=0))return r("voteScore must be a positive integer greater than 0");if(Rt.isNotNullOrUndefined(O)&&(!Rt.isInteger(O)||O<0||O>6))return r("precision must be a positive integer >= 0 and <= 6");var I={owner_address:Zt(t),name:Vt(i),abbr:Vt(a),description:Vt(u),url:Vt(c),total_supply:parseInt(d),trx_num:parseInt(p),num:parseInt(y),start_time:parseInt(v),end_time:parseInt(w),free_asset_net_limit:parseInt(_),public_free_asset_net_limit:parseInt(M),frozen_supply:{frozen_amount:parseInt(T),frozen_days:parseInt(k)}};parseInt(T)>0||delete I.frozen_supply,O&&!isNaN(parseInt(O))&&(I.precision=parseInt(O)),P&&!isNaN(parseInt(P))&&(I.vote_score=parseInt(P)),e&&e.permissionId&&(I.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/createassetissue",I,"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}}},{key:"updateAccount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.updateAccount,e,t,r);if(!this.validator.notValid([{name:"Name",type:"not-empty-string",value:e},{name:"origin",type:"address",value:t}],n)){var i={account_name:Vt(e),owner_address:Zt(t)};r&&r.permissionId&&(i.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/updateaccount",i,"post").then((function(e){return Jt(e,n)})).catch((function(e){return n(e)}))}}},{key:"setAccountId",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.setAccountId,e,t);e&&Rt.isString(e)&&e.startsWith("0x")&&(e=e.slice(2)),this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e},{name:"origin",type:"address",value:t}],r)||this.tronWeb.fullNode.request("wallet/setaccountid",{account_id:e,owner_address:Zt(t)},"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}},{key:"updateToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)?(r=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.updateToken,e,t);var n=e,i=n.description,o=void 0!==i&&i,a=n.url,s=void 0!==a&&a,u=n.freeBandwidth,l=void 0===u?0:u,c=n.freeBandwidthLimit,f=void 0===c?0:c;if(!this.validator.notValid([{name:"token description",type:"not-empty-string",value:o},{name:"token url",type:"url",value:s},{name:"issuer",type:"address",value:t},{name:"Free bandwidth amount",type:"positive-integer",value:l},{name:"Free bandwidth limit",type:"positive-integer",value:f}],r)){var d={owner_address:Zt(t),description:Vt(o),url:Vt(s),new_limit:parseInt(l),new_public_limit:parseInt(f)};e&&e.permissionId&&(d.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/updateasset",d,"post").then((function(e){return Jt(e,r)})).catch((function(e){return r(e)}))}}},{key:"sendAsset",value:function(){return this.sendToken.apply(this,arguments)}},{key:"purchaseAsset",value:function(){return this.purchaseToken.apply(this,arguments)}},{key:"createAsset",value:function(){return this.createToken.apply(this,arguments)}},{key:"updateAsset",value:function(){return this.updateToken.apply(this,arguments)}},{key:"createProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.createProposal,e,t,r);if(!this.validator.notValid([{name:"issuer",type:"address",value:t}],n)){var i="Invalid proposal parameters provided";if(!e)return n(i);Rt.isArray(e)||(e=[e]);var o,a=zt(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!Rt.isObject(s))return n(i)}}catch(e){a.e(e)}finally{a.f()}var u={owner_address:Zt(t),parameters:e};r&&r.permissionId&&(u.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/proposalcreate",u,"post").then((function(e){return Jt(e,n)})).catch((function(e){return n(e)}))}}},{key:"deleteProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.deleteProposal,e,t,r);if(!this.validator.notValid([{name:"issuer",type:"address",value:t},{name:"proposalID",type:"integer",value:e,gte:0}],n)){var i={owner_address:Zt(t),proposal_id:parseInt(e)};r&&r.permissionId&&(i.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/proposaldelete",i,"post").then((function(e){return Jt(e,n)})).catch((function(e){return n(e)}))}}},{key:"voteProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)?(i=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.voteProposal,e,t,r,n);if(!this.validator.notValid([{name:"voter",type:"address",value:r},{name:"proposalID",type:"integer",value:e,gte:0},{name:"has approval",type:"boolean",value:t}],i)){var o={owner_address:Zt(r),proposal_id:parseInt(e),is_add_approval:t};n&&n.permissionId&&(o.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/proposalapprove",o,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}}},{key:"createTRXExchange",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(i)&&(o=i,i={}),Rt.isFunction(n)?(o=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(i=n,n=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.createTRXExchange,e,t,r,n,i);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:e},{name:"token balance",type:"positive-integer",value:t},{name:"trx balance",type:"positive-integer",value:r}],o)){var a={owner_address:Zt(n),first_token_id:Vt(e),first_token_balance:t,second_token_id:"5f",second_token_balance:r};i&&i.permissionId&&(a.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/exchangecreate",a,"post").then((function(e){o(null,e)})).catch((function(e){return o(e)}))}}},{key:"createTokenExchange",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Rt.isFunction(o)&&(a=o,o={}),Rt.isFunction(i)?(a=i,i=this.tronWeb.defaultAddress.hex):Rt.isObject(i)&&(o=i,i=this.tronWeb.defaultAddress.hex),!a)return this.injectPromise(this.createTokenExchange,e,t,r,n,i,o);if(!this.validator.notValid([{name:"owner",type:"address",value:i},{name:"first token name",type:"not-empty-string",value:e},{name:"second token name",type:"not-empty-string",value:r},{name:"first token balance",type:"positive-integer",value:t},{name:"second token balance",type:"positive-integer",value:n}],a)){var s={owner_address:Zt(i),first_token_id:Vt(e),first_token_balance:t,second_token_id:Vt(r),second_token_balance:n};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/exchangecreate",s,"post").then((function(e){a(null,e)})).catch((function(e){return a(e)}))}}},{key:"injectExchangeTokens",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(i)&&(o=i,i={}),Rt.isFunction(n)?(o=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(i=n,n=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.injectExchangeTokens,e,t,r,n,i);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:t},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}],o)){var a={owner_address:Zt(n),exchange_id:parseInt(e),token_id:Vt(t),quant:parseInt(r)};i&&i.permissionId&&(a.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/exchangeinject",a,"post").then((function(e){return Jt(e,o)})).catch((function(e){return o(e)}))}}},{key:"withdrawExchangeTokens",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(i)&&(o=i,i={}),Rt.isFunction(n)?(o=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(i=n,n=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.withdrawExchangeTokens,e,t,r,n,i);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:t},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}],o)){var a={owner_address:Zt(n),exchange_id:parseInt(e),token_id:Vt(t),quant:parseInt(r)};i&&i.permissionId&&(a.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/exchangewithdraw",a,"post").then((function(e){return Jt(e,o)})).catch((function(e){return o(e)}))}}},{key:"tradeExchangeTokens",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Rt.isFunction(o)&&(a=o,o={}),Rt.isFunction(i)?(a=i,i=this.tronWeb.defaultAddress.hex):Rt.isObject(i)&&(o=i,i=this.tronWeb.defaultAddress.hex),!a)return this.injectPromise(this.tradeExchangeTokens,e,t,r,n,i,o);if(!this.validator.notValid([{name:"owner",type:"address",value:i},{name:"token name",type:"not-empty-string",value:t},{name:"tokenAmountSold",type:"integer",value:r,gte:1},{name:"tokenAmountExpected",type:"integer",value:n,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}],a)){var s={owner_address:Zt(i),exchange_id:parseInt(e),token_id:this.tronWeb.fromAscii(t),quant:parseInt(r),expected:parseInt(n)};o&&o.permissionId&&(s.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/exchangetransaction",s,"post").then((function(e){return Jt(e,a)})).catch((function(e){return a(e)}))}}},{key:"updateSetting",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)?(i=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.updateSetting,e,t,r,n);if(!this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:e},{name:"userFeePercentage",type:"integer",value:t,gte:0,lte:100}],i)){var o={owner_address:Zt(r),contract_address:Zt(e),consume_user_resource_percent:t};n&&n.permissionId&&(o.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/updatesetting",o,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}}},{key:"updateEnergyLimit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)?(i=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.updateEnergyLimit,e,t,r,n);if(!this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:e},{name:"originEnergyLimit",type:"integer",value:t,gte:0,lte:1e7}],i)){var o={owner_address:Zt(r),contract_address:Zt(e),origin_energy_limit:t};n&&n.permissionId&&(o.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/updateenergylimit",o,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}}},{key:"checkPermissions",value:function(e,t){if(e){if(e.type!==t||!e.permission_name||!Rt.isString(e.permission_name)||!Rt.isInteger(e.threshold)||e.threshold<1||!e.keys)return!1;var r,n=zt(e.keys);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(!this.tronWeb.isAddress(i.address)||!Rt.isInteger(i.weight)||i.weight>e.threshold||i.weight<1||2===t&&!e.operations)return!1}}catch(e){n.e(e)}finally{n.f()}}return!0}},{key:"updateAccountPermissions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(i=n,n=!1),Rt.isFunction(r)&&(i=r,r=n=!1),Rt.isFunction(t)&&(i=t,t=r=n=!1),!i)return this.injectPromise(this.updateAccountPermissions,e,t,r,n);if(!this.tronWeb.isAddress(e))return i("Invalid ownerAddress provided");if(!this.checkPermissions(t,0))return i("Invalid ownerPermissions provided");if(!this.checkPermissions(r,1))return i("Invalid witnessPermissions provided");Array.isArray(n)||(n=[n]);var o,a=zt(n);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!this.checkPermissions(s,2))return i("Invalid activesPermissions provided")}}catch(e){a.e(e)}finally{a.f()}var u={owner_address:e};t&&(u.owner=t),r&&(u.witness=r),n&&(u.actives=1===n.length?n[0]:n),this.tronWeb.fullNode.request("wallet/accountpermissionupdate",u,"post").then((function(e){return Jt(e,i)})).catch((function(e){return i(e)}))}},{key:"newTxID",value:(i=p()(R.a.mark((function e(t,r){return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",this.injectPromise(this.newTxID,t));case 2:this.tronWeb.fullNode.request("wallet/getsignweight",t,"post").then((function(e){e=e.transaction.transaction,"boolean"==typeof t.visible&&(e.visible=t.visible),r(null,e)})).catch((function(e){return r("Error generating a new transaction id.")}));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"alterTransaction",value:(n=p()(R.a.mark((function e(t){var r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.length>1&&void 0!==i[1]?i[1]:{},n=i.length>2&&void 0!==i[2]&&i[2]){e.next=4;break}return e.abrupt("return",this.injectPromise(this.alterTransaction,t,r));case 4:if(!t.signature){e.next=6;break}return e.abrupt("return",n("You can not extend the expiration of a signed transaction."));case 6:if(!r.data){e.next=12;break}if("hex"!==r.dataFormat&&(r.data=this.tronWeb.toHex(r.data)),r.data=r.data.replace(/^0x/,""),0!==r.data.length){e.next=11;break}return e.abrupt("return",n("Invalid data provided"));case 11:t.raw_data.data=r.data;case 12:if(!r.extension){e.next=17;break}if(r.extension=parseInt(1e3*r.extension),!(isNaN(r.extension)||t.raw_data.expiration+r.extension<=Date.now()+3e3)){e.next=16;break}return e.abrupt("return",n("Invalid extension provided"));case 16:t.raw_data.expiration+=r.extension;case 17:this.newTxID(t,n);case 18:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"extendExpiration",value:(r=p()(R.a.mark((function e(t,r){var n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>2&&void 0!==i[2]&&i[2]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.extendExpiration,t,r));case 3:this.alterTransaction(t,{extension:r},n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"addUpdateData",value:(t=p()(R.a.mark((function e(t,r){var n,i,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>2&&void 0!==o[2]?o[2]:"utf8",i=o.length>3&&void 0!==o[3]&&o[3],Rt.isFunction(n)&&(i=n,n="utf8"),i){e.next=5;break}return e.abrupt("return",this.injectPromise(this.addUpdateData,t,r,n));case 5:this.alterTransaction(t,{data:r,dataFormat:n},i);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function Xt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xt(Object(r),!0).forEach((function(t){O()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function er(e){return pr.address.toHex(e)}var tr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,e),!t||!t instanceof pr)throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.injectPromise=Ut()(this),this.cache={contracts:{}},this.validator=new Wt(t)}var t,r,n,i,o,a,s,u,l,c,f,d,h,m,y,g,b;return w()(e,[{key:"_parseToken",value:function(e){return Qt(Qt({},e),{},{name:this.tronWeb.toUtf8(e.name),abbr:e.abbr&&this.tronWeb.toUtf8(e.abbr),description:e.description&&this.tronWeb.toUtf8(e.description),url:e.url&&this.tronWeb.toUtf8(e.url)})}},{key:"getCurrentBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getCurrentBlock);this.tronWeb.fullNode.request("wallet/getnowblock").then((function(t){e(null,t)})).catch((function(t){return e(t)}))}},{key:"getConfirmedCurrentBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getConfirmedCurrentBlock);this.tronWeb.solidityNode.request("walletsolidity/getnowblock").then((function(t){e(null,t)})).catch((function(t){return e(t)}))}},{key:"getBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultBlock),t?!1===e?t("No block identifier provided"):("earliest"==e&&(e=0),"latest"==e?this.getCurrentBlock(t):isNaN(e)&&Rt.isHex(e)?this.getBlockByHash(e,t):void this.getBlockByNumber(e,t)):this.injectPromise(this.getBlock,e)}},{key:"getBlockByHash",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getBlockByHash,e);this.tronWeb.fullNode.request("wallet/getblockbyid",{value:e},"post").then((function(e){if(!Object.keys(e).length)return t("Block not found");t(null,e)})).catch((function(e){return t(e)}))}},{key:"getBlockByNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?!Rt.isInteger(e)||e<0?t("Invalid block number provided"):void this.tronWeb.fullNode.request("wallet/getblockbynum",{num:parseInt(e)},"post").then((function(e){if(!Object.keys(e).length)return t("Block not found");t(null,e)})).catch((function(e){return t(e)})):this.injectPromise(this.getBlockByNumber,e)}},{key:"getBlockTransactionCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultBlock),!t)return this.injectPromise(this.getBlockTransactionCount,e);this.getBlock(e).then((function(e){var r=e.transactions;t(null,(void 0===r?[]:r).length)})).catch((function(e){return t(e)}))}},{key:"getTransactionFromBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=0),Rt.isFunction(e)&&(r=e,e=this.tronWeb.defaultBlock),!r)return this.injectPromise(this.getTransactionFromBlock,e,t);this.getBlock(e).then((function(e){var n=e.transactions,i=void 0!==n&&n;i?"number"==typeof t?t>=0&&t<i.length?r(null,i[t]):r("Invalid transaction index provided"):r(null,i):r("Transaction not found in block")})).catch((function(e){return r(e)}))}},{key:"getTransaction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getTransaction,e);this.tronWeb.fullNode.request("wallet/gettransactionbyid",{value:e},"post").then((function(e){if(!Object.keys(e).length)return t("Transaction not found");t(null,e)})).catch((function(e){return t(e)}))}},{key:"getConfirmedTransaction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getConfirmedTransaction,e);this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid",{value:e},"post").then((function(e){if(!Object.keys(e).length)return t("Transaction not found");t(null,e)})).catch((function(e){return t(e)}))}},{key:"getUnconfirmedTransactionInfo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._getTransactionInfoById(e,{confirmed:!1},t)}},{key:"getTransactionInfo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._getTransactionInfoById(e,{confirmed:!0},t)}},{key:"_getTransactionInfoById",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this._getTransactionInfoById,e,t);this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request("wallet".concat(t.confirmed?"solidity":"","/gettransactioninfobyid"),{value:e},"post").then((function(e){r(null,e)})).catch((function(e){return r(e)}))}},{key:"getTransactionsToAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Rt.isFunction(r)&&(n=r,r=0),Rt.isFunction(t)&&(n=t,t=30),n?(e=this.tronWeb.address.toHex(e),this.getTransactionsRelated(e,"to",t,r,n)):this.injectPromise(this.getTransactionsToAddress,e,t,r)}},{key:"getTransactionsFromAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Rt.isFunction(r)&&(n=r,r=0),Rt.isFunction(t)&&(n=t,t=30),n?(e=this.tronWeb.address.toHex(e),this.getTransactionsRelated(e,"from",t,r,n)):this.injectPromise(this.getTransactionsFromAddress,e,t,r)}},{key:"getTransactionsRelated",value:(b=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u,l,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:this.tronWeb.defaultAddress.hex,r=c.length>1&&void 0!==c[1]?c[1]:"all",n=c.length>2&&void 0!==c[2]?c[2]:30,i=c.length>3&&void 0!==c[3]?c[3]:0,o=c.length>4&&void 0!==c[4]&&c[4],Rt.isFunction(i)&&(o=i,i=0),Rt.isFunction(n)&&(o=n,n=30),Rt.isFunction(r)&&(o=r,r="all"),Rt.isFunction(t)&&(o=t,t=this.tronWeb.defaultAddress.hex),o){e.next=11;break}return e.abrupt("return",this.injectPromise(this.getTransactionsRelated,t,r,n,i));case 11:if(["to","from","all"].includes(r)){e.next=13;break}return e.abrupt("return",o('Invalid direction provided: Expected "to", "from" or "all"'));case 13:if("all"!=r){e.next=27;break}return e.prev=14,e.next=17,Promise.all([this.getTransactionsRelated(t,"from",n,i),this.getTransactionsRelated(t,"to",n,i)]);case 17:return a=e.sent,s=qt()(a,2),u=s[0],l=s[1],e.abrupt("return",o(null,[].concat(K()(u.map((function(e){return e.direction="from",e}))),K()(l.map((function(e){return e.direction="to",e})))).sort((function(e,t){return t.raw_data.timestamp-e.raw_data.timestamp}))));case 24:return e.prev=24,e.t0=e.catch(14),e.abrupt("return",o(e.t0));case 27:if(this.tronWeb.isAddress(t)){e.next=29;break}return e.abrupt("return",o("Invalid address provided"));case 29:if(!(!Rt.isInteger(n)||n<0||i&&n<1)){e.next=31;break}return e.abrupt("return",o("Invalid limit provided"));case 31:if(Rt.isInteger(i)&&!(i<0)){e.next=33;break}return e.abrupt("return",o("Invalid offset provided"));case 33:t=this.tronWeb.address.toHex(t),this.tronWeb.solidityNode.request("walletextension/gettransactions".concat(r,"this"),{account:{address:t},offset:i,limit:n},"post").then((function(e){var t=e.transaction;o(null,t)})).catch((function(e){return o(e)}));case 35:case"end":return e.stop()}}),e,this,[[14,24]])}))),function(){return b.apply(this,arguments)})},{key:"getAccount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),t?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.solidityNode.request("walletsolidity/getaccount",{address:e},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)}))):t("Invalid address provided"):this.injectPromise(this.getAccount,e)}},{key:"getAccountById",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getAccountById,e);this.getAccountInfoById(e,{confirmed:!0},t)}},{key:"getAccountInfoById",value:function(e,t,r){this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e}],r)||(e.startsWith("0x")&&(e=e.slice(2)),this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request("wallet".concat(t.confirmed?"solidity":"","/getaccountbyid"),{account_id:e},"post").then((function(e){r(null,e)})).catch((function(e){return r(e)})))}},{key:"getBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!t)return this.injectPromise(this.getBalance,e);this.getAccount(e).then((function(e){var r=e.balance;t(null,void 0===r?0:r)})).catch((function(e){return t(e)}))}},{key:"getUnconfirmedAccount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),t?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.fullNode.request("wallet/getaccount",{address:e},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)}))):t("Invalid address provided"):this.injectPromise(this.getUnconfirmedAccount,e)}},{key:"getUnconfirmedAccountById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getUnconfirmedAccountById,e);this.getAccountInfoById(e,{confirmed:!1},t)}},{key:"getUnconfirmedBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!t)return this.injectPromise(this.getUnconfirmedBalance,e);this.getUnconfirmedAccount(e).then((function(e){var r=e.balance;t(null,void 0===r?0:r)})).catch((function(e){return t(e)}))}},{key:"getBandwidth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),t?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.fullNode.request("wallet/getaccountnet",{address:e},"post").then((function(e){var r=e.freeNetUsed,n=void 0===r?0:r,i=e.freeNetLimit,o=void 0===i?0:i,a=e.NetUsed,s=void 0===a?0:a,u=e.NetLimit;t(null,o-n+((void 0===u?0:u)-s))})).catch((function(e){return t(e)}))):t("Invalid address provided"):this.injectPromise(this.getBandwidth,e)}},{key:"getTokensIssuedByAddress",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),r?this.tronWeb.isAddress(t)?(t=this.tronWeb.address.toHex(t),void this.tronWeb.fullNode.request("wallet/getassetissuebyaccount",{address:t},"post").then((function(t){var n=t.assetIssue,i=void 0!==n&&n;if(!i)return r(null,{});var o=i.map((function(t){return e._parseToken(t)})).reduce((function(e,t){return e[t.name]=t,e}),{});r(null,o)})).catch((function(e){return r(e)}))):r("Invalid address provided"):this.injectPromise(this.getTokensIssuedByAddress,t)}},{key:"getTokenFromID",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Rt.isInteger(t)&&(t=t.toString()),Rt.isString(t)&&t.length?void this.tronWeb.fullNode.request("wallet/getassetissuebyname",{value:this.tronWeb.fromUtf8(t)},"post").then((function(t){if(!t.name)return r("Token does not exist");r(null,e._parseToken(t))})).catch((function(e){return r(e)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenFromID,t)}},{key:"listNodes",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.listNodes);this.tronWeb.fullNode.request("wallet/listnodes").then((function(r){var n=r.nodes;t(null,(void 0===n?[]:n).map((function(t){var r=t.address,n=r.host,i=r.port;return"".concat(e.tronWeb.toUtf8(n),":").concat(i)})))})).catch((function(e){return t(e)}))}},{key:"getBlockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(t)&&(r=t,t=30),Rt.isFunction(e)&&(r=e,e=0),r?!Rt.isInteger(e)||e<0?r("Invalid start of range provided"):!Rt.isInteger(t)||t<=e?r("Invalid end of range provided"):void this.tronWeb.fullNode.request("wallet/getblockbylimitnext",{startNum:parseInt(e),endNum:parseInt(t)+1},"post").then((function(e){var t=e.block;r(null,void 0===t?[]:t)})).catch((function(e){return r(e)})):this.injectPromise(this.getBlockRange,e,t)}},{key:"listSuperRepresentatives",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listSuperRepresentatives);this.tronWeb.fullNode.request("wallet/listwitnesses").then((function(t){var r=t.witnesses;e(null,void 0===r?[]:r)})).catch((function(t){return e(t)}))}},{key:"listTokens",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(r)&&(n=r,r=0),Rt.isFunction(t)&&(n=t,t=0),n?!Rt.isInteger(t)||t<0||r&&t<1?n("Invalid limit provided"):!Rt.isInteger(r)||r<0?n("Invalid offset provided"):t?void this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist",{offset:parseInt(r),limit:parseInt(t)},"post").then((function(t){var r=t.assetIssue;n(null,(void 0===r?[]:r).map((function(t){return e._parseToken(t)})))})).catch((function(e){return n(e)})):this.tronWeb.fullNode.request("wallet/getassetissuelist").then((function(t){var r=t.assetIssue;n(null,(void 0===r?[]:r).map((function(t){return e._parseToken(t)})))})).catch((function(e){return n(e)})):this.injectPromise(this.listTokens,t,r)}},{key:"timeUntilNextVoteCycle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.timeUntilNextVoteCycle);this.tronWeb.fullNode.request("wallet/getnextmaintenancetime").then((function(t){var r=t.num,n=void 0===r?-1:r;if(-1==n)return e("Failed to get time until next vote cycle");e(null,Math.floor(n/1e3))})).catch((function(t){return e(t)}))}},{key:"getContract",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?this.tronWeb.isAddress(e)?void(this.cache.contracts[e]?r(null,this.cache.contracts[e]):(e=this.tronWeb.address.toHex(e),this.tronWeb.fullNode.request("wallet/getcontract",{value:e}).then((function(n){if(n.Error)return r("Contract does not exist");t.cache.contracts[e]=n,r(null,n)})).catch((function(e){return r(e)})))):r("Invalid contract address provided"):this.injectPromise(this.getContract,e)}},{key:"verifyMessage",value:(g=p()(R.a.mark((function t(){var r,n,i,o,a,s=arguments;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=s.length>0&&void 0!==s[0]&&s[0],n=s.length>1&&void 0!==s[1]&&s[1],i=s.length>2&&void 0!==s[2]?s[2]:this.tronWeb.defaultAddress.base58,o=!(s.length>3&&void 0!==s[3])||s[3],a=s.length>4&&void 0!==s[4]&&s[4],Rt.isFunction(i)&&(a=i,i=this.tronWeb.defaultAddress.base58,o=!0),Rt.isFunction(o)&&(a=o,o=!0),a){t.next=9;break}return t.abrupt("return",this.injectPromise(this.verifyMessage,r,n,i,o));case 9:if(Rt.isHex(r)){t.next=11;break}return t.abrupt("return",a("Expected hex message input"));case 11:if(!e.verifySignature(r,i,n,o)){t.next=13;break}return t.abrupt("return",a(null,!0));case 13:a("Signature does not match");case 14:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:"verifyMessageV2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(n)&&(i=n,n={}),!i)return this.injectPromise(this.verifyMessageV2,t,r,n);try{i(null,e.verifyMessageV2(t,r))}catch(e){i(e)}}},{key:"verifyTypedData",value:function(t,r,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.base58,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return Rt.isFunction(o)&&(a=o,o=this.tronWeb.defaultAddress.base58),a?e.verifyTypedData(t,r,n,i,o)?a(null,!0):void a("Signature does not match"):this.injectPromise(this.verifyTypedData,t,r,n,i,o)}},{key:"sign",value:(y=p()(R.a.mark((function t(){var r,n,i,o,a,s,u=arguments;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=u.length>0&&void 0!==u[0]&&u[0],n=u.length>1&&void 0!==u[1]?u[1]:this.tronWeb.defaultPrivateKey,i=!(u.length>2&&void 0!==u[2])||u[2],o=u.length>3&&void 0!==u[3]&&u[3],a=u.length>4&&void 0!==u[4]&&u[4],Rt.isFunction(o)&&(a=o,o=!1),Rt.isFunction(i)&&(a=i,i=!0,o=!1),Rt.isFunction(n)&&(a=n,n=this.tronWeb.defaultPrivateKey,i=!0,o=!1),a){t.next=10;break}return t.abrupt("return",this.injectPromise(this.sign,r,n,i,o));case 10:if(!Rt.isString(r)){t.next=21;break}if(Rt.isHex(r)){t.next=13;break}return t.abrupt("return",a("Expected hex message input"));case 13:return t.prev=13,s=e.signString(r,n,i),t.abrupt("return",a(null,s));case 18:t.prev=18,t.t0=t.catch(13),a(t.t0);case 21:if(Rt.isObject(r)){t.next=23;break}return t.abrupt("return",a("Invalid transaction provided"));case 23:if(o||!r.signature){t.next=25;break}return t.abrupt("return",a("Transaction is already signed"));case 25:if(t.prev=25,o){t.next=30;break}if(this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(n)).toLowerCase()===this.tronWeb.address.toHex(r.raw_data.contract[0].parameter.value.owner_address)){t.next=30;break}return t.abrupt("return",a("Private key does not match address in transaction"));case 30:return t.abrupt("return",a(null,Rt.crypto.signTransaction(n,r)));case 33:t.prev=33,t.t1=t.catch(25),a(t.t1);case 36:case"end":return t.stop()}}),t,this,[[13,18],[25,33]])}))),function(){return y.apply(this,arguments)})},{key:"signMessageV2",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultPrivateKey,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(n)&&(i=n,n={}),Rt.isFunction(r)&&(i=r,r=this.tronWeb.defaultPrivateKey),!i)return this.injectPromise(this.signMessageV2,t,r);try{return i(null,e.signMessageV2(t,r))}catch(e){i(e)}}},{key:"_signTypedData",value:function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultPrivateKey,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(i)&&(o=i,i=this.tronWeb.defaultPrivateKey),!o)return this.injectPromise(this._signTypedData,t,r,n,i);try{return o(null,e._signTypedData(t,r,n,i))}catch(e){o(e)}}},{key:"multiSign",value:(m=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]&&u[0],r=u.length>1&&void 0!==u[1]?u[1]:this.tronWeb.defaultPrivateKey,n=u.length>2&&void 0!==u[2]&&u[2],i=u.length>3&&void 0!==u[3]&&u[3],Rt.isFunction(n)&&(i=n,n=0),Rt.isFunction(r)&&(i=r,r=this.tronWeb.defaultPrivateKey,n=0),i){e.next=8;break}return e.abrupt("return",this.injectPromise(this.multiSign,t,r,n));case 8:if(Rt.isObject(t)&&t.raw_data&&t.raw_data.contract){e.next=10;break}return e.abrupt("return",i("Invalid transaction provided"));case 10:if(t.raw_data.contract[0].Permission_id||!(n>0)){e.next=30;break}return t.raw_data.contract[0].Permission_id=n,o=this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(r)).toLowerCase(),e.next=15,this.getSignWeight(t,n);case 15:if("PERMISSION_ERROR"!==(a=e.sent).result.code){e.next=18;break}return e.abrupt("return",i(a.result.message));case 18:if(s=!1,a.permission.keys.map((function(e){e.address===o&&(s=!0)})),s){e.next=22;break}return e.abrupt("return",i(r+" has no permission to sign"));case 22:if(!a.approved_list||-1==a.approved_list.indexOf(o)){e.next=24;break}return e.abrupt("return",i(r+" already sign transaction"));case 24:if(!a.transaction||!a.transaction.transaction){e.next=29;break}t=a.transaction.transaction,n>0&&(t.raw_data.contract[0].Permission_id=n),e.next=30;break;case 29:return e.abrupt("return",i("Invalid transaction provided"));case 30:return e.prev=30,e.abrupt("return",i(null,Rt.crypto.signTransaction(r,t)));case 34:e.prev=34,e.t0=e.catch(30),i(e.t0);case 37:case"end":return e.stop()}}),e,this,[[30,34]])}))),function(){return m.apply(this,arguments)})},{key:"getApprovedList",value:(h=p()(R.a.mark((function e(t){var r,n=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.getApprovedList,t));case 3:if(Rt.isObject(t)){e.next=5;break}return e.abrupt("return",r("Invalid transaction provided"));case 5:this.tronWeb.fullNode.request("wallet/getapprovedlist",t,"post").then((function(e){r(null,e)})).catch((function(e){return r(e)}));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"getSignWeight",value:(d=p()(R.a.mark((function e(t,r){var n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>2&&void 0!==i[2]&&i[2],Rt.isFunction(r)&&(n=r,r=void 0),n){e.next=4;break}return e.abrupt("return",this.injectPromise(this.getSignWeight,t,r));case 4:if(Rt.isObject(t)&&t.raw_data&&t.raw_data.contract){e.next=6;break}return e.abrupt("return",n("Invalid transaction provided"));case 6:if(Rt.isInteger(r)?t.raw_data.contract[0].Permission_id=parseInt(r):"number"!=typeof t.raw_data.contract[0].Permission_id&&(t.raw_data.contract[0].Permission_id=0),Rt.isObject(t)){e.next=9;break}return e.abrupt("return",n("Invalid transaction provided"));case 9:this.tronWeb.fullNode.request("wallet/getsignweight",t,"post").then((function(e){n(null,e)})).catch((function(e){return n(e)}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"sendRawTransaction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(t)&&(r=t,t={}),r?Rt.isObject(e)?Rt.isObject(t)?e.signature&&Rt.isArray(e.signature)?void this.tronWeb.fullNode.request("wallet/broadcasttransaction",e,"post").then((function(t){t.result&&(t.transaction=e),r(null,t)})).catch((function(e){return r(e)})):r("Transaction is not signed"):r("Invalid options provided"):r("Invalid transaction provided"):this.injectPromise(this.sendRawTransaction,e,t)}},{key:"sendHexTransaction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t={}),!r)return this.injectPromise(this.sendHexTransaction,e,t);if(!Rt.isHex(e))return r("Invalid hex transaction provided");if(!Rt.isObject(t))return r("Invalid options provided");var n={transaction:e};this.tronWeb.fullNode.request("wallet/broadcasthex",n,"post").then((function(t){t.result&&(t.transaction=JSON.parse(t.transaction),t.hexTransaction=e),r(null,t)})).catch((function(e){return r(e)}))}},{key:"sendTransaction",value:(f=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>0&&void 0!==l[0]&&l[0],r=l.length>1&&void 0!==l[1]&&l[1],n=l.length>2&&void 0!==l[2]?l[2]:{},i=l.length>3&&void 0!==l[3]&&l[3],Rt.isFunction(n)&&(i=n,n={}),"string"==typeof n&&(n={privateKey:n}),i){e.next=8;break}return e.abrupt("return",this.injectPromise(this.sendTransaction,t,r,n));case 8:if(this.tronWeb.isAddress(t)){e.next=10;break}return e.abrupt("return",i("Invalid recipient provided"));case 10:if(Rt.isInteger(r)&&!(r<=0)){e.next=12;break}return e.abrupt("return",i("Invalid amount provided"));case 12:if((n=Qt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},n)).privateKey||n.address){e.next=15;break}return e.abrupt("return",i("Function requires either a private key or address to be set"));case 15:return e.prev=15,o=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,e.next=19,this.tronWeb.transactionBuilder.sendTrx(t,r,o);case 19:return a=e.sent,e.next=22,this.sign(a,n.privateKey||void 0);case 22:return s=e.sent,e.next=25,this.sendRawTransaction(s);case 25:return u=e.sent,e.abrupt("return",i(null,u));case 29:return e.prev=29,e.t0=e.catch(15),e.abrupt("return",i(e.t0));case 32:case"end":return e.stop()}}),e,this,[[15,29]])}))),function(){return f.apply(this,arguments)})},{key:"sendToken",value:(c=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u,l,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],r=c.length>1&&void 0!==c[1]&&c[1],n=c.length>2&&void 0!==c[2]&&c[2],i=c.length>3&&void 0!==c[3]?c[3]:{},o=c.length>4&&void 0!==c[4]&&c[4],Rt.isFunction(i)&&(o=i,i={}),"string"==typeof i&&(i={privateKey:i}),o){e.next=9;break}return e.abrupt("return",this.injectPromise(this.sendToken,t,r,n,i));case 9:if(this.tronWeb.isAddress(t)){e.next=11;break}return e.abrupt("return",o("Invalid recipient provided"));case 11:if(Rt.isInteger(r)&&!(r<=0)){e.next=13;break}return e.abrupt("return",o("Invalid amount provided"));case 13:if(Rt.isInteger(n)&&(n=n.toString()),Rt.isString(n)){e.next=16;break}return e.abrupt("return",o("Invalid token ID provided"));case 16:if((i=Qt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},i)).privateKey||i.address){e.next=19;break}return e.abrupt("return",o("Function requires either a private key or address to be set"));case 19:return e.prev=19,a=i.privateKey?this.tronWeb.address.fromPrivateKey(i.privateKey):i.address,e.next=23,this.tronWeb.transactionBuilder.sendToken(t,r,n,a);case 23:return s=e.sent,e.next=26,this.sign(s,i.privateKey||void 0);case 26:return u=e.sent,e.next=29,this.sendRawTransaction(u);case 29:return l=e.sent,e.abrupt("return",o(null,l));case 33:return e.prev=33,e.t0=e.catch(19),e.abrupt("return",o(e.t0));case 36:case"end":return e.stop()}}),e,this,[[19,33]])}))),function(){return c.apply(this,arguments)})},{key:"freezeBalance",value:(l=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u,l,c,f=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=f.length>0&&void 0!==f[0]?f[0]:0,r=f.length>1&&void 0!==f[1]?f[1]:3,n=f.length>2&&void 0!==f[2]?f[2]:"BANDWIDTH",i=f.length>3&&void 0!==f[3]?f[3]:{},o=f.length>4&&void 0!==f[4]?f[4]:void 0,a=f.length>5&&void 0!==f[5]&&f[5],Rt.isFunction(o)&&(a=o,o=void 0),Rt.isFunction(r)&&(a=r,r=3),Rt.isFunction(n)&&(a=n,n="BANDWIDTH"),Rt.isFunction(i)&&(a=i,i={}),"string"==typeof i&&(i={privateKey:i}),a){e.next=13;break}return e.abrupt("return",this.injectPromise(this.freezeBalance,t,r,n,i,o));case 13:if(["BANDWIDTH","ENERGY"].includes(n)){e.next=15;break}return e.abrupt("return",a('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'));case 15:if(Rt.isInteger(t)&&!(t<=0)){e.next=17;break}return e.abrupt("return",a("Invalid amount provided"));case 17:if(Rt.isInteger(r)&&!(r<3)){e.next=19;break}return e.abrupt("return",a("Invalid duration provided, minimum of 3 days"));case 19:if((i=Qt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},i)).privateKey||i.address){e.next=22;break}return e.abrupt("return",a("Function requires either a private key or address to be set"));case 22:return e.prev=22,s=i.privateKey?this.tronWeb.address.fromPrivateKey(i.privateKey):i.address,e.next=26,this.tronWeb.transactionBuilder.freezeBalance(t,r,n,s,o);case 26:return u=e.sent,e.next=29,this.sign(u,i.privateKey||void 0);case 29:return l=e.sent,e.next=32,this.sendRawTransaction(l);case 32:return c=e.sent,e.abrupt("return",a(null,c));case 36:return e.prev=36,e.t0=e.catch(22),e.abrupt("return",a(e.t0));case 39:case"end":return e.stop()}}),e,this,[[22,36]])}))),function(){return l.apply(this,arguments)})},{key:"unfreezeBalance",value:(u=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>0&&void 0!==l[0]?l[0]:"BANDWIDTH",r=l.length>1&&void 0!==l[1]?l[1]:{},n=l.length>2&&void 0!==l[2]?l[2]:void 0,i=l.length>3&&void 0!==l[3]&&l[3],Rt.isFunction(n)&&(i=n,n=void 0),Rt.isFunction(t)&&(i=t,t="BANDWIDTH"),Rt.isFunction(r)&&(i=r,r={}),"string"==typeof r&&(r={privateKey:r}),i){e.next=10;break}return e.abrupt("return",this.injectPromise(this.unfreezeBalance,t,r,n));case 10:if(["BANDWIDTH","ENERGY"].includes(t)){e.next=12;break}return e.abrupt("return",i('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'));case 12:if((r=Qt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},r)).privateKey||r.address){e.next=15;break}return e.abrupt("return",i("Function requires either a private key or address to be set"));case 15:return e.prev=15,o=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,e.next=19,this.tronWeb.transactionBuilder.unfreezeBalance(t,o,n);case 19:return a=e.sent,e.next=22,this.sign(a,r.privateKey||void 0);case 22:return s=e.sent,e.next=25,this.sendRawTransaction(s);case 25:return u=e.sent,e.abrupt("return",i(null,u));case 29:return e.prev=29,e.t0=e.catch(15),e.abrupt("return",i(e.t0));case 32:case"end":return e.stop()}}),e,this,[[15,29]])}))),function(){return u.apply(this,arguments)})},{key:"updateAccount",value:(s=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]&&u[0],r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]&&u[2],Rt.isFunction(r)&&(n=r,r={}),"string"==typeof r&&(r={privateKey:r}),n){e.next=7;break}return e.abrupt("return",this.injectPromise(this.updateAccount,t,r));case 7:if(Rt.isString(t)&&t.length){e.next=9;break}return e.abrupt("return",n("Name must be a string"));case 9:if((r=Qt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},r)).privateKey||r.address){e.next=12;break}return e.abrupt("return",n("Function requires either a private key or address to be set"));case 12:return e.prev=12,i=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,e.next=16,this.tronWeb.transactionBuilder.updateAccount(t,i);case 16:return o=e.sent,e.next=19,this.sign(o,r.privateKey||void 0);case 19:return a=e.sent,e.next=22,this.sendRawTransaction(a);case 22:return s=e.sent,e.abrupt("return",n(null,s));case 26:return e.prev=26,e.t0=e.catch(12),e.abrupt("return",n(e.t0));case 29:case"end":return e.stop()}}),e,this,[[12,26]])}))),function(){return s.apply(this,arguments)})},{key:"signMessage",value:function(){return this.sign.apply(this,arguments)}},{key:"sendAsset",value:function(){return this.sendToken.apply(this,arguments)}},{key:"send",value:function(){return this.sendTransaction.apply(this,arguments)}},{key:"sendTrx",value:function(){return this.sendTransaction.apply(this,arguments)}},{key:"broadcast",value:function(){return this.sendRawTransaction.apply(this,arguments)}},{key:"broadcastHex",value:function(){return this.sendHexTransaction.apply(this,arguments)}},{key:"signTransaction",value:function(){return this.sign.apply(this,arguments)}},{key:"getProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?!Rt.isInteger(e)||e<0?t("Invalid proposalID provided"):void this.tronWeb.fullNode.request("wallet/getproposalbyid",{id:parseInt(e)},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)})):this.injectPromise(this.getProposal,e)}},{key:"listProposals",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listProposals);this.tronWeb.fullNode.request("wallet/listproposals",{},"post").then((function(t){var r=t.proposals;e(null,void 0===r?[]:r)})).catch((function(t){return e(t)}))}},{key:"getChainParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getChainParameters);this.tronWeb.fullNode.request("wallet/getchainparameters",{},"post").then((function(t){var r=t.chainParameter;e(null,void 0===r?[]:r)})).catch((function(t){return e(t)}))}},{key:"getAccountResources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?this.tronWeb.isAddress(e)?void this.tronWeb.fullNode.request("wallet/getaccountresource",{address:this.tronWeb.address.toHex(e)},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)})):t("Invalid address provided"):this.injectPromise(this.getAccountResources,e)}},{key:"getExchangeByID",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?!Rt.isInteger(e)||e<0?t("Invalid exchangeID provided"):void this.tronWeb.fullNode.request("wallet/getexchangebyid",{id:e},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)})):this.injectPromise(this.getExchangeByID,e)}},{key:"listExchanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listExchanges);this.tronWeb.fullNode.request("wallet/listexchanges",{},"post").then((function(t){var r=t.exchanges;e(null,void 0===r?[]:r)}),"post").catch((function(t){return e(t)}))}},{key:"listExchangesPaginated",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=0),Rt.isFunction(e)&&(r=e,e=10),!r)return this.injectPromise(this.listExchangesPaginated,e,t);this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist",{limit:e,offset:t},"post").then((function(e){var t=e.exchanges;r(null,void 0===t?[]:t)})).catch((function(e){return r(e)}))}},{key:"getNodeInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getNodeInfo);this.tronWeb.fullNode.request("wallet/getnodeinfo",{},"post").then((function(t){e(null,t)}),"post").catch((function(t){return e(t)}))}},{key:"getTokenListByName",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Rt.isInteger(t)&&(t=t.toString()),Rt.isString(t)&&t.length?void this.tronWeb.fullNode.request("wallet/getassetissuelistbyname",{value:this.tronWeb.fromUtf8(t)},"post").then((function(t){if(Array.isArray(t.assetIssue))r(null,t.assetIssue.map((function(t){return e._parseToken(t)})));else if(!t.name)return r("Token does not exist");r(null,e._parseToken(t))})).catch((function(e){return r(e)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenListByName,t)}},{key:"getTokenByID",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Rt.isInteger(t)&&(t=t.toString()),Rt.isString(t)&&t.length?void this.tronWeb.fullNode.request("wallet/getassetissuebyid",{value:t},"post").then((function(t){if(!t.name)return r("Token does not exist");r(null,e._parseToken(t))})).catch((function(e){return r(e)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenByID,t)}},{key:"getReward",value:(a=p()(R.a.mark((function e(t){var r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]&&i[2],(r=i.length>1&&void 0!==i[1]?i[1]:{}).confirmed=!0,e.abrupt("return",this._getReward(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getUnconfirmedReward",value:(o=p()(R.a.mark((function e(t){var r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]&&i[2],(r=i.length>1&&void 0!==i[1]?i[1]:{}).confirmed=!1,e.abrupt("return",this._getReward(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getBrokerage",value:(i=p()(R.a.mark((function e(t){var r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]&&i[2],(r=i.length>1&&void 0!==i[1]?i[1]:{}).confirmed=!0,e.abrupt("return",this._getBrokerage(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getUnconfirmedBrokerage",value:(n=p()(R.a.mark((function e(t){var r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]&&i[2],(r=i.length>1&&void 0!==i[1]?i[1]:{}).confirmed=!1,e.abrupt("return",this._getBrokerage(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_getReward",value:(r=p()(R.a.mark((function e(){var t,r,n,i,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:this.tronWeb.defaultAddress.hex,r=o.length>1?o[1]:void 0,n=o.length>2&&void 0!==o[2]&&o[2],Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),n){e.next=7;break}return e.abrupt("return",this.injectPromise(this._getReward,t,r));case 7:if(!this.validator.notValid([{name:"origin",type:"address",value:t}],n)){e.next=9;break}return e.abrupt("return");case 9:i={address:er(t)},this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getReward"),i,"post").then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===e.reward)return n("Not found.");n(null,e.reward)})).catch((function(e){return n(e)}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_getBrokerage",value:(t=p()(R.a.mark((function e(){var t,r,n,i,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:this.tronWeb.defaultAddress.hex,r=o.length>1?o[1]:void 0,n=o.length>2&&void 0!==o[2]&&o[2],Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),n){e.next=7;break}return e.abrupt("return",this.injectPromise(this._getBrokerage,t,r));case 7:if(!this.validator.notValid([{name:"origin",type:"address",value:t}],n)){e.next=9;break}return e.abrupt("return");case 9:i={address:er(t)},this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getBrokerage"),i,"post").then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===e.brokerage)return n("Not found.");n(null,e.brokerage)})).catch((function(e){return n(e)}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"verifySignature",value:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e=e.replace(/^0x/,""),r=r.replace(/^0x/,"");var i=[].concat(K()(le(n?"TRON Signed Message:\n32":"Ethereum Signed Message:\n32")),K()(Rt.code.hexStr2byteArray(e))),o=se(i),a="41"+fe(o,{recoveryParam:"1c"==r.substring(128,130)?1:0,r:"0x"+r.substring(0,64),s:"0x"+r.substring(64,128)}).substr(2);return pr.address.fromHex(a)==pr.address.fromHex(t)}},{key:"verifyMessageV2",value:function(e,t){return Rt.message.verifyMessage(e,t)}},{key:"verifyTypedData",value:function(e,t,r,n,i){n=n.replace(/^0x/,"");var o=Rt._TypedDataEncoder.hash(e,t,r),a="41"+fe(o,{recoveryParam:"1c"==n.substring(128,130)?1:0,r:"0x"+n.substring(0,64),s:"0x"+n.substring(64,128)}).substr(2);return pr.address.fromHex(a)==pr.address.fromHex(i)}},{key:"signString",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=e.replace(/^0x/,"");var n=new de({toHexString:function(){return"0x"+t},value:t}),i=[].concat(K()(le(r?"TRON Signed Message:\n32":"Ethereum Signed Message:\n32")),K()(Rt.code.hexStr2byteArray(e))),o=se(i),a=n.signDigest(o);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}},{key:"signMessageV2",value:function(e,t){return Rt.message.signMessage(e,t)}},{key:"_signTypedData",value:function(e,t,r,n){return Rt.crypto._signTypedData(e,t,r,n)}}]),e}();function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){O()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ir=function(e,t){return At(e,t)},or=function(){function e(t,r){v()(this,e),this.tronWeb=t.tronWeb,this.contract=t,this.abi=r,this.name=r.name||(r.name=r.type),this.inputs=r.inputs||[],this.outputs=r.outputs||[],this.functionSelector=function(e){if(e.stateMutability=e.stateMutability?e.stateMutability.toLowerCase():"nonpayable",e.type=e.type?e.type.toLowerCase():"","fallback"===e.type||"receive"===e.type)return"0x";var t=new Rt.ethersUtils.Interface([e]);return"event"===e.type?t.getEvent(e.name).format(Rt.ethersUtils.FormatTypes.sighash):t.getFunction(e.name).format(Rt.ethersUtils.FormatTypes.sighash)}(r),this.signature=this.tronWeb.sha3(this.functionSelector,!1).slice(0,8),this.injectPromise=Ut()(this),this.defaultOptions={feeLimit:this.tronWeb.feeLimit,callValue:0,userFeePercentage:100,shouldPollResponse:!1}}var t,r,n;return w()(e,[{key:"decodeInput",value:function(e){return ir(this.inputs,"0x"+e)}},{key:"onMethod",value:function(){var e=this,t="";if(this.abi&&!/event/i.test(this.abi.type)){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t=wt(this.abi,n)}return{call:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(r)&&(n=r,r={}),r=nr(nr({},r),{},{rawParameter:t}),e._call([],[],r,n)},send:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.tronWeb.defaultPrivateKey,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(n)&&(i=n,n=e.tronWeb.defaultPrivateKey),Rt.isFunction(r)&&(i=r,r={}),r=nr(nr({},r),{},{rawParameter:t}),e._send([],[],r,n,i)},watch:function(){return e._watch.apply(e,arguments)}}}},{key:"_call",value:(n=p()(R.a.mark((function e(t,r){var n,i,o,a,s=this,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:{},i=u.length>3&&void 0!==u[3]&&u[3],Rt.isFunction(n)&&(i=n,n={}),i){e.next=5;break}return e.abrupt("return",this.injectPromise(this._call,t,r,n));case 5:if(t.length===r.length){e.next=7;break}return e.abrupt("return",i("Invalid argument count provided"));case 7:if(this.contract.address){e.next=9;break}return e.abrupt("return",i("Smart contract is missing address"));case 9:if(this.contract.deployed){e.next=11;break}return e.abrupt("return",i("Calling smart contracts requires you to load the contract first"));case 11:if(o=this.abi.stateMutability,["pure","view"].includes(o.toLowerCase())){e.next=14;break}return e.abrupt("return",i('Methods with state mutability "'.concat(o,'" must use send()')));case 14:n=nr(nr(nr({},this.defaultOptions),{},{from:this.tronWeb.defaultAddress.hex},n),{},{_isConstant:!0}),a=r.map((function(e,r){return{type:t[r],value:e}})),this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,n,a,!!n.from&&this.tronWeb.address.toHex(n.from),(function(e,t){if(e)return i(e);if(!Rt.hasProperty(t,"constant_result"))return i("Failed to execute");try{var r=t.constant_result[0].length;if(0===r||r%64==8){var n="The call has been reverted or has thrown an error.";if(0!==r){n+=" Error message: ";for(var o="",a=t.constant_result[0].substring(8),u=0;u<r-8;u+=64)o+=s.tronWeb.toUtf8(a.substring(u,u+64));n+=o.replace(/(\u0000|\u000b|\f)+/g," ").replace(/ +/g," ").replace(/\s+$/g,"")}return i(n)}var l=ir(s.abi,"0x"+t.constant_result[0]);return 1===l.length&&1===Object.keys(l).length&&(l=l[0]),i(null,l)}catch(e){return i(e)}}));case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"_send",value:(r=p()(R.a.mark((function e(t,r){var n,i,o,a,s,u,l,c,f,d,h,m=this,y=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=y.length>2&&void 0!==y[2]?y[2]:{},i=y.length>3&&void 0!==y[3]?y[3]:this.tronWeb.defaultPrivateKey,o=y.length>4&&void 0!==y[4]&&y[4],Rt.isFunction(i)&&(o=i,i=this.tronWeb.defaultPrivateKey),Rt.isFunction(n)&&(o=n,n={}),o){e.next=7;break}return e.abrupt("return",this.injectPromise(this._send,t,r,n,i));case 7:if(t.length===r.length){e.next=9;break}throw new Error("Invalid argument count provided");case 9:if(this.contract.address){e.next=11;break}return e.abrupt("return",o("Smart contract is missing address"));case 11:if(this.contract.deployed){e.next=13;break}return e.abrupt("return",o("Calling smart contracts requires you to load the contract first"));case 13:if(a=this.abi.stateMutability,!["pure","view"].includes(a.toLowerCase())){e.next=16;break}return e.abrupt("return",o('Methods with state mutability "'.concat(a,'" must use call()')));case 16:return["payable"].includes(a.toLowerCase())||(n.callValue=0),n=nr(nr({},this.defaultOptions),{},{from:this.tronWeb.defaultAddress.hex},n),s=r.map((function(e,r){return{type:t[r],value:e}})),e.prev=19,u=i?this.tronWeb.address.fromPrivateKey(i):this.tronWeb.defaultAddress.base58,e.next=23,this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,n,s,this.tronWeb.address.toHex(u));case 23:if((l=e.sent).result&&l.result.result){e.next=26;break}return e.abrupt("return",o("Unknown error: "+JSON.stringify(l,null,2)));case 26:return e.next=28,this.tronWeb.trx.sign(l.transaction,i);case 28:if((c=e.sent).signature){e.next=33;break}if(i){e.next=32;break}return e.abrupt("return",o("Transaction was not signed properly"));case 32:return e.abrupt("return",o("Invalid private key provided"));case 33:return e.next=35,this.tronWeb.trx.sendRawTransaction(c);case 35:if(!(f=e.sent).code){e.next=40;break}return d={error:f.code,message:f.code},f.message&&(d.message=this.tronWeb.toUtf8(f.message)),e.abrupt("return",o(d));case 40:if(n.shouldPollResponse){e.next=42;break}return e.abrupt("return",o(null,c.txID));case 42:(h=function(){var e=p()(R.a.mark((function e(){var t,r,i,a=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(20!==(t=a.length>0&&void 0!==a[0]?a[0]:0)){e.next=3;break}return e.abrupt("return",o({error:"Cannot find result in solidity node",transaction:c}));case 3:return e.next=5,m.tronWeb.trx.getTransactionInfo(c.txID);case 5:if(r=e.sent,Object.keys(r).length){e.next=8;break}return e.abrupt("return",setTimeout((function(){h(t+1)}),3e3));case 8:if(!r.result||"FAILED"!==r.result){e.next=10;break}return e.abrupt("return",o({error:m.tronWeb.toUtf8(r.resMessage),transaction:c,output:r}));case 10:if(Rt.hasProperty(r,"contractResult")){e.next=12;break}return e.abrupt("return",o({error:"Failed to execute: "+JSON.stringify(r,null,2),transaction:c,output:r}));case 12:if(!n.rawResponse){e.next=14;break}return e.abrupt("return",o(null,r));case 14:if(1===(i=ir(m.abi,"0x"+r.contractResult[0])).length&&1===Object.keys(i).length&&(i=i[0]),!n.keepTxID){e.next=18;break}return e.abrupt("return",o(null,[c.txID,i]));case 18:return e.abrupt("return",o(null,i));case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())(),e.next=49;break;case 46:return e.prev=46,e.t0=e.catch(19),e.abrupt("return",o(e.t0));case 49:case"end":return e.stop()}}),e,this,[[19,46]])}))),function(e,t){return r.apply(this,arguments)})},{key:"_watch",value:(t=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u=this,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>0&&void 0!==l[0]?l[0]:{},r=l.length>1&&void 0!==l[1]&&l[1],Rt.isFunction(t)&&(r=t,t={}),Rt.isFunction(r)){e.next=5;break}throw new Error("Expected callback to be provided");case 5:if(this.contract.address){e.next=7;break}return e.abrupt("return",r("Smart contract is missing address"));case 7:if(this.abi.type&&/event/i.test(this.abi.type)){e.next=9;break}return e.abrupt("return",r("Invalid method type for event watching"));case 9:if(this.tronWeb.eventServer){e.next=11;break}return e.abrupt("return",r("No event server configured"));case 11:return n=!1,i=!1,o=Date.now()-1e3,a=function(){var e=p()(R.a.mark((function e(){var r,n,a,s,l,c;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r={since:o,eventName:u.name,sort:"block_timestamp",blockNumber:"latest",filters:t.filters},t.size&&(r.size=t.size),t.resourceNode&&(/full/i.test(t.resourceNode)?r.onlyUnconfirmed=!0:r.onlyConfirmed=!0),e.next=6,u.tronWeb.event.getEventsByContractAddress(u.contract.address,r);case 6:return n=e.sent,a=n.sort((function(e,t){return t.block-e.block})),s=qt()(a,1),l=s[0],c=n.filter((function(e,r){return!(t.resourceNode&&e.resourceNode&&t.resourceNode.toLowerCase()!==e.resourceNode.toLowerCase()||n.slice(0,r).some((function(t){return JSON.stringify(t)==JSON.stringify(e)}))||i&&!(e.block>i))})),l&&(i=l.block),e.abrupt("return",c);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}(),s=function(){n&&clearInterval(n),n=setInterval((function(){a().then((function(e){return e.forEach((function(e){r(null,Rt.parseEvent(e,u.abi))}))})).catch((function(e){return r(e)}))}),3e3)},e.next=18,a();case 18:return s(),e.abrupt("return",{start:s,stop:function(){n&&(clearInterval(n),n=!1)}});case 20:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),ar=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(v()(this,e),!t||!t instanceof pr)throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.injectPromise=Ut()(this),this.address=n,this.abi=r,this.eventListener=!1,this.bytecode=!1,this.deployed=!1,this.lastBlock=!1,this.methods={},this.methodInstances={},this.props=[],this.tronWeb.isAddress(n)?this.deployed=!0:this.address=!1,this.loadAbi(r)}var t,r,i,o;return w()(e,[{key:"_getEvents",value:(o=p()(R.a.mark((function e(){var t,r,n,i,o,a,s=this,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},e.next=3,this.tronWeb.event.getEventsByContractAddress(this.address,t);case 3:return r=e.sent,n=r.sort((function(e,t){return t.block-e.block})),i=qt()(n,1),o=i[0],a=r.filter((function(e,n){return!(t.resourceNode&&e.resourceNode&&t.resourceNode.toLowerCase()!==e.resourceNode.toLowerCase()||r.slice(0,n).some((function(t){return JSON.stringify(t)==JSON.stringify(e)}))||s.lastBlock&&!(e.block>s.lastBlock))})),o&&(this.lastBlock=o.block),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"_startEventListener",value:(i=p()(R.a.mark((function e(){var t,r,i=this,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:{},r=o.length>1?o[1]:void 0,Rt.isFunction(t)&&(r=t,t={}),this.eventListener&&clearInterval(this.eventListener),this.tronWeb.eventServer){e.next=6;break}throw new Error("Event server is not configured");case 6:if(this.address){e.next=8;break}throw new Error("Contract is not configured with an address");case 8:return this.eventCallback=r,e.next=11,this._getEvents(t);case 11:this.eventListener=setInterval((function(){i._getEvents(t).then((function(e){return e.forEach((function(e){i.eventCallback&&i.eventCallback(e)}))})).catch((function(e){n.error("Failed to get event list",e)}))}),3e3);case 12:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_stopEventListener",value:function(){this.eventListener&&(clearInterval(this.eventListener),this.eventListener=!1,this.eventCallback=!1)}},{key:"hasProperty",value:function(e){return this.hasOwnProperty(e)||this.__proto__.hasOwnProperty(e)}},{key:"loadAbi",value:function(e){var t=this;this.abi=e,this.methods={},this.props.forEach((function(e){return delete t[e]})),e.forEach((function(e){if(e.type&&!/constructor/i.test(e.type)){var r=new or(t,e),n=r.onMethod.bind(r),i=r.name,o=r.functionSelector,a=r.signature;t.methods[i]=n,t.methods[o]=n,t.methods[a]=n,t.methodInstances[i]=r,t.methodInstances[o]=r,t.methodInstances[a]=r,t.hasProperty(i)||(t[i]=n,t.props.push(i)),t.hasProperty(o)||(t[o]=n,t.props.push(o)),t.hasProperty(a)||(t[a]=n,t.props.push(a))}}))}},{key:"decodeInput",value:function(e){var t=e.substring(0,8),r=e.substring(8);if(!this.methodInstances[t])throw new Error("Contract method "+t+" not found");return{name:this.methodInstances[t].name,params:this.methodInstances[t].decodeInput(r)}}},{key:"new",value:(r=p()(R.a.mark((function e(t){var r,n,i,o,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.length>1&&void 0!==u[1]?u[1]:this.tronWeb.defaultPrivateKey,n=u.length>2&&void 0!==u[2]&&u[2],Rt.isFunction(r)&&(n=r,r=this.tronWeb.defaultPrivateKey),n){e.next=5;break}return e.abrupt("return",this.injectPromise(this.new,t,r));case 5:return e.prev=5,i=this.tronWeb.address.fromPrivateKey(r),e.next=9,this.tronWeb.transactionBuilder.createSmartContract(t,i);case 9:return o=e.sent,e.next=12,this.tronWeb.trx.sign(o,r);case 12:return a=e.sent,e.next=15,this.tronWeb.trx.sendRawTransaction(a);case 15:if(!(s=e.sent).code){e.next=18;break}return e.abrupt("return",n({error:s.code,message:this.tronWeb.toUtf8(s.message)}));case 18:return e.next=20,Rt.sleep(3e3);case 20:return e.abrupt("return",this.at(a.contract_address,n));case 23:return e.prev=23,e.t0=e.catch(5),e.abrupt("return",n(e.t0));case 26:case"end":return e.stop()}}),e,this,[[5,23]])}))),function(e){return r.apply(this,arguments)})},{key:"at",value:(t=p()(R.a.mark((function e(t){var r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.length>1&&void 0!==i[1]&&i[1]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.at,t));case 3:return e.prev=3,e.next=6,this.tronWeb.trx.getContract(t);case 6:if((n=e.sent).contract_address){e.next=9;break}return e.abrupt("return",r("Unknown error: "+JSON.stringify(n,null,2)));case 9:return this.address=n.contract_address,this.bytecode=n.bytecode,this.deployed=!0,this.loadAbi(n.abi&&n.abi.entrys?n.abi.entrys:[]),e.abrupt("return",r(null,this));case 16:if(e.prev=16,e.t0=e.catch(3),!e.t0.toString().includes("does not exist")){e.next=20;break}return e.abrupt("return",r("Contract has not been deployed on the network"));case 20:return e.abrupt("return",r(e.t0));case 21:case"end":return e.stop()}}),e,this,[[3,16]])}))),function(e){return t.apply(this,arguments)})},{key:"events",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e={}),!Rt.isFunction(t))throw new Error("Callback function expected");var r=this;return{start:function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return n?(r._startEventListener(e,t).then((function(){n()})).catch((function(e){n(e)})),this):(r._startEventListener(e,t),this)},stop:function(){r._stopEventListener()}}}}]),e}(),sr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(v()(this,e),!t||!t instanceof pr)throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.pluginNoOverride=["register"],this.disablePlugins=r.disablePlugins}return w()(e,[{key:"register",value:function(e,t){var r={requires:"0.0.0",components:{}},n={libs:[],plugged:[],skipped:[]};if(this.disablePlugins)return n.error="This instance of TronWeb has plugins disabled.",n;var i=new e(this.tronWeb);if(Rt.isFunction(i.pluginInterface)&&(r=i.pluginInterface(t)),!Dt.a.satisfies(pr.version,r.requires))throw new Error("The plugin is not compatible with this version of TronWeb");if(r.fullClass){var o=i.constructor.name,a=o.substring(0,1).toLowerCase()+o.substring(1);o!==a&&(pr[o]=e,this.tronWeb[a]=i,n.libs.push(o))}else for(var s in r.components)if(this.tronWeb.hasOwnProperty(s)){var u=r.components[s],l=this.tronWeb[s].pluginNoOverride||[];for(var c in u)"constructor"===c||this.tronWeb[s][c]&&(l.includes(c)||/^_/.test(c))?n.skipped.push(c):(this.tronWeb[s][c]=u[c].bind(this.tronWeb[s]),n.plugged.push(c))}return n}}]),e}(),ur=r(27),lr=r.n(ur),cr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(v()(this,e),!(t&&t instanceof pr))throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.injectPromise=Ut()(this)}return w()(e,[{key:"setServer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"healthcheck";if(!t)return this.tronWeb.eventServer=!1;if(Rt.isString(t)&&(t=new Nt.HttpProvider(t)),!this.tronWeb.isValidProvider(t))throw new Error("Invalid event server provided");this.tronWeb.eventServer=t,this.tronWeb.eventServer.isConnected=function(){return e.tronWeb.eventServer.request(r).then((function(){return!0})).catch((function(){return!1}))}}},{key:"getEventsByContractAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Object.assign({sinceTimestamp:0,eventName:!1,blockNumber:!1,size:20,page:1},t),o=i.sinceTimestamp,a=i.since,s=i.fromTimestamp,u=i.eventName,l=i.blockNumber,c=i.size,f=i.page,d=i.onlyConfirmed,h=i.onlyUnconfirmed,p=i.previousLastEventFingerprint,m=i.previousFingerprint,g=i.fingerprint,v=i.rawResponse,b=i.sort,w=i.filters;if(!r)return this.injectPromise(this.getEventsByContractAddress,e,t);if(s=s||o||a,!this.tronWeb.eventServer)return r("No event server configured");var A=[];if(!this.tronWeb.isAddress(e))return r("Invalid contract address provided");if(u&&!e)return r("Usage of event name filtering requires a contract address");if(void 0!==s&&!Rt.isInteger(s))return r("Invalid fromTimestamp provided");if(!Rt.isInteger(c))return r("Invalid size provided");if(c>200&&(n.warn("Defaulting to maximum accepted size: 200"),c=200),!Rt.isInteger(f))return r("Invalid page provided");if(l&&!u)return r("Usage of block number filtering requires an event name");e&&A.push(this.tronWeb.address.fromHex(e)),u&&A.push(u),l&&A.push(l);var _={size:c,page:f};return"object"===y()(w)&&Object.keys(w).length>0&&(_.filters=JSON.stringify(w)),s&&(_.fromTimestamp=_.since=s),d&&(_.only_confirmed=d),h&&!d&&(_.only_unconfirmed=h),b&&(_.sort=b),(g=g||m||p)&&(_.fingerprint=g),this.tronWeb.eventServer.request("event/contract/".concat(A.join("/"),"?").concat(lr.a.stringify(_))).then((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Rt.isArray(e)?r(null,!0===v?e:e.map((function(e){return Rt.mapEvent(e)}))):r(e):r("Unknown error occurred")})).catch((function(e){return r(e.response&&e.response.data||e)}))}},{key:"getEventsByTransactionID",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(t)&&(r=t,t={}),r?this.tronWeb.eventServer?this.tronWeb.eventServer.request("event/transaction/".concat(e)).then((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Rt.isArray(e)?r(null,!0===t.rawResponse?e:e.map((function(e){return Rt.mapEvent(e)}))):r(e):r("Unknown error occurred")})).catch((function(e){return r(e.response&&e.response.data||e)})):r("No event server configured"):this.injectPromise(this.getEventsByTransactionID,e,t)}}]),e}();function fr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(r),!0).forEach((function(t){O()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var hr=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];v()(this,e),this.mainchain=n;var o=t.fullHost,a=t.fullNode,s=t.solidityNode,u=t.eventServer,l=t.mainGatewayAddress,c=t.sideGatewayAddress,f=t.sideChainId;this.sidechain=new r(o||a,o||s,o||u,i),this.isAddress=this.mainchain.isAddress,this.utils=this.mainchain.utils,this.setMainGatewayAddress(l),this.setSideGatewayAddress(c),this.setChainId(f),this.injectPromise=Ut()(this),this.validator=new Wt(this.sidechain);var d=this;this.sidechain.trx.sign=function(){return d.sign.apply(d,arguments)},this.sidechain.trx.multiSign=function(){return d.multiSign.apply(d,arguments)}}var t,r,n,i,o,a,s,u,l,c,f,d,h,m,y,g,b,A,_,S,M;return w()(e,[{key:"setMainGatewayAddress",value:function(e){if(!this.isAddress(e))throw new Error("Invalid main gateway address provided");this.mainGatewayAddress=e}},{key:"setSideGatewayAddress",value:function(e){if(!this.isAddress(e))throw new Error("Invalid side gateway address provided");this.sideGatewayAddress=e}},{key:"setChainId",value:function(e){if(!this.utils.isString(e)||!e)throw new Error("Invalid side chainId provided");this.chainId=e}},{key:"signTransaction",value:function(e,t){"string"==typeof e&&(e=this.utils.code.hexStr2byteArray(e));var r=this.utils.code.hexStr2byteArray(this.chainId),n=this.utils.code.hexStr2byteArray(t.txID).concat(r),i=this.sidechain.utils.ethersUtils.sha256(n),o=this.utils.crypto.ECKeySign(this.utils.code.hexStr2byteArray(i.replace(/^0x/,"")),e);return Array.isArray(t.signature)?t.signature.includes(o)||t.signature.push(o):t.signature=[o],t}},{key:"multiSign",value:(M=p()(R.a.mark((function e(){var t,r,n,i,o,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]&&u[0],r=u.length>1&&void 0!==u[1]?u[1]:this.sidechain.defaultPrivateKey,n=u.length>2&&void 0!==u[2]&&u[2],i=u.length>3&&void 0!==u[3]&&u[3],this.utils.isFunction(n)&&(i=n,n=0),this.utils.isFunction(r)&&(i=r,r=this.mainchain.defaultPrivateKey,n=0),i){e.next=8;break}return e.abrupt("return",this.injectPromise(this.multiSign,t,r,n));case 8:if(this.utils.isObject(t)&&t.raw_data&&t.raw_data.contract){e.next=10;break}return e.abrupt("return",i("Invalid transaction provided"));case 10:if(t.raw_data.contract[0].Permission_id||!(n>0)){e.next=30;break}return t.raw_data.contract[0].Permission_id=n,o=this.sidechain.address.toHex(this.sidechain.address.fromPrivateKey(r)).toLowerCase(),e.next=15,this.sidechain.trx.getSignWeight(t,n);case 15:if("PERMISSION_ERROR"!==(a=e.sent).result.code){e.next=18;break}return e.abrupt("return",i(a.result.message));case 18:if(s=!1,a.permission.keys.map((function(e){e.address===o&&(s=!0)})),s){e.next=22;break}return e.abrupt("return",i(r+" has no permission to sign"));case 22:if(!a.approved_list||-1==a.approved_list.indexOf(o)){e.next=24;break}return e.abrupt("return",i(r+" already sign transaction"));case 24:if(!a.transaction||!a.transaction.transaction){e.next=29;break}(t=a.transaction.transaction).raw_data.contract[0].Permission_id=n,e.next=30;break;case 29:return e.abrupt("return",i("Invalid transaction provided"));case 30:return e.prev=30,e.abrupt("return",i(null,this.signTransaction(r,t)));case 34:e.prev=34,e.t0=e.catch(30),i(e.t0);case 37:case"end":return e.stop()}}),e,this,[[30,34]])}))),function(){return M.apply(this,arguments)})},{key:"sign",value:(S=p()(R.a.mark((function e(){var t,r,n,i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]&&s[0],r=s.length>1&&void 0!==s[1]?s[1]:this.sidechain.defaultPrivateKey,n=!(s.length>2&&void 0!==s[2])||s[2],i=s.length>3&&void 0!==s[3]&&s[3],o=s.length>4&&void 0!==s[4]&&s[4],this.utils.isFunction(i)&&(o=i,i=!1),this.utils.isFunction(n)&&(o=n,n=!0,i=!1),this.utils.isFunction(r)&&(o=r,r=this.sidechain.defaultPrivateKey,n=!0,i=!1),o){e.next=10;break}return e.abrupt("return",this.injectPromise(this.sign,t,r,n,i));case 10:if(!this.utils.isString(t)){e.next=21;break}if(this.utils.isHex(t)){e.next=13;break}return e.abrupt("return",o("Expected hex message input"));case 13:return e.prev=13,a=this.sidechain.trx.signString(t,r,n),e.abrupt("return",o(null,a));case 18:e.prev=18,e.t0=e.catch(13),o(e.t0);case 21:if(this.utils.isObject(t)){e.next=23;break}return e.abrupt("return",o("Invalid transaction provided"));case 23:if(i||!t.signature){e.next=25;break}return e.abrupt("return",o("Transaction is already signed"));case 25:if(e.prev=25,i){e.next=30;break}if(this.sidechain.address.toHex(this.sidechain.address.fromPrivateKey(r)).toLowerCase()===this.sidechain.address.toHex(t.raw_data.contract[0].parameter.value.owner_address)){e.next=30;break}return e.abrupt("return",o("Private key does not match address in transaction"));case 30:return e.abrupt("return",o(null,this.signTransaction(r,t)));case 33:e.prev=33,e.t1=e.catch(25),o(e.t1);case 36:case"end":return e.stop()}}),e,this,[[13,18],[25,33]])}))),function(){return S.apply(this,arguments)})},{key:"depositTrx",value:(_=p()(R.a.mark((function e(t,r,n){var i,o,a,s,u,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>3&&void 0!==l[3]?l[3]:{},o=l.length>4&&void 0!==l[4]?l[4]:this.mainchain.defaultPrivateKey,a=l.length>5&&void 0!==l[5]&&l[5],this.utils.isFunction(o)&&(a=o,o=this.mainchain.defaultPrivateKey),this.utils.isFunction(i)&&(a=i,i={}),a){e.next=7;break}return e.abrupt("return",this.injectPromise(this.depositTrx,t,r,n,i,o));case 7:if(!this.validator.notValid([{name:"callValue",type:"integer",value:t,gte:0},{name:"depositFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],a)){e.next=9;break}return e.abrupt("return");case 9:return i=dr({callValue:Number(t)+Number(r),feeLimit:n},i),e.prev=10,e.next=13,this.mainchain.contract().at(this.mainGatewayAddress);case 13:return s=e.sent,e.next=16,s.depositTRX().send(i,o);case 16:return u=e.sent,e.abrupt("return",a(null,u));case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",a(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r){return _.apply(this,arguments)})},{key:"depositTrc10",value:(A=p()(R.a.mark((function e(t,r,n,i){var o,a,s,u,l,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>4&&void 0!==c[4]?c[4]:{},a=c.length>5&&void 0!==c[5]?c[5]:this.mainchain.defaultPrivateKey,s=c.length>6&&void 0!==c[6]&&c[6],this.utils.isFunction(a)&&(s=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(o)&&(s=o,o={}),s){e.next=7;break}return e.abrupt("return",this.injectPromise(this.depositTrc10,t,r,n,i,o,a));case 7:if(!this.validator.notValid([{name:"tokenValue",type:"integer",value:r,gte:0},{name:"depositFee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:i,gte:0},{name:"tokenId",type:"integer",value:t,gte:0}],s)){e.next=9;break}return e.abrupt("return");case 9:return o=dr(dr({tokenId:t,tokenValue:r,feeLimit:i},o),{},{callValue:n}),e.prev=10,e.next=13,this.mainchain.contract().at(this.mainGatewayAddress);case 13:return u=e.sent,e.next=16,u.depositTRC10(t,r).send(o,a);case 16:l=e.sent,s(null,l),e.next=23;break;case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",s(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r,n){return A.apply(this,arguments)})},{key:"depositTrc",value:(b=p()(R.a.mark((function e(t,r,n,i,o){var a,s,u,l,c,f,d=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=d.length>5&&void 0!==d[5]?d[5]:{},s=d.length>6&&void 0!==d[6]?d[6]:this.mainchain.defaultPrivateKey,u=d.length>7&&void 0!==d[7]&&d[7],this.utils.isFunction(s)&&(u=s,s=this.mainchain.defaultPrivateKey),this.utils.isFunction(a)&&(u=a,a={}),u){e.next=7;break}return e.abrupt("return",this.injectPromise(this.depositTrc,t,r,n,i,o,a,s));case 7:if(!this.validator.notValid([{name:"functionSelector",type:"not-empty-string",value:t},{name:"num",type:"integer",value:r,gte:0},{name:"fee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:i,gte:0},{name:"contractAddress",type:"address",value:o}],u)){e.next=9;break}return e.abrupt("return");case 9:if(a=dr(dr({feeLimit:i},a),{},{callValue:n,tokenId:"",tokenValue:0}),e.prev=10,l=null,"approve"!==t){e.next=21;break}return e.next=15,this.mainchain.contract().at(o);case 15:return c=e.sent,e.next=18,c.approve(this.mainGatewayAddress,r).send(a,s);case 18:l=e.sent,e.next=44;break;case 21:return e.next=23,this.mainchain.contract().at(this.mainGatewayAddress);case 23:f=e.sent,e.t0=t,e.next="depositTRC20"===e.t0?27:"depositTRC721"===e.t0?31:"retryDeposit"===e.t0?35:"retryMapping"===e.t0?39:43;break;case 27:return e.next=29,f.depositTRC20(o,r).send(a,s);case 29:case 33:case 37:case 41:return l=e.sent,e.abrupt("break",44);case 31:return e.next=33,f.depositTRC721(o,r).send(a,s);case 35:return e.next=37,f.retryDeposit(r).send(a,s);case 39:return e.next=41,f.retryMapping(r).send(a,s);case 43:return e.abrupt("break",44);case 44:u(null,l),e.next=50;break;case 47:return e.prev=47,e.t1=e.catch(10),e.abrupt("return",u(e.t1));case 50:case"end":return e.stop()}}),e,this,[[10,47]])}))),function(e,t,r,n,i){return b.apply(this,arguments)})},{key:"approveTrc20",value:(g=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.depositTrc("approve",t,0,r,n,i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return g.apply(this,arguments)})},{key:"approveTrc721",value:(y=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.depositTrc("approve",t,0,r,n,i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return y.apply(this,arguments)})},{key:"depositTrc20",value:(m=p()(R.a.mark((function e(t,r,n,i){var o,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>4&&void 0!==u[4]?u[4]:{},a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],e.abrupt("return",this.depositTrc("depositTRC20",t,r,n,i,o,a,s));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return m.apply(this,arguments)})},{key:"depositTrc721",value:(h=p()(R.a.mark((function e(t,r,n,i){var o,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>4&&void 0!==u[4]?u[4]:{},a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],e.abrupt("return",this.depositTrc("depositTRC721",t,r,n,i,o,a,s));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return h.apply(this,arguments)})},{key:"mappingTrc",value:(d=p()(R.a.mark((function e(t,r,n,i){var o,a,s,u,l,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>4&&void 0!==c[4]?c[4]:{},a=c.length>5&&void 0!==c[5]?c[5]:this.mainchain.defaultPrivateKey,s=c.length>6?c[6]:void 0,this.utils.isFunction(a)&&(s=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(o)&&(s=o,o={}),s){e.next=7;break}return e.abrupt("return",this.injectPromise(this.mappingTrc,t,r,n,i,o,a));case 7:if(!this.validator.notValid([{name:"trxHash",type:"not-empty-string",value:t},{name:"mappingFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],s)){e.next=9;break}return e.abrupt("return");case 9:return t=t.startsWith("0x")?t:"0x"+t,o=dr(dr({feeLimit:n},o),{},{callValue:r}),e.prev=11,e.next=14,this.mainchain.contract().at(this.mainGatewayAddress);case 14:if(u=e.sent,l=null,"mappingTRC20"!==i){e.next=22;break}return e.next=19,u.mappingTRC20(t).send(o,a);case 19:l=e.sent,e.next=29;break;case 22:if("mappingTRC721"!==i){e.next=28;break}return e.next=25,u.mappingTRC721(t).send(o,a);case 25:l=e.sent,e.next=29;break;case 28:s(new Error("type must be trc20 or trc721"));case 29:s(null,l),e.next=35;break;case 32:return e.prev=32,e.t0=e.catch(11),e.abrupt("return",s(e.t0));case 35:case"end":return e.stop()}}),e,this,[[11,32]])}))),function(e,t,r,n){return d.apply(this,arguments)})},{key:"mappingTrc20",value:(f=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.mappingTrc(t,r,n,"mappingTRC20",i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"mappingTrc721",value:(c=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.mappingTrc(t,r,n,"mappingTRC721",i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return c.apply(this,arguments)})},{key:"withdrawTrx",value:(l=p()(R.a.mark((function e(t,r,n){var i,o,a,s,u,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>3&&void 0!==l[3]?l[3]:{},o=l.length>4&&void 0!==l[4]?l[4]:this.mainchain.defaultPrivateKey,a=l.length>5&&void 0!==l[5]&&l[5],this.utils.isFunction(o)&&(a=o,o=this.mainchain.defaultPrivateKey),this.utils.isFunction(i)&&(a=i,i={}),a){e.next=7;break}return e.abrupt("return",this.injectPromise(this.withdrawTrx,t,r,n,i,o));case 7:if(!this.validator.notValid([{name:"callValue",type:"integer",value:t,gte:0},{name:"withdrawFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],a)){e.next=9;break}return e.abrupt("return");case 9:return i=dr({callValue:Number(t)+Number(r),feeLimit:n},i),e.prev=10,e.next=13,this.sidechain.contract().at(this.sideGatewayAddress);case 13:return s=e.sent,e.next=16,s.withdrawTRX().send(i,o);case 16:return u=e.sent,e.abrupt("return",a(null,u));case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",a(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r){return l.apply(this,arguments)})},{key:"withdrawTrc10",value:(u=p()(R.a.mark((function e(t,r,n,i){var o,a,s,u,l,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>4&&void 0!==c[4]?c[4]:{},a=c.length>5&&void 0!==c[5]?c[5]:this.mainchain.defaultPrivateKey,s=c.length>6&&void 0!==c[6]&&c[6],this.utils.isFunction(a)&&(s=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(o)&&(s=o,o={}),s){e.next=7;break}return e.abrupt("return",this.injectPromise(this.withdrawTrc10,t,r,n,i,o,a));case 7:if(!this.validator.notValid([{name:"tokenId",type:"integer",value:t,gte:0},{name:"tokenValue",type:"integer",value:r,gte:0},{name:"withdrawFee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:i,gte:0}],s)){e.next=9;break}return e.abrupt("return");case 9:return o=dr({tokenValue:r,tokenId:t,callValue:n,feeLimit:i},o),e.prev=10,e.next=13,this.sidechain.contract().at(this.sideGatewayAddress);case 13:return u=e.sent,e.next=16,u.withdrawTRC10(t,r).send(o,a);case 16:return l=e.sent,e.abrupt("return",s(null,l));case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",s(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r,n){return u.apply(this,arguments)})},{key:"withdrawTrc",value:(s=p()(R.a.mark((function e(t,r,n,i,o){var a,s,u,l,c,f,d,h,m,y,g=this,v=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=v.length>5&&void 0!==v[5]?v[5]:{},s=v.length>6&&void 0!==v[6]?v[6]:this.mainchain.defaultPrivateKey,u=v.length>7&&void 0!==v[7]&&v[7],this.utils.isFunction(s)&&(u=s,s=this.mainchain.defaultPrivateKey),this.utils.isFunction(a)&&(u=a,a={}),u){e.next=7;break}return e.abrupt("return",this.injectPromise(this.withdrawTrc,t,r,n,i,o,a,s));case 7:if(!this.validator.notValid([{name:"functionSelector",type:"not-empty-string",value:t},{name:"numOrId",type:"integer",value:r,gte:0},{name:"withdrawFee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:i,gte:0},{name:"contractAddress",type:"address",value:o}],u)){e.next=9;break}return e.abrupt("return");case 9:return a=dr(dr({feeLimit:i},a),{},{callValue:n}),l=[{type:"uint256",value:r}],e.prev=11,c=s?this.sidechain.address.fromPrivateKey(s):this.sidechain.defaultAddress.base58,e.next=15,this.sidechain.transactionBuilder.triggerSmartContract(o,t,a,l,this.sidechain.address.toHex(c));case 15:if((f=e.sent).result&&f.result.result){e.next=18;break}return e.abrupt("return",u("Unknown error: "+JSON.stringify(f.transaction,null,2)));case 18:return e.next=20,this.sidechain.trx.sign(f.transaction,s);case 20:if((d=e.sent).signature){e.next=25;break}if(s){e.next=24;break}return e.abrupt("return",u("Transaction was not signed properly"));case 24:return e.abrupt("return",u("Invalid private key provided"));case 25:return e.next=27,this.sidechain.trx.sendRawTransaction(d);case 27:if(!(h=e.sent).code){e.next=32;break}return m={error:h.code,message:h.code},h.message&&(m.message=this.sidechain.toUtf8(h.message)),e.abrupt("return",u(m));case 32:if(a.shouldPollResponse){e.next=34;break}return e.abrupt("return",u(null,d.txID));case 34:(y=function(){var e=p()(R.a.mark((function e(){var t,r,n,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(20!=(t=i.length>0&&void 0!==i[0]?i[0]:0)){e.next=3;break}return e.abrupt("return",u({error:"Cannot find result in solidity node",transaction:d}));case 3:return e.next=5,g.sidechain.trx.getTransactionInfo(d.txID);case 5:if(r=e.sent,Object.keys(r).length){e.next=8;break}return e.abrupt("return",setTimeout((function(){y(t+1)}),3e3));case 8:if(!r.result||"FAILED"!=r.result){e.next=10;break}return e.abrupt("return",u({error:g.sidechain.toUtf8(r.resMessage),transaction:d,output:r}));case 10:if(g.utils.hasProperty(r,"contractResult")){e.next=12;break}return e.abrupt("return",u({error:"Failed to execute: "+JSON.stringify(r,null,2),transaction:d,output:r}));case 12:if(!a.rawResponse){e.next=14;break}return e.abrupt("return",u(null,r));case 14:return 1===(n=decodeOutput(g.outputs,"0x"+r.contractResult[0])).length&&(n=n[0]),e.abrupt("return",u(null,n));case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())(),e.next=41;break;case 38:return e.prev=38,e.t0=e.catch(11),e.abrupt("return",u(e.t0));case 41:case"end":return e.stop()}}),e,this,[[11,38]])}))),function(e,t,r,n,i){return s.apply(this,arguments)})},{key:"withdrawTrc20",value:(a=p()(R.a.mark((function e(t,r,n,i,o){var a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],e.abrupt("return",this.withdrawTrc("withdrawal(uint256)",t,r,n,i,o,a,s));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return a.apply(this,arguments)})},{key:"withdrawTrc721",value:(o=p()(R.a.mark((function e(t,r,n,i,o){var a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],e.abrupt("return",this.withdrawTrc("withdrawal(uint256)",t,r,n,i,o,a,s));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return o.apply(this,arguments)})},{key:"injectFund",value:(i=p()(R.a.mark((function e(t,r,n){var i,o,a,s,u,l,c,f,d=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=d.length>3&&void 0!==d[3]?d[3]:this.mainchain.defaultPrivateKey,o=d.length>4&&void 0!==d[4]&&d[4],this.utils.isFunction(i)&&(o=i,i=this.mainchain.defaultPrivateKey),this.utils.isFunction(n)&&(o=n,n={}),o){e.next=6;break}return e.abrupt("return",this.injectPromise(this.injectFund,t,r,n,i));case 6:if(!this.validator.notValid([{name:"num",type:"integer",value:t,gte:0},{name:"feeLimit",type:"integer",value:r,gte:0}],o)){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,a=this.sidechain.address.fromPrivateKey(i),s=this.sidechain.address.toHex(a),e.next=13,this.sidechain.fullNode.request("/wallet/fundinject",{owner_address:s,amount:t},"post");case 13:return u=e.sent,e.next=16,this.sidechain.trx.sign(u,i);case 16:if((l=e.sent).signature){e.next=21;break}if(i){e.next=20;break}return e.abrupt("return",o("Transaction was not signed properly"));case 20:return e.abrupt("return",o("Invalid private key provided"));case 21:return e.next=23,this.sidechain.trx.sendRawTransaction(l);case 23:if(!(c=e.sent).code){e.next=28;break}return f={error:c.code,message:c.code},c.message&&(f.message=this.mainchain.toUtf8(c.message)),e.abrupt("return",o(f));case 28:return e.abrupt("return",o(null,l.txID));case 31:return e.prev=31,e.t0=e.catch(8),e.abrupt("return",o(e.t0));case 34:case"end":return e.stop()}}),e,this,[[8,31]])}))),function(e,t,r){return i.apply(this,arguments)})},{key:"retryWithdraw",value:(n=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.sidechain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.withdrawTrc("retryWithdraw(uint256)",t,r,n,this.sideGatewayAddress,i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"retryDeposit",value:(r=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.depositTrc("retryDeposit",t,r,n,this.mainGatewayAddress,i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"retryMapping",value:(t=p()(R.a.mark((function e(t,r,n){var i,o,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>3&&void 0!==s[3]?s[3]:{},o=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],e.abrupt("return",this.depositTrc("retryMapping",t,r,n,this.mainGatewayAddress,i,o,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}(),pr=function(e){M()(a,e);var t,r,n,o=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=k()(e);if(t){var i=k()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return T()(this,r)}}(a);function a(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=arguments.length>4&&void 0!==arguments[4]&&arguments[4];v()(this,a),e=o.call(this);var l=!1,c=!1;return"object"===y()(r)&&(r.fullNode||r.fullHost)?(t=r.fullNode||r.fullHost,s=n,n=r.solidityNode||r.fullHost,i=r.eventServer||r.fullHost,l=r.headers||!1,c=r.eventHeaders||l,u=r.privateKey):t=r,Rt.isString(t)&&(t=new Nt.HttpProvider(t)),Rt.isString(n)&&(n=new Nt.HttpProvider(n)),Rt.isString(i)&&(i=new Nt.HttpProvider(i)),e.event=new cr(_()(e)),e.transactionBuilder=new Yt(_()(e)),e.trx=new tr(_()(e)),e.plugin=new sr(_()(e),r),e.utils=Rt,e.setFullNode(t),e.setSolidityNode(n),e.setEventServer(i),e.providers=Nt,e.BigNumber=Pt.a,e.defaultBlock=!1,e.defaultPrivateKey=!1,e.defaultAddress={hex:!1,base58:!1},["sha3","toHex","toUtf8","fromUtf8","toAscii","fromAscii","toDecimal","fromDecimal","toSun","fromSun","toBigNumber","isAddress","createAccount","address","version","createRandom","fromMnemonic"].forEach((function(t){e[t]=a[t]})),"object"===y()(s)&&(s.fullNode||s.fullHost)?e.sidechain=new hr(s,a,_()(e),u):u=u||s,u&&e.setPrivateKey(u),e.fullnodeVersion="3.5.0",e.feeLimit=15e7,e.injectPromise=Ut()(_()(e)),l&&e.setFullNodeHeader(l),c&&e.setEventHeader(c),e}return w()(a,[{key:"getFullnodeVersion",value:(n=p()(R.a.mark((function e(){var t;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.trx.getNodeInfo();case 3:t=e.sent,this.fullnodeVersion=t.configNodeInfo.codeVersion,2===this.fullnodeVersion.split(".").length&&(this.fullnodeVersion+=".0"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),this.fullnodeVersion="3.5.0";case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return n.apply(this,arguments)})},{key:"setDefaultBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if([!1,"latest","earliest",0].includes(e))return this.defaultBlock=e;if(!Rt.isInteger(e)||!e)throw new Error("Invalid block ID provided");this.defaultBlock=Math.abs(e)}},{key:"setPrivateKey",value:function(e){try{this.setAddress(this.address.fromPrivateKey(e))}catch(e){throw new Error("Invalid private key provided")}this.defaultPrivateKey=e,this.emit("privateKeyChanged",e)}},{key:"setAddress",value:function(e){if(!this.isAddress(e))throw new Error("Invalid address provided");var t=this.address.toHex(e),r=this.address.fromHex(e);this.defaultPrivateKey&&this.address.fromPrivateKey(this.defaultPrivateKey)!==r&&(this.defaultPrivateKey=!1),this.defaultAddress={hex:t,base58:r},this.emit("addressChanged",{hex:t,base58:r})}},{key:"fullnodeSatisfies",value:function(e){return Dt.a.satisfies(this.fullnodeVersion,e)}},{key:"isValidProvider",value:function(e){return Object.values(Nt).some((function(t){return e instanceof t}))}},{key:"setFullNode",value:function(e){if(Rt.isString(e)&&(e=new Nt.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid full node provided");this.fullNode=e,this.fullNode.setStatusPage("wallet/getnowblock"),this.getFullnodeVersion()}},{key:"setSolidityNode",value:function(e){if(Rt.isString(e)&&(e=new Nt.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid solidity node provided");this.solidityNode=e,this.solidityNode.setStatusPage("walletsolidity/getnowblock")}},{key:"setEventServer",value:function(){var e;(e=this.event).setServer.apply(e,arguments)}},{key:"setHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Nt.HttpProvider(this.fullNode.host,3e4,!1,!1,e),r=new Nt.HttpProvider(this.solidityNode.host,3e4,!1,!1,e),n=new Nt.HttpProvider(this.eventServer.host,3e4,!1,!1,e);this.setFullNode(t),this.setSolidityNode(r),this.setEventServer(n)}},{key:"setFullNodeHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Nt.HttpProvider(this.fullNode.host,3e4,!1,!1,e),r=new Nt.HttpProvider(this.solidityNode.host,3e4,!1,!1,e);this.setFullNode(t),this.setSolidityNode(r)}},{key:"setEventHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Nt.HttpProvider(this.eventServer.host,3e4,!1,!1,e);this.setEventServer(t)}},{key:"currentProviders",value:function(){return{fullNode:this.fullNode,solidityNode:this.solidityNode,eventServer:this.eventServer}}},{key:"currentProvider",value:function(){return this.currentProviders()}},{key:"getEventResult",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return"object"!==y()(r[1])&&(r[1]={sinceTimestamp:r[1]||0,eventName:r[2]||!1,blockNumber:r[3]||!1,size:r[4]||20,page:r[5]||1},r.splice(2,4),Rt.isFunction(r[2])||(Rt.isFunction(r[1].page)?(r[2]=r[1].page,r[1].page=1):Rt.isFunction(r[1].size)&&(r[2]=r[1].size,r[1].size=20,r[1].page=1))),(e=this.event).getEventsByContractAddress.apply(e,r)}},{key:"getEventByTransactionID",value:function(){var e;return(e=this.event).getEventsByTransactionID.apply(e,arguments)}},{key:"contract",value:function(){return new ar(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],arguments.length>1&&void 0!==arguments[1]&&arguments[1])}},{key:"isConnected",value:(r=p()(R.a.mark((function e(){var t,r=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.isConnected));case 3:return e.t0=t,e.next=6,this.fullNode.isConnected();case 6:return e.t1=e.sent,e.next=9,this.solidityNode.isConnected();case 9:if(e.t2=e.sent,e.t3=this.eventServer,!e.t3){e.next=15;break}return e.next=14,this.eventServer.isConnected();case 14:e.t3=e.sent;case 15:return e.t4=e.t3,e.t5={fullNode:e.t1,solidityNode:e.t2,eventServer:e.t4},e.abrupt("return",(0,e.t0)(null,e.t5));case 18:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}],[{key:"address",get:function(){return{fromHex:function(e){return Rt.isHex(e)?Rt.crypto.getBase58CheckAddress(Rt.code.hexStr2byteArray(e.replace(/^0x/,"41"))):e},toHex:function(e){return Rt.isHex(e)?e.toLowerCase().replace(/^0x/,"41"):Rt.code.byteArray2hexStr(Rt.crypto.decodeBase58Address(e)).toLowerCase()},fromPrivateKey:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return Rt.crypto.pkToAddress(e,t)}catch(e){return!1}}}}},{key:"sha3",value:function(e){return(arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?"":"0x")+se(i.from(e,"utf-8")).toString().substring(2)}},{key:"toHex",value:function(e){if(Rt.isBoolean(e))return a.fromDecimal(+e);if(Rt.isBigNumber(e))return a.fromDecimal(e);if("object"===y()(e))return a.fromUtf8(JSON.stringify(e));if(Rt.isString(e)){if(/^(-|)0x/.test(e))return e;if(!isFinite(e)||/^\s*$/.test(e))return a.fromUtf8(e)}var t=a.fromDecimal(e);if("0xNaN"===t)throw new Error("The passed value is not convertible to a hex string");return t}},{key:"toUtf8",value:function(e){if(Rt.isHex(e))return e=e.replace(/^0x/,""),i.from(e,"hex").toString("utf8");throw new Error("The passed value is not a valid hex string")}},{key:"fromUtf8",value:function(e){if(!Rt.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+i.from(e,"utf8").toString("hex")}},{key:"toAscii",value:function(e){if(Rt.isHex(e)){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t}throw new Error("The passed value is not a valid hex string")}},{key:"fromAscii",value:function(e,t){if(!Rt.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+i.from(e,"ascii").toString("hex").padEnd(t,"0")}},{key:"toDecimal",value:function(e){return a.toBigNumber(e).toNumber()}},{key:"fromDecimal",value:function(e){var t=a.toBigNumber(e),r=t.toString(16);return t.isLessThan(0)?"-0x"+r.substr(1):"0x"+r}},{key:"fromSun",value:function(e){var t=a.toBigNumber(e).div(1e6);return Rt.isBigNumber(e)?t:t.toString(10)}},{key:"toSun",value:function(e){var t=a.toBigNumber(e).times(1e6);return Rt.isBigNumber(e)?t:t.toString(10)}},{key:"toBigNumber",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Rt.isBigNumber(e)?e:Rt.isString(e)&&/^(-|)0x/.test(e)?new Pt.a(e.replace("0x",""),16):new Pt.a(e.toString(10),10)}},{key:"isAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!Rt.isString(e))return!1;if(42===e.length)try{return a.isAddress(Rt.crypto.getBase58CheckAddress(Rt.code.hexStr2byteArray(e)))}catch(e){return!1}try{return Rt.crypto.isAddressValid(e)}catch(e){return!1}}},{key:"createAccount",value:(t=p()(R.a.mark((function e(){var t;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Rt.accounts.generateAccount(),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"createRandom",value:function(e){return Rt.accounts.generateRandom(e)}},{key:"fromMnemonic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m/44'/195'/0'/0/0",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";return Rt.accounts.generateAccountWithMnemonic(e,t,r)}}]),a}(Bt.a);O()(pr,"providers",Nt),O()(pr,"BigNumber",Pt.a),O()(pr,"TransactionBuilder",Yt),O()(pr,"Trx",tr),O()(pr,"Contract",ar),O()(pr,"Plugin",sr),O()(pr,"Event",cr),O()(pr,"version",Ft.a),O()(pr,"utils",Rt)}]).default},5650:(e,t,r)=>{e.exports=r(3003)},4623:(e,t,r)=>{"use strict";var n=r(6468),i=r(5745),o=r(8545),a=r(9039),s=r(791),u=r(8586),l=r(1385),c=r(5300),f=r(5452),d=r(1192);e.exports=function(e){return new Promise((function(t,r){var h,p=e.data,m=e.headers,y=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(p)&&delete m["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+w)}var A=s(e.baseURL,e.url);function _(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),g()}),(function(e){r(e),g()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(A,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=_:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(_)},v.onabort=function(){v&&(r(c("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(c("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(c(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||l(A))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(m,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete m[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),y&&"json"!==y&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),p||(p=null),v.send(p)}))}},3003:(e,t,r)=>{"use strict";var n=r(6468),i=r(2729),o=r(6055),a=r(8719),s=function e(t){var r=new o(t),s=i(o.prototype.request,r);return n.extend(s,o.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(6482));s.Axios=o,s.Cancel=r(1192),s.CancelToken=r(9870),s.isCancel=r(7361),s.VERSION=r(9167).version,s.all=function(e){return Promise.all(e)},s.spread=r(7127),s.isAxiosError=r(2786),e.exports=s,e.exports.default=s},1192:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},9870:(e,t,r)=>{"use strict";var n=r(1192);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},7361:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},6055:(e,t,r)=>{"use strict";var n=r(6468),i=r(9039),o=r(5786),a=r(1936),s=r(8719),u=r(7168),l=u.validators;function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&u.assertOptions(r,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,c=[];if(this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)})),!i){var f=[a,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(c),o=Promise.resolve(t);f.length;)o=o.then(f.shift(),f.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;c.length;)o=o.then(c.shift(),c.shift());return o},c.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=c},5786:(e,t,r)=>{"use strict";var n=r(6468);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},791:(e,t,r)=>{"use strict";var n=r(2386),i=r(1698);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5300:(e,t,r)=>{"use strict";var n=r(5875);e.exports=function(e,t,r,i,o){var a=new Error(e);return n(a,t,r,i,o)}},1936:(e,t,r)=>{"use strict";var n=r(6468),i=r(6548),o=r(7361),a=r(6482),s=r(1192);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},5875:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},8719:(e,t,r)=>{"use strict";var n=r(6468);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var l={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},5745:(e,t,r)=>{"use strict";var n=r(5300);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},6548:(e,t,r)=>{"use strict";var n=r(6468),i=r(6482);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},6482:(e,t,r)=>{"use strict";var n=r(4155),i=r(6468),o=r(986),a=r(5875),s=r(5452),u={"Content-Type":"application/x-www-form-urlencoded"};function l(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,f={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(4623)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(l(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(l(t,"application/json"),function(e,t,r){if(i.isString(e))try{return(0,JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||f.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw a(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){f.headers[e]=i.merge(u)})),e.exports=f},5452:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},9167:e=>{e.exports={version:"0.26.1"}},2729:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},9039:(e,t,r)=>{"use strict";var n=r(6468);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},1698:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},8545:(e,t,r)=>{"use strict";var n=r(6468);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},2386:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},2786:(e,t,r)=>{"use strict";var n=r(6468);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},1385:(e,t,r)=>{"use strict";var n=r(6468);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},986:(e,t,r)=>{"use strict";var n=r(6468);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},8586:(e,t,r)=>{"use strict";var n=r(6468),i=["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"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},7127:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7168:(e,t,r)=>{"use strict";var n=r(5108),i=r(9167).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+i+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,i,s){if(!1===e)throw new Error(o(i," has been removed"+(t?" in "+t:"")));return t&&!a[i]&&(a[i]=!0,n.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],a=t[o];if(a){var s=e[o],u=void 0===s||a(s,o,e);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:o}},6468:(e,t,r)=>{"use strict";var n=r(2729),i=Object.prototype.toString;function o(e){return Array.isArray(e)}function a(e){return void 0===e}function s(e){return"[object ArrayBuffer]"===i.call(e)}function u(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isPlainObject:l,isUndefined:a,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return u(e)&&c(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function e(){var t={};function r(r,n){l(t[n])&&l(r)?t[n]=e(t[n],r):l(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)f(arguments[n],r);return t},extend:function(e,t,r){return f(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},7898:(e,t,r)=>{var n,i=r(4155),o=r(5108);t=e.exports=J,n="object"==typeof i&&i.env&&i.env.NODE_DEBUG&&/\bsemver\b/i.test(i.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),o.log.apply(o,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var a=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,u=t.re=[],l=t.src=[],c=0,f=c++;l[f]="0|[1-9]\\d*";var d=c++;l[d]="[0-9]+";var h=c++;l[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var p=c++;l[p]="("+l[f]+")\\.("+l[f]+")\\.("+l[f]+")";var m=c++;l[m]="("+l[d]+")\\.("+l[d]+")\\.("+l[d]+")";var y=c++;l[y]="(?:"+l[f]+"|"+l[h]+")";var g=c++;l[g]="(?:"+l[d]+"|"+l[h]+")";var v=c++;l[v]="(?:-("+l[y]+"(?:\\."+l[y]+")*))";var b=c++;l[b]="(?:-?("+l[g]+"(?:\\."+l[g]+")*))";var w=c++;l[w]="[0-9A-Za-z-]+";var A=c++;l[A]="(?:\\+("+l[w]+"(?:\\."+l[w]+")*))";var _=c++,S="v?"+l[p]+l[v]+"?"+l[A]+"?";l[_]="^"+S+"$";var M="[v=\\s]*"+l[m]+l[b]+"?"+l[A]+"?",x=c++;l[x]="^"+M+"$";var T=c++;l[T]="((?:<|>)?=?)";var E=c++;l[E]=l[d]+"|x|X|\\*";var k=c++;l[k]=l[f]+"|x|X|\\*";var P=c++;l[P]="[v=\\s]*("+l[k]+")(?:\\.("+l[k]+")(?:\\.("+l[k]+")(?:"+l[v]+")?"+l[A]+"?)?)?";var O=c++;l[O]="[v=\\s]*("+l[E]+")(?:\\.("+l[E]+")(?:\\.("+l[E]+")(?:"+l[b]+")?"+l[A]+"?)?)?";var I=c++;l[I]="^"+l[T]+"\\s*"+l[P]+"$";var R=c++;l[R]="^"+l[T]+"\\s*"+l[O]+"$";var N=c++;l[N]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var C=c++;l[C]="(?:~>?)";var B=c++;l[B]="(\\s*)"+l[C]+"\\s+",u[B]=new RegExp(l[B],"g");var F=c++;l[F]="^"+l[C]+l[P]+"$";var L=c++;l[L]="^"+l[C]+l[O]+"$";var D=c++;l[D]="(?:\\^)";var j=c++;l[j]="(\\s*)"+l[D]+"\\s+",u[j]=new RegExp(l[j],"g");var U=c++;l[U]="^"+l[D]+l[P]+"$";var $=c++;l[$]="^"+l[D]+l[O]+"$";var q=c++;l[q]="^"+l[T]+"\\s*("+M+")$|^$";var K=c++;l[K]="^"+l[T]+"\\s*("+S+")$|^$";var H=c++;l[H]="(\\s*)"+l[T]+"\\s*("+M+"|"+l[P]+")",u[H]=new RegExp(l[H],"g");var W=c++;l[W]="^\\s*("+l[P]+")\\s+-\\s+("+l[P]+")\\s*$";var z=c++;l[z]="^\\s*("+l[O]+")\\s+-\\s+("+l[O]+")\\s*$";var G=c++;l[G]="(<|>)?=?\\s*\\*";for(var Z=0;Z<35;Z++)n(Z,l[Z]),u[Z]||(u[Z]=new RegExp(l[Z]));function V(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof J)return e;if("string"!=typeof e)return null;if(e.length>a)return null;if(!(t.loose?u[x]:u[_]).test(e))return null;try{return new J(e,t)}catch(e){return null}}function J(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof J){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>a)throw new TypeError("version is longer than "+a+" characters");if(!(this instanceof J))return new J(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?u[x]:u[_]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}t.parse=V,t.valid=function(e,t){var r=V(e,t);return r?r.version:null},t.clean=function(e,t){var r=V(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=J,J.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},J.prototype.toString=function(){return this.version},J.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof J||(e=new J(e,this.options)),this.compareMain(e)||this.comparePre(e)},J.prototype.compareMain=function(e){return e instanceof J||(e=new J(e,this.options)),X(this.major,e.major)||X(this.minor,e.minor)||X(this.patch,e.patch)},J.prototype.comparePre=function(e){if(e instanceof J||(e=new J(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return X(r,i)}while(++t)},J.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new J(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(re(e,t))return null;var r=V(e),n=V(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return i+a;return o},t.compareIdentifiers=X;var Y=/^[0-9]+$/;function X(e,t){var r=Y.test(e),n=Y.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}function Q(e,t,r){return new J(e,r).compare(new J(t,r))}function ee(e,t,r){return Q(e,t,r)>0}function te(e,t,r){return Q(e,t,r)<0}function re(e,t,r){return 0===Q(e,t,r)}function ne(e,t,r){return 0!==Q(e,t,r)}function ie(e,t,r){return Q(e,t,r)>=0}function oe(e,t,r){return Q(e,t,r)<=0}function ae(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return re(e,r,n);case"!=":return ne(e,r,n);case">":return ee(e,r,n);case">=":return ie(e,r,n);case"<":return te(e,r,n);case"<=":return oe(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function se(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof se){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof se))return new se(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ue?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return X(t,e)},t.major=function(e,t){return new J(e,t).major},t.minor=function(e,t){return new J(e,t).minor},t.patch=function(e,t){return new J(e,t).patch},t.compare=Q,t.compareLoose=function(e,t){return Q(e,t,!0)},t.rcompare=function(e,t,r){return Q(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compare(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.rcompare(e,n,r)}))},t.gt=ee,t.lt=te,t.eq=re,t.neq=ne,t.gte=ie,t.lte=oe,t.cmp=ae,t.Comparator=se;var ue={};function le(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof le)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new le(e.raw,t);if(e instanceof se)return new le(e.value,t);if(!(this instanceof le))return new le(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function ce(e){return!e||"x"===e.toLowerCase()||"*"===e}function fe(e,t,r,n,i,o,a,s,u,l,c,f,d){return((t=ce(r)?"":ce(n)?">="+r+".0.0":ce(i)?">="+r+"."+n+".0":">="+t)+" "+(s=ce(u)?"":ce(l)?"<"+(+u+1)+".0.0":ce(c)?"<"+u+"."+(+l+1)+".0":f?"<="+u+"."+l+"."+c+"-"+f:"<="+s)).trim()}function de(e,t,r){for(var i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(i=0;i<e.length;i++)if(n(e[i].semver),e[i].semver!==ue&&e[i].semver.prerelease.length>0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function he(e,t,r){try{t=new le(t,r)}catch(e){return!1}return t.test(e)}function pe(e,t,r,n){var i,o,a,s,u;switch(e=new J(e,n),t=new le(t,n),r){case">":i=ee,o=oe,a=te,s=">",u=">=";break;case"<":i=te,o=ie,a=ee,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(he(e,t,n))return!1;for(var l=0;l<t.set.length;++l){var c=t.set[l],f=null,d=null;if(c.forEach((function(e){e.semver===ue&&(e=new se(">=0.0.0")),f=f||e,d=d||e,i(e.semver,f.semver,n)?f=e:a(e.semver,d.semver,n)&&(d=e)})),f.operator===s||f.operator===u)return!1;if((!d.operator||d.operator===s)&&o(e,d.semver))return!1;if(d.operator===u&&a(e,d.semver))return!1}return!0}se.prototype.parse=function(e){var t=this.options.loose?u[q]:u[K],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new J(r[2],this.options.loose):this.semver=ue},se.prototype.toString=function(){return this.value},se.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===ue||("string"==typeof e&&(e=new J(e,this.options)),ae(e,this.operator,this.semver,this.options))},se.prototype.intersects=function(e,t){if(!(e instanceof se))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return r=new le(e.value,t),he(this.value,r,t);if(""===e.operator)return r=new le(this.value,t),he(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=ae(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=ae(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||o&&a||s||u},t.Range=le,le.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},le.prototype.toString=function(){return this.range},le.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?u[z]:u[W];e=e.replace(r,fe),n("hyphen replace",e),e=e.replace(u[H],"$1$2$3"),n("comparator trim",e,u[H]),e=(e=(e=e.replace(u[B],"$1~")).replace(u[j],"$1^")).split(/\s+/).join(" ");var i=t?u[q]:u[K],o=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?u[$]:u[U];return e.replace(r,(function(t,r,i,o,a){var s;return n("caret",e,t,r,i,o,a),ce(r)?s="":ce(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":ce(o)?s="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":a?(n("replaceCaret pr",a),s="0"===r?"0"===i?">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+"-"+a+" <"+(+r+1)+".0.0"):(n("no pr"),s="0"===r?"0"===i?">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1):">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"),n("caret return",s),s}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?u[L]:u[F];return e.replace(r,(function(t,r,i,o,a){var s;return n("tilde",e,t,r,i,o,a),ce(r)?s="":ce(i)?s=">="+r+".0.0 <"+(+r+1)+".0.0":ce(o)?s=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":a?(n("replaceTilde pr",a),s=">="+r+"."+i+"."+o+"-"+a+" <"+r+"."+(+i+1)+".0"):s=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0",n("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?u[R]:u[I];return e.replace(r,(function(t,r,i,o,a,s){n("xRange",e,t,r,i,o,a,s);var u=ce(i),l=u||ce(o),c=l||ce(a);return"="===r&&c&&(r=""),u?t=">"===r||"<"===r?"<0.0.0":"*":r&&c?(l&&(o=0),a=0,">"===r?(r=">=",l?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),t=r+i+"."+o+"."+a):l?t=">="+i+".0.0 <"+(+i+1)+".0.0":c&&(t=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(u[G],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(i)}))),o.map((function(e){return new se(e,this.options)}),this)},le.prototype.intersects=function(e,t){if(!(e instanceof le))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return e.set.some((function(e){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new le(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},le.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new J(e,this.options));for(var t=0;t<this.set.length;t++)if(de(this.set[t],e,this.options))return!0;return!1},t.satisfies=he,t.maxSatisfying=function(e,t,r){var n=null,i=null;try{var o=new le(t,r)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(n&&-1!==i.compare(e)||(i=new J(n=e,r)))})),n},t.minSatisfying=function(e,t,r){var n=null,i=null;try{var o=new le(t,r)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(n&&1!==i.compare(e)||(i=new J(n=e,r)))})),n},t.minVersion=function(e,t){e=new le(e,t);var r=new J("0.0.0");if(e.test(r))return r;if(r=new J("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;n<e.set.length;++n)e.set[n].forEach((function(e){var t=new J(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!ee(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return r&&e.test(r)?r:null},t.validRange=function(e,t){try{return new le(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return pe(e,t,"<",r)},t.gtr=function(e,t,r){return pe(e,t,">",r)},t.outside=pe,t.prerelease=function(e,t){var r=V(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new le(e,r),t=new le(t,r),e.intersects(t)},t.coerce=function(e){if(e instanceof J)return e;if("string"!=typeof e)return null;var t=e.match(u[N]);return null==t?null:V(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},8913:(e,t,r)=>{"use strict";var n,i,o,a;Object.defineProperty(t,"__esModule",{value:!0}),t.CONTRACTS_ADDRESSES=t.SHASTA_CONTRACTS_ADDRESSES_BASE58=t.TRON_CONTRACTS_ADDRESSES_BASE58=t.GasLimitOffset=t.GasPrice_NOW=t.NULL_ADDRESS=t.API_BASE_URL=t.CHAIN=t.ID_CHAINNAME=t.HOST_CHAINNAME=t.CHAIN_ID=void 0;var s,u,l=r(307);t.CHAIN_ID=((n={})[l.Network.Tron]=728126428,n[l.Network.Shasta]=2494104990,n),t.HOST_CHAINNAME={"https://api.trongrid.io":l.Network.Tron,"https://api.shasta.trongrid.io":l.Network.Shasta},t.ID_CHAINNAME={728126428:l.Network.Tron,2494104990:l.Network.Shasta},t.CHAIN=((i={})[l.Network.Tron]="tron",i[l.Network.Shasta]="tron",i),t.API_BASE_URL=((o={})[l.Network.Tron]={api:"https://api.apenft.io",api2:"https://api.apenft.io",key:"rV9UjZwMSK4zqkKEWOUnUXXY2zNgPJ8i",secret:"X6nsVJtRzySGjXvsfRN5RAweKtFtLKBZ",apenftBaseApiUrl:"https://api-gateway.apenft.io"},o[l.Network.Shasta]={api:"https://api-testnet.apenft.io",api2:"https://api-testnet.apenft.io",key:"ewSLIdRTSkss2oFsBFdCuO113l0zXX2K",secret:"Km8wDTfjIF5lwJl4qpouzeqNMrd78K1w",apenftBaseApiUrl:"https://api-gateway-dev.apenft.io"},o),t.NULL_ADDRESS="T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",t.GasPrice_NOW={url:"https://www.gasnow.org/api/v3/gas/price",type:"fast"},t.GasLimitOffset=1.18,function(e){e.ERC20AssetProxy="TRgSk4foxSg4JaV2EjNz8qzaNrBhUtWUnz",e.ERC721AssetProxy="TRJ54KCbg29a4nb8LVPgNp61o2ity2WkDu",e.ERC1155AssetProxy="TQPdK4DutVPkFhcWP6KqshpyRBT95zS2CE",e.APENFTExchange="TQr5axvJzETeHsUiXv6QjBEh1BKH571AZu",e.ExchangeHelper="TYxaWsBNMtE9L1bsUUdXCKm99Ab2jziEbA",e.APENFTExchangeKeeper="TEQAs54FPKYQdTZAPyT3okfbq2MH4dEeP1",e.APENFTSharedAsset="TG8UTFQfcmyqb3bSjqK1svTtzrn2mLcUXS",e.FeeRecipientAddress="TPyjyZfsYaXStgz2NmAraF1uZcMtkgNan5",e.WTRX="TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"}(s=t.TRON_CONTRACTS_ADDRESSES_BASE58||(t.TRON_CONTRACTS_ADDRESSES_BASE58={})),function(e){e.ERC20AssetProxy="TC7G2nApC3WKGkkkrppUJSmNSnj7KYkaiq",e.ERC721AssetProxy="TVDuLb8zE9mcMJqMtUD1gMTnFKRZduwhb7",e.ERC1155AssetProxy="TEHxYWo9AkzMy2CFAghQQgBNCgBMqtZGKa",e.APENFTExchange="TYnuR3ripQNZUYUvjkjzbwQ48zHKdAtzis",e.ExchangeHelper="TCWuXtzPEqKJ2MLygtCr27i1ehYFJKDBdT",e.APENFTExchangeKeeper="TEdP593yFJkAiBzwdT56JrXW1pohsTA4ag",e.APENFTSharedAsset="TG8UTFQfcmyqb3bSjqK1svTtzrn2mLcUXS",e.FeeRecipientAddress="TRxMn4k6ZpPhHLEqVojaXRzr3PP3p3B9KE",e.WTRX="TF2ipqRnrDzuPrANJCJggmaM753FCE1ZWE",e.ERC721Asset="TKGSPEk2FLrEod8bTLCxxS9AbeXvYe21aC",e.ERC20Asset="TTRjXLinU9FAZETtL5TDNsQGd7sc7Hu26T",e.ERC1155Asset="TD34cLBPdDhjRHDgiWkG42LnbCZk5fP2fP",e.FactoryContract=""}(u=t.SHASTA_CONTRACTS_ADDRESSES_BASE58||(t.SHASTA_CONTRACTS_ADDRESSES_BASE58={})),t.CONTRACTS_ADDRESSES=((a={})[l.Network.Tron]=s,a[l.Network.Shasta]=u,a)},2375:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccountApi=void 0;var s=r(5994),u=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getUser=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getUser",gql:s.getUser,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getUsers=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getUsers",gql:s.getUsers,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getCollections=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getCollections",gql:s.getCollections,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getUserSentOffers=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getUserSentOffers",gql:s.getUserSentOffers,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getUserReceivedOffers=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getUserReceivedOffers",gql:s.getUserReceivedOffers,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssets=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssets",gql:s.getAssets,params:e})];case 1:return[2,t.sent()]}}))}))},t}(r(7288).GraphqlApi);t.AccountApi=u},892:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetApi=void 0;var s=r(7449),u=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getAssetListings=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetListings",gql:s.getAssetListings,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetOffers=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetOffers",gql:s.getAssetOffers,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetDetail=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetDetail",gql:s.getAssetDetail,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetTradingHistory=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetTradingHistory",gql:s.getAssetTradingHistory,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetMoreCollection=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetMoreCollection",gql:s.getAssetMoreCollection,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetListingInfo=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetListingInfo",gql:s.getAssetListingInfo,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetSales=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetSales",gql:s.getAssetSales,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getAssetBids=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getAssetBids",gql:s.getAssetBids,params:e})];case 1:return[2,t.sent()]}}))}))},t}(r(7288).GraphqlApi);t.AssetApi=u},7288:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.GraphqlApi=void 0;var i=r(8687),o=r(8913),a=function(){function e(e){var t=e.networkName;if(this.apiBaseUrl=o.API_BASE_URL[t].apenftBaseApiUrl,this.chainId=o.CHAIN_ID[t],this.appKey=o.API_BASE_URL[t].key,this.appSecret=o.API_BASE_URL[t].secret,this.account=e.account||"",!this.apiBaseUrl)throw new Error("".concat(t," undefined api"));this.chain=o.CHAIN[t],this.walletChainId="0x".concat(this.chainId.toString(16)),this.networkName=t;var r=this.getAPISign(t);this.gqlClient=new i.GraphQLClient("".concat(this.apiBaseUrl,"/graphql"),{headers:n({},r)})}return e.prototype.getAPISign=function(e){return{"x-chain-name":o.CHAIN[e]}},e.prototype.blockChainRequest=function(e){e.funcName;var t=e.gql,r=e.params,i=n(n({},r),{blockChain:{chain:this.chain,chainId:this.walletChainId}});return this.gqlClient.request(t,i)},e.prototype.putRequest=function(e){e.funcName;var t=e.gql,r=e.params,i={input:n(n({},r),{blockChain:{chain:this.chain,chainId:this.walletChainId}})};return this.gqlClient.request(t,i)},e}();t.GraphqlApi=a},5046:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionApi=void 0;var s=r(3144),u=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getSingleCollectionInfo=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getSingleCollectionInfo",gql:s.getSingleCollectionInfo,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getCollectionTradeTrend=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getCollectionTradeTrend",gql:s.getCollectionTradeTrend,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getSingleCollectionAttributes=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getSingleCollectionAttributes",gql:s.getSingleCollectionAttributes,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getCollectionTradingHistory=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getCollectionTradingHistory",gql:s.getCollectionTradingHistory,params:e})];case 1:return[2,t.sent()]}}))}))},t.prototype.getHotCollections=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.blockChainRequest({funcName:"getHotCollections",gql:s.getHotCollections,params:e})];case 1:return[2,t.sent()]}}))}))},t}(r(7288).GraphqlApi);t.CollectionApi=u},5994:function(e,t,r){"use strict";var n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.getAssets=t.getUserReceivedOffers=t.getUserSentOffers=t.getCollections=t.getUsers=t.getUser=void 0;var i,o,a,s,u,l,c=r(8687),f=r(1160);t.getUser=(0,c.gql)(i||(i=n(["\n query getUser($address: String) {\n user(address: $address) {\n profile {\n account_address\n user_name\n profile_image_url\n bio\n profile_cover_url\n external_link\n twitter_link\n instagram_link\n discord_link\n telegram_link\n medium_link\n }\n }\n }\n"],["\n query getUser($address: String) {\n user(address: $address) {\n profile {\n account_address\n user_name\n profile_image_url\n bio\n profile_cover_url\n external_link\n twitter_link\n instagram_link\n discord_link\n telegram_link\n medium_link\n }\n }\n }\n"]))),t.getUsers=(0,c.gql)(o||(o=n(["\n query getUsers($pagination: Pagination, $search: String) {\n users(pagination: $pagination, search: $search) {\n items {\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n }\n }\n"],["\n query getUsers($pagination: Pagination, $search: String) {\n users(pagination: $pagination, search: $search) {\n items {\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n }\n }\n"]))),t.getCollections=(0,c.gql)(a||(a=n(["\n ","\n query getCollections(\n $pagination: Pagination\n $sort: CollectionSortBy\n $owners: [String]\n $search: String\n ) {\n collections(\n pagination: $pagination\n sort: $sort\n owners: $owners\n search: $search\n ) {\n items {\n name\n image_url\n contract_address\n banner_image_url\n is_verified\n description\n owner {\n profile {\n user_name\n account_address\n }\n }\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n query getCollections(\n $pagination: Pagination\n $sort: CollectionSortBy\n $owners: [String]\n $search: String\n ) {\n collections(\n pagination: $pagination\n sort: $sort\n owners: $owners\n search: $search\n ) {\n items {\n name\n image_url\n contract_address\n banner_image_url\n is_verified\n description\n owner {\n profile {\n user_name\n account_address\n }\n }\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),f.PAGINATION_FIELDS),t.getUserSentOffers=(0,c.gql)(s||(s=n(["\n ","\n ","\n query getUserSentOffers($pagination: Pagination, $user: String) {\n user_sent_offers(pagination: $pagination, user: $user) {\n items {\n ...orderFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n ","\n query getUserSentOffers($pagination: Pagination, $user: String) {\n user_sent_offers(pagination: $pagination, user: $user) {\n items {\n ...orderFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),f.PAGINATION_FIELDS,f.ORDER_FIELDS),t.getUserReceivedOffers=(0,c.gql)(u||(u=n(["\n ","\n ","\n query getUserReceivedOffers($pagination: Pagination, $user: String) {\n user_rcvd_offers(pagination: $pagination, user: $user) {\n items {\n bestBidOrder {\n ...orderFields\n }\n contractAddress\n token {\n token_id\n image_url\n name\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n ","\n query getUserReceivedOffers($pagination: Pagination, $user: String) {\n user_rcvd_offers(pagination: $pagination, user: $user) {\n items {\n bestBidOrder {\n ...orderFields\n }\n contractAddress\n token {\n token_id\n image_url\n name\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),f.PAGINATION_FIELDS,f.ORDER_FIELDS),t.getAssets=(0,c.gql)(l||(l=n(["\n ","\n ","\n query getAssets(\n $pagination: Pagination\n $sort: AssetSortBy\n $price: PriceRangeFilter\n $statuses: [AssetStatus]\n $collections: [String]\n $user_account: String\n $owners: [String]\n $creators: [String]\n $attributes: [AttributesFilter]\n $search: String\n $categories: [String]\n $currencies: [String]\n $is_recommend: Boolean\n ) {\n assets(\n sort: $sort\n pagination: $pagination\n price: $price\n statuses: $statuses\n collections: $collections\n user_account: $user_account\n owners: $owners\n creators: $creators\n attributes: $attributes\n search: $search\n categories: $categories\n currencies: $currencies\n is_recommend: $is_recommend\n ) {\n items {\n ...assetsFields\n }\n pagination {\n ...paginationFields\n total\n }\n }\n }\n"],["\n ","\n ","\n query getAssets(\n $pagination: Pagination\n $sort: AssetSortBy\n $price: PriceRangeFilter\n $statuses: [AssetStatus]\n $collections: [String]\n $user_account: String\n $owners: [String]\n $creators: [String]\n $attributes: [AttributesFilter]\n $search: String\n $categories: [String]\n $currencies: [String]\n $is_recommend: Boolean\n ) {\n assets(\n sort: $sort\n pagination: $pagination\n price: $price\n statuses: $statuses\n collections: $collections\n user_account: $user_account\n owners: $owners\n creators: $creators\n attributes: $attributes\n search: $search\n categories: $categories\n currencies: $currencies\n is_recommend: $is_recommend\n ) {\n items {\n ...assetsFields\n }\n pagination {\n ...paginationFields\n total\n }\n }\n }\n"])),f.PAGINATION_FIELDS,f.ASSETS_FIELDS)},7449:function(e,t,r){"use strict";var n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.getAssetBids=t.getAssetSales=t.getAssetListingInfo=t.getAssetMoreCollection=t.getAssetTradingHistory=t.getAssetOffers=t.getAssetListings=t.getAssetDetail=void 0;var i,o,a,s,u,l,c,f,d=r(8687),h=r(1160);t.getAssetDetail=(0,d.gql)(i||(i=n(["\n ","\n ","\n ","\n ","\n query getAssetDetail($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n token_id\n contract_address\n image_url\n animation_url\n token_uri\n token_type\n name\n description\n creators {\n address\n profile {\n user_name\n profile_image_url\n }\n }\n attributes {\n trait_type\n value\n }\n collection {\n royalty\n royalty_address\n name\n is_verified\n contract_address\n image_url\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n categories\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n attributes {\n asset_total\n trait_types_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n balance\n owner {\n ...userFields\n }\n }\n }\n }\n"],["\n ","\n ","\n ","\n ","\n query getAssetDetail($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n token_id\n contract_address\n image_url\n animation_url\n token_uri\n token_type\n name\n description\n creators {\n address\n profile {\n user_name\n profile_image_url\n }\n }\n attributes {\n trait_type\n value\n }\n collection {\n royalty\n royalty_address\n name\n is_verified\n contract_address\n image_url\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n categories\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n attributes {\n asset_total\n trait_types_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n balance\n owner {\n ...userFields\n }\n }\n }\n }\n"])),h.USER_FIELDS,h.ASKS_FIELDS,h.BIDS_FIELDS,h.SALES_FIELDS),t.getAssetListings=(0,d.gql)(o||(o=n(["\n ","\n ","\n query getAssetListings(\n $pagination: Pagination\n $token_id: String\n $collection: String\n $is_order_ask: Boolean\n ) {\n nft_valid_orders(\n pagination: $pagination\n token_id: $token_id\n collection: $collection\n need_ask: $is_order_ask\n ) {\n items {\n ...orderFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n ","\n query getAssetListings(\n $pagination: Pagination\n $token_id: String\n $collection: String\n $is_order_ask: Boolean\n ) {\n nft_valid_orders(\n pagination: $pagination\n token_id: $token_id\n collection: $collection\n need_ask: $is_order_ask\n ) {\n items {\n ...orderFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),h.PAGINATION_FIELDS,h.ORDER_FIELDS),t.getAssetOffers=(0,d.gql)(a||(a=n(["\n ","\n ","\n query getAssetOffers(\n $pagination: Pagination\n $token_id: String\n $collection: String\n $is_order_ask: Boolean\n ) {\n nft_valid_orders(\n pagination: $pagination\n token_id: $token_id\n collection: $collection\n need_ask: $is_order_ask\n ) {\n items {\n ...orderFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n ","\n query getAssetOffers(\n $pagination: Pagination\n $token_id: String\n $collection: String\n $is_order_ask: Boolean\n ) {\n nft_valid_orders(\n pagination: $pagination\n token_id: $token_id\n collection: $collection\n need_ask: $is_order_ask\n ) {\n items {\n ...orderFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),h.ORDER_FIELDS,h.PAGINATION_FIELDS),t.getAssetTradingHistory=(0,d.gql)(s||(s=n(["\n ","\n ","\n query getAssetTradingHistory(\n $pagination: Pagination\n $token_id: String\n $collections: [String]\n ) {\n events(\n pagination: $pagination\n token_id: $token_id\n collections: $collections\n ) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n tx_hash\n to {\n ...userFields\n }\n from {\n ...userFields\n }\n payments {\n currency {\n symbol\n icon\n decimal\n }\n price\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n ","\n query getAssetTradingHistory(\n $pagination: Pagination\n $token_id: String\n $collections: [String]\n ) {\n events(\n pagination: $pagination\n token_id: $token_id\n collections: $collections\n ) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n tx_hash\n to {\n ...userFields\n }\n from {\n ...userFields\n }\n payments {\n currency {\n symbol\n icon\n decimal\n }\n price\n }\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),h.PAGINATION_FIELDS,h.USER_FIELDS),t.getAssetMoreCollection=(0,d.gql)(u||(u=n(["\n ","\n ","\n query getAssetMoreCollection(\n $pagination: Pagination\n $sort: AssetSortBy\n $collections: [String]\n ) {\n assets(sort: $sort, pagination: $pagination, collections: $collections) {\n items {\n ...assetsFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"],["\n ","\n ","\n query getAssetMoreCollection(\n $pagination: Pagination\n $sort: AssetSortBy\n $collections: [String]\n ) {\n assets(sort: $sort, pagination: $pagination, collections: $collections) {\n items {\n ...assetsFields\n }\n pagination {\n ...paginationFields\n }\n }\n }\n"])),h.PAGINATION_FIELDS,h.ASSETS_FIELDS),t.getAssetListingInfo=(0,d.gql)(l||(l=n(["\n ","\n query getAssetListingInfo($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n asks_v2 {\n ...asksFields\n }\n }\n }\n"],["\n ","\n query getAssetListingInfo($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n asks_v2 {\n ...asksFields\n }\n }\n }\n"])),h.ASKS_FIELDS),t.getAssetSales=(0,d.gql)(c||(c=n(["\n ","\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n sales_v2 {\n ...salesFields\n }\n }\n }\n"],["\n ","\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n sales_v2 {\n ...salesFields\n }\n }\n }\n"])),h.SALES_FIELDS),t.getAssetBids=(0,d.gql)(f||(f=n(["\n ","\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n bids_v2 {\n ...bidsFields\n }\n }\n }\n"],["\n ","\n query getAssetSales($token_id: String, $collection: String) {\n asset(token_id: $token_id, collection: $collection) {\n bids_v2 {\n ...bidsFields\n }\n }\n }\n"])),h.BIDS_FIELDS)},3144:function(e,t,r){"use strict";var n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.getHotCollections=t.getCollectionTradingHistory=t.getSingleCollectionInfo=t.getSingleCollectionAttributes=t.getCollectionTradeTrend=void 0;var i,o,a,s,u,l=r(8687),c=r(1160);t.getCollectionTradeTrend=(0,l.gql)(i||(i=n(["\n query getCollectionTradeTrend($days: CollectionTradeTrendFilterDays, $collection: String) {\n collection_trade_trend(days: $days, collection: $collection) {\n avg_price\n num_sale\n volume\n day_stats {\n avg_price\n num_sale\n timestamp\n volume\n }\n }\n }\n"],["\n query getCollectionTradeTrend($days: CollectionTradeTrendFilterDays, $collection: String) {\n collection_trade_trend(days: $days, collection: $collection) {\n avg_price\n num_sale\n volume\n day_stats {\n avg_price\n num_sale\n timestamp\n volume\n }\n }\n }\n"]))),t.getSingleCollectionAttributes=(0,l.gql)(o||(o=n(["\n query getSingleCollectionAttributes($address: String) {\n collection(address: $address) {\n attributes {\n asset_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n }\n"],["\n query getSingleCollectionAttributes($address: String) {\n collection(address: $address) {\n attributes {\n asset_total\n trait_types {\n trait_type\n values_total\n values {\n count\n value\n }\n }\n }\n }\n }\n"]))),t.getSingleCollectionInfo=(0,l.gql)(a||(a=n(["\n query getSingleCollectionInfo($address: String) {\n collection(address: $address) {\n contract_address\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n image_original_url\n image_url\n banner_image_url\n is_verified\n in_activity\n name\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n avg_price_24h\n }\n owner {\n address\n }\n co_operators\n }\n }\n"],["\n query getSingleCollectionInfo($address: String) {\n collection(address: $address) {\n contract_address\n description\n discord_link\n facebook_link\n instagram_link\n telegram_link\n twitter_link\n website_link\n external_url\n medium_link\n image_original_url\n image_url\n banner_image_url\n is_verified\n in_activity\n name\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n avg_price_24h\n }\n owner {\n address\n }\n co_operators\n }\n }\n"]))),t.getCollectionTradingHistory=(0,l.gql)(s||(s=n(["\n query getCollectionTradingHistory(\n $pagination: Pagination\n $event_types: [EventType]\n $currencies: [String]\n $collections: [String]\n $user: String\n ) {\n events(pagination: $pagination, event_types: $event_types, currencies: $currencies, collections: $collections, user: $user) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n token_id\n tx_hash\n contract_address\n to {\n ...","\n }\n from {\n ...","\n }\n quantity\n payments {\n currency {\n symbol\n icon\n decimal\n }\n price\n }\n token {\n image_url\n name\n }\n }\n pagination {\n ...","\n }\n }\n }\n"],["\n query getCollectionTradingHistory(\n $pagination: Pagination\n $event_types: [EventType]\n $currencies: [String]\n $collections: [String]\n $user: String\n ) {\n events(pagination: $pagination, event_types: $event_types, currencies: $currencies, collections: $collections, user: $user) {\n items {\n event_type\n event_time\n expire_time\n from_address\n to_address\n token_id\n tx_hash\n contract_address\n to {\n ...","\n }\n from {\n ...","\n }\n quantity\n payments {\n currency {\n symbol\n icon\n decimal\n }\n price\n }\n token {\n image_url\n name\n }\n }\n pagination {\n ...","\n }\n }\n }\n"])),c.USER_FIELDS,c.USER_FIELDS,c.PAGINATION_FIELDS),t.getHotCollections=(0,l.gql)(u||(u=n(["\n query getHotCollections($chain: String, $is_recommend: Boolean) {\n collections(chain: $chain, is_recommend: $is_recommend) {\n items {\n image_url\n name\n contract_address\n is_verified\n description\n fore_banner_image_url\n banner_image_url\n object_count\n stat {\n volume_total\n floor_price\n owners_total\n assets_total\n }\n }\n }\n }\n"],["\n query getHotCollections($chain: String, $is_recommend: Boolean) {\n collections(chain: $chain, is_recommend: $is_recommend) {\n items {\n image_url\n name\n contract_address\n is_verified\n description\n fore_banner_image_url\n banner_image_url\n object_count\n stat {\n volume_total\n floor_price\n owners_total\n assets_total\n }\n }\n }\n }\n"])))},1160:function(e,t,r){"use strict";var n=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object.defineProperty(t,"__esModule",{value:!0}),t.ORDER_FIELDS=t.ASSETS_FIELDS=t.SALES_FIELDS=t.BIDS_FIELDS=t.ASKS_FIELDS=t.CURRENCY_FIELDS=t.USER_FIELDS=t.PAGINATION_FIELDS=void 0;var i,o,a,s,u,l,c,f,d=r(8687);t.PAGINATION_FIELDS=(0,d.gql)(i||(i=n(["\n fragment paginationFields on PagingInfo {\n cursor\n has_next\n }\n"],["\n fragment paginationFields on PagingInfo {\n cursor\n has_next\n }\n"]))),t.USER_FIELDS=(0,d.gql)(o||(o=n(["\n fragment userFields on User {\n profile {\n account_address\n user_name\n profile_image_url\n }\n }\n"],["\n fragment userFields on User {\n profile {\n account_address\n user_name\n profile_image_url\n }\n }\n"]))),t.CURRENCY_FIELDS=(0,d.gql)(a||(a=n(["\n fragment currencyFields on Currency {\n address\n decimal\n icon\n symbol\n }\n"],["\n fragment currencyFields on Currency {\n address\n decimal\n icon\n symbol\n }\n"]))),t.ASKS_FIELDS=(0,d.gql)(s||(s=n(["\n fragment asksFields on NFTBestAsk {\n bestAskCreatedDate\n bestAskExpirationDate\n bestAskListingDate\n bestAskOrderQuantity\n bestAskOrderString\n bestAskOrderType\n bestAskPrice\n bestAskPriceBase\n bestAskPriceCNY\n bestAskPriceUSD\n bestAskSaleKind\n bestAskToken\n bestAskTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"],["\n fragment asksFields on NFTBestAsk {\n bestAskCreatedDate\n bestAskExpirationDate\n bestAskListingDate\n bestAskOrderQuantity\n bestAskOrderString\n bestAskOrderType\n bestAskPrice\n bestAskPriceBase\n bestAskPriceCNY\n bestAskPriceUSD\n bestAskSaleKind\n bestAskToken\n bestAskTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"]))),t.BIDS_FIELDS=(0,d.gql)(u||(u=n(["\n fragment bidsFields on NFTBestBid {\n bestBidCreatedDate\n bestBidListingDate\n bestBidOrderQuantity\n bestBidOrderString\n bestBidPrice\n bestBidPriceBase\n bestBidPriceCNY\n bestBidPriceUSD\n bestBidToken\n bestBidTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"],["\n fragment bidsFields on NFTBestBid {\n bestBidCreatedDate\n bestBidListingDate\n bestBidOrderQuantity\n bestBidOrderString\n bestBidPrice\n bestBidPriceBase\n bestBidPriceCNY\n bestBidPriceUSD\n bestBidToken\n bestBidTokenId\n chain\n chainId\n contractAddress\n currency {\n address\n decimal\n icon\n symbol\n }\n }\n"]))),t.SALES_FIELDS=(0,d.gql)(l||(l=n(["\n fragment salesFields on NFTLastSale {\n currency {\n address\n decimal\n icon\n symbol\n }\n lastSalePrice\n lastSaleQuantity\n }\n"],["\n fragment salesFields on NFTLastSale {\n currency {\n address\n decimal\n icon\n symbol\n }\n lastSalePrice\n lastSaleQuantity\n }\n"]))),t.ASSETS_FIELDS=(0,d.gql)(c||(c=n(["\n ","\n ","\n ","\n ","\n fragment assetsFields on Token {\n token_id\n contract_address\n image_url\n animation_url\n name\n collection {\n name\n is_verified\n contract_address\n image_url\n banner_image_url\n description\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n owner {\n ...userFields\n }\n }\n }\n"],["\n ","\n ","\n ","\n ","\n fragment assetsFields on Token {\n token_id\n contract_address\n image_url\n animation_url\n name\n collection {\n name\n is_verified\n contract_address\n image_url\n banner_image_url\n description\n stat {\n assets_total\n owners_total\n floor_price\n volume_total\n }\n payment_tokens {\n address\n symbol\n decimal\n icon\n }\n }\n asks_v2 {\n ...asksFields\n }\n bids_v2 {\n ...bidsFields\n }\n sales_v2 {\n ...salesFields\n }\n owners {\n owner {\n ...userFields\n }\n }\n }\n"])),t.USER_FIELDS,t.ASKS_FIELDS,t.BIDS_FIELDS,t.SALES_FIELDS),t.ORDER_FIELDS=(0,d.gql)(f||(f=n(["\n fragment orderFields on OrderV2 {\n approvedOnChain\n basePrice\n cancelled\n chain\n chainId\n closedTime\n closingDate\n createdDate\n collection {\n contract_address\n name\n stat {\n floor_price\n }\n }\n createdDate\n currency {\n symbol\n icon\n decimal\n }\n dataToCall\n englishAuctionReservePrice\n exchange\n exchangeData\n expirationTime\n extra\n feeMethod\n feeRecipient\n finalized\n howToCall\n id\n listingTime\n maker\n makerProtocolFee\n makerRelayerFee\n makerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n markedInvalid\n metadata {\n asset {\n address\n data\n id\n quantity\n }\n schema\n }\n orderHash\n orderType\n paymentToken\n price\n priceBase\n priceCNY\n priceUSD\n quantity\n r\n replacementPattern\n s\n saleKind\n salt\n side\n standard\n staticExtradata\n staticTarget\n taker\n takerProtocolFee\n takerRelayerFee\n takerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n target\n token {\n image_url\n name\n token_id\n token_type\n }\n v\n }\n"],["\n fragment orderFields on OrderV2 {\n approvedOnChain\n basePrice\n cancelled\n chain\n chainId\n closedTime\n closingDate\n createdDate\n collection {\n contract_address\n name\n stat {\n floor_price\n }\n }\n createdDate\n currency {\n symbol\n icon\n decimal\n }\n dataToCall\n englishAuctionReservePrice\n exchange\n exchangeData\n expirationTime\n extra\n feeMethod\n feeRecipient\n finalized\n howToCall\n id\n listingTime\n maker\n makerProtocolFee\n makerRelayerFee\n makerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n markedInvalid\n metadata {\n asset {\n address\n data\n id\n quantity\n }\n schema\n }\n orderHash\n orderType\n paymentToken\n price\n priceBase\n priceCNY\n priceUSD\n quantity\n r\n replacementPattern\n s\n saleKind\n salt\n side\n standard\n staticExtradata\n staticTarget\n taker\n takerProtocolFee\n takerRelayerFee\n takerUser {\n address\n profile {\n account_address\n profile_image_url\n user_name\n }\n }\n target\n token {\n image_url\n name\n token_id\n token_type\n }\n v\n }\n"])))},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountApi=t.AssetApi=t.CollectionApi=t.GqlApi=void 0;var n=r(5046);Object.defineProperty(t,"CollectionApi",{enumerable:!0,get:function(){return n.CollectionApi}});var i=r(892);Object.defineProperty(t,"AssetApi",{enumerable:!0,get:function(){return i.AssetApi}});var o=r(2375);Object.defineProperty(t,"AccountApi",{enumerable:!0,get:function(){return o.AccountApi}}),t.GqlApi={collectionApi:n.CollectionApi,assetApi:i.AssetApi,accountApi:o.AccountApi}},2663:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.APENFTQuery=void 0;var u=r(481),l=r(677),c=r(3553),f=r(974),d=r(307),h=function(e){function t(t,r,n){var i,o,a=this;(a=e.call(this,r)||this).accountAddress="";var s=r.networkName;return a.accountAddress=(null==n?void 0:n.address)||(null===(i=t.defaultAddress)||void 0===i?void 0:i.base58)||"",(null===(o=a.accountAddress)||void 0===o?void 0:o.length)>0&&a.accountAddress,a.gqlApi={collectionApi:new l.GqlApi.collectionApi({networkName:s,account:a.accountAddress}),assetApi:new l.GqlApi.assetApi({networkName:s,account:a.accountAddress}),accountApi:new l.GqlApi.accountApi({networkName:s,account:a.accountAddress})},a.walletProvider=t,a}return i(t,e),t.prototype.getSingleCollectionInfo=function(e){return a(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t={address:e},[4,this.gqlApi.collectionApi.getSingleCollectionInfo(t)];case 1:return[2,null==(r=n.sent())?void 0:r.collection]}}))}))},t.prototype.getCollectionTradeTrend=function(e){var t=e.days,r=void 0===t?d.CollectionTradeTrendFilterDays.Days_90:t,n=e.collection;return a(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e={days:r,collection:n},[2,this.gqlApi.collectionApi.getCollectionTradeTrend(e)]}))}))},t.prototype.getSingleCollectionAttributes=function(e){var t=e.address;return a(this,void 0,void 0,(function(){var e;return s(this,(function(r){return e={address:t},[2,this.gqlApi.collectionApi.getSingleCollectionAttributes(e)]}))}))},t.prototype.getCollectionTradingHistory=function(e){var t=e.pagination,r=void 0===t?{first:100}:t,n=e.event_types,i=e.currencies,o=e.collections,u=e.user;return a(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e={pagination:r,event_types:n,currencies:i,collections:o,user:u},[2,this.gqlApi.collectionApi.getCollectionTradingHistory(e)]}))}))},t.prototype.getHotCollections=function(e){var t=e.chain,r=e.is_recommend;return a(this,void 0,void 0,(function(){var e;return s(this,(function(n){return e={chain:t,is_recommend:r},[2,this.gqlApi.collectionApi.getHotCollections(e)]}))}))},t.prototype.getAssetListingOrders=function(e,t,r){return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n={pagination:{first:(null==r?void 0:r.first)||100,cursor:(null==r?void 0:r.cursor)||""},is_order_ask:!0,token_id:t,collection:e},[4,this.gqlApi.assetApi.getAssetListings(n)];case 1:return[2,null==(i=o.sent())?void 0:i.nft_valid_orders]}}))}))},t.prototype.getAssetOffers=function(e,t,r){return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n={pagination:{first:(null==r?void 0:r.first)||100,cursor:(null==r?void 0:r.cursor)||""},is_order_ask:!1,token_id:t,collection:e},[4,this.gqlApi.assetApi.getAssetOffers(n)];case 1:return[2,null==(i=o.sent())?void 0:i.nft_valid_orders]}}))}))},t.prototype.getAssetDetail=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r={token_id:t,collection:e},[4,this.gqlApi.assetApi.getAssetDetail(r)];case 1:return[2,null==(n=i.sent())?void 0:n.asset]}}))}))},t.prototype.getAssetTradingHistory=function(e,t,r){return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n={collections:[e],token_id:t,pagination:{first:(null==r?void 0:r.first)||100,cursor:(null==r?void 0:r.cursor)||""}},[4,this.gqlApi.assetApi.getAssetTradingHistory(n)];case 1:return[2,null==(i=o.sent())?void 0:i.events]}}))}))},t.prototype.getCollectionAssetsList=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r={pagination:{first:(null==t?void 0:t.first)||100,cursor:(null==t?void 0:t.cursor)||""},sort:d.AssetSortBy.RecentlyCreated,collections:[e]},[4,this.gqlApi.assetApi.getAssetMoreCollection(r)];case 1:return[2,null==(n=i.sent())?void 0:n.assets]}}))}))},t.prototype.getAssetBestAskOrderInfo=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return[4,this.getAssetListings(e,t)];case 1:return r=i.sent(),(null==(n=r[0])?void 0:n.bestAskOrderString)?[2,JSON.parse(n.bestAskOrderString)]:[2,{}]}}))}))},t.prototype.getAssetBidInfo=function(e,t){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,this.getAssetBids(e,t)];case 1:return(null==(r=n.sent())?void 0:r.length)?[2,r[0]]:[2,{}]}}))}))},t.prototype.getAssetBidOrderParams=function(e,t,r,n){var i,o,u,l,c,f,d;return a(this,void 0,void 0,(function(){var a,h,p,m,y,g;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetDetail(e,t)];case 1:return a=s.sent(),h=null===(i=null==a?void 0:a.bids_v2)||void 0===i?void 0:i[0],p=null===(o=null==a?void 0:a.asks_v2)||void 0===o?void 0:o[0],m=(null===(u=null==h?void 0:h.currency)||void 0===u?void 0:u.symbol)?null===(l=null==h?void 0:h.currency)||void 0===l?void 0:l.symbol:null===(c=null==p?void 0:p.currency)||void 0===c?void 0:c.symbol,y=null===(d=null===(f=null==a?void 0:a.collection)||void 0===f?void 0:f.payment_tokens)||void 0===d?void 0:d.filter((function(e){return e.symbol===m})),n=n||m,r=r||(null==p?void 0:p.bestAskPrice),g=null==y?void 0:y.find((function(e){return e.symbol.toLowerCase()===(null==n?void 0:n.toLowerCase())})),[2,{asset:this.getAssetFormatData(a),quantity:1,paymentToken:g,startAmount:r,bestAsk:p,expirationTime:null==p?void 0:p.bestAskExpirationDate}]}}))}))},t.prototype.getEnglishAuctionOrderParams=function(e){var t,r,n=e.collection,i=e.id,u=e.bidPrice,l=e.reservePrice,c=e.currency,f=e.expirationTime;return a(this,void 0,void 0,(function(){var e,a;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetDetail(n,i)];case 1:return e=s.sent(),a=null===(r=null===(t=null==e?void 0:e.collection)||void 0===t?void 0:t.payment_tokens)||void 0===r?void 0:r.find((function(e){return e.symbol.toLowerCase()===c.toLowerCase()})),f=Math.round(f/1e3),[2,{asset:this.getAssetFormatData(e),quantity:1,paymentToken:o(o({},a),{decimals:null==a?void 0:a.decimal}),englishAuctionReservePrice:l,expirationTime:f,startAmount:u}]}}))}))},t.prototype.getFixPriceOrderParams=function(e){var t,r,n=e.collection,i=e.id,u=e.price,l=e.currency,c=e.expirationTime,f=e.buyerAddress;return a(this,void 0,void 0,(function(){var e,a,d;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetDetail(n,i)];case 1:return e=s.sent(),a=null===(r=null===(t=null==e?void 0:e.collection)||void 0===t?void 0:t.payment_tokens)||void 0===r?void 0:r.find((function(e){return e.symbol.toLowerCase()===l.toLowerCase()})),c=Math.round(c/1e3),d=Math.round(Date.now()/1e3+5),[2,{asset:this.getAssetFormatData(e,f),quantity:1,paymentToken:o(o({},a),{decimals:null==a?void 0:a.decimal}),expirationTime:c,startAmount:u,listingTime:d,buyerAddress:f}]}}))}))},t.prototype.getEnglishAuctionBiddingOrderParams=function(e){var t,r,n,i=e.collection,u=e.id,l=e.price,c=e.currency;return a(this,void 0,void 0,(function(){var e,a,f;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetDetail(i,u)];case 1:return e=s.sent(),a=null===(t=null==e?void 0:e.asks_v2)||void 0===t?void 0:t[0],f=null===(n=null===(r=null==e?void 0:e.collection)||void 0===r?void 0:r.payment_tokens)||void 0===n?void 0:n.find((function(e){return e.symbol.toLowerCase()===c.toLowerCase()})),[2,{asset:this.getAssetFormatData(e),quantity:1,bestAsk:a,paymentToken:o(o({},f),{decimals:null==f?void 0:f.decimal}),startAmount:l}]}}))}))},t.prototype.getLowerPriceOrderParams=function(e){var t,r,n=e.collection,i=e.id,o=e.price;return a(this,void 0,void 0,(function(){var e,a,u,l;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetDetail(n,i)];case 1:return e=s.sent(),a=null===(t=null==e?void 0:e.asks_v2)||void 0===t?void 0:t[0],u=null===(r=null==a?void 0:a.currency)||void 0===r?void 0:r.decimal,l=JSON.parse(null==a?void 0:a.bestAskOrderString),[2,{asset:this.getAssetFormatData(e),oldOrder:l,parameter:{quantity:"1",basePrice:(0,f.withPrecision)(o,u)}}]}}))}))},t.prototype.getMakeOfferOrderOrderParams=function(e){var t=e.collection,r=e.id,n=e.price,i=e.currency,o=e.expirationTime;return a(this,void 0,void 0,(function(){var e;return s(this,(function(a){return e={collection:t,id:r,price:n,currency:i,expirationTime:o},[2,this.getFixPriceOrderParams(e)]}))}))},t.prototype.getTransferParams=function(e,t){return a(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return[4,this.getAssetDetail(e,t)];case 1:return r=o.sent(),n={asset:{id:null==r?void 0:r.token_id,address:null==r?void 0:r.contract_address,quantity:1,data:""},schema:c.TOKEN_TYPE_MAP[null==r?void 0:r.token_type]},i={tokenId:null==r?void 0:r.token_id,tokenAddress:null==r?void 0:r.contract_address},[2,{metadata:n,assetData:i}]}}))}))},t.prototype.getAssetFormatData=function(e,t){var r,n;return{tokenId:e.token_id,tokenAddress:e.contract_address,schemaName:c.TOKEN_TYPE_MAP[null==e?void 0:e.token_type],data:null==e?void 0:e.token_uri,collection:{transferFeeAddress:t?"":null===(r=null==e?void 0:e.collection)||void 0===r?void 0:r.royalty_address,APENFTSellerFeeBasisPoints:t?0:(null===(n=null==e?void 0:e.collection)||void 0===n?void 0:n.royalty)||0}}},t.prototype.getAssetSaleInfo=function(e,t){return a(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,this.getAssetSales(e,t)];case 1:return(null==(r=n.sent())?void 0:r.length)?[2,r[0]]:[2,{}]}}))}))},t.prototype.getAssetSales=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n={token_id:t,collection:e},[4,this.gqlApi.assetApi.getAssetSales(n)];case 1:return i=o.sent(),[2,null===(r=null==i?void 0:i.asset)||void 0===r?void 0:r.sales_v2]}}))}))},t.prototype.getAssetBids=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n={token_id:t,collection:e},[4,this.gqlApi.assetApi.getAssetBids(n)];case 1:return i=o.sent(),[2,null===(r=null==i?void 0:i.asset)||void 0===r?void 0:r.bids_v2]}}))}))},t.prototype.getAssetListings=function(e,t){var r;return a(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n={token_id:t,collection:e},[4,this.gqlApi.assetApi.getAssetListingInfo(n)];case 1:return i=o.sent(),[2,null===(r=null==i?void 0:i.asset)||void 0===r?void 0:r.asks_v2]}}))}))},t.prototype.getAssetsList=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r={pagination:{first:(null==t?void 0:t.first)||100,cursor:(null==t?void 0:t.cursor)||""},user:e,sort:d.AssetSortBy.RecentlyListed,owners:[e]},[4,this.gqlApi.accountApi.getAssets(r)];case 1:return[2,null==(n=i.sent())?void 0:n.assets]}}))}))},t.prototype.getSentOffers=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r={pagination:{first:(null==t?void 0:t.first)||100,cursor:(null==t?void 0:t.cursor)||""},user:e},[4,this.gqlApi.accountApi.getUserSentOffers(r)];case 1:return[2,null==(n=i.sent())?void 0:n.user_sent_offers]}}))}))},t.prototype.getReceivedOffers=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r={pagination:{first:(null==t?void 0:t.first)||100,cursor:(null==t?void 0:t.cursor)||""},user:e},[4,this.gqlApi.accountApi.getUserReceivedOffers(r)];case 1:return[2,null==(n=i.sent())?void 0:n.user_rcvd_offers]}}))}))},t.prototype.getCollections=function(e,t){return a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r={pagination:{first:(null==t?void 0:t.first)||100,cursor:(null==t?void 0:t.cursor)||""},owners:[e]},[4,this.gqlApi.accountApi.getCollections(r)];case 1:return[2,null==(n=i.sent())?void 0:n.collections]}}))}))},t}(u.QueryAPI);t.APENFTQuery=h},6952:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fetch=void 0;var s,u=a(r(204)),l=r(8913);s="undefined"==typeof window?u.default:window.fetch.bind(window);var c=function(){function e(e,t,r){var n=t.networkName;this.chain=l.CHAIN[n],this.apiBaseUrl=e,this.authToken="",this.logger=r||function(e){return e}}return e.prototype.get=function(e,t){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this._fetch(e,t)];case 1:return[2,r.sent().json()]}}))}))},e.prototype.post=function(e,t,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){var i,a,s;return o(this,(function(o){switch(o.label){case 0:return i=n({method:"POST",body:t?JSON.stringify(t):void 0,headers:{Accept:"application/json","Content-Type":"application/json"}},r),[4,this._fetch(e,t,i)];case 1:return(a=o.sent()).ok?[4,a.json()]:[3,3];case 2:return(s=o.sent()).data?[2,s.data]:[2,s];case 3:return[2,a];case 4:return[2]}}))}))},e.prototype.put=function(e,t,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post(e,t,n({method:"PUT"},r))]}))}))},e.prototype._fetch=function(e,t,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){var a,u,l,c,f=this;return o(this,(function(d){return a=this.apiBaseUrl,u=this.authToken,l=a+e,c=n(n({},r),{headers:n(n(n({},u?{Authorization:u}:{}),r.headers||{}),{"x-chain-name":this.chain,"x-signature":(null==t?void 0:t.signature)?null==t?void 0:t.signature:""})}),this.logger("Sending request: ".concat(l," ").concat(JSON.stringify(c).substr(0,100),"...")),[2,s(l,c).then((function(e){return i(f,void 0,void 0,(function(){return o(this,(function(t){return[2,this._handleApiResponse(e)]}))}))}))]}))}))},e.prototype._handleApiResponse=function(e){return i(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){switch(n.label){case 0:if(e.ok)return this.logger("Got success: ".concat(e.status)),[2,e];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.text()];case 2:return t=n.sent(),t=JSON.parse(t),[3,4];case 3:return n.sent(),[3,4];case 4:switch(this.logger("Got error ".concat(e.status,": ").concat(JSON.stringify(t))),e.status){case 400:r=t&&t.errors?t.errors.join(", "):"Invalid request: ".concat(JSON.stringify(t));break;case 401:case 403:r="Unauthorized. Full message was '".concat(JSON.stringify(t),"'");break;case 404:r="Not found. Full message was '".concat(JSON.stringify(t),"'");break;case 500:r="Internal server error. OpenSea has been alerted, but if the problem persists please contact us via Discord: https://discord.gg/ga8EJbv - full message was ".concat(JSON.stringify(t));break;case 503:r="Service unavailable. Please try again in a few minutes. If the problem persists please contact us via Discord: https://discord.gg/ga8EJbv - full message was ".concat(JSON.stringify(t));break;default:r="Message: ".concat(JSON.stringify(t))}throw new Error("API Error ".concat(e.status,": ").concat(r))}}))}))},e.prototype.throwOrContinue=function(e,t){var r=!!e.message&&(e.message.includes("503")||e.message.includes("429"));if(t<=0||!r)throw e},e}();t.Fetch=c},481:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueryAPI=void 0;var o=r(8913),a=function(e){function t(t,r){var n=e.call(this,o.API_BASE_URL[t.networkName].api,t,r)||this;n.pageSize=20;var i=t.networkName;return n.chain=o.CHAIN[i],n.chainId=o.CHAIN_ID[i],n.walletChainId="0x".concat(n.chainId.toString(16)),n.chainInfo={chain:o.CHAIN[i],chainId:n.walletChainId},n.logger=r||function(e){return e},n}return i(t,e),t}(r(6952).Fetch);t.QueryAPI=a},5492:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ERC1155Schema=void 0;var o=r(307);t.ERC1155Schema={version:1,deploymentBlock:0,name:"ERC1155",description:"Items conforming to the ERC1155 spec, using transferFrom.",thumbnail:"",website:"https://github.com/ethereum/eips/issues/1155",fields:[{name:"ID",type:"uint256",description:"Asset Token ID"},{name:"Address",type:"address",description:"Asset Contract Address"},{name:"Quantity",type:"uint256",description:"Quantity to transfer"},{name:"Data",type:"bytes",description:"Data to transfer"}],assetFromFields:function(e){return{id:e.ID,address:e.Address,quantity:e.Quantity,data:e.Data}},assetToFields:function(e){return{ID:e.id,Address:e.address,Quantity:e.quantity,Data:e.data}},formatter:function(e){return n(void 0,void 0,void 0,(function(){return i(this,(function(t){return[2,{title:"ERC1155 Asset: Token ID "+e.id+" at "+e.address,description:"Trading "+e.quantity.toString(),url:"",thumbnail:"",properties:[]}]}))}))},functions:{transfer:function(e){return{type:o.AbiType.Function,name:"safeTransferFrom",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_from",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"_to",type:"address"},{kind:o.FunctionInputKind.Asset,name:"_id",type:"uint256",value:e.id},{kind:o.FunctionInputKind.Count,name:"_value",type:"uint256",value:e.quantity},{kind:o.FunctionInputKind.Data,name:"_data",type:"bytes",value:e.data}],outputs:[]}},countOf:function(e){return{type:o.AbiType.Function,name:"balanceOf",payable:!1,constant:!0,stateMutability:o.StateMutability.View,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_owner",type:"address"},{kind:o.FunctionInputKind.Asset,name:"_id",type:"uint256",value:e.id}],outputs:[{kind:o.FunctionOutputKind.Count,name:"balance",type:"uint"}],assetFromOutputs:function(e){return e.balance}}},isApprove:function(e){return{type:o.AbiType.Function,name:"isApprovedForAll",payable:!1,constant:!0,stateMutability:o.StateMutability.View,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_owner",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"_operator",type:"address"}],outputs:[{kind:o.FunctionOutputKind.Owner,name:"owner",type:"bool"}]}},approve:function(e){return{type:o.AbiType.Function,name:"setApprovalForAll",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_operator",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"isoperator",type:"bool"}],outputs:[]}},assetsOfOwnerByIndex:[]},events:{transfer:[]},hash:function(e){return e.address+"-"+e.id}}},8705:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20Schema=void 0;var o=r(307);t.ERC20Schema={version:1,deploymentBlock:0,name:"ERC20",description:"Items conforming to the ERC20 spec, using transferFrom.",thumbnail:"",website:"https://github.com/ethereum/eips/issues/20",fields:[{name:"Address",type:"address",description:"Asset Contract Address"},{name:"Account",type:"address",description:"Account Address"},{name:"Quantity",type:"uint256",description:"Quantity to transfer"}],assetFromFields:function(e){return{address:e.Address,account:e.Account,quantity:e.Quantity}},assetToFields:function(e){return{Address:e.address,Account:e.account,Quantity:e.quantity}},formatter:function(e){return n(void 0,void 0,void 0,(function(){return i(this,(function(t){return[2,{title:"ERC20 Asset at "+e.address,description:"Trading "+e.quantity.toString(),url:"",thumbnail:"",properties:[]}]}))}))},functions:{transfer:function(e){return{type:o.AbiType.Function,name:"transferFrom",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_from",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"_to",type:"address"},{kind:o.FunctionInputKind.Count,name:"_value",type:"uint256",value:e.quantity}],outputs:[]}},isApprove:function(e){return{type:o.AbiType.Function,name:"allowance",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"owner",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"spender",type:"address"}],outputs:[{kind:o.FunctionOutputKind.Count,name:"balance",type:"uint256"}]}},approve:function(e){return{type:o.AbiType.Function,name:"approve",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Replaceable,name:"to",type:"address"},{kind:o.FunctionInputKind.Asset,name:"amount",type:"uint256",value:e.quantity}],outputs:[]}},countOf:function(e){return{type:o.AbiType.Function,name:"balanceOf",payable:!1,constant:!0,stateMutability:o.StateMutability.View,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"owner",type:"address"}],outputs:[{kind:o.FunctionOutputKind.Count,name:"balance",type:"uint256"}],assetFromOutputs:function(e){return e.balance}}},assetsOfOwnerByIndex:[]},events:{transfer:[]},hash:function(e){return e.address}}},4621:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.ERC721Schema=void 0;var o=r(307);t.ERC721Schema={version:2,deploymentBlock:0,name:"ERC721",description:"Items conforming to the ERC721 spec, using transferFrom.",thumbnail:"",website:"http://erc721.org/",fields:[{name:"ID",type:"uint256",description:"Asset Token ID"},{name:"Address",type:"address",description:"Asset Contract Address"}],assetFromFields:function(e){return{id:e.ID,address:e.Address}},assetToFields:function(e){return{ID:e.id,Address:e.address}},formatter:function(e){return n(void 0,void 0,void 0,(function(){return i(this,(function(t){return[2,{title:"ERC721 Asset: Token ID "+e.id+" at "+e.address,description:"",url:"",thumbnail:"",properties:[]}]}))}))},functions:{transfer:function(e){return{type:o.AbiType.Function,name:"transferFrom",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_from",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"_to",type:"address"},{kind:o.FunctionInputKind.Asset,name:"_tokenId",type:"uint256",value:e.id}],outputs:[]}},isApprove:function(e,t){return{type:o.AbiType.Function,name:"isApprovedForAll",payable:!1,constant:!0,stateMutability:o.StateMutability.View,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"_owner",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"_operator",type:"address"}],outputs:[{kind:o.FunctionOutputKind.Owner,name:"owner",type:"bool"}]}},approve:function(e,t){return{type:o.AbiType.Function,name:"setApprovalForAll",payable:!1,constant:!1,stateMutability:o.StateMutability.Nonpayable,target:e.address,inputs:[{kind:o.FunctionInputKind.Owner,name:"operator",type:"address"},{kind:o.FunctionInputKind.Replaceable,name:"isoperator",type:"bool"}],outputs:[]}},ownerOf:function(e){return{type:o.AbiType.Function,name:"ownerOf",payable:!1,constant:!0,stateMutability:o.StateMutability.View,target:e.address,inputs:[{kind:o.FunctionInputKind.Asset,name:"_tokenId",type:"uint256",value:e.id}],outputs:[{kind:o.FunctionOutputKind.Owner,name:"owner",type:"address"}]}},assetsOfOwnerByIndex:[]},events:{transfer:[]},hash:function(e){return e.address+"-"+e.id}}},8176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.APENFTExchangeSchemas=void 0;var n=r(307),i={inputs:[{components:[{internalType:"address",name:"exchange",type:"address"},{internalType:"address",name:"maker",type:"address"},{internalType:"address",name:"taker",type:"address"},{internalType:"uint256",name:"makerRelayerFee",type:"uint256"},{internalType:"uint256",name:"takerRelayerFee",type:"uint256"},{internalType:"uint256",name:"makerProtocolFee",type:"uint256"},{internalType:"uint256",name:"takerProtocolFee",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"},{internalType:"enum DataType.FeeMethod",name:"feeMethod",type:"uint8"},{internalType:"enum SaleKindInterface.Side",name:"side",type:"uint8"},{internalType:"enum SaleKindInterface.SaleKind",name:"saleKind",type:"uint8"},{internalType:"address",name:"target",type:"address"},{internalType:"enum DataType.HowToCall",name:"howToCall",type:"uint8"},{internalType:"bytes",name:"dataToCall",type:"bytes"},{internalType:"bytes",name:"replacementPattern",type:"bytes"},{internalType:"address",name:"staticTarget",type:"address"},{internalType:"bytes",name:"staticExtradata",type:"bytes"},{internalType:"address",name:"paymentToken",type:"address"},{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"uint256",name:"extra",type:"uint256"},{internalType:"uint256",name:"listingTime",type:"uint256"},{internalType:"uint256",name:"expirationTime",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"}],internalType:"struct DataType.Order",name:"order",type:"tuple"},{components:[{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct DataType.Sig",name:"sig",type:"tuple"}],name:"cancelOrder",outputs:[],stateMutability:"nonpayable",type:"function"},o={inputs:[{components:[{internalType:"address",name:"exchange",type:"address"},{internalType:"address",name:"maker",type:"address"},{internalType:"address",name:"taker",type:"address"},{internalType:"uint256",name:"makerRelayerFee",type:"uint256"},{internalType:"uint256",name:"takerRelayerFee",type:"uint256"},{internalType:"uint256",name:"makerProtocolFee",type:"uint256"},{internalType:"uint256",name:"takerProtocolFee",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"},{internalType:"enum DataType.FeeMethod",name:"feeMethod",type:"uint8"},{internalType:"enum SaleKindInterface.Side",name:"side",type:"uint8"},{internalType:"enum SaleKindInterface.SaleKind",name:"saleKind",type:"uint8"},{internalType:"address",name:"target",type:"address"},{internalType:"enum DataType.HowToCall",name:"howToCall",type:"uint8"},{internalType:"bytes",name:"dataToCall",type:"bytes"},{internalType:"bytes",name:"replacementPattern",type:"bytes"},{internalType:"address",name:"staticTarget",type:"address"},{internalType:"bytes",name:"staticExtradata",type:"bytes"},{internalType:"address",name:"paymentToken",type:"address"},{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"uint256",name:"extra",type:"uint256"},{internalType:"uint256",name:"listingTime",type:"uint256"},{internalType:"uint256",name:"expirationTime",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"}],internalType:"struct DataType.Order",name:"buy",type:"tuple"},{components:[{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct DataType.Sig",name:"buySig",type:"tuple"},{components:[{internalType:"address",name:"exchange",type:"address"},{internalType:"address",name:"maker",type:"address"},{internalType:"address",name:"taker",type:"address"},{internalType:"uint256",name:"makerRelayerFee",type:"uint256"},{internalType:"uint256",name:"takerRelayerFee",type:"uint256"},{internalType:"uint256",name:"makerProtocolFee",type:"uint256"},{internalType:"uint256",name:"takerProtocolFee",type:"uint256"},{internalType:"address",name:"feeRecipient",type:"address"},{internalType:"enum DataType.FeeMethod",name:"feeMethod",type:"uint8"},{internalType:"enum SaleKindInterface.Side",name:"side",type:"uint8"},{internalType:"enum SaleKindInterface.SaleKind",name:"saleKind",type:"uint8"},{internalType:"address",name:"target",type:"address"},{internalType:"enum DataType.HowToCall",name:"howToCall",type:"uint8"},{internalType:"bytes",name:"dataToCall",type:"bytes"},{internalType:"bytes",name:"replacementPattern",type:"bytes"},{internalType:"address",name:"staticTarget",type:"address"},{internalType:"bytes",name:"staticExtradata",type:"bytes"},{internalType:"address",name:"paymentToken",type:"address"},{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"uint256",name:"extra",type:"uint256"},{internalType:"uint256",name:"listingTime",type:"uint256"},{internalType:"uint256",name:"expirationTime",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"}],internalType:"struct DataType.Order",name:"sell",type:"tuple"},{components:[{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],internalType:"struct DataType.Sig",name:"sellSig",type:"tuple"},{internalType:"bytes32",name:"metadata",type:"bytes32"}],name:"orderMatch",outputs:[],stateMutability:"nonpayable",type:"function"};t.APENFTExchangeSchemas={functions:{orderMatch:function(e){return{type:n.AbiType.Function,name:"orderMatch",payable:!1,constant:!1,stateMutability:n.StateMutability.Nonpayable,target:e.address,inputs:[{kind:n.FunctionInputKind.Data,components:o.inputs[0].components,name:o.inputs[0].name,type:"tuple"},{kind:n.FunctionInputKind.Data,components:o.inputs[1].components,name:o.inputs[1].name,type:"tuple"},{kind:n.FunctionInputKind.Data,components:o.inputs[2].components,name:o.inputs[2].name,type:"tuple"},{kind:n.FunctionInputKind.Data,components:o.inputs[3].components,name:o.inputs[3].name,type:"tuple"},{kind:n.FunctionInputKind.Data,name:"metadata",type:"bytes32"}],outputs:[]}},orderCancel:function(e){return{type:n.AbiType.Function,name:"cancelOrder",payable:!1,constant:!1,stateMutability:n.StateMutability.Nonpayable,target:e.address,inputs:[{kind:n.FunctionInputKind.Data,components:i.inputs[0].components,name:i.inputs[0].name,type:"tuple"},{kind:n.FunctionInputKind.Data,components:i.inputs[1].components,name:i.inputs[1].name,type:"tuple"}],outputs:[]}}}}},9792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.APENFTRegistrySchemas=void 0;var n=r(307);t.APENFTRegistrySchemas={address:"",functions:{registerProxy:function(e){return{type:n.AbiType.Function,name:"registerProxy",payable:!1,constant:!1,stateMutability:n.StateMutability.Nonpayable,target:e.address,inputs:[],outputs:[]}},accountProxy:function(e){return{type:n.AbiType.Function,name:"proxies",payable:!1,constant:!0,stateMutability:n.StateMutability.View,target:e.address,inputs:[{kind:n.FunctionInputKind.Owner,name:"account",type:"address"}],outputs:[{kind:n.FunctionOutputKind.Other,name:"proxy",type:"address"}]}}}}},2079:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransferSchemas=t.getApproveSchemas=t.getIsApproveSchemas=t.getBalanceSchemas=t.common=t.schemas=t.getParams=t.encodeParamsCall=t.encodeWeb3Call=t.encodeCall=t.encodeSell=t.encodeBuy=void 0;var n=r(3005),i=r(5248),o=r(9792),a=r(8176),s=r(8705),u=r(4621),l=r(5492),c=r(307),f=r(6797);Object.defineProperty(t,"encodeBuy",{enumerable:!0,get:function(){return f.encodeBuy}}),Object.defineProperty(t,"encodeSell",{enumerable:!0,get:function(){return f.encodeSell}}),Object.defineProperty(t,"encodeCall",{enumerable:!0,get:function(){return f.encodeCall}}),Object.defineProperty(t,"encodeWeb3Call",{enumerable:!0,get:function(){return f.encodeWeb3Call}}),Object.defineProperty(t,"encodeParamsCall",{enumerable:!0,get:function(){return f.encodeParamsCall}}),Object.defineProperty(t,"getParams",{enumerable:!0,get:function(){return f.getParams}}),t.schemas={tron:n.tronSchemas,shasta:i.shastaSchemas},t.common={APENFTRegistrySchemas:o.APENFTRegistrySchemas,APENFTExchangeSchemas:a.APENFTExchangeSchemas,ERC20Schema:s.ERC20Schema,ERC721Schema:u.ERC721Schema,ERC1155Schema:l.ERC1155Schema},t.getBalanceSchemas=function(e){var t=e.asset.address,r=e.asset.id,n=e.schema,i=l.ERC1155Schema.functions.countOf({address:t,id:r});return n===c.APENFTSchemaName.ERC721&&(i=u.ERC721Schema.functions.ownerOf({address:t,id:r})),i},t.getIsApproveSchemas=function(e){var t=e.asset.address,r=e.schema,n=l.ERC1155Schema.functions.isApprove({address:t});return r===c.APENFTSchemaName.ERC721&&(n=u.ERC721Schema.functions.isApprove({address:t})),n},t.getApproveSchemas=function(e){var t=e.asset.address,r=e.schema,n=l.ERC1155Schema.functions.approve({address:t});return r===c.APENFTSchemaName.ERC721&&(n=u.ERC721Schema.functions.approve({address:t})),n},t.getTransferSchemas=function(e){var t,r=e.asset.address,n="0x";"quantity"in e.asset&&(t=e.asset.quantity),"data"in e.asset&&(n=e.asset.data||n);var i=e.asset.id,o=e.schema,a=l.ERC1155Schema.functions.transfer({address:r,id:i,quantity:t,data:n});return o===c.APENFTSchemaName.ERC721&&(a=u.ERC721Schema.functions.transfer({address:r,id:i})),c.APENFTSchemaName.ERC1155,a}},6797:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDefaultCall=t.encodeBuy=t.encodeSell=t.encodeParamsCall=t.getParams=t.encodeWeb3Call=t.encodeCall=t.encodeReplacementPattern=void 0;var o=r(3119),a=r(2751),s=r(307),u=i(r(3666)),l=function(e){switch(e){case"address":case"bytes20":return"0x0000000000000000000000000000000000000000";case"bytes32":return"0x0000000000000000000000000000000000000000000000000000000000000000";case"bool":return!1;case"int":case"uint":case"uint8":case"uint16":case"uint32":case"uint64":case"uint256":return 0;default:throw"Default value not yet implemented for type: "+e}},c=function(e,t,r){var i=[],a=[],s=e.inputs.reduce((function(e,t){var r=t.type.match(/\[(.+)\]$/);return e+(r?32*parseInt(r[1],10):32)}),0);e.inputs.map((function(e){var r=e.kind,n=e.type,i=e.value;return{bitmask:t.includes(r)?255:0,type:(0,o.elementaryName)(n),value:void 0!==i?i:l(n)}})).reduce((function(e,t){var r=t.bitmask,u=t.type,l=t.value,c=n.alloc((0,o.encodeSingle)(u,l).length).fill(r);if((0,o.isDynamic)(u)){if(r)throw"Replacement is not supported for dynamic parameters.";return i.push(n.alloc((0,o.encodeSingle)("uint256",s).length)),a.push(c),e+c.length}return i.push(c),e}),s);var u=n.alloc(4),c=n.concat([u,n.concat(i.concat(a))]);return r?"0x".concat(c.toString("hex")):c.map((function(e){return e?1:0})).join("")};t.encodeReplacementPattern=function(e,t,r){return void 0===t&&(t=s.FunctionInputKind.Replaceable),void 0===r&&(r=!0),c(e,[t],r)},t.encodeCall=function(e,t){var r=e.inputs.map((function(e){return e.type}));return(0,a.bufferToHex)(o.ABI.methodID(e.name,r))+u.default.utils.abi.encodeParamsV2ByABI(e,t).substring(2)},t.encodeWeb3Call=function(e,r){return(0,t.encodeCall)(e,r)},t.getParams=function(e,t){var r=t.owner,n=t.replace;return e.inputs.map((function(e){switch(e.kind){case s.FunctionInputKind.Replaceable:return n;case s.FunctionInputKind.Owner:return r;default:return e.value}}))},t.encodeParamsCall=function(e,r){var n=r.owner,i=r.replace,o=(0,t.getParams)(e,{owner:n,replace:i});return(0,t.encodeCall)(e,o)},t.encodeSell=function(e,r,n){var i=e.functions.transfer(r);return{target:i.target,dataToCall:(0,t.encodeDefaultCall)(i,n),replacementPattern:(0,t.encodeReplacementPattern)(i)}},t.encodeBuy=function(e,r,n,i){var o=e.functions.transfer(r),a=o.inputs.filter((function(e){return e.kind===s.FunctionInputKind.Replaceable})),u=o.inputs.filter((function(e){return e.kind===s.FunctionInputKind.Owner}));1!==a.length&&function(e){throw"Error"}(a.length);var f=o.inputs.map((function(e){switch(e.kind){case s.FunctionInputKind.Replaceable:return n;case s.FunctionInputKind.Owner:return l(e.type);default:return e.value.toString()}})),d=(0,t.encodeCall)(o,f),h="0x";return u.length>0&&(h=i===s.OfferType.ContractOffer?c(o,[s.FunctionInputKind.Owner,s.FunctionInputKind.Asset],!0):(0,t.encodeReplacementPattern)(o,s.FunctionInputKind.Owner)),{target:o.target,dataToCall:d,replacementPattern:h}},t.encodeDefaultCall=function(e,r){var n=e.inputs.map((function(e){switch(e.kind){case s.FunctionInputKind.Replaceable:return l(e.type);case s.FunctionInputKind.Owner:return r;case s.FunctionInputKind.Asset:case s.FunctionInputKind.Count:default:return e.value}}));return(0,t.encodeCall)(e,n)}},5248:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shastaSchemas=void 0;var n=r(5492),i=r(8705),o=r(4621);t.shastaSchemas=[i.ERC20Schema,o.ERC721Schema,n.ERC1155Schema]},3005:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tronSchemas=void 0;var n=r(5492),i=r(8705),o=r(4621);t.tronSchemas=[i.ERC20Schema,o.ERC721Schema,n.ERC1155Schema]},8447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tokens=void 0;var n=r(2931),i=r(5192);t.tokens={tron:n.tronTokens,shasta:i.shastaTokens}},5192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shastaTokens=void 0,t.shastaTokens={otherTokens:[{name:"WTRX",symbol:"WTRX",decimals:6,address:"TF2ipqRnrDzuPrANJCJggmaM753FCE1ZWE"}]}},2931:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tronTokens=void 0,t.tronTokens={otherTokens:[{name:"WTRX",symbol:"WTRX",decimals:6,address:"TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR"}]}},4413:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var s=r(307),u=r(2079),l=r(3553),c=r(8033),f=r(3119),d=r(2184),h=r(2536),p=function(e){function t(t,r){var n,i,o=this;return(o=e.call(this,t,r)||this).accountProxy=l.NULL_ADDRESS,o.account=r.account||(null===(n=t.defaultAddress)||void 0===n?void 0:n.base58)||"",(null===(i=o.account)||void 0===i?void 0:i.length)>0&&o.account,o.accountProxy=l.NULL_ADDRESS,o.contracts=new h.Contracts(t,r),o}return i(t,e),t.prototype.getTokenApprove=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(o){switch(o.label){case 0:return[4,this.checkTokenTransferProxy(e.address)];case 1:return r=o.sent(),n=r.gte(t),[4,this.getTokenBalances(e.address)];case 2:return i=o.sent(),[2,{isApprove:n,balances:i}]}}))}))},t.prototype.getAssetApprove=function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(o){switch(o.label){case 0:return[4,this.checkAssetTransferProxy(e)];case 1:return r=o.sent(),[4,this.getAssetBalances(e)];case 2:return n=o.sent(),i=(null===(t=e.asset)||void 0===t?void 0:t.quantity)||"1",[2,{isApprove:r=r&&new l.BigNumber(n).gte(i),balances:n}]}}))}))},t.prototype.orderApprove=function(e){var t=e.metadata,r=e.paymentToken,n=e.side,i=e.basePrice;return o(this,void 0,void 0,(function(){var e,o,u,c,f,d,h,p;return a(this,(function(a){switch(a.label){case 0:return n!=s.OrderSide.Sell?[3,6]:(e={metadata:t,paymentTokenApprove:{isApprove:!1,func:this.approveTokenTransferProxy,balances:"0"},sellAssetApprove:{isApprove:!1,func:this.approveAssetTransferProxy,balances:"0"}},[4,this.getAssetApprove(t)]);case 1:return o=a.sent(),e.sellAssetApprove.isApprove=o.isApprove,e.sellAssetApprove.balances=o.balances,r.address===l.NULL_ADDRESS?[3,3]:[4,this.getTokenApprove(r,i)];case 2:return u=a.sent(),h=u.isApprove,p=u.balances,e.paymentTokenApprove.isApprove=h,e.paymentTokenApprove.balances=p,[3,5];case 3:return e.paymentTokenApprove.isApprove=!0,c=e.paymentTokenApprove,[4,this.web3.trx.getBalance(this.account)];case 4:c.balances=a.sent(),a.label=5;case 5:return[2,e];case 6:return f={paymentTokenApprove:{isApprove:!1,balances:"",func:this.approveTokenTransferProxy},metadata:t},r.address===l.NULL_ADDRESS?[3,8]:[4,this.getTokenApprove(r,i)];case 7:return d=a.sent(),h=d.isApprove,p=d.balances,f.paymentTokenApprove.isApprove=h,f.paymentTokenApprove.balances=p,[3,9];case 8:throw"Error";case 9:return[2,f]}}))}))},t.prototype.getOrderApproveStep=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s;return a(this,(function(a){return n=(0,c.assetToMetadata)(e.asset,e.quantity?String(e.quantity):"1"),i=e.paymentToken||this.TRX,o=new l.BigNumber(10).pow(i.decimals),s=new l.BigNumber(r).times(o),[2,this.orderApprove({metadata:n,paymentToken:i,side:t,basePrice:s})]}))}))},t.prototype.orderApproveCalldata=function(e){var t=e.metadata,r=e.paymentToken,n=e.side,i=e.basePrice;return o(this,void 0,void 0,(function(){var e,o,u,c,f,d,h,p,m,y,g;return a(this,(function(a){switch(a.label){case 0:return n!=s.OrderSide.Sell?[3,8]:[4,this.getAccountProxy(t.schema)];case 1:return e=a.sent(),y={metadata:t,paymentTokenApprove:{isApprove:!1,calldata:this.approveTokenTransferProxyCalldata(r.address),balances:"0"}},g={isApprove:!1},[4,this.approveAssetTransferProxyCalldata(t,e)];case 2:return y.sellAssetApprove=(g.calldata=a.sent(),g.balances="0",g),o=y,[4,this.getAssetApprove(t)];case 3:return u=a.sent(),o.sellAssetApprove.isApprove=u.isApprove,o.sellAssetApprove.balances=u.balances,r.address===l.NULL_ADDRESS?[3,5]:[4,this.getTokenApprove(r,i)];case 4:return c=a.sent(),p=c.isApprove,m=c.balances,o.paymentTokenApprove.isApprove=p,o.paymentTokenApprove.balances=m,[3,7];case 5:return o.paymentTokenApprove.isApprove=!0,f=o.paymentTokenApprove,[4,this.web3.trx.getBalance(this.account)];case 6:f.balances=a.sent(),a.label=7;case 7:return[2,o];case 8:return d={paymentTokenApprove:{isApprove:!1,balances:"",calldata:this.approveTokenTransferProxyCalldata(r.address)},metadata:t},r.address===l.NULL_ADDRESS?[3,10]:[4,this.getTokenApprove(r,i)];case 9:return h=a.sent(),p=h.isApprove,m=h.balances,d.paymentTokenApprove.isApprove=p,d.paymentTokenApprove.balances=m,[3,11];case 10:throw"Error";case 11:return[2,d]}}))}))},t.prototype.getAccountProxy=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return e===s.APENFTSchemaName.ERC1155?[2,Promise.resolve(this.erc1155AssetProxy)]:[2,Promise.resolve(this.erc721AssetProxy)]}))}))},t.prototype.checkTokenTransferProxy=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){return t=this.erc20AssetProxy,r=this.Erc20Func.isApprove({address:e}),n=(0,u.encodeParamsCall)(r,{owner:this.account,replace:t}),i=(0,u.getParams)(r,{owner:this.account,replace:t}),o={functionSelector:f.ABI.methodSig(r),parameters:f.ABI.paramsArray(r.inputs,i)},s={to:e,data:n,rawData:o},[2,this.tronCall(s,null==r?void 0:r.outputs)]}))}))},t.prototype.getTokenBalances=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,l,c;return a(this,(function(a){switch(a.label){case 0:return r=t||this.account,n=this.Erc20Func.countOf({address:e}),i=(0,u.encodeParamsCall)(n,{owner:r}),o=(0,u.getParams)(n,{owner:r}),s={functionSelector:f.ABI.methodSig(n),parameters:f.ABI.paramsArray(n.inputs,o)},l={to:e,data:i,rawData:s},[4,this.tronCall(l,null==n?void 0:n.outputs)];case 1:return c=a.sent(),[2,new Promise((function(e){return e(c.toString())}))]}}))}))},t.prototype.getAssetBalances=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,l,c;return a(this,(function(a){switch(a.label){case 0:return r=t||this.account,n=(0,u.getBalanceSchemas)(e),i=(0,u.encodeParamsCall)(n,{owner:r}),o=(0,u.getParams)(n,{owner:r}),s={functionSelector:f.ABI.methodSig(n),parameters:f.ABI.paramsArray(n.inputs,o)},l={to:n.target,data:i,rawData:s},[4,this.tronCall(l,null==n?void 0:n.outputs)];case 1:return c=a.sent(),"address"===(null==n?void 0:n.outputs[0].type)?[2,this.web3.address.fromHex(c)===r?"1":"0"]:[2,c.toString()]}}))}))},t.prototype.approveTokenTransferProxy=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,c;return a(this,(function(a){return t=this.erc20AssetProxy,r=l.MAX_UINT_256.toString(),n=this.Erc20Func.approve({quantity:r}),i=(0,u.encodeParamsCall)(n,{replace:t}),o=(0,u.getParams)(n,{replace:t}),s={functionSelector:f.ABI.methodSig(n),parameters:f.ABI.paramsArray(n.inputs,o)},c={to:e,data:i,rawData:s},[2,this.tronSend(c,this.account)]}))}))},t.prototype.approveTokenTransferProxyCalldata=function(e){var t=this.erc20AssetProxy,r=l.MAX_UINT_256.toString(),n=this.Erc20Func.approve({quantity:r});return{to:e,data:(0,u.encodeParamsCall)(n,{replace:t})}},t.prototype.checkAssetTransferProxy=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,l,c;return a(this,(function(a){switch(a.label){case 0:return t=this.account,[4,this.getAccountProxy(e.schema)];case 1:return r=a.sent(),n=(0,u.getIsApproveSchemas)(e),i=(0,u.encodeParamsCall)(n,{owner:t,replace:r}),o=(0,u.getParams)(n,{owner:t,replace:r}),s={functionSelector:f.ABI.methodSig(n),parameters:f.ABI.paramsArray(n.inputs,o)},l={to:n.target,data:i,rawData:s},[4,this.tronCall(l,null==n?void 0:n.outputs)];case 2:return c=a.sent(),(null==n?void 0:n.outputs.some((function(e){return"address"==e.type})))?[2,this.web3.address.fromHex(c)===r]:[2,c]}}))}))},t.prototype.approveAssetTransferProxy=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this.getAccountProxy(e.schema)];case 1:return t=a.sent(),r=(0,u.getApproveSchemas)(e),n=(0,u.encodeParamsCall)(r,{owner:t,replace:!0}),i=(0,u.getParams)(r,{owner:t,replace:!0}),o={functionSelector:f.ABI.methodSig(r),parameters:f.ABI.paramsArray(r.inputs,i)},s={to:r.target,data:n,rawData:o},[2,this.tronSend(s,this.account)]}}))}))},t.prototype.approveAssetTransferProxyCalldata=function(e,t){var r=(0,u.getApproveSchemas)(e),n=(0,u.encodeParamsCall)(r,{owner:t,replace:!0});return{to:r.target,data:n}},t.prototype.orderMatch=function(e){var t=e.buy,r=e.sell,n=e.metadata,i=void 0===n?"0x0000000000000000000000000000000000000000000000000000000000000000":n;return o(this,void 0,void 0,(function(){var e,n,o,s,d,h,p,m,y,g,v;return a(this,(function(a){return e=(0,c.orderParamsEncode)(r),n=(0,c.orderSigEncode)(r),o=(0,c.orderParamsEncode)(t),s=(0,c.orderSigEncode)(t),d=[o,s,e,n,i],h=t.paymentToken==l.NULL_ADDRESS?t.basePrice:0,p=this.APENFTExchange,m=this.APENFTExchangeFunc.orderMatch({address:p}),y=(0,u.encodeWeb3Call)(m,d),g={functionSelector:f.ABI.methodSig(m),parameters:f.ABI.paramsArray(m.inputs,d)},v={to:p,data:y,value:h,rawData:g},[2,this.tronSend(v,this.account)]}))}))},t.prototype.orderCancel=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,l,d;return a(this,(function(a){return t=this.APENFTExchange,r=(0,c.orderParamsEncode)(e),n=(0,c.orderSigEncode)(e),i=this.APENFTExchangeFunc.orderCancel({address:t}),o=[r,n],s=(0,u.encodeWeb3Call)(i,o),l={functionSelector:f.ABI.methodSig(i),parameters:f.ABI.paramsArray(i.inputs,o)},d={to:t,data:s,rawData:l},[2,this.tronSend(d,this.account)]}))}))},t.prototype.assetTransfer=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,l;return a(this,(function(a){return r=this.account,n=(0,u.getTransferSchemas)(e),i=(0,u.encodeParamsCall)(n,{owner:r,replace:t}),o=(0,u.getParams)(n,{owner:r,replace:t}),s={functionSelector:f.ABI.methodSig(n),parameters:f.ABI.paramsArray(n.inputs,o)},l={to:n.target,data:i,rawData:s},[2,this.tronSend(l,r)]}))}))},t.prototype.accountApprove=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:switch(String(e.code)){case"1101":return[3,1];case"1102":return[3,3];case"1106":return[3,5]}return[3,7];case 1:return[4,this.approveTokenTransferProxy(e.data.erc20Address)];case 2:case 4:case 6:return[2,t.sent()];case 3:case 5:return[4,this.approveAssetTransferProxy(e.data.order.metadata)];case 7:throw e}}))}))},t}(d.ContractSchemas);t.Account=p},7280:function(e,t,r){"use strict";var n=r(5108),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.initApprove=t.isBuyOrderHandle=t.isSellOrderHandle=void 0;var a=r(8913),s=r(307);t.isSellOrderHandle=function(e){return e===s.MakeOrderType.FixPriceOrder||e===s.MakeOrderType.DutchAuctionOrder||e===s.MakeOrderType.EnglishAuctionOrder},t.isBuyOrderHandle=function(e){return e===s.MakeOrderType.MakeOfferOrder||e===s.MakeOrderType.EnglishAuctionBiddingOrder},t.initApprove=function(e){var r=e.APENFTOrders,s=e.orderType,u=e.orderParams;return i(void 0,void 0,void 0,(function(){var e,i,l,c,f,d,h,p,m,y,g,v,b,w;return o(this,(function(o){switch(o.label){case 0:return e=(0,t.isSellOrderHandle)(s),i=(0,t.isBuyOrderHandle)(s),l=r.account.APENFTSharedAssetAddr===u.asset.tokenAddress,c=""===(null===(h=null==u?void 0:u.paymentToken)||void 0===h?void 0:h.address)||void 0===(null===(p=null==u?void 0:u.paymentToken)||void 0===p?void 0:p.address)||(null===(m=null==u?void 0:u.paymentToken)||void 0===m?void 0:m.address)===a.NULL_ADDRESS,e?[4,r.account.getOrderApproveStep(u,1,null==u?void 0:u.startAmount)]:[3,7];case 1:return!("paymentTokenApprove"in(f=o.sent()))||c||f.paymentTokenApprove.isApprove?[3,4]:[3,2];case 2:return[4,null===(y=f.paymentTokenApprove)||void 0===y?void 0:y.func.call(null==r?void 0:r.account,null===(g=null==u?void 0:u.paymentToken)||void 0===g?void 0:g.address)];case 3:d=o.sent(),n.log("paymentTokenApprove app"),n.log(d),o.label=4;case 4:return!("sellAssetApprove"in f)||l||f.sellAssetApprove.isApprove?[3,7]:[3,5];case 5:return[4,null===(v=f.sellAssetApprove)||void 0===v?void 0:v.func.call(r.account,null==f?void 0:f.metadata)];case 6:d=o.sent(),n.log("sellAssetApprove app"),n.log(d),o.label=7;case 7:return i?[4,r.account.getOrderApproveStep(u,0,null==u?void 0:u.startAmount)]:[3,11];case 8:return!("paymentTokenApprove"in(f=o.sent()))||c||f.paymentTokenApprove.isApprove?[3,11]:[3,9];case 9:return[4,null===(b=f.paymentTokenApprove)||void 0===b?void 0:b.func.call(null==r?void 0:r.account,null===(w=null==u?void 0:u.paymentToken)||void 0===w?void 0:w.address)];case 10:d=o.sent(),n.log("paymentTokenApprove app"),n.log(d),o.label=11;case 11:return[2,!0]}}))}))}},7389:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fetch=void 0;var s,u=a(r(204));s="undefined"==typeof window?u.default:window.fetch.bind(window);var l=function(){function e(e){this.apiBaseUrl=e,this.authToken=""}return e.prototype.get=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this._fetch(e)];case 1:return[2,t.sent().json()]}}))}))},e.prototype.post=function(e,t,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){var i,a,s;return o(this,(function(o){switch(o.label){case 0:return i=n({method:"POST",body:t?JSON.stringify(t):void 0,headers:{Accept:"application/json","Content-Type":"application/json"}},r),[4,this._fetch(e,i)];case 1:return(a=o.sent()).ok?[4,a.json()]:[3,3];case 2:return(s=o.sent()).data?[2,s.data]:[2,s];case 3:return[2,a];case 4:return[2]}}))}))},e.prototype.put=function(e,t,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post(e,t,n({method:"PUT"},r))]}))}))},e.prototype._fetch=function(e,t){return void 0===t&&(t={}),i(this,void 0,void 0,(function(){var r,a,u,l,c=this;return o(this,(function(f){return r=this.apiBaseUrl,a=this.authToken,u=r+e,l=n(n({},t),{headers:n(n({},a?{Authorization:a}:{}),t.headers||{})}),[2,s(u,l).then((function(e){return i(c,void 0,void 0,(function(){return o(this,(function(t){return[2,this._handleApiResponse(e)]}))}))}))]}))}))},e.prototype._handleApiResponse=function(e){return i(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){switch(n.label){case 0:if(e.ok)return[2,e];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.text()];case 2:return t=n.sent(),t=JSON.parse(t),[3,4];case 3:return n.sent(),[3,4];case 4:switch(e.status){case 400:r=t&&t.errors?t.errors.join(", "):"Invalid request: ".concat(JSON.stringify(t));break;case 401:case 403:r="Unauthorized. Full message was '".concat(JSON.stringify(t),"'");break;case 404:r="Not found. Full message was '".concat(JSON.stringify(t),"'");break;case 500:r="Internal server error. OpenSea has been alerted, but if the problem persists please contact us via Discord: https://discord.gg/ga8EJbv - full message was ".concat(JSON.stringify(t));break;case 503:r="Service unavailable. Please try again in a few minutes. If the problem persists please contact us via Discord: https://discord.gg/ga8EJbv - full message was ".concat(JSON.stringify(t));break;default:r="Message: ".concat(JSON.stringify(t))}throw new Error("API Error ".concat(e.status,": ").concat(r))}}))}))},e.prototype.throwOrContinue=function(e,t){var r=!!e.message&&(e.message.includes("503")||e.message.includes("429"));if(t<=0||!r)throw e},e}();t.Fetch=l},2184:function(e,t,r){"use strict";var n,i=r(5108),o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractSchemas=void 0;var l=u(r(4431)),c=r(7187),f=u(r(5504)),d=r(3553),h=r(2079),p=r(8447),m=r(8913),y=function(e){function t(t,r){var n=e.call(this)||this;n.TRX={name:"tron",symbol:"TRX",address:d.NULL_ADDRESS,decimals:6};var i=r.networkName;n.paymentTokenList=p.tokens[i].otherTokens,n.networkName=i,n.chainId=m.CHAIN_ID[i];var o=m.CONTRACTS_ADDRESSES[i],a=o.ExchangeHelper,s=o.APENFTExchange,u=o.APENFTSharedAsset,l=o.APENFTExchangeKeeper,c=o.FeeRecipientAddress,f=o.ERC20AssetProxy,y=o.ERC721AssetProxy,g=o.ERC1155AssetProxy,v=o.WTRX;if(n.contractsAddr=o,n.WTRXAddr=v,n.WTRXToken={name:"tron",symbol:"WTRX",address:v,decimals:18},n.APENFTSharedAssetAddr=u,n.APENFTExchangeKeeperAddr=l,n.feeRecipientAddress=c,!a||!s)throw new Error("".concat(n.networkName," abi undefined"));return n.web3=t,n.APENFTExchange=s,n.erc20AssetProxy=f,n.erc721AssetProxy=y,n.erc1155AssetProxy=g,n.Erc20Func=h.common.ERC20Schema.functions,n.APENFTRegistryFunc=h.common.APENFTRegistrySchemas.functions,n.APENFTExchangeFunc=h.common.APENFTExchangeSchemas.functions,n}return o(t,e),t.prototype.getGasPrice=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){return[2,0]}))}))},t.prototype.tronCall=function(e,t){return a(this,void 0,void 0,(function(){var r,n,o,a,u,c=this;return s(this,(function(s){return r=e.to,e.data,n=e.rawData,o=n.functionSelector,a=n.parameters,u={from:this.web3.defaultAddress.hex,callValue:0,_isConstant:!0,feeLimit:1e9},[2,new Promise((function(e,n){c.web3.transactionBuilder.triggerSmartContract(r,o,u,a,!!u.from&&c.web3.address.toHex(u.from)).then((function(r){c.web3.utils.hasProperty(r,"constant_result")||n("Failed to execute");var o=r.constant_result[0].length;if(0===o||o%64==8){var a="The call has been reverted or has thrown an error.";if(0!==o){a+=" Error message: ";for(var s="",u=r.constant_result[0].substring(8),f=0;f<o-8;f+=64)s+=c.web3.toUtf8(u.substring(f,f+64));a+=s.replace(/(\u0000|\u000b|\f)+/g," ").replace(/ +/g," ").replace(/\s+$/g,"")}n(a)}var d=c.web3.utils.abi.decodeParamsV2ByABI({outputs:t},"0x"+r.constant_result[0]);if(1===d.length&&"object"==typeof(d=d[0])&&d&&d._isBigNumber)try{d=new l.default(d.toString())}catch(e){i.log("failed while converting output to BigNumber",e)}e(d)})).catch((function(e){n(e)}))}))]}))}))},t.prototype.tronSend=function(e,t){return a(this,void 0,void 0,(function(){var t,r,n,i,o,u,l,c,d,h,p,m,y=this;return s(this,(function(g){switch(g.label){case 0:return t=e.to,e.data,r=e.value,n=e.rawData,i=n.functionSelector,o=n.parameters,u={from:this.web3.defaultAddress.base58,callValue:r||0,shouldPollResponse:!0},l=(0,f.default)(),[4,this.web3.transactionBuilder.triggerSmartContract(t,i,u,o)];case 1:return c=g.sent(),[4,this.web3.trx.sign(c.transaction)];case 2:return(d=g.sent()).signature?[4,this.web3.trx.sendRawTransaction(d)]:[2,Promise.reject("Transaction was not signed properly")];case 3:return(h=g.sent()).code&&(p={error:h.code,message:h.code},h.message&&(p.message=this.web3.toUtf8(h.message)),l.reject(p)),u.shouldPollResponse?(m=function(e){return void 0===e&&(e=0),a(y,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(a){switch(a.label){case 0:return 30===e?[2,l.reject({error:"Cannot find result in solidity node",transaction:d})]:[4,this.web3.trx.getUnconfirmedTransactionInfo(d.txID)];case 1:return t=a.sent(),Object.keys(t).length?(t.receipt&&l.eventEmitter.emit("receipt",{transaction:d,output:t}),t.result&&"FAILED"===t.result||t.receipt&&"SUCCESS"!==t.receipt.result?[2,l.reject({error:this.web3.toUtf8(t.resMessage),transaction:d,output:t})]:"contractResult"in t?[4,this.web3.trx.getBlock("latest")]:[2,l.reject({error:"Failed to execute: "+JSON.stringify(t,null,2),transaction:d,output:t})]):[2,setTimeout((function(){m(e+1)}),2e3)];case 2:return r=a.sent(),n=r.block_header.raw_data.number,i=t.blockNumber,(o=n-i)>4&&(l.eventEmitter.emit("confirmation",o,t,d),"contract_address"in t)?(t.contract_address=this.web3.address.fromHex(t.contract_address),[2,l.resolve(t)]):(l.eventEmitter.emit("confirming",o,t,d),setTimeout((function(){m(e+1)}),2e3),[2])}}))}))},m(),[2,Promise.resolve({txHash:d.txID,txSend:l.eventEmitter})]):(l.resolve(d.txID),l.eventEmitter.emit("transactionHash",d.txID),[2,Promise.resolve({txHash:d.txID,txSend:l.eventEmitter})])}}))}))},t}(c.EventEmitter);t.ContractSchemas=y},2536:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Contracts=void 0;var a=r(7187),s=o(r(8845)),u=o(r(7489)),l=o(r(8520)),c=o(r(2994)),f=o(r(9533)),d=o(r(5076)),h=o(r(9980)),p=o(r(9783)),m=o(r(8129)),y=r(8913),g=r(8447),v=function(e){function t(t,r){var n=e.call(this)||this;n.TRX={name:"tron",symbol:"TRX",address:y.NULL_ADDRESS,decimals:6};var i=r.networkName;n.paymentTokenList=g.tokens[i].otherTokens,n.networkName=i;var o=y.CONTRACTS_ADDRESSES[i],a=o.ExchangeHelper,v=o.APENFTExchange,b=o.APENFTSharedAsset,w=o.APENFTExchangeKeeper,A=o.FeeRecipientAddress,_=o.WTRX,S=o.ERC20AssetProxy,M=o.ERC721AssetProxy,x=o.ERC1155AssetProxy,T=o.FactoryContract;if(n.contractsAddr=o,n.WTRXAddr=_,n.WTRXToken={name:"tron",symbol:"WTRX",address:_,decimals:18},n.APENFTSharedAssetAddr=b,n.APENFTExchangeKeeperAddr=w,n.feeRecipientAddress=A,n.erc20AssetProxyAddr=S,n.erc721AssetProxyAddr=M,n.erc1155AssetProxyAddr=x,n.factoryContractAddr=T,!a||!v)throw new Error("".concat(n.networkName," abi undefined"));return n.exchangeHelper=t.contract(h.default.abi,a),n.exchange=t.contract(d.default.abi,v),n.erc20AssetProxy=t.contract(p.default.abi,S),n.APENFTSharedAsset=t.contract(f.default.abi,b),T&&T.length>0&&(n.factoryContract=t.contract(m.default.abi,T)),n.erc20=t.contract(u.default.abi),n.erc721=t.contract(l.default.abi),n.erc1155=t.contract(c.default.abi),n.authenticatedProxy=t.contract(s.default.abi),n.web3=t,t.contract().constructor.prototype.clone=function(){return new this.constructor(this.tronWeb,this.abi,this.address)},n}return i(t,e),t}(a.EventEmitter);t.Contracts=v},4603:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.APENFTOrders=void 0;var l=u(r(4431)),c=r(4045),f=r(8047),d=r(4413),h=r(8334),p=r(307),m=r(8033),y=r(7919),g=function(e){function t(t,r,n){var i,o=this;return(o=e.call(this,r)||this).accountAddress="",o.accountAddress=(null==n?void 0:n.address)||(null===(i=t.defaultAddress)||void 0===i?void 0:i.base58)||"",o.orders=new f.Orders(t,r),o.account=new d.Account(t,r),o.assetFactory=new h.AssetFactory(t,r),o.walletProvider=t,o}return i(t,e),t.prototype.ordersCancelSign=function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,(0,m.web3Sign)(this.account.web3,e,this.accountAddress)];case 1:return t=r.sent(),[2,{hash:e,signature:t}]}}))}))},t.prototype.getAssetOrderVersion=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(a){switch(a.label){case 0:return t={contractAddress:e.tokenAddress,tokenId:e.tokenId,chain:this.chain,chainId:this.walletChainId},[4,this.ordersVersion(t)];case 1:if(!(r=a.sent()).isTradable)throw"Error";return n=o({},e),i=this.orders.APENFTSharedAssetAddr,1===r.orderVersion&&t.contractAddress===i&&r.uri&&!e.data?n=o(o({},e),{data:r.uri}):e.schemaName===p.APENFTSchemaName.ERC1155&&0===r.orderVersion&&(n=o(o({},e),{data:""})),[2,{orderVersion:r,newAsset:n}]}}))}))},t.prototype.createSellOrder=function(e){var t=e.asset,r=e.quantity,n=void 0===r?1:r,i=e.paymentToken,u=void 0===i?this.orders.TRX:i,l=e.listingTime,c=void 0===l?0:l,f=e.expirationTime,d=void 0===f?0:f,h=e.startAmount,p=e.endAmount,m=e.buyerAddress;return a(this,void 0,void 0,(function(){var e,r,i,a,l,f;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetOrderVersion(t)];case 1:return e=s.sent(),r=e.orderVersion,i=e.newAsset,a={asset:i,quantity:n,paymentTokenObj:u,accountAddress:this.accountAddress,startAmount:h,endAmount:p,listingTime:c,expirationTime:d,buyerAddress:m},[4,this.orders.createSellOrder(a)];case 2:return(l=s.sent())?(f=o(o({},l),{version:r.orderVersion}),[2,this.ordersPost({order:f})]):[2]}}))}))},t.prototype.createAuctionOrder=function(e){var t=e.asset,r=e.quantity,n=e.paymentToken,i=e.expirationTime,u=e.startAmount,l=e.englishAuctionReservePrice;return a(this,void 0,void 0,(function(){var e,a,c,f,d,h;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetOrderVersion(t)];case 1:return e=s.sent(),a=e.orderVersion,c=e.newAsset,f={asset:c,quantity:r,paymentTokenObj:n,accountAddress:this.accountAddress,startAmount:u,englishAuctionReservePrice:l,expirationTime:i,waitForHighestBid:!0},[4,this.orders.createSellOrder(f)];case 2:return(d=s.sent())?(h=o(o({},d),{version:a.orderVersion}),[2,this.ordersPost({order:h})]):[2]}}))}))},t.prototype.createBiddingOrder=function(e){var t=e.asset,r=(e.quantity,e.paymentToken),n=e.startAmount,i=e.bestAsk;return a(this,void 0,void 0,(function(){var e,a,u,l,c,f,d,h;return s(this,(function(s){switch(s.label){case 0:return 0===(null==i?void 0:i.bestAskOrderType)?[2]:(e=!!i&&JSON.parse(null==i?void 0:i.bestAskOrderString),a=this.orders.orderFromJSON(e),[4,this.getAssetOrderVersion(t)]);case 1:return u=s.sent(),l=u.orderVersion,c=u.newAsset,r=r||this.orders.WTRXToken,f={asset:c,accountAddress:this.accountAddress,startAmount:n,paymentTokenObj:r,expirationTime:null==a?void 0:a.expirationTime.toNumber(),quantity:null==a?void 0:a.quantity.toNumber(),sellOrder:a},[4,this.orders.createBuyOrder(f)];case 2:return(d=s.sent())?(h=o(o({},d),{version:l.orderVersion}),[2,this.ordersPost({order:h})]):[2]}}))}))},t.prototype.createBuyOrder=function(e){var t=e.asset,r=e.quantity,n=e.paymentToken,i=e.expirationTime,u=e.startAmount;return a(this,void 0,void 0,(function(){var e,a,l,c,f,d;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAssetOrderVersion(t)];case 1:return e=s.sent(),a=e.orderVersion,l=e.newAsset,n=n||this.orders.WTRXToken,c={asset:l,accountAddress:this.accountAddress,startAmount:u,paymentTokenObj:n,expirationTime:i,quantity:r},[4,this.orders.createBuyOrder(c)];case 2:return(f=s.sent())?(d=o(o({},f),{version:a.orderVersion}),[2,this.ordersPost({order:d})]):[2]}}))}))},t.prototype.createLowerPriceOrder=function(e){var t,r,n=e.oldOrder,i=e.parameter,u=e.asset;return a(this,void 0,void 0,(function(){var e,a,c,f,d,h,p,g,v,b,w,A,_,S,M,x;return s(this,(function(s){switch(s.label){case 0:return e=n.metadata.asset,a={tokenAddress:e.address,tokenId:e.id,schemaName:n.metadata.schema},[4,this.getAssetOrderVersion(a)];case 1:return c=s.sent(),f=c.orderVersion,d=c.newAsset,h=this.orders.APENFTSharedAssetAddr,p=n.englishAuctionReservePrice&&new l.default(n.englishAuctionReservePrice).gt(0),g=(null===(t=u.collection)||void 0===t?void 0:t.transferFeeAddress)?null===(r=u.collection)||void 0===r?void 0:r.transferFeeAddress:this.account.feeRecipientAddress,v=p?{takerRelayerFee:null==u?void 0:u.collection.APENFTSellerFeeBasisPoints}:{feeRecipient:g,makerRelayerFee:null==u?void 0:u.collection.APENFTSellerFeeBasisPoints},e.address===h&&f.uri&&1===f.orderVersion&&(e.data=d.data),b=o(o(o(o({},n),i),v),{salt:(0,y.generatePseudoRandomSalt)()}),w=this.orders.computeOrderCallData(b,this.orders.networkName,this.accountAddress),A=w.dataToCall,_=w.replacementPattern,S=o(o({},b),{dataToCall:A,replacementPattern:_,makerReferrerFee:(0,m.makeBigNumber)(0)}),[4,this.orders.createSignedOrder({unHashOrder:S})];case 2:return(M=s.sent())?(x=o(o({},M),{version:f.orderVersion}),[2,this.ordersPost({order:x})]):[2]}}))}))},t.prototype.acceptOrder=function(e){return a(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=this.accountAddress,r=this.orders.orderFromJSON(e),n="",e.side===p.OrderSide.Sell&&(n=t),e.side===p.OrderSide.Buy&&(n=e.maker),i=this.orders.makeMatchingOrder({signedOrder:r,accountAddress:t,recipientAddress:n}),o=i.buy,a=i.sell,[4,this.account.orderMatch({buy:o,sell:a})];case 1:return[2,s.sent()]}}))}))},t}(c.OrdersAPI);t.APENFTOrders=g},8334:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetFactory=void 0;var u=s(r(5504)),l=r(2536),c=s(r(2476)),f=r(8033),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.contracts={},t}return i(t,e),t.prototype.contract721=function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return this.contracts[e]?[3,2]:(t=this.contracts,r=e,[4,this.web3.contract(c.default.abi,e)]);case 1:t[r]=n.sent(),n.label=2;case 2:return[2,this.contracts[e]]}}))}))},t.prototype.balanceOf=function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this.contract721(e)];case 1:return[4,r.sent().balanceOf(t).call()];case 2:return[2,r.sent()]}}))}))},t.prototype.createAsset721x=function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this.factoryContract.createERCAsset(t,e,r)];case 1:return[2,n.sent()]}}))}))},t.prototype.createAsset721=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,l,d,h,p;return a(this,(function(a){switch(a.label){case 0:return i={shouldPollResponse:!0,feeLimit:1e9,callValue:0,userFeePercentage:30,originEnergyLimit:1e7},n=Object.assign({},i,n),o={abi:c.default.abi,bytecode:c.default.bytecode,feeLimit:n.feeLimit,callValue:n.callValue,userFeePercentage:n.userFeePercent,originEnergyLimit:n.originEnergyLimit,name:"APENFT721",parameters:[t,e,r,this.erc721AssetProxyAddr],permissionId:0},[4,this.web3.transactionBuilder.createSmartContract(o,this.web3.defaultAddress.hex)];case 1:return s=a.sent(),[4,this.web3.trx.sign(s)];case 2:return(l=a.sent()).signature?[4,this.web3.trx.sendRawTransaction(l)]:[2,Promise.reject("Transaction was not signed properly")];case 3:return d=a.sent(),h=(0,u.default)(),d.code?(p={error:d.code,message:d.code},d.message&&(p.message=this.web3.toUtf8(d.message)),h.reject(p),[2,Promise.reject(p)]):(null==n?void 0:n.shouldPollResponse)?((0,f.checkResultFast)(0,this.web3,h,l),[2,Promise.resolve({txHash:l.txID,txSend:h.eventEmitter})]):(h.resolve(l.txID),h.eventEmitter.emit("transactionHash",l.txID),[2,Promise.resolve({txHash:l.txID,txSend:h.eventEmitter})])}}))}))},t.prototype.deployAsset721=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:i={shouldPollResponse:!0,feeLimit:1e9,callValue:0,userFeePercentage:30,originEnergyLimit:1e7},n=Object.assign({},i,n),o={abi:c.default.abi,bytecode:c.default.bytecode,feeLimit:n.feeLimit,callValue:n.callValue,userFeePercentage:n.userFeePercent,originEnergyLimit:n.originEnergyLimit,name:"APENFT721",parameters:[t,e,r,this.erc721AssetProxyAddr]},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.web3.contract().new(o)];case 2:return s=a.sent(),[2,Promise.resolve(s)];case 3:return u=a.sent(),[2,Promise.reject(u)];case 4:return[2]}}))}))},t.prototype.mint721=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:n=(0,u.default)(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.contract721(e).catch((function(e){n.eventEmitter.emit("error",e)}))];case 2:return[4,a.sent().mintTo(t,r||"").send().catch((function(e){n.eventEmitter.emit("error",e)}))];case 3:return(i=a.sent())?(n.eventEmitter.emit("transactionHash",i),(0,f.checkResultFast)(0,this.web3,n,{txID:i}),[2,Promise.resolve({txHash:i,txSend:n.eventEmitter})]):[2,Promise.reject("Transaction was not signed properly")];case 4:return o=a.sent(),n.eventEmitter.emit("error",o),[2,Promise.resolve({txHash:"",txSend:n.eventEmitter})];case 5:return[2]}}))}))},t}(l.Contracts);t.AssetFactory=d},8047:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Orders=t.OrderCheckStatus=void 0;var u,l=r(307),c=r(3553),f=r(6135),d=r(7919),h=r(8033),p=r(2536);(u=t.OrderCheckStatus||(t.OrderCheckStatus={})).StartOrderHashSign="startOrderHashSign",u.EndOrderHashSign="endOrderHashSign",u.StartOrderMatch="startOrderMatch",u.OrderMatchTxHash="orderMatchTxHash",u.EndOrderMatch="endOrderMatch",u.StartCancelOrder="startCancelOrder",u.EndCancelOrder="endCancelOrder",u.RegisterTxHash="registerTxHash",u.EndRegister="endRegister",u.ApproveErc20TxHash="approveErc20TxHash",u.EndApproveErc20="endApproveErc20",u.ApproveErc721TxHash="approveErc721TxHash",u.EndApproveErc721="endApproveErc721",u.ApproveErc1155TxHash="approveErc1155TxHash",u.EndApproveErc1155="endApproveErc1155",u.TransferErc1155="transferErc1155",u.TransferErc721="transferErc721",u.End="End";var m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.makeMatchingOrder=function(e){var t=e.signedOrder,r=e.accountAddress,n=e.recipientAddress,i=this.networkName,a=n;a&&t.side!=l.OrderSide.Buy||(a=r);var s=this.feeRecipientAddress,u=(0,d._makeMatchingOrder)({networkName:i,unSignedOrder:t,accountAddress:r,assetRecipientAddress:a,feeRecipientAddress:s}),c=o(o({},u),{hash:t.hash});return(0,d.assignOrdersToSides)(t,c)},t.prototype.createSignedOrder=function(e){var t=e.unHashOrder;return a(this,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,(0,f.checkUnhashedOrder)(this,t)];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,(0,d.hashAndValidateOrder)(this.web3,this.exchangeHelper,t)];case 3:return[2,r.sent()];case 4:throw(e=r.sent()).data?e.data.order=t:e=o(o({},e),{message:e.message,data:{order:t}}),e;case 5:return[2]}}))}))},t.prototype.createBuyOrder=function(e){var t=e.asset,r=e.accountAddress,n=e.startAmount,i=e.paymentTokenObj,o=e.quantity,u=void 0===o?1:o,l=e.expirationTime,c=void 0===l?0:l,f=e.sellOrder,h=e.referrerAddress;return a(this,void 0,void 0,(function(){var e,o,a;return s(this,(function(s){switch(s.label){case 0:return e=this.networkName,o=this.exchange.address,[4,(0,d._makeBuyOrder)({networkName:e,exchangeAddr:o,asset:t,quantity:u,accountAddress:r,startAmount:n,expirationTime:c,paymentTokenObj:i,extraBountyBasisPoints:0,feeRecipientAddr:this.feeRecipientAddress,sellOrder:f,referrerAddress:h})];case 1:return a=s.sent(),[2,this.createSignedOrder({unHashOrder:a})]}}))}))},t.prototype.createSellOrder=function(e){var t=e.asset,r=e.accountAddress,n=e.startAmount,i=e.paymentTokenObj,o=void 0===i?this.TRX:i,u=e.endAmount,l=e.quantity,f=void 0===l?1:l,h=e.listingTime,p=e.expirationTime,m=void 0===p?0:p,y=e.waitForHighestBid,g=void 0!==y&&y,v=e.englishAuctionReservePrice,b=e.extraBountyBasisPoints,w=void 0===b?0:b,A=e.buyerAddress;return a(this,void 0,void 0,(function(){var e,i,a;return s(this,(function(s){switch(s.label){case 0:return m=m?parseInt(String(m)):m,e=this.networkName,i=this.exchange.address,[4,(0,d._makeSellOrder)({networkName:e,exchangeAddr:i,asset:t,quantity:f,accountAddress:r,startAmount:n,endAmount:u,listingTime:h,expirationTime:m,waitForHighestBid:g,englishAuctionReservePrice:v,paymentTokenObj:o,extraBountyBasisPoints:w,feeRecipientAddr:this.feeRecipientAddress,buyerAddress:A||c.NULL_ADDRESS})];case 1:return a=s.sent(),[2,this.createSignedOrder({unHashOrder:a})]}}))}))},t.prototype.getOrderCurrentPrice=function(e){var t,r,n,i,o,u;return a(this,void 0,void 0,(function(){return s(this,(function(a){return[2,this.exchangeHelper.methods.calculateFinalPrice(null===(t=e.side)||void 0===t?void 0:t.toString(),null===(r=e.saleKind)||void 0===r?void 0:r.toString(),null===(n=e.basePrice)||void 0===n?void 0:n.toString(),null===(i=e.extra)||void 0===i?void 0:i.toString(),null===(o=e.listingTime)||void 0===o?void 0:o.toString(),null===(u=e.expirationTime)||void 0===u?void 0:u.toString()).call()]}))}))},t.prototype.getOrderCancelledOrFinalized=function(e){return a(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=(0,h.orderParamsEncode)(e),[4,this.exchangeHelper.methods.hashToSign(t).call()];case 1:return r=n.sent(),[2,this.exchange.methods.cancelledOrFinalized(r).call()]}}))}))},t.prototype.checkMatchOrder=function(e,t){return a(this,void 0,void 0,(function(){return s(this,(function(r){return[2,(0,f.checkMatchOrder)(this,e,t)]}))}))},t.prototype.checkOrder=function(e){return a(this,void 0,void 0,(function(){return s(this,(function(t){return[2,(0,f.checkOrder)(this,e)]}))}))},t.prototype.orderToJSON=function(e){return(0,d.orderToJSON)(e)},t.prototype.orderFromJSON=function(e){return(0,d.orderFromJSON)(e)},t.prototype.computeOrderCallData=function(e,t,r){return(0,d.computeOrderCallData)(e,t,r)},t}(p.Contracts);t.Orders=m},4045:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.OrdersAPI=void 0;var u=r(8033),l=r(8913),c=function(e){function t(t){var r=e.call(this,t.apiBaseUrl||l.API_BASE_URL[t.networkName].api)||this,n=t.networkName;return r.chain=l.CHAIN[n],r.chainId=l.CHAIN_ID[n],r.walletChainId="0x".concat(r.chainId.toString(16)),r.chainInfo={chain:l.CHAIN[n],chainId:r.walletChainId},r}return i(t,e),t.prototype.ordersPost=function(e){var t=e.order,r=e.retries,n=void 0===r?2:r;return a(this,void 0,void 0,(function(){var e,r;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,this.post("/v1/orders/post",o(o({},t),this.chainInfo))];case 1:return e=i.sent(),[3,4];case 2:return r=i.sent(),this.throwOrContinue(r,n),[4,(0,u.Sleep)(3e3)];case 3:return i.sent(),[2,this.ordersPost({order:t,retries:n-1})];case 4:if(e&&"status"in e&&"success"!==e.status&&"code"in e&&0!==e.code)throw e;return[2,e]}}))}))},t.prototype.ordersVersion=function(e,t){return void 0===t&&(t=2),a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,this.post("/v1/orders/orderVersionQuery",o(o({},e),this.chainInfo))];case 1:return r=i.sent(),[3,4];case 2:return n=i.sent(),this.throwOrContinue(n,t),[4,(0,u.Sleep)(3e3)];case 3:return i.sent(),[2,this.ordersVersion(e,t-1)];case 4:return[2,r]}}))}))},t.prototype.ordersConfData=function(e){return void 0===e&&(e=2),a(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,4]),[4,this.post("/v1/orders/confData",o({},this.chainInfo))];case 1:return t=n.sent(),[3,4];case 2:return r=n.sent(),this.throwOrContinue(r,e),[4,(0,u.Sleep)(3e3)];case 3:return n.sent(),[2,this.ordersConfData(e-1)];case 4:return[2,t]}}))}))},t.prototype.ordersHidden=function(e,t){return void 0===t&&(t=2),a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,this.post("/v1/orders/cancel",o(o({},e),this.chainInfo))];case 1:return r=i.sent(),[3,4];case 2:return n=i.sent(),this.throwOrContinue(n,t),[4,(0,u.Sleep)(3e3)];case 3:return i.sent(),[2,this.ordersHidden(e,t-1)];case 4:return[2,r]}}))}))},t.prototype.ordersQuery=function(e,t){return void 0===t&&(t=2),a(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,4]),[4,this.post("/v1/orders/query",o(o({},e),this.chainInfo))];case 1:return r=i.sent(),[3,4];case 2:return n=i.sent(),this.throwOrContinue(n,t),[4,(0,u.Sleep)(3e3)];case 3:return i.sent(),[2,this.ordersQuery(e,t-1)];case 4:return[2,r]}}))}))},t}(r(7389).Fetch);t.OrdersAPI=c},3119:function(e,t,r){"use strict";var n=r(8764).Buffer,i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.ABI=t.isDynamic=t.encodeSingle=t.elementaryName=t.bufferToHex=void 0;var o=r(2751);function a(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function s(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function u(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function l(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function c(e){var t=typeof e;if("string"===t)return(0,o.isHexPrefixed)(e)?new o.BN((0,o.stripHexPrefix)(e),16):new o.BN(e,10);if("number"===t)return new o.BN(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function f(e,t){var r,i,a,d;if("address"===e)return f("uint160",c(t));if("bool"===e)return f("uint8",t?1:0);if("string"===e)return f("bytes",n.from(t,"utf8"));if(m(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(r=l(e))&&0!==r&&t.length>r)throw new Error("Elements exceed array size: "+r);for(d in a=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)a.push(f(e,t[d]));if("dynamic"===r){var h=f("uint256",t.length);a.unshift(h)}return n.concat(a)}if("bytes"===e)return t=(0,o.isHexPrefixed)(t)?(0,o.toBuffer)(t):n.from(t),a=n.concat([f("uint256",t.length),t]),t.length%32!=0&&(a=n.concat([a,(0,o.zeros)(32-t.length%32)])),a;if(e.startsWith("bytes")){if((r=s(e))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return(0,o.setLengthRight)(t,32)}if(e.startsWith("uint")){if((r=s(e))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((i=c(t)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());if(i<0)throw new Error("Supplied uint is negative");return i.toArrayLike(n,"be",32)}if(e.startsWith("int")){if((r=s(e))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((i=c(t)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());return i.toTwos(256).toArrayLike(n,"be",32)}if(e.startsWith("ufixed")){if(r=u(e),(i=c(t))<0)throw new Error("Supplied ufixed is negative");return f("uint256",i.mul(new o.BN(2).pow(new o.BN(r[1]))))}if(e.startsWith("fixed"))return r=u(e),f("int256",c(t).mul(new o.BN(2).pow(new o.BN(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function d(e,t,r){var i,a,s,u;if("string"==typeof e&&(e=h(e)),"address"===e.name)return d(e.rawType,t,r).toArrayLike(n,"be",20).toString("hex");if("bool"===e.name)return d(e.rawType,t,r).toString()===new o.BN(1).toString();if("string"===e.name){var l=d(e.rawType,t,r);return n.from(l,"utf8").toString()}if(e.isArray){for(s=[],i=e.size,"dynamic"===e.size&&(r=d("uint256",t,r).toNumber(),i=d("uint256",t,r).toNumber(),r+=32),u=0;u<i;u++){var c=d(e.subArray,t,r);s.push(c),r+=e.subArray.memoryUsage}return s}if("bytes"===e.name)return r=d("uint256",t,r).toNumber(),i=d("uint256",t,r).toNumber(),t.slice(r+32,r+32+i);if(e.name.startsWith("bytes"))return t.slice(r,r+e.size);if(e.name.startsWith("uint")){if((a=new o.BN(t.slice(r,r+32),16,"be")).bitLength()>e.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("int")){if((a=new o.BN(t.slice(r,r+32),16,"be").fromTwos(256)).bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+a.bitLength());return a}if(e.name.startsWith("ufixed")){if(i=new o.BN(2).pow(new o.BN(e.size[1])),!(a=d("uint256",t,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return a.div(i)}if(e.name.startsWith("fixed")){if(i=new o.BN(2).pow(new o.BN(e.size[1])),!(a=d("int256",t,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return a.div(i)}throw new Error("Unsupported or invalid type: "+e.name)}function h(e){var t,r;if(m(e)){t=l(e);var n=e.slice(0,e.lastIndexOf("["));return n=h(n),{isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:n.memoryUsage*t,subArray:n}}var i=void 0;switch(e){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes"}if(r={rawType:i,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?r.size=s(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=u(e)),e.startsWith("bytes")&&"bytes"!==e&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}function p(e){return"string"===e||"bytes"===e||"dynamic"===l(e)}function m(e){return e.lastIndexOf("]")===e.length-1}Object.defineProperty(t,"bufferToHex",{enumerable:!0,get:function(){return o.bufferToHex}}),t.elementaryName=a,t.encodeSingle=f,t.isDynamic=p,t.ABI={},t.ABI.methodSig=function(e){var t=e.inputs.map((function(e){return 0===e.type.indexOf("tuple")?y(e,!0):e.type}));return e.name+"("+t.map(a).join(",")+")"},t.ABI.eventID=function(e,t){var r=e+"("+t.map(a).join(",")+")";return(0,o.keccak256)(n.from(r))},t.ABI.methodID=function(e,r){return t.ABI.eventID(e,r).slice(0,4)},t.ABI.rawEncode=function(e,t){var r=[],i=[],o=0;e.forEach((function(e){if(m(e)){var t=l(e);o+="dynamic"!==t?32*t:32}else o+=32}));for(var s=0;s<e.length;s++){var u=a(e[s]),c=f(u,t[s]);p(u)?(r.push(f("uint256",o)),i.push(c),o+=c.length):r.push(c)}return n.concat(r.concat(i))},t.ABI.rawInputsEncode=function(e){for(var t,r=[],n=[],o=0;o<e.length;o++){var a=e[o];"tuple"===a.type?(r=i(i([],r,!0),null===(t=a.components)||void 0===t?void 0:t.map((function(e){return e.type})),!0),n=i(i([],n,!0),a.value,!0)):(r.push(a.type),n.push(a.value))}return this.rawEncode(r,n)},t.ABI.rawDecode=function(e,t){for(var r=[],i=n.from(t),o=0,s=0;s<e.length;s++){var u=h(a(e[s])),l=d(u,i,o);o+=u.memoryUsage,r.push(l)}return r};var y=function(e,t){if(e&&0===e.type.indexOf("tuple")&&e.components){var r=e.components.map((function(e){return y(e,t)}));return"".concat(t?"":"tuple","(").concat(r.join(","),")").concat((n=e.type.match(/([a-zA-Z0-9])(\[.*\])/))?n[2]:"")}var n;return/trcToken/.test(e.type)?e.type.replace(/trcToken/,"uint256"):e.type};t.ABI.paramsArray=function(e,t){for(var r=[],n=[],i=0;i<e.length;i++){var o=e[i].type;"bool"===o&&"false"===t[i]&&(t[i]=!1),n.push(0===o.indexOf("tuple")?y(e[i]):o)}for(i=0;i<n.length;i++)r.push({type:n[i],value:t[i]});return r}},5504:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6729)),o=function(e){var t,r,n=new Promise((function(e,n){t=e,r=n}));if(e)return{resolve:t,reject:r,eventEmitter:n};var o=new i.default;return n._events=o._events,n.emit=o.emit,n.on=o.on,n.once=o.once,n.off=o.off,n.listeners=o.listeners,n.addListener=o.addListener,n.removeListener=o.removeListener,n.removeAllListeners=o.removeAllListeners,{resolve:t,reject:r,eventEmitter:n}};o.resolve=function(e){var t=o(!0);return t.resolve(e),t.eventEmitter},t.default=o},6135:function(e,t,r){"use strict";var n=r(5108),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAPENFTAssetURI=t.checkAssetBalance=t.checkAssetApprove=t.checkAssetAddress=t.checkAssetMint=t.checkOrderCancelledOrFinalized=t.getOrderCancelledOrFinalized=t.ordersCanMatch=t._ordersCanMatch=t.validateOrder=t.checkDataToCall=t.checkMatchOrder=t.checkOrder=t.checkUnhashedOrder=t.checkApproveSchemaProxy=t.checkApproveERC721TransferProxy=t.checkApproveERC1155TransferProxy=t.checkApproveTokenTransferProxy=t.checkRegisterProxy=t.getAccountProxyAddr=void 0;var s=r(6797),u=r(3553),l=r(307),c=r(8033),f=r(7919),d=r(3119),h=r(2184);function p(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return t===l.APENFTSchemaName.ERC1155?[2,Promise.resolve(e.erc1155AssetProxyAddr)]:[2,Promise.resolve(e.erc721AssetProxyAddr)]}))}))}function m(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){switch(o.label){case 0:return[4,e.methods.erc20Proxy().call()];case 1:return n=o.sent(),[4,t.methods.allowance(r,n).call()];case 2:if(i=o.sent(),new u.BigNumber(i.toString()).eq(0))throw"Error";return[2,!0]}}))}))}function y(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){switch(o.label){case 0:return[4,p(e,l.APENFTSchemaName.ERC1155)];case 1:return n=o.sent(),[4,t.methods.isApprovedForAll(r,n).call()];case 2:if(!(i=o.sent()))throw"Error";return[2,i]}}))}))}function g(e,t,r,n){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return[4,p(e,l.APENFTSchemaName.ERC721)];case 1:return n=i.sent(),[4,t.methods.isApprovedForAll(r,n).call()];case 2:if(!i.sent())throw"Error";return[2,!0]}}))}))}function v(e,t,r){var n;return o(this,void 0,void 0,(function(){var r,i,o,u,l,m,y,g,v,b;return a(this,(function(a){switch(a.label){case 0:return[4,p(e,t.schema)];case 1:return r=a.sent(),i=(0,c.getSchemaList)(e.networkName,t.schema),o=i[0],u={tokenId:t.asset.id,tokenAddress:t.asset.address,schemaName:t.schema},l=(0,f.getAPENFTAsset)(o,u),m=null===(n=null==o?void 0:o.functions)||void 0===n?void 0:n.isApprove(l),y=(0,s.encodeCall)(m,[u.tokenId]),g={functionSelector:d.ABI.methodSig(m),parameters:d.ABI.paramsArray(m.inputs,[u.tokenId])},v={to:m.target,data:y,rawData:g},[4,new h.ContractSchemas(null,null).tronCall.call({web3:e.web3},v,null==m?void 0:m.outputs)];case 2:if(b=a.sent(),(null==m?void 0:m.outputs.some((function(e){return"address"==e.type})))&&(b=e.web3.address.fromHex(b)===r),!b)throw"Error";return[2,b]}}))}))}function b(e,t){return o(this,void 0,void 0,(function(){var r,n,o,s,f,d,h;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,11,,12]),P(e.networkName,t),(r=e.erc20.clone()).deployed=!0,n=t.metadata,t.side!=l.OrderSide.Sell?[3,3]:[4,O(e,o=t)];case 1:return a.sent(),[4,I(e,o)];case 2:a.sent(),a.label=3;case 3:return t.side!=l.OrderSide.Buy?[3,10]:(s=t,E(n).assetAddress==e.APENFTSharedAssetAddr?[3,5]:[4,k(0,n)]);case 4:a.sent(),a.label=5;case 5:return s.paymentToken===u.NULL_ADDRESS?[3,8]:(r.address=s.paymentToken,[4,(0,c.getAccountBalance)(e.web3,s.maker,r)]);case 6:if(f=a.sent().erc20Bal,(0,c.makeBigNumber)(f).lt(s.basePrice))throw"Error";return[4,m(e.exchange,r,s.maker)];case 7:return a.sent(),[3,10];case 8:return[4,(0,c.getAccountBalance)(e.web3,s.maker)];case 9:if(d=a.sent().ethBal,(0,c.makeBigNumber)(d).lt(s.basePrice))throw"Error";a.label=10;case 10:return A(e.networkName,t),[3,12];case 11:throw(h=a.sent()).data?h.data.order=t:h=i(i({},h),{message:h.message,data:{order:t}}),h;case 12:return[2,!0]}}))}))}function w(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,b(e,t)];case 1:return r.sent(),[4,T(e,t)];case 2:return r.sent(),[4,_(e.exchangeHelper,t)];case 3:return r.sent(),[2,!0]}}))}))}function A(e,t){var r,n=(0,c.getSchemaList)(e,t.metadata.schema),o=t.metadata.asset;if(o.data||o.schemaName!==l.APENFTSchemaName.ERC1155||(o=i(i({},o),{data:""})),(r=t.side==l.OrderSide.Sell?(0,s.encodeSell)(n[0],o,t.maker):(0,s.encodeBuy)(n[0],o,t.maker)).dataToCall!=t.dataToCall)throw"Error: dataToCall";if(r.target!=t.target)throw"Error: target";if(r.replacementPattern!=t.replacementPattern)throw"Error: replacementPattern"}function _(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:r=(0,c.orderParamsEncode)(t),n=(0,c.orderSigEncode)(t),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.methods.validateOrder(r,n).call()];case 2:if(!(i=a.sent()))throw"Error";return[2,i];case 3:if(!(o=a.sent()).code)throw"Error";throw o;case 4:return[2]}}))}))}n.log,t.getAccountProxyAddr=p,t.checkRegisterProxy=function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,!0]}))}))},t.checkApproveTokenTransferProxy=m,t.checkApproveERC1155TransferProxy=y,t.checkApproveERC721TransferProxy=g,t.checkApproveSchemaProxy=v,t.checkUnhashedOrder=b,t.checkOrder=w,t.checkMatchOrder=function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:if(!r.basePrice.gte(t.basePrice))throw"Error";if(!M(t,r))throw"Error";if(r.feeRecipient==u.NULL_ADDRESS)return[3,3];if(!r.takerRelayerFee.lte(t.takerRelayerFee))throw"sell.takerRelayerFee ".concat(r.takerRelayerFee," <= buy.takerRelayerFee ").concat(t.takerRelayerFee);return[4,b(e,t)];case 1:return n.sent(),[4,w(e,r)];case 2:return n.sent(),[3,6];case 3:if(!t.takerRelayerFee.lte(r.takerRelayerFee))throw"buy.takerRelayerFee ".concat(t.takerRelayerFee," <= sell.takerRelayerFee ").concat(r.takerRelayerFee);return[4,b(e,r)];case 4:return n.sent(),[4,w(e,t)];case 5:n.sent(),n.label=6;case 6:return[2,!0]}}))}))},t.checkDataToCall=A,t.validateOrder=_;var S=function(e,t){var r=Math.round(Date.now()/1e3);return e=u.BigNumber.isBigNumber(e)?e.toNumber():Number(e),t=u.BigNumber.isBigNumber(t)?t.toNumber():Number(t),e<=r&&(0==t||r<t)};function M(e,t){return 0==e.side&&1==t.side&&e.feeMethod==t.feeMethod&&e.paymentToken==t.paymentToken&&(t.taker==u.NULL_ADDRESS||t.taker==e.maker)&&(e.taker==u.NULL_ADDRESS||e.taker==t.maker||!1)&&(t.feeRecipient==u.NULL_ADDRESS&&e.feeRecipient!=u.NULL_ADDRESS||t.feeRecipient!=u.NULL_ADDRESS&&e.feeRecipient==u.NULL_ADDRESS)&&(e.target==t.target||!1)&&(e.howToCall==t.howToCall||!1)&&(S(e.listingTime,e.expirationTime)||!1)&&(S(t.listingTime,t.expirationTime)||!1)}function x(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=(0,c.orderParamsEncode)(t),[4,e.exchangeHelper.methods.hashToSign(r).call()];case 1:return n=i.sent(),[2,e.exchange.methods.cancelledOrFinalized(n).call()]}}))}))}function T(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,x(e,t)];case 1:if(r.sent())throw t.side===l.OrderSide.Sell?"Error: Sell":"Error: Buy";return[2]}}))}))}function E(e){if(!e.asset.id||!e.asset.address)throw"Error: sell.metadata.asset.id or address undefined";return{tokenId:e.asset.id,assetAddress:e.asset.address}}function k(e,t){return o(this,void 0,void 0,(function(){var e;return a(this,(function(r){return(e=E(t)).tokenId,e.assetAddress,[2,!0]}))}))}function P(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){if(r=(0,c.getSchemaList)(e,t.metadata.schema),E(t.metadata).assetAddress,0===r.length)throw"Error";return[2]}))}))}function O(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:switch(n=(r=t).maker,i=r.metadata,(o=E(i)).tokenId,s=o.assetAddress,(u=e.erc20.clone()).deployed=!0,i.schema){case l.APENFTSchemaName.ERC20:return[3,1];case l.APENFTSchemaName.ERC721:return[3,2];case l.APENFTSchemaName.ERC1155:return[3,4]}return[3,8];case 1:return(u=e.erc20.clone()).address=s,u.deployed=!0,[3,10];case 2:return(u=e.erc721.clone()).address=s,u.deployed=!0,[4,g(e,u,n)];case 3:return a.sent(),[3,10];case 4:return(u=e.erc1155.clone()).address=s,u.deployed=!0,s==e.APENFTSharedAssetAddr?[3,6]:[4,k(0,i)];case 5:a.sent(),a.label=6;case 6:return[4,y(e,u,n)];case 7:return a.sent(),[3,10];case 8:return[4,v(e,i)];case 9:return a.sent(),[3,10];case 10:return[2,u]}}))}))}function I(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,c,f,d,h;return a(this,(function(a){switch(a.label){case 0:switch(r=t.maker,n=t.metadata,i=E(n),o=i.tokenId,s=i.assetAddress,(c=e.erc20.clone()).deployed=!0,f=0,n.schema){case l.APENFTSchemaName.ERC20:return[3,1];case l.APENFTSchemaName.ERC721:return[3,2];case l.APENFTSchemaName.ERC1155:return[3,4]}return[3,6];case 1:return(c=e.erc20.clone()).address=s,c.deployed=!0,[3,7];case 2:return(c=e.erc721.clone()).address=s,c.deployed=!0,[4,c.methods.ownerOf(o).call()];case 3:if(d=a.sent(),h=e.web3.address.toHex(r),d!==h)throw"Error";return f=1,[3,7];case 4:return(c=e.erc1155.clone()).address=s,c.deployed=!0,[4,c.methods.balanceOf(r,o).call()];case 5:return f=a.sent(),[3,7];case 6:throw"Error";case 7:if(u.BigNumber.isBigNumber(t.quantity)||(t.quantity=new u.BigNumber(t.quantity)),t.quantity.gt(f.toString()))throw"Error";return[2,Number(f)]}}))}))}t._ordersCanMatch=M,t.ordersCanMatch=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){if(n=(0,c.orderParamsEncode)(t),i=(0,c.orderParamsEncode)(r),!e.methods.ordersCanMatch(n,i).call())throw"Error";return[2,!0]}))}))},t.getOrderCancelledOrFinalized=x,t.checkOrderCancelledOrFinalized=T,t.checkAssetMint=k,t.checkAssetAddress=P,t.checkAssetApprove=O,t.checkAssetBalance=I,t.getAPENFTAssetURI=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return[4,e.APENFTSharedAsset.methods._getOverrideURI(t).call()];case 1:return r=i.sent(),[4,e.APENFTSharedAsset.methods.uri(t).call()];case 2:return n=i.sent(),[2,{overURI:r,URI:n}]}}))}))}},3553:function(e,t,r){"use strict";var n,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TOKEN_TYPE_MAP=t.STATIC_EXTRADATA=t.INVERSE_BASIS_POINT=t.APENFT_SELLER_BOUNTY_BASIS_POINTS=t.DEFAULT_MAX_BOUNTY=t.DEFAULT_SELLER_FEE_BASIS_POINTS=t.DEFAULT_BUYER_FEE_BASIS_POINTS=t.ORDER_MATCHING_LATENCY_SECONDS=t.MIN_Listing_SECONDS=t.MIN_EXPIRATION_SECONDS=t.MAX_UINT_256=t.MAX_DIGITS_IN_UNSIGNED_256_INT=t.NULL_BLOCK_HASH=t.NULL_ADDRESS=t.BigNumber=void 0;var o=i(r(4431));t.BigNumber=o.default;var a=r(307);o.default.config({EXPONENTIAL_AT:1e9}),t.NULL_ADDRESS="T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb",t.NULL_BLOCK_HASH="0x0000000000000000000000000000000000000000000000000000000000000000",t.MAX_DIGITS_IN_UNSIGNED_256_INT=78,t.MAX_UINT_256="115792089237316195423570985008687907853269984665640564039457584007913129639935",t.MIN_EXPIRATION_SECONDS=10,t.MIN_Listing_SECONDS=10,t.ORDER_MATCHING_LATENCY_SECONDS=604800,t.DEFAULT_BUYER_FEE_BASIS_POINTS=0,t.DEFAULT_SELLER_FEE_BASIS_POINTS=((n={})[a.Network.Tron]=0,n[a.Network.Shasta]=50,n),t.DEFAULT_MAX_BOUNTY=t.DEFAULT_SELLER_FEE_BASIS_POINTS,t.APENFT_SELLER_BOUNTY_BASIS_POINTS=100,t.INVERSE_BASIS_POINT=1e4,t.STATIC_EXTRADATA="0x0c225aad",t.TOKEN_TYPE_MAP={"TRC-20":"ERC20","TRC-721":"ERC721","TRC-1155":"ERC1155"}},5085:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.APENFTError=t.ErrorCodes=void 0,t.ErrorCodes=[{code:"INVALID_ARGUMENT",message:"Smart contract error"},{code:"1000",message:"SDK"},{code:"1001",message:"Account no registration"},{code:"1002",message:"Account authProxy without authorization exchangeProxyRegistryAddr "},{code:"1003",message:"Order match estimateGas failure {{msg}}"},{code:"1004",message:"Order match failure {{msg}}"},{code:"1101",message:"TokenTransferProxy allowAmount equel 0 "},{code:"1102",message:"ERC1155TransferProxy NFTs isApprovedForAll is false "},{code:"1103",message:"{{assetType}} balanceOf insufficient order quantity {{orderQuantity}} owner quantity {{ownerQuantity}}!"},{code:"1104",message:"Insufficient {{assetType}} balance"},{code:"1106",message:"ERC721TransferProxy NFTs getApproved is false "},{code:"1108",message:"{{schemaName}} NFTs isApproved is false {{tokenId}} "},{code:"1201",message:"Order: buy.basePrice to be greater than sell.basePrice!"},{code:"1202",message:"Order can match false"},{code:"1203",message:"Order validateOrder false "},{code:"1204",message:"Buy order payment Token cannot be ETH "},{code:"1205",message:"Order parameter false "},{code:"1206",message:"{{assetType}} asset does not support "},{code:"1207",message:"{{orderSide}} Order cancelledOrFinalized false "},{code:"1208",message:"CheckDataToCall {{part}} error "},{code:"1209",message:"{{assetType}} asset address {{address}} not support "},{code:"1211",message:"The APENFTShareAsset Order URI does not match the URI returned in Order Version "},{code:"1212",message:"The APENFTShareAsset TokenID cannot be traded for the time being "},{code:"2001",message:"{{funcName}} RPC send request error {{stack}} {{msg}}"},{code:"2002",message:"{{funcName}} RPC call request error {{stack}}"},{code:"2003",message:"{{funcName}} RPC web3 request error {{stack}}"},{code:"2004",message:"{{funcName}} RPC execution error {{stack}}"},{code:"4001",message:"MetaMask Error "}];var i=function(e){function r(r){var n,i,o=this,a=t.ErrorCodes.find((function(e){return e.code==r.code}));if(Number(null==a?void 0:a.code)>1e3){var s=r.context&&(null==a?void 0:a.message)?(n=a.message,i=r.context,n.replace(/\{\{(.*?)\}\}/g,(function(e,t){return i[t.trim()]}))):null==a?void 0:a.message;o=e.call(this,s)||this}else"1000"==(null==a?void 0:a.code)?(s=r.message||"",o=e.call(this,s+"-"+(null==a?void 0:a.message))||this):o=e.call(this,"undefined code!")||this;return o.code=r.code.toString(),o.data=r.data,o.context=r.context,o}return n(r,e),r}(Error);t.APENFTError=i},2867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._validateFees=t._getSellFeeParameters=t._getBuyFeeParameters=t.computeFees=void 0;var n=r(8033),i=r(3553),o=r(307);function a(e,t){var r=i.INVERSE_BASIS_POINT/100;if(e>i.INVERSE_BASIS_POINT||t>i.INVERSE_BASIS_POINT)throw new Error("Invalid buyer/seller fees: must be less than ".concat(r,"%"));if(e<0||t<0)throw new Error("Invalid buyer/seller fees: must be at least 0%")}t.computeFees=function(e){var t,r,a,s,u,l,c,f,d,h=e.asset,p=e.side,m=(e.accountAddress,e.isPrivate),y=void 0!==m&&m,g=e.extraBountyBasisPoints,v=void 0===g?0:g,b=e.networkName,w=i.DEFAULT_BUYER_FEE_BASIS_POINTS,A=i.DEFAULT_SELLER_FEE_BASIS_POINTS[b],_=0,S=0,M=0,x=0,T=(0,n.makeBigNumber)(0),E=null,k=i.DEFAULT_MAX_BOUNTY[b];h&&(_+=(null===(t=null==h?void 0:h.collection)||void 0===t?void 0:t.APENFTBuyerFeeBasisPoints)||0,S+=(null===(r=null==h?void 0:h.collection)||void 0===r?void 0:r.APENFTSellerFeeBasisPoints)||0,M+=(null===(a=null==h?void 0:h.collection)||void 0===a?void 0:a.devBuyerFeeBasisPoints)||0,x+=(null===(s=null==h?void 0:h.collection)||void 0===s?void 0:s.devSellerFeeBasisPoints)||0,k=S),p==o.OrderSide.Sell&&h&&(T=(null===(u=null==h?void 0:h.collection)||void 0===u?void 0:u.transferFee)?(0,n.makeBigNumber)(null===(l=null==h?void 0:h.collection)||void 0===l?void 0:l.transferFee):T,E=(null===(c=null==h?void 0:h.collection)||void 0===c?void 0:c.transferFeePaymentToken)?null===(d=null===(f=null==h?void 0:h.collection)||void 0===f?void 0:f.transferFeePaymentToken)||void 0===d?void 0:d.address:E);var P=p==o.OrderSide.Sell?v:0,O=P+i.APENFT_SELLER_BOUNTY_BASIS_POINTS>k;if(P>0&&O){var I="Total bounty exceeds the maximum for this asset type (".concat(k/100,"%).");throw k>=i.APENFT_SELLER_BOUNTY_BASIS_POINTS&&(I+=" Remember that It will add ".concat(i.APENFT_SELLER_BOUNTY_BASIS_POINTS/100,"% for referrers with OpenSea accounts!")),new Error(I)}return y&&(_=0,S=0,M=0,x=0,P=0,w=0,A=0),{buyerProtocolFeeBasisPoints:w,sellerProtocolFeeBasisPoints:A,totalBuyerFeeBasisPoints:_+M,totalSellerFeeBasisPoints:S+x,APENFTBuyerFeeBasisPoints:_,APENFTSellerFeeBasisPoints:S,devBuyerFeeBasisPoints:M,devSellerFeeBasisPoints:x,sellerBountyBasisPoints:P,transferFee:T,transferFeeTokenAddress:E}},t._getBuyFeeParameters=function(e,t,r,i,s){var u,l,c,f;return a(r,i),s?(u=s.waitingForBestCounterOrder?(0,n.makeBigNumber)(s.makerRelayerFee):(0,n.makeBigNumber)(s.takerRelayerFee),l=s.waitingForBestCounterOrder?(0,n.makeBigNumber)(s.takerRelayerFee):(0,n.makeBigNumber)(s.makerRelayerFee),c=(0,n.makeBigNumber)(e),f=(0,n.makeBigNumber)(t)):(u=(0,n.makeBigNumber)(r),l=(0,n.makeBigNumber)(i),c=(0,n.makeBigNumber)(e),f=(0,n.makeBigNumber)(t)),{makerRelayerFee:u,takerRelayerFee:l,makerProtocolFee:c,takerProtocolFee:f,makerReferrerFee:(0,n.makeBigNumber)(0),feeMethod:o.FeeMethod.SplitFee}},t._getSellFeeParameters=function(e,t,r,i,s,u){return void 0===u&&(u=0),a(r,i),{makerRelayerFee:s?(0,n.makeBigNumber)(r):(0,n.makeBigNumber)(i),takerRelayerFee:s?(0,n.makeBigNumber)(i):(0,n.makeBigNumber)(r),makerProtocolFee:s?(0,n.makeBigNumber)(e):(0,n.makeBigNumber)(t),takerProtocolFee:s?(0,n.makeBigNumber)(t):(0,n.makeBigNumber)(e),makerReferrerFee:(0,n.makeBigNumber)(u),feeMethod:o.FeeMethod.SplitFee}},t._validateFees=a},8033:function(e,t,r){"use strict";var n=r(5108),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.orderFromJSON=t.Sleep=t.checkResultFast=t.checkResult=t.getTokenList=t.orderSigEncode=t.orderParamsEncode=t.hashOrder=t.getSchemaList=t.getAccountBalance=t.web3Sign=t.makeBigNumber=t.assetToMetadata=t.getAPENFTAssetURI=t.toBaseUnitAmount=void 0;var s=r(2079),u=r(8447),l=r(3553);t.toBaseUnitAmount=function(e,t){var r=new l.BigNumber(10).pow(t);return e.times(r).integerValue()},t.getAPENFTAssetURI=function(e,t){return i(void 0,void 0,void 0,(function(){var r,n;return o(this,(function(i){switch(i.label){case 0:return[4,e.APENFTSharedAsset.methods._getOverrideURI(t).call()];case 1:return r=i.sent(),[4,e.APENFTSharedAsset.methods.uri(t).call()];case 2:return n=i.sent(),[2,{overURI:r,URI:n}]}}))}))},t.assetToMetadata=function(e,t){return{asset:{id:e.tokenId,address:e.tokenAddress,quantity:t},schema:e.schemaName}},t.makeBigNumber=function(e){return"0x"===e&&(e=0),e=e.toString(),new l.BigNumber(e)},t.web3Sign=function(e,t,r){return i(this,void 0,void 0,(function(){var r,i,a,s,u;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),r=t,e.utils.isString(t)&&!e.utils.isHex(t)&&(i=e.toHex(t).replace(/^0x/,""),a=e.utils.code.hexStr2byteArray(i),r=e.utils.ethersUtils.keccak256(a).replace(/^0x/,"")),e.defaultAddress&&2!==e.defaultAddress.type&&(r+="1"),[4,e.trx.sign(r.replace(/^0x/,""))];case 1:return s=o.sent(),"01"==(u=s.substring(128,130))?s=s.substring(0,128)+"1c":"00"==u&&(s=s.substring(0,128)+"1b"),n.log("msg to sign",t),n.log("hash to sign",r),n.log("signatureRes",s),[2,s];case 2:throw o.sent();case 3:return[2]}}))}))},t.getAccountBalance=function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return[4,e.trx.getBalance(t).catch((function(e){throw"Error"}))];case 1:return n=o.sent(),i=0,r?[4,r.methods.balanceOf(t).call().catch((function(e){throw"Error"}))]:[3,3];case 2:i=o.sent(),o.label=3;case 3:return[2,{ethBal:Number(n),erc20Bal:Number(i)}]}}))}))},t.getSchemaList=function(e,t){var r=s.schemas[e];if(!r)throw"Error";if(t&&(r=r.filter((function(e){return e.name===t}))),0===r.length)throw"Error";return r},t.hashOrder=function(e,t){return e.utils.soliditySha3({type:"address",value:t.exchange},{type:"address",value:t.maker},{type:"address",value:t.taker},{type:"uint256",value:t.makerRelayerFee},{type:"uint256",value:t.takerRelayerFee},{type:"uint256",value:t.takerProtocolFee},{type:"uint256",value:t.takerProtocolFee},{type:"address",value:t.feeRecipient},{type:"uint8",value:t.feeMethod},{type:"uint8",value:t.side},{type:"uint8",value:t.saleKind},{type:"address",value:t.target},{type:"uint8",value:t.howToCall},{type:"bytes",value:t.dataToCall},{type:"bytes",value:t.replacementPattern},{type:"address",value:t.staticTarget},{type:"bytes",value:t.staticExtradata},{type:"address",value:t.paymentToken},{type:"uint256",value:t.basePrice},{type:"uint256",value:t.extra},{type:"uint256",value:t.listingTime},{type:"uint256",value:t.expirationTime},{type:"uint256",value:t.salt}).toString("hex")},t.orderParamsEncode=function(e){for(var t=[],r=0,i=["exchange","maker","taker","makerRelayerFee","takerRelayerFee","makerProtocolFee","takerProtocolFee","feeRecipient","feeMethod","side","saleKind","target","howToCall","dataToCall","replacementPattern","staticTarget","staticExtradata","paymentToken","basePrice","extra","listingTime","expirationTime","salt"];r<i.length;r++){var o=i[r],a=e[o];void 0!==a?(l.BigNumber.isBigNumber(a)&&(a=a.toString()),t.push(a)):n.log("orderParamsEncode key undefined",o)}return t},t.orderSigEncode=function(e){for(var t=[],r=0,i=["v","r","s"];r<i.length;r++){var o=i[r];void 0!==e[o]?t.push(e[o]):n.log("orderSigEncode key undefined",o)}return t},t.getTokenList=function(e,t){var r=t.symbol,n=t.address,i=u.tokens[e];return r?a([],i.otherTokens,!0).filter((function(e){return e.symbol===r})):n?a([],i.otherTokens,!0).filter((function(e){return e.address===n})):a([],i.otherTokens,!0)},t.checkResult=function(e,r,n,a){return void 0===e&&(e=0),i(void 0,void 0,void 0,(function(){var i,s,u,l,c,f;return o(this,(function(o){switch(o.label){case 0:return 60===e?[2,n.reject({error:"Cannot find result in solidity node",transaction:a})]:[4,r.trx.getTransactionInfo(a.txID)];case 1:return i=o.sent(),Object.keys(i).length?i.result&&"FAILED"===i.result?[2,n.reject({error:r.toUtf8(i.resMessage),transaction:a,output:i})]:"contractResult"in i?"contract_address"in i?(s=r.address.fromHex(i.contract_address),[2,n.resolve(s)]):(n.eventEmitter.emit("receipt",{transaction:a,output:i}),[4,r.trx.getBlock("latest")]):[2,n.reject({error:"Failed to execute: "+JSON.stringify(i,null,2),transaction:a,output:i})]:[2,setTimeout((function(){(0,t.checkResult)(e+1,r,n,a)}),3e3)];case 2:return u=o.sent(),l=u.block_header.raw_data.number,c=i.blockNumber,f=l-c,[2,n.eventEmitter.emit("confirmation",f,i,a)]}}))}))},t.checkResultFast=function(e,r,n,a){return void 0===e&&(e=0),i(void 0,void 0,void 0,(function(){var i,s,u,l,c;return o(this,(function(o){switch(o.label){case 0:return 30===e?[2,n.reject({error:"Cannot find result in full-node",transaction:a})]:[4,r.trx.getUnconfirmedTransactionInfo(a.txID)];case 1:return i=o.sent(),Object.keys(i).length?(i.receipt&&n.eventEmitter.emit("receipt",{transaction:a,output:i}),i.result&&"FAILED"===i.result||i.receipt&&"SUCCESS"!==i.receipt.result?[2,n.reject({error:r.toUtf8(i.resMessage),transaction:a,output:i})]:"contractResult"in i?[4,r.trx.getBlock("latest")]:[2,n.reject({error:"Failed to execute: "+JSON.stringify(i,null,2),transaction:a,output:i})]):[2,setTimeout((function(){(0,t.checkResultFast)(e+1,r,n,a)}),2e3)];case 2:return s=o.sent(),u=s.block_header.raw_data.number,l=i.blockNumber,(c=u-l)>4&&(n.eventEmitter.emit("confirmation",c,i,a),"contract_address"in i)?(i.contract_address=r.address.fromHex(i.contract_address),[2,n.resolve(i)]):(n.eventEmitter.emit("confirming",c,i,a),setTimeout((function(){(0,t.checkResultFast)(e+1,r,n,a)}),2e3),[2])}}))}))},t.Sleep=function(e){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,new Promise((function(t,r){setTimeout((function(){t({status:"wakeUp"})}),e)}))]}))}))},t.orderFromJSON=function(e){var t=new Date;return{hash:e.hash||e.orderHash,cancelledOrFinalized:e.cancelled||e.finalized,markedInvalid:e.marked_invalid,metadata:e.metadata,quantity:new l.BigNumber(e.quantity||1),exchange:e.exchange,makerAccount:e.maker,takerAccount:e.taker,maker:e.maker,taker:e.taker,makerRelayerFee:new l.BigNumber(e.makerRelayerFee),takerRelayerFee:new l.BigNumber(e.takerRelayerFee),makerProtocolFee:new l.BigNumber(e.makerProtocolFee),takerProtocolFee:new l.BigNumber(e.takerProtocolFee),makerReferrerFee:new l.BigNumber(e.makerReferrerFee||0),waitingForBestCounterOrder:e.feeRecipient==l.NULL_ADDRESS,feeMethod:e.feeMethod,feeRecipientAccount:e.feeRecipient,feeRecipient:e.feeRecipient,side:e.side,saleKind:e.saleKind,target:e.target,howToCall:e.howToCall,dataToCall:e.dataToCall,replacementPattern:e.replacementPattern,staticTarget:e.staticTarget,staticExtradata:e.staticExtradata,paymentToken:e.paymentToken,basePrice:new l.BigNumber(e.basePrice),extra:new l.BigNumber(e.extra),currentBounty:new l.BigNumber(e.currentBounty||0),currentPrice:new l.BigNumber(e.currentPrice||0),createdTime:new l.BigNumber(Math.round(t.getTime()/1e3)),listingTime:new l.BigNumber(e.listingTime),expirationTime:new l.BigNumber(e.expirationTime),salt:new l.BigNumber(e.salt),v:Number.parseInt(e.v),r:e.r,s:e.s,paymentTokenContract:e.paymentToken||void 0,asset:e.asset||void 0,assetBundle:e.assetBundle||void 0}}},7919:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.orderFromJSON=t.assignOrdersToSides=t._makeMatchingOrder=t.computeOrderCallData=t.computeOrderParams=t._getStaticCallTargetAndExtraData=t.getCurrentPrice=t.orderToJSON=t.signOrderHash=t.hashAndValidateOrder=t.getOrderHash=t._makeSellOrder=t._makeBuyOrder=t.getTimeParameters=t.getPriceParameters=t.generatePseudoRandomSalt=t.getSchemaAndAsset=t.getAPENFTAsset=t.getSchema=void 0;var a=r(307),s=r(2079),u=r(2867),l=r(3553),c=r(8913),f=r(6135),d=r(8033);function h(e,t){var r=(0,d.getSchemaList)(e,t);if(0==r.length)throw"Error";return r[0]}function p(e,t,r){void 0===r&&(r=new l.BigNumber(1));var n=null!=t.tokenId?t.tokenId.toString():void 0;return e.assetFromFields({ID:n,Quantity:r.toString(),Address:t.tokenAddress,Name:t.name,Data:t.data||""})}function m(e,t,r){var n=h(e,t.schemaName),i=(0,d.makeBigNumber)(r);return{schema:n,APENFTAsset:p(n,t,i),quantityBN:i}}function y(){var e=l.BigNumber.random(l.MAX_DIGITS_IN_UNSIGNED_256_INT),t=new l.BigNumber(10).pow(l.MAX_DIGITS_IN_UNSIGNED_256_INT-1);return e.times(t).integerValue()}function g(e,t,r,n,i,o){void 0===i&&(i=!1);var a=null!=n?r-n:0,s=e,u=s.address,c=s.decimals||s.decimal,f=s.address==l.NULL_ADDRESS;if(isNaN(r)||null==r||r<0)throw"Starting price must be a number >= 0";if(!f&&!s)throw"No ERC-20 token found for '".concat(u,"'");if(f&&i)throw"English auctions must use wrapped ETH or an ERC-20 token.";if(a<0)throw"End price must be less than or equal to the start price.";if(a>0&&0==t)throw"Expiration time must be set if order will change in price.";if(o&&!i)throw"Reserve prices may only be set on English auctions.";if(o&&o<r)throw"Reserve price must be greater than or equal to the start amount.";return{basePrice:(0,d.toBaseUnitAmount)((0,d.makeBigNumber)(r),c),extra:(0,d.toBaseUnitAmount)((0,d.makeBigNumber)(a),c),paymentToken:u,reservePrice:o?(0,d.toBaseUnitAmount)((0,d.makeBigNumber)(o),c):void 0}}function v(e,t,r){void 0===r&&(r=!1);var n=Math.round(Date.now()/1e3+l.MIN_EXPIRATION_SECONDS);if(Math.round(Date.now()/1e3-1),0!=e&&e<n)throw"Expiration time must be at least ".concat(l.MIN_EXPIRATION_SECONDS," seconds from now, or zero (non-expiring).");if(t&&0!==e&&t>=e)throw"Listing time must be before the expiration time.";if(r&&0==e)throw"English auctions must have an expiration time.";if(r&&t)throw"Cannot schedule an English auction for the future.";if(Number.parseInt(e.toString())!=e)throw"Expiration timestamp must be a whole number of seconds";return r?(t=e,e+=l.ORDER_MATCHING_LATENCY_SECONDS):t=t||Math.round(Date.now()/1e3-100),{listingTime:(0,d.makeBigNumber)(t),expirationTime:(0,d.makeBigNumber)(e)}}function b(e,t){return i(this,void 0,void 0,(function(){var r,n;return o(this,(function(i){switch(i.label){case 0:r=(0,d.orderParamsEncode)(t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.methods.hashOrder(r).call()];case 2:if(!(n=i.sent()))throw{message:"orderHash undefined"};return[2,n];case 3:throw"exchangeHelper.methods.hashOrder "+i.sent().message;case 4:return[2]}}))}))}function w(e,t){return i(this,void 0,void 0,(function(){var r,n,i;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,(0,d.web3Sign)(e,t.hash,t.maker)];case 1:return n=o.sent(),i=n.replace(/^0x/,""),r={v:Number.parseInt(i.slice(128,130),16),r:"0x".concat(i.slice(0,64)),s:"0x".concat(i.slice(64,128))},[3,3];case 2:throw o.sent();case 3:return[2,r]}}))}))}function A(e){var t=e.networkName,r=(e.asset,e.useTxnOriginStaticCall);return i(this,void 0,void 0,(function(){return o(this,(function(e){return r?[2,{staticTarget:c.CONTRACTS_ADDRESSES[t].APENFTExchangeKeeper,staticExtradata:l.STATIC_EXTRADATA}]:[2,{staticTarget:l.NULL_ADDRESS,staticExtradata:"0x"}]}))}))}t.getSchema=h,t.getAPENFTAsset=p,t.getSchemaAndAsset=m,t.generatePseudoRandomSalt=y,t.getPriceParameters=g,t.getTimeParameters=v,t._makeBuyOrder=function(e){var t,r,n,c=e.networkName,f=e.exchangeAddr,d=e.asset,h=e.quantity,p=e.accountAddress,b=e.startAmount,w=e.expirationTime,_=void 0===w?0:w,S=e.paymentTokenObj,M=e.extraBountyBasisPoints,x=void 0===M?0:M,T=e.feeRecipientAddr,E=e.sellOrder;return e.referrerAddress,i(this,void 0,void 0,(function(){var e,i,w,M,k,P,O,I,R,N,C,B,F,L,D,j,U,$,q,K,H,W,z,G,Z,V,J,Y,X,Q;return o(this,(function(o){switch(o.label){case 0:return e=m(c,d,h),i=e.schema,w=e.APENFTAsset,M=e.quantityBN,k=E?E.maker:l.NULL_ADDRESS,P=(0,s.encodeBuy)(i,w,p),O=P.target,I=P.dataToCall,R=P.replacementPattern,N=g(S,_,b),C=N.basePrice,B=N.extra,F=N.paymentToken,L=v(_),[4,(0,u.computeFees)({asset:d,extraBountyBasisPoints:x,side:a.OrderSide.Buy,networkName:c})];case 1:return D=o.sent(),j=D.buyerProtocolFeeBasisPoints,U=D.sellerProtocolFeeBasisPoints,$=D.totalBuyerFeeBasisPoints,q=D.totalSellerFeeBasisPoints,K=E&&E.feeRecipient!==l.NULL_ADDRESS?l.NULL_ADDRESS:(null===(t=d.collection)||void 0===t?void 0:t.transferFeeAddress)&&(null===(r=d.collection)||void 0===r?void 0:r.transferFeeAddress)!==l.NULL_ADDRESS?null===(n=d.collection)||void 0===n?void 0:n.transferFeeAddress:T,H=(0,u._getBuyFeeParameters)(j,U,$,q,E),W=H.makerRelayerFee,z=H.takerRelayerFee,G=H.makerProtocolFee,Z=H.takerProtocolFee,V=H.makerReferrerFee,J=H.feeMethod,[4,A({networkName:c,asset:d,useTxnOriginStaticCall:!1})];case 2:return Y=o.sent(),X=Y.staticTarget,Q=Y.staticExtradata,[2,{exchange:f,maker:p,taker:k,quantity:M,makerRelayerFee:W,takerRelayerFee:z,makerProtocolFee:G,takerProtocolFee:Z,makerReferrerFee:V,waitingForBestCounterOrder:!1,feeMethod:J,feeRecipient:K,side:a.OrderSide.Buy,saleKind:a.SaleKind.FixedPrice,target:O,howToCall:a.HowToCall.Call,dataToCall:I,replacementPattern:R,staticTarget:X,staticExtradata:Q,paymentToken:F,basePrice:C,extra:B,listingTime:L.listingTime,expirationTime:L.expirationTime,salt:y(),metadata:{asset:w,schema:i.name,version:i.version}}]}}))}))},t._makeSellOrder=function(e){var t,r=e.networkName,n=e.exchangeAddr,c=e.asset,f=e.quantity,h=e.accountAddress,p=e.startAmount,b=e.endAmount,w=e.listingTime,_=e.expirationTime,S=e.waitForHighestBid,M=e.englishAuctionReservePrice,x=void 0===M?0:M,T=e.paymentTokenObj,E=e.extraBountyBasisPoints,k=e.feeRecipientAddr,P=e.buyerAddress;return i(this,void 0,void 0,(function(){var e,i,M,O,I,R,N,C,B,F,L,D,j,U,$,q,K,H,W,z,G,Z,V,J,Y,X,Q,ee,te,re,ne,ie,oe;return o(this,(function(o){switch(o.label){case 0:return e=m(r,c,f),i=e.schema,M=e.APENFTAsset,O=e.quantityBN,I=(0,s.encodeSell)(i,M,h),R=I.target,N=I.dataToCall,C=I.replacementPattern,B=void 0!==b&&b!==p?a.SaleKind.DutchAuction:a.SaleKind.FixedPrice,F=g(T,_,p,b,S,x),L=F.basePrice,D=F.extra,j=F.paymentToken,U=F.reservePrice,$=v(_,w,S),q=P!=l.NULL_ADDRESS,[4,(0,u.computeFees)({asset:c,side:a.OrderSide.Sell,isPrivate:q,extraBountyBasisPoints:E,networkName:r})];case 1:return K=o.sent(),H=K.buyerProtocolFeeBasisPoints,W=K.sellerProtocolFeeBasisPoints,z=K.totalSellerFeeBasisPoints,G=K.totalBuyerFeeBasisPoints,Z=K.sellerBountyBasisPoints,V=S?l.NULL_ADDRESS:(null===(t=c.collection)||void 0===t?void 0:t.transferFeeAddress)||k,J=(0,u._getSellFeeParameters)(H,W,G,z,S,Z),Y=J.makerRelayerFee,X=J.takerRelayerFee,Q=J.makerProtocolFee,ee=J.takerProtocolFee,te=J.makerReferrerFee,re=J.feeMethod,[4,A({networkName:r,asset:c,useTxnOriginStaticCall:S})];case 2:return ne=o.sent(),ie=ne.staticTarget,oe=ne.staticExtradata,[2,{exchange:n,maker:h,taker:P,quantity:O,makerRelayerFee:Y,takerRelayerFee:X,makerProtocolFee:Q,takerProtocolFee:ee,makerReferrerFee:te,waitingForBestCounterOrder:S,englishAuctionReservePrice:U?(0,d.makeBigNumber)(U):void 0,feeMethod:re,feeRecipient:V,side:a.OrderSide.Sell,saleKind:B,target:R,howToCall:a.HowToCall.Call,dataToCall:N,replacementPattern:C,staticTarget:ie,staticExtradata:oe,paymentToken:j,basePrice:L,extra:D,listingTime:$.listingTime,expirationTime:$.expirationTime,salt:y(),metadata:{asset:M,schema:i.name,version:i.version}}]}}))}))},t.getOrderHash=b,t.hashAndValidateOrder=function(e,r,a){return i(this,void 0,void 0,(function(){var i,s,u,l;return o(this,(function(o){switch(o.label){case 0:return[4,b(r,a)];case 1:return i=o.sent(),s=n(n({},a),{hash:i}),[4,w(e,s).catch((function(e){throw e}))];case 2:return u=o.sent(),l=n(n({},s),u),[4,(0,f.validateOrder)(r,l)];case 3:return o.sent(),[2,(0,t.orderToJSON)(l)]}}))}))},t.signOrderHash=w,t.orderToJSON=function(e){var t;return{exchange:e.exchange,maker:e.maker,taker:e.taker,makerRelayerFee:e.makerRelayerFee.toString(),takerRelayerFee:e.takerRelayerFee.toString(),makerProtocolFee:e.makerProtocolFee.toString(),takerProtocolFee:e.takerProtocolFee.toString(),makerReferrerFee:e.makerReferrerFee.toString(),feeMethod:e.feeMethod,feeRecipient:e.feeRecipient,side:e.side,saleKind:e.saleKind,target:e.target,howToCall:e.howToCall,dataToCall:e.dataToCall,replacementPattern:e.replacementPattern,staticTarget:e.staticTarget,staticExtradata:e.staticExtradata,paymentToken:e.paymentToken,quantity:e.quantity.toString(),basePrice:e.basePrice.toString(),englishAuctionReservePrice:null===(t=null==e?void 0:e.englishAuctionReservePrice)||void 0===t?void 0:t.toString(),extra:e.extra.toString(),listingTime:e.listingTime.toString(),expirationTime:e.expirationTime.toString(),salt:e.salt.toString(),metadata:e.metadata,v:e.v,r:e.r,s:e.s,hash:e.hash}},t.getCurrentPrice=function(e,t){var r,n,a,s,u,l;return i(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,e.methods.calculateFinalPrice(null===(r=t.side)||void 0===r?void 0:r.toString(),null===(n=t.saleKind)||void 0===n?void 0:n.toString(),null===(a=t.basePrice)||void 0===a?void 0:a.toString(),null===(s=t.extra)||void 0===s?void 0:s.toString(),null===(u=t.listingTime)||void 0===u?void 0:u.toString(),null===(l=t.expirationTime)||void 0===l?void 0:l.toString()).call()];case 1:return[2,i.sent()]}}))}))},t._getStaticCallTargetAndExtraData=A,t.computeOrderParams=function(e,t,r){if(e.metadata&&"asset"in e.metadata){var n=h(t,e.metadata.schema),i=e.metadata.asset;return e.side==a.OrderSide.Buy?(0,s.encodeSell)(n,i,r):(0,s.encodeBuy)(n,i,r)}throw"Invalid order metadata"},t.computeOrderCallData=function(e,t,r){if("asset"in e.metadata){var n=h(t,e.metadata.schema),i=e.metadata.asset;return e.side==a.OrderSide.Buy?(0,s.encodeBuy)(n,i,r):(0,s.encodeSell)(n,i,r)}throw"Invalid order metadata"},t._makeMatchingOrder=function(e){var r=e.networkName,n=e.unSignedOrder,i=e.accountAddress,o=e.assetRecipientAddress,s=e.feeRecipientAddress,u=n,c=(0,t.computeOrderParams)(u,r,o),f=c.target,h=c.dataToCall,p=c.replacementPattern,m=v(0),g=u.feeRecipient==l.NULL_ADDRESS?s:l.NULL_ADDRESS;return{exchange:u.exchange,maker:i,taker:u.maker,quantity:u.quantity,makerRelayerFee:u.makerRelayerFee,takerRelayerFee:u.takerRelayerFee,makerProtocolFee:u.makerProtocolFee,takerProtocolFee:u.takerProtocolFee,makerReferrerFee:u.makerReferrerFee,waitingForBestCounterOrder:!1,feeMethod:u.feeMethod,feeRecipient:g,side:(u.side+1)%2,saleKind:a.SaleKind.FixedPrice,target:f,howToCall:u.howToCall,dataToCall:h,replacementPattern:p,staticTarget:l.NULL_ADDRESS,staticExtradata:"0x",paymentToken:u.paymentToken,basePrice:u.basePrice,extra:(0,d.makeBigNumber)(0),listingTime:m.listingTime,expirationTime:m.expirationTime,salt:y(),metadata:u.metadata}},t.assignOrdersToSides=function(e,t){var r,i;return e.side==a.OrderSide.Sell?(i=e,r=n(n({},t),{v:i.v,r:i.r,s:i.s})):(r=e,i=n(n({},t),{v:r.v,r:r.r,s:r.s})),{buy:r,sell:i}},t.orderFromJSON=function(e){var t=new Date;return{hash:e.hash||e.orderHash,cancelledOrFinalized:e.cancelled||e.finalized,markedInvalid:e.marked_invalid,metadata:e.metadata,quantity:new l.BigNumber(e.quantity||1),exchange:e.exchange,makerAccount:e.maker,takerAccount:e.taker,maker:e.maker,taker:e.taker,makerRelayerFee:new l.BigNumber(e.makerRelayerFee),takerRelayerFee:new l.BigNumber(e.takerRelayerFee),makerProtocolFee:new l.BigNumber(e.makerProtocolFee),takerProtocolFee:new l.BigNumber(e.takerProtocolFee),makerReferrerFee:new l.BigNumber(e.makerReferrerFee||0),waitingForBestCounterOrder:new l.BigNumber(e.englishAuctionReservePrice).gt(0),feeMethod:e.feeMethod,feeRecipientAccount:e.feeRecipient,feeRecipient:e.feeRecipient,side:e.side,saleKind:e.saleKind,target:e.target,howToCall:e.howToCall,dataToCall:e.dataToCall,replacementPattern:e.replacementPattern,staticTarget:e.staticTarget,staticExtradata:e.staticExtradata,paymentToken:e.paymentToken,basePrice:new l.BigNumber(e.basePrice),extra:new l.BigNumber(e.extra),currentBounty:new l.BigNumber(e.currentBounty||0),currentPrice:new l.BigNumber(e.currentPrice||0),createdTime:new l.BigNumber(Math.round(t.getTime()/1e3)),listingTime:new l.BigNumber(e.listingTime),expirationTime:new l.BigNumber(e.expirationTime),salt:new l.BigNumber(e.salt),v:Number.parseInt(e.v),r:e.r,s:e.s,paymentTokenContract:e.paymentToken||void 0,asset:e.asset||void 0,assetBundle:e.assetBundle||void 0}}},307:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=t.CollectionTradeTrendFilterDays=t.AssetSortBy=t.AbiType=t.OfferType=t.StateMutability=t.FunctionOutputKind=t.FunctionInputKind=t.HowToCall=t.SaleKind=t.OrderType=t.OrderSide=t.FeeMethod=t.TokenStandardVersion=t.APENFTSchemaName=t.MakeOrderType=t.Network=t.TronWeb=void 0;var i,o,a,s,u,l,c,f,d,h,p,m,y,g,v,b,w,A=n(r(3666));t.TronWeb=A.default,(w=t.Network||(t.Network={})).Tron="tron",w.Shasta="shasta",(b=t.MakeOrderType||(t.MakeOrderType={})).FixPriceOrder="FixPriceOrder",b.DutchAuctionOrder="DutchAuctionOrder",b.EnglishAuctionOrder="EnglishAuctionOrder",b.LowerPriceOrder="LowerPriceOrder",b.MakeOfferOrder="MakeOfferOrder",b.EnglishAuctionBiddingOrder="EnglishAuctionBiddingOrder",(v=t.APENFTSchemaName||(t.APENFTSchemaName={})).ERC20="ERC20",v.ERC721="ERC721",v.ERC1155="ERC1155",(g=t.TokenStandardVersion||(t.TokenStandardVersion={})).Unsupported="unsupported",g.Locked="locked",g.Enjin="1155-1.0",g.ERC721v1="1.0",g.ERC721v2="2.0",g.ERC721v3="3.0",(y=t.FeeMethod||(t.FeeMethod={}))[y.ProtocolFee=0]="ProtocolFee",y[y.SplitFee=1]="SplitFee",(m=t.OrderSide||(t.OrderSide={}))[m.Buy=0]="Buy",m[m.Sell=1]="Sell",(p=t.OrderType||(t.OrderType={}))[p.All=-1]="All",p[p.Buy=0]="Buy",p[p.Sell=1]="Sell",(h=t.SaleKind||(t.SaleKind={}))[h.FixedPrice=0]="FixedPrice",h[h.DutchAuction=1]="DutchAuction",(d=t.HowToCall||(t.HowToCall={}))[d.Call=0]="Call",d[d.DelegateCall=1]="DelegateCall",d[d.StaticCall=2]="StaticCall",d[d.Create=3]="Create",(f=t.FunctionInputKind||(t.FunctionInputKind={})).Replaceable="replaceable",f.Asset="asset",f.Owner="owner",f.Index="index",f.Count="count",f.Data="data",(c=t.FunctionOutputKind||(t.FunctionOutputKind={})).Owner="owner",c.Asset="asset",c.Count="count",c.Other="other",(l=t.StateMutability||(t.StateMutability={})).Pure="pure",l.View="view",l.Payable="payable",l.Nonpayable="nonpayable",(u=t.OfferType||(t.OfferType={})).Default="default",u.ContractOffer="contract_offer",(s=t.AbiType||(t.AbiType={})).Function="function",s.Constructor="constructor",s.Event="event",s.Fallback="fallback",(a=t.AssetSortBy||(t.AssetSortBy={})).HighestLastSale="HighestLastSale",a.RecentlyListed="RecentlyListed",a.PriceLowToHigh="PriceLowToHigh",a.PriceHighToLow="PriceHighToLow",a.RecentlyTransfer="RecentlyTransfer",a.RecentlyCreated="RecentlyCreated",a.RecentlySold="RecentlySold",a.EndingSoon="EndingSoon",(o=t.CollectionTradeTrendFilterDays||(t.CollectionTradeTrendFilterDays={})).Days_7="Days_7",o.Days_14="Days_14",o.Days_30="Days_30",o.Days_60="Days_60",o.Days_90="Days_90",o.Days_365="Days_365",o.Days_All="Days_All",(i=t.EventType||(t.EventType={})).Transfer="Transfer",i.Offer="Offer",i.Listing="Listing",i.CancelOffer="CancelOffer",i.CancelListing="CancelListing",i.Mint="Mint",i.Burn="Burn",i.Sale="Sale"},974:function(e,t,r){"use strict";var n=r(5108),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.withPrecision=void 0;var o=i(r(4431));t.withPrecision=function(e,t){if(!e)return 0;try{var r=new o.default(10).exponentiatedBy(t),i=new o.default(e).multipliedBy(r),a=i.toExponential().match(/\d(?:\.(\d*))?e([+-]\d+)/);return Math.floor(1e4*i.toFixed(Math.max(0,(a[1]||"").length-a[2])))/1e4}catch(e){n.log(e)}}},5869:(e,t,r)=>{"use strict";function n(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(u())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(l,t.headers[l]);i.send(t.body||null)}))}r.r(t),r.d(t,{default:()=>n})},4927:(e,t,r)=>{var n=r(5108);function i(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?n.trace(t):n.warn(t),r=!0}return e.apply(this,arguments)}}},384:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:(e,t,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),a=r(5692);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,c=s(Object.prototype.toString),f=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(l)var m=s(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===c(e)}function v(e){return"[object Set]"===c(e)}function b(e){return"[object WeakMap]"===c(e)}function w(e){return"[object WeakSet]"===c(e)}function A(e){return"[object ArrayBuffer]"===c(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(A.working?A(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===c(e)}function M(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||M(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),t.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=M;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(e){return"[object SharedArrayBuffer]"===c(e)}function E(e){return void 0!==x&&(void 0===T.working&&(T.working=T(new x)),T.working?T(e):e instanceof x)}function k(e){return y(e,f)}function P(e){return y(e,d)}function O(e){return y(e,h)}function I(e){return u&&y(e,p)}function R(e){return l&&y(e,m)}t.isSharedArrayBuffer=E,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},t.isGeneratorObject=function(e){return"[object Generator]"===c(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},t.isNumberObject=k,t.isStringObject=P,t.isBooleanObject=O,t.isBigIntObject=I,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return k(e)||P(e)||O(e)||I(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||E(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:(e,t,r)=>{var n=r(4155),i=r(5108),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},a=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(a,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])v(s)||!S(s)?o+=" "+s:o+=" "+c(s);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var s={},u=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+l+"$","i")}function c(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),A(n.showHidden)&&(n.showHidden=!1),A(n.depth)&&(n.depth=2),A(n.colors)&&(n.colors=!1),A(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,e,n.depth)}function f(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function d(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&T(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=h(e,i,n)),i}var o=function(e,t){if(A(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(T(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return e.stylize(Date.prototype.toString.call(r),"date");if(x(r))return p(r)}var l,c="",f=!1,d=["{","}"];return y(r)&&(f=!0,d=["[","]"]),T(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(c=" "+RegExp.prototype.toString.call(r)),M(r)&&(c=" "+Date.prototype.toUTCString.call(r)),x(r)&&(c=" "+p(r)),0!==a.length||f&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),l=f?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)O(t,String(a))?o.push(m(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(m(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return m(e,r,n,s,t,f)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,d)):d[0]+c+d[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),O(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?h(e,u.value,null):h(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),A(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function y(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function A(e){return void 0===e}function _(e){return S(e)&&"[object RegExp]"===E(e)}function S(e){return"object"==typeof e&&null!==e}function M(e){return S(e)&&"[object Date]"===E(e)}function x(e){return S(e)&&("[object Error]"===E(e)||e instanceof Error)}function T(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(u.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=c,c.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]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=y,t.isBoolean=g,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=A,t.isRegExp=_,t.types.isRegExp=_,t.isObject=S,t.isDate=M,t.types.isDate=M,t.isError=x,t.types.isNativeError=x,t.isFunction=T,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;i.log("%s - %s",(r=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),P[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(I&&e[I]){var t;if("function"!=typeof(t=e[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),I&&Object.defineProperty(t,I,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=I,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(R.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},8966:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=Ze(r(8469)),o=Ze(r(7536)),a=Ze(r(1359)),s=Ze(r(557)),u=Ze(r(2315)),l=Ze(r(9466)),c=Ze(r(661)),f=Ze(r(3868)),d=Ze(r(2492)),h=Ze(r(8999)),p=Ze(r(1028)),m=Ze(r(7795)),y=Ze(r(221)),g=Ze(r(2549)),v=Ze(r(3494)),b=Ze(r(9493)),w=Ze(r(7380)),A=Ge(r(9234)),_=Ge(r(4583)),S=Ze(r(4986)),M=Ze(r(1513)),x=Ze(r(4595)),T=Ze(r(3928)),E=Ze(r(7245)),k=Ze(r(5566)),P=Ze(r(4094)),O=Ze(r(7146)),I=Ze(r(2941)),R=Ze(r(9019)),N=Ze(r(3590)),C=Ze(r(6826)),B=Ze(r(2828)),F=Ze(r(937)),L=Ge(r(9146)),D=Ze(r(5218)),j=Ze(r(7117)),U=Ze(r(6090)),$=Ze(r(8335)),q=Ze(r(6298)),K=Ze(r(6454)),H=Ze(r(6648)),W=Ze(r(4339)),z=Ge(r(8177)),G=Ze(r(2438)),Z=Ze(r(368)),V=Ze(r(8874)),J=Ze(r(4979)),Y=Ze(r(1008)),X=Ze(r(4069)),Q=Ze(r(4958)),ee=Ze(r(3235)),te=Ze(r(7278)),re=Ze(r(9131)),ne=Ze(r(3315)),ie=Ze(r(1464)),oe=Ze(r(7228)),ae=Ze(r(1592)),se=Ze(r(682)),ue=Ze(r(9396)),le=Ze(r(5807)),ce=Ze(r(7148)),fe=Ze(r(7612)),de=Ze(r(9887)),he=Ze(r(3058)),pe=Ge(r(8355)),me=Ze(r(2129)),ye=Ze(r(94)),ge=Ze(r(8021)),ve=Ze(r(9211)),be=Ze(r(5061)),we=Ze(r(4611)),Ae=Ze(r(1727)),_e=Ze(r(6776)),Se=Ze(r(9963)),Me=Ze(r(2782)),xe=Ze(r(5008)),Te=Ze(r(2689)),Ee=Ze(r(8983)),ke=Ze(r(2776)),Pe=Ze(r(4554)),Oe=Ze(r(478)),Ie=Ge(r(8140)),Re=Ze(r(4959)),Ne=Ze(r(9778)),Ce=Ze(r(4790)),Be=Ze(r(5152)),Fe=Ze(r(4816)),Le=Ze(r(8035)),De=Ze(r(4714)),je=Ze(r(4928)),Ue=Ze(r(8346)),$e=Ze(r(2900)),qe=Ze(r(8220)),Ke=Ze(r(6023)),He=Ze(r(7633)),We=Ze(r(5977));function ze(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return ze=function(){return e},e}function Ge(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var t=ze();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}function Ze(e){return e&&e.__esModule?e:{default:e}}var Ve={version:"13.9.0",toDate:i.default,toFloat:o.default,toInt:a.default,toBoolean:s.default,equals:u.default,contains:l.default,matches:c.default,isEmail:f.default,isURL:d.default,isMACAddress:h.default,isIP:p.default,isIPRange:m.default,isFQDN:y.default,isBoolean:b.default,isIBAN:z.default,isBIC:G.default,isAlpha:A.default,isAlphaLocales:A.locales,isAlphanumeric:_.default,isAlphanumericLocales:_.locales,isNumeric:S.default,isPassportNumber:M.default,isPort:x.default,isLowercase:T.default,isUppercase:E.default,isAscii:P.default,isFullWidth:O.default,isHalfWidth:I.default,isVariableWidth:R.default,isMultibyte:N.default,isSemVer:C.default,isSurrogatePair:B.default,isInt:F.default,isIMEI:k.default,isFloat:L.default,isFloatLocales:L.locales,isDecimal:D.default,isHexadecimal:j.default,isOctal:U.default,isDivisibleBy:$.default,isHexColor:q.default,isRgbColor:K.default,isHSL:H.default,isISRC:W.default,isMD5:Z.default,isHash:V.default,isJWT:J.default,isJSON:Y.default,isEmpty:X.default,isLength:Q.default,isLocale:w.default,isByteLength:ee.default,isUUID:te.default,isMongoId:re.default,isAfter:ne.default,isBefore:ie.default,isIn:oe.default,isLuhnNumber:ae.default,isCreditCard:se.default,isIdentityCard:ue.default,isEAN:le.default,isISIN:ce.default,isISBN:fe.default,isISSN:de.default,isMobilePhone:pe.default,isMobilePhoneLocales:pe.locales,isPostalCode:Ie.default,isPostalCodeLocales:Ie.locales,isEthereumAddress:me.default,isCurrency:ye.default,isBtcAddress:ge.default,isISO6391:ve.default,isISO8601:be.default,isRFC3339:we.default,isISO31661Alpha2:Ae.default,isISO31661Alpha3:_e.default,isISO4217:Se.default,isBase32:Me.default,isBase58:xe.default,isBase64:Te.default,isDataURI:Ee.default,isMagnetURI:ke.default,isMimeType:Pe.default,isLatLong:Oe.default,ltrim:Re.default,rtrim:Ne.default,trim:Ce.default,escape:Be.default,unescape:Fe.default,stripLow:Le.default,whitelist:De.default,blacklist:je.default,isWhitelisted:Ue.default,normalizeEmail:$e.default,toString,isSlug:qe.default,isStrongPassword:He.default,isTaxID:he.default,isDate:g.default,isTime:v.default,isLicensePlate:Ke.default,isVAT:We.default,ibanLocales:z.locales};t.default=Ve,e.exports=t.default,e.exports.default=t.default},79:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commaDecimal=t.dotDecimal=t.bengaliLocales=t.farsiLocales=t.arabicLocales=t.englishLocales=t.decimal=t.alphanumeric=t.alpha=void 0;var r={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ώ]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fa-IR":/^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,"fi-FI":/^[A-ZÅÄÖ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๐\s]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"vi-VN":/^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,"ko-KR":/^[ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[א-ת]+$/,fa:/^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/};t.alpha=r;var n={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fi-FI":/^[0-9A-ZÅÄÖ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"ja-JP":/^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"th-TH":/^[ก-๙\s]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ko-KR":/^[0-9ㄱ-ㅎㅏ-ㅣ가-힣]*$/,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,"vi-VN":/^[0-9A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,he:/^[0-9א-ת]+$/,fa:/^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,bn:/^['ঀঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃৄেৈোৌ্ৎৗড়ঢ়য়ৠৡৢৣ০১২৩৪৫৬৭৮৯ৰৱ৲৳৴৵৶৷৸৹৺৻']+$/,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/};t.alphanumeric=n;var i={"en-US":".",ar:"٫"};t.decimal=i;var o=["AU","GB","HK","IN","NZ","ZA","ZM"];t.englishLocales=o;for(var a,s=0;s<o.length;s++)r[a="en-".concat(o[s])]=r["en-US"],n[a]=n["en-US"],i[a]=i["en-US"];var u=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];t.arabicLocales=u;for(var l,c=0;c<u.length;c++)r[l="ar-".concat(u[c])]=r.ar,n[l]=n.ar,i[l]=i.ar;var f=["IR","AF"];t.farsiLocales=f;for(var d,h=0;h<f.length;h++)n[d="fa-".concat(f[h])]=n.fa,i[d]=i.ar;var p=["BD","IN"];t.bengaliLocales=p;for(var m,y=0;y<p.length;y++)r[m="bn-".concat(p[y])]=r.bn,n[m]=n.bn,i[m]=i["en-US"];var g=["ar-EG","ar-LB","ar-LY"];t.dotDecimal=g;var v=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"];t.commaDecimal=v;for(var b=0;b<g.length;b++)i[g[b]]=i["en-US"];for(var w=0;w<v.length;w++)i[v[w]]=",";r["fr-CA"]=r["fr-FR"],n["fr-CA"]=n["fr-FR"],r["pt-BR"]=r["pt-PT"],n["pt-BR"]=n["pt-PT"],i["pt-BR"]=i["pt-PT"],r["pl-Pl"]=r["pl-PL"],n["pl-Pl"]=n["pl-PL"],i["pl-Pl"]=i["pl-PL"],r["fa-AF"]=r.fa},4928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),e.replace(new RegExp("[".concat(t,"]+"),"g"),"")};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},9466:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){return(0,n.default)(e),(r=(0,o.default)(r,s)).ignoreCase?e.toLowerCase().split((0,i.default)(t).toLowerCase()).length>r.minOccurrences:e.split((0,i.default)(t)).length>r.minOccurrences};var n=a(r(5571)),i=a(r(1913)),o=a(r(4808));function a(e){return e&&e.__esModule?e:{default:e}}var s={ignoreCase:!1,minOccurrences:1};e.exports=t.default,e.exports.default=t.default},2315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),e===t};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},5152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},3315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=(null==t?void 0:t.comparisonDate)||t||Date().toString(),n=(0,i.default)(r),o=(0,i.default)(e);return!!(o&&n&&o>n)};var n,i=(n=r(8469))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},9234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(e);var n=e,a=r.ignore;if(a)if(a instanceof RegExp)n=n.replace(a,"");else{if("string"!=typeof a)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(a.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(t in o.alpha)return o.alpha[t].test(n);throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=r(79),a=Object.keys(o.alpha);t.locales=a},4583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(e);var n=e,a=r.ignore;if(a)if(a instanceof RegExp)n=n.replace(a,"");else{if("string"!=typeof a)throw new Error("ignore should be instance of a String or RegExp");n=n.replace(new RegExp("[".concat(a.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"")}if(t in o.alphanumeric)return o.alphanumeric[t].test(n);throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=r(79),a=Object.keys(o.alphanumeric);t.locales=a},4094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[\x00-\x7F]+$/;e.exports=t.default,e.exports.default=t.default},2438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t=e.slice(4,6).toUpperCase();return!(!o.CountryCodes.has(t)&&"XK"!==t)&&a.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=r(1727),a=/^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;e.exports=t.default,e.exports.default=t.default},2782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(e),(t=(0,i.default)(t,u)).crockford?s.test(e):!(e.length%8!=0||!a.test(e))};var n=o(r(5571)),i=o(r(4808));function o(e){return e&&e.__esModule?e:{default:e}}var a=/^[A-Z2-7]+=*$/,s=/^[A-HJKMNP-TV-Z0-9]+$/,u={crockford:!1};e.exports=t.default,e.exports.default=t.default},5008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),!!o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[A-HJ-NP-Za-km-z1-9]*$/;e.exports=t.default,e.exports.default=t.default},2689:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),t=(0,i.default)(t,u);var r=e.length;if(t.urlSafe)return s.test(e);if(r%4!=0||a.test(e))return!1;var o=e.indexOf("=");return-1===o||o===r-1||o===r-2&&"="===e[r-1]};var n=o(r(5571)),i=o(r(4808));function o(e){return e&&e.__esModule?e:{default:e}}var a=/[^A-Z0-9+\/=]/i,s=/^[A-Z0-9_\-]*$/i,u={urlSafe:!1};e.exports=t.default,e.exports.default=t.default},1464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);(0,n.default)(e);var r=(0,i.default)(t),o=(0,i.default)(e);return!!(o&&r&&o<r)};var n=o(r(5571)),i=o(r(8469));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},9493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;return(0,i.default)(e),t.loose?s.includes(e.toLowerCase()):a.includes(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={loose:!1},a=["true","false","1","0"],s=[].concat(a,["yes","no"]);e.exports=t.default,e.exports.default=t.default},8021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)||a.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(bc1)[a-z0-9]{25,39}$/,a=/^(1|3)[A-HJ-NP-Za-km-z1-9]{25,39}$/;e.exports=t.default,e.exports.default=t.default},3235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n;(0,i.default)(e),"object"===o(t)?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var a=encodeURI(e).split(/%..|./).length-1;return a>=r&&(void 0===n||a<=n)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}e.exports=t.default,e.exports.default=t.default},682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(e);var r=t.provider,o=e.replace(/[- ]+/g,"");if(r&&r.toLowerCase()in a){if(!a[r.toLowerCase()].test(o))return!1}else{if(r&&!(r.toLowerCase()in a))throw new Error("".concat(r," is not a valid credit card provider."));if(!s.test(o))return!1}return(0,i.default)(e)};var n=o(r(5571)),i=o(r(1592));function o(e){return e&&e.__esModule?e:{default:e}}var a={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},s=/^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;e.exports=t.default,e.exports.default=t.default},94:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),function(e){var t="\\d{".concat(e.digits_after_decimal[0],"}");e.digits_after_decimal.forEach((function(e,r){0!==r&&(t="".concat(t,"|\\d{").concat(e,"}"))}));var r="(".concat(e.symbol.replace(/\W/,(function(e){return"\\".concat(e)})),")").concat(e.require_symbol?"":"?"),n="-?",i="[1-9]\\d{0,2}(\\".concat(e.thousands_separator,"\\d{3})*"),o="(".concat(["0","[1-9]\\d*",i].join("|"),")?"),a="(\\".concat(e.decimal_separator,"(").concat(t,"))").concat(e.require_decimal?"":"?"),s=o+(e.allow_decimal||e.require_decimal?a:"");return e.allow_negatives&&!e.parens_for_negatives&&(e.negative_sign_after_digits?s+=n:e.negative_sign_before_digits&&(s=n+s)),e.allow_negative_sign_placeholder?s="( (?!\\-))?".concat(s):e.allow_space_after_symbol?s=" ?".concat(s):e.allow_space_after_digits&&(s+="( (?!$))?"),e.symbol_after_digits?s+=r:s=r+s,e.allow_negatives&&(e.parens_for_negatives?s="(\\(".concat(s,"\\)|").concat(s,")"):e.negative_sign_before_digits||e.negative_sign_after_digits||(s=n+s)),new RegExp("^(?!-? )(?=.*\\d)".concat(s,"$"))}(t=(0,n.default)(t,a)).test(e)};var n=o(r(4808)),i=o(r(5571));function o(e){return e&&e.__esModule?e:{default:e}}var a={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};e.exports=t.default,e.exports.default=t.default},8983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t=e.split(",");if(t.length<2)return!1;var r=t.shift().trim().split(";"),n=r.shift();if("data:"!==n.slice(0,5))return!1;var u=n.slice(5);if(""!==u&&!o.test(u))return!1;for(var l=0;l<r.length;l++)if((l!==r.length-1||"base64"!==r[l].toLowerCase())&&!a.test(r[l]))return!1;for(var c=0;c<t.length;c++)if(!s.test(t[c]))return!1;return!0};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[a-z]+\/[a-z0-9\-\+\._]+$/i,a=/^[a-z\-]+=[a-z0-9\-]+$/i,s=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;e.exports=t.default,e.exports.default=t.default},2549:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t="string"==typeof t?(0,i.default)({format:t},s):(0,i.default)(t,s),"string"==typeof e&&(m=t.format,/(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(m))){var r,n=t.delimiters.find((function(e){return-1!==t.format.indexOf(e)})),a=t.strictMode?n:t.delimiters.find((function(t){return-1!==e.indexOf(t)})),u=function(e,t){for(var r=[],n=Math.min(e.length,t.length),i=0;i<n;i++)r.push([e[i],t[i]]);return r}(e.split(a),t.format.toLowerCase().split(n)),l={},c=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=o(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}(u);try{for(c.s();!(r=c.n()).done;){var f=(p=r.value,2,function(e){if(Array.isArray(e))return e}(p)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),2!==r.length);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(p)||o(p,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=f[0],h=f[1];if(d.length!==h.length)return!1;l[h.charAt(0)]=d}}catch(e){c.e(e)}finally{c.f()}return new Date("".concat(l.m,"/").concat(l.d,"/").concat(l.y)).getDate()===+l.d}var p,m;return!t.strictMode&&("[object Date]"===Object.prototype.toString.call(e)&&isFinite(e))};var n,i=(n=r(4808))&&n.__esModule?n:{default:n};function o(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var s={format:"YYYY/MM/DD",delimiters:["/","-"],strictMode:!1};e.exports=t.default,e.exports.default=t.default},5218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),(t=(0,n.default)(t,u)).locale in a.decimal)return!(0,o.default)(l,e.replace(/ /g,""))&&function(e){return new RegExp("^[-+]?([0-9]+)?(\\".concat(a.decimal[e.locale],"[0-9]{").concat(e.decimal_digits,"})").concat(e.force_decimal?"":"?","$"))}(t).test(e);throw new Error("Invalid locale '".concat(t.locale,"'"))};var n=s(r(4808)),i=s(r(5571)),o=s(r(8343)),a=r(79);function s(e){return e&&e.__esModule?e:{default:e}}var u={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},l=["","-","+"];e.exports=t.default,e.exports.default=t.default},8335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(e),(0,i.default)(e)%parseInt(t,10)==0};var n=o(r(5571)),i=o(r(7536));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},5807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t,r,n=Number(e.slice(-1));return s.test(e)&&n===((r=10-(t=e).slice(0,-1).split("").map((function(e,r){return Number(e)*function(e,t){return e===o||e===a?t%2==0?3:1:t%2==0?1:3}(t.length,r)})).reduce((function(e,t){return e+t}),0)%10)<10?r:0)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=8,a=14,s=/^(\d{8}|\d{13}|\d{14})$/;e.exports=t.default,e.exports.default=t.default},3868:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),(t=(0,i.default)(t,l)).require_display_name||t.allow_display_name){var r=e.match(c);if(r){var u=r[1];if(e=e.replace(u,"").replace(/(^<|>$)/g,""),u.endsWith(" ")&&(u=u.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(t.split('"').length!==t.split('\\"').length)return!1}return!0}(u))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>y)return!1;var g=e.split("@"),v=g.pop(),b=v.toLowerCase();if(t.host_blacklist.includes(b))return!1;if(t.host_whitelist.length>0&&!t.host_whitelist.includes(b))return!1;var w=g.join("@");if(t.domain_specific_validation&&("gmail.com"===b||"googlemail.com"===b)){var A=(w=w.toLowerCase()).split("+")[0];if(!(0,o.default)(A.replace(/\./g,""),{min:6,max:30}))return!1;for(var _=A.split("."),S=0;S<_.length;S++)if(!d.test(_[S]))return!1}if(!(!1!==t.ignore_max_length||(0,o.default)(w,{max:64})&&(0,o.default)(v,{max:254})))return!1;if(!(0,a.default)(v,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length})){if(!t.allow_ip_domain)return!1;if(!(0,s.default)(v)){if(!v.startsWith("[")||!v.endsWith("]"))return!1;var M=v.slice(1,-1);if(0===M.length||!(0,s.default)(M))return!1}}if('"'===w[0])return w=w.slice(1,w.length-1),t.allow_utf8_local_part?m.test(w):h.test(w);for(var x=t.allow_utf8_local_part?p:f,T=w.split("."),E=0;E<T.length;E++)if(!x.test(T[E]))return!1;return!t.blacklisted_chars||-1===w.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g"))};var n=u(r(5571)),i=u(r(4808)),o=u(r(3235)),a=u(r(221)),s=u(r(1028));function u(e){return e&&e.__esModule?e:{default:e}}var l={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},c=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,d=/^[a-z\d]+$/,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,p=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,m=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,y=254;e.exports=t.default,e.exports.default=t.default},4069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(e),0===((t=(0,i.default)(t,a)).ignore_whitespace?e.trim().length:e.length)};var n=o(r(5571)),i=o(r(4808));function o(e){return e&&e.__esModule?e:{default:e}}var a={ignore_whitespace:!1};e.exports=t.default,e.exports.default=t.default},2129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(0x)[0-9a-f]{40}$/i;e.exports=t.default,e.exports.default=t.default},221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),(t=(0,i.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1)),!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var r=e.split("."),o=r[r.length-1];if(t.require_tld){if(r.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(o))return!1;if(/\s/.test(o))return!1}return!(!t.allow_numeric_tld&&/^\d+$/.test(o))&&r.every((function(e){return!(e.length>63&&!t.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)||/[\uff01-\uff5e]/.test(e)||/^-|-$/.test(e)||!t.allow_underscores&&/_/.test(e))}))};var n=o(r(5571)),i=o(r(4808));function o(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default},9146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e),t=t||{};var r=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(t.locale?o.decimal[t.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(""===e||"."===e||","===e||"-"===e||"+"===e)return!1;var n=parseFloat(e.replace(",","."));return r.test(e)&&(!t.hasOwnProperty("min")||n>=t.min)&&(!t.hasOwnProperty("max")||n<=t.max)&&(!t.hasOwnProperty("lt")||n<t.lt)&&(!t.hasOwnProperty("gt")||n>t.gt)},t.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=r(79),a=Object.keys(o.decimal);t.locales=a},7146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)},t.fullWidth=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;t.fullWidth=o},6648:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t=e.replace(/\s+/g," ").replace(/\s?(hsla?\(|\)|,)\s?/gi,"$1");return-1!==t.indexOf(",")?o.test(t):a.test(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(,(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}(,((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?))?\)$/i,a=/^hsla?\(((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?))(deg|grad|rad|turn)?(\s(\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%){2}\s?(\/\s((\+|\-)?([0-9]+(\.[0-9]+)?(e(\+|\-)?[0-9]+)?|\.[0-9]+(e(\+|\-)?[0-9]+)?)%?)\s?)?\)$/i;e.exports=t.default,e.exports.default=t.default},2941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)},t.halfWidth=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;t.halfWidth=o},8874:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),new RegExp("^[a-fA-F0-9]{".concat(o[t],"}$")).test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};e.exports=t.default,e.exports.default=t.default},6298:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;e.exports=t.default,e.exports.default=t.default},7117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(0x|0h)?[0-9A-F]+$/i;e.exports=t.default,e.exports.default=t.default},8177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),function(e){var t=e.replace(/[\s\-]+/gi,"").toUpperCase(),r=t.slice(0,2).toUpperCase();return r in o&&o[r].test(t)}(e)&&function(e){var t=e.replace(/[^A-Z0-9]+/gi,"").toUpperCase();return 1===(t.slice(4)+t.slice(0,4)).replace(/[A-Z]/g,(function(e){return e.charCodeAt(0)-55})).match(/\d{1,7}/g).reduce((function(e,t){return Number(e+t)%97}),"")}(e)},t.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/},a=Object.keys(o);t.locales=a},5566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=o;if((t=t||{}).allow_hyphens&&(r=a),!r.test(e))return!1;e=e.replace(/-/g,"");for(var n=0,s=2,u=0;u<14;u++){var l=e.substring(14-u-1,14-u),c=parseInt(l,10)*s;n+=c>=10?c%10+1:c,1===s?s+=1:s-=1}return(10-n%10)%10===parseInt(e.substring(14,15),10)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[0-9]{15}$/,a=/^\d{2}-\d{6}-\d{6}-\d{1}$/;e.exports=t.default,e.exports.default=t.default},1028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,i.default)(t),(r=String(r))?"4"===r?s.test(t):"6"===r&&l.test(t):e(t,4)||e(t,6)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",a="(".concat(o,"[.]){3}").concat(o),s=new RegExp("^".concat(a,"$")),u="(?:[0-9a-fA-F]{1,4})",l=new RegExp("^("+"(?:".concat(u,":){7}(?:").concat(u,"|:)|")+"(?:".concat(u,":){6}(?:").concat(a,"|:").concat(u,"|:)|")+"(?:".concat(u,":){5}(?::").concat(a,"|(:").concat(u,"){1,2}|:)|")+"(?:".concat(u,":){4}(?:(:").concat(u,"){0,1}:").concat(a,"|(:").concat(u,"){1,3}|:)|")+"(?:".concat(u,":){3}(?:(:").concat(u,"){0,2}:").concat(a,"|(:").concat(u,"){1,4}|:)|")+"(?:".concat(u,":){2}(?:(:").concat(u,"){0,3}:").concat(a,"|(:").concat(u,"){1,5}|:)|")+"(?:".concat(u,":){1}(?:(:").concat(u,"){0,4}:").concat(a,"|(:").concat(u,"){1,6}|:)|")+"(?::((?::".concat(u,"){0,5}:").concat(a,"|(?::").concat(u,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default},7795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,n.default)(e);var r=e.split("/");if(2!==r.length)return!1;if(!a.test(r[1]))return!1;if(r[1].length>1&&r[1].startsWith("0"))return!1;if(!(0,i.default)(r[0],t))return!1;var o=null;switch(String(t)){case"4":o=s;break;case"6":o=u;break;default:o=(0,i.default)(r[0],"6")?u:s}return r[1]<=o&&r[1]>=0};var n=o(r(5571)),i=o(r(1028));function o(e){return e&&e.__esModule?e:{default:e}}var a=/^\d{1,3}$/,s=32,u=128;e.exports=t.default,e.exports.default=t.default},7612:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,r){(0,i.default)(t);var n=String((null==r?void 0:r.version)||r);if(!(null!=r&&r.version||r))return e(t,{version:10})||e(t,{version:13});var u=t.replace(/[\s-]+/g,""),l=0;if("10"===n){if(!o.test(u))return!1;for(var c=0;c<n-1;c++)l+=(c+1)*u.charAt(c);if("X"===u.charAt(9)?l+=100:l+=10*u.charAt(9),l%11==0)return!0}else if("13"===n){if(!a.test(u))return!1;for(var f=0;f<12;f++)l+=s[f%2]*u.charAt(f);if(u.charAt(12)-(10-l%10)%10==0)return!0}return!1};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(?:[0-9]{9}X|[0-9]{10})$/,a=/^(?:[0-9]{13})$/,s=[1,3];e.exports=t.default,e.exports.default=t.default},7148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,i.default)(e),!o.test(e))return!1;for(var t=!0,r=0,n=e.length-2;n>=0;n--)if(e[n]>="A"&&e[n]<="Z")for(var a=e[n].charCodeAt(0)-55,s=0,u=[a%10,Math.trunc(a/10)];s<u.length;s++){var l=u[s];r+=t?l>=5?1+2*(l-5):2*l:l,t=!t}else{var c=e[n].charCodeAt(0)-"0".charCodeAt(0);r+=t?c>=5?1+2*(c-5):2*c:c,t=!t}var f=10*Math.trunc((r+9)/10)-r;return+e[e.length-1]===f};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;e.exports=t.default,e.exports.default=t.default},1727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.has(e.toUpperCase())},t.CountryCodes=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=new Set(["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]),a=o;t.CountryCodes=a},6776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.has(e.toUpperCase())};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=new Set(["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"]);e.exports=t.default,e.exports.default=t.default},9963:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.has(e.toUpperCase())},t.CurrencyCodes=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLL","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VES","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XCD","XDR","XOF","XPD","XPF","XPT","XSU","XTS","XUA","XXX","YER","ZAR","ZMW","ZWL"]),a=o;t.CurrencyCodes=a},9211:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.has(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=new Set(["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"]);e.exports=t.default,e.exports.default=t.default},5061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(e);var r=t.strictSeparator?a.test(e):o.test(e);return r&&t.strict?s(e):r};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,a=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,s=function(e){var t=e.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(t){var r=Number(t[1]),n=Number(t[2]);return r%4==0&&r%100!=0||r%400==0?n<=366:n<=365}var i=e.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),o=i[1],a=i[2],s=i[3],u=a?"0".concat(a).slice(-2):a,l=s?"0".concat(s).slice(-2):s,c=new Date("".concat(o,"-").concat(u||"01","-").concat(l||"01"));return!a||!s||c.getUTCFullYear()===o&&c.getUTCMonth()+1===a&&c.getUTCDate()===s};e.exports=t.default,e.exports.default=t.default},4339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;e.exports=t.default,e.exports.default=t.default},9887:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(e);var r=o;if(r=t.require_hyphen?r.replace("?",""):r,!(r=t.case_sensitive?new RegExp(r):new RegExp(r,"i")).test(e))return!1;for(var n=e.replace("-","").toUpperCase(),a=0,s=0;s<n.length;s++){var u=n[s];a+=("X"===u?10:+u)*(8-s)}return a%11==0};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o="^\\d{4}-?\\d{3}[\\dX]$";e.exports=t.default,e.exports.default=t.default},9396:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),t in a)return a[t](e);if("any"===t){for(var r in a)if(a.hasOwnProperty(r)&&(0,a[r])(e))return!0;return!1}throw new Error("Invalid locale '".concat(t,"'"))};var n=o(r(5571)),i=o(r(937));function o(e){return e&&e.__esModule?e:{default:e}}var a={PL:function(e){(0,n.default)(e);var t={1:1,2:3,3:7,4:9,5:1,6:3,7:7,8:9,9:1,10:3,11:0};if(null!=e&&11===e.length&&(0,i.default)(e,{allow_leading_zeroes:!0})){var r=e.split("").slice(0,-1).reduce((function(e,r,n){return e+Number(r)*t[n+1]}),0)%10,o=Number(e.charAt(e.length-1));if(0===r&&0===o||o===10-r)return!0}return!1},ES:function(e){(0,n.default)(e);var t={X:0,Y:1,Z:2},r=e.trim().toUpperCase();if(!/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/.test(r))return!1;var i=r.slice(0,-1).replace(/[X,Y,Z]/g,(function(e){return t[e]}));return r.endsWith(["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"][i%23])},FI:function(e){return(0,n.default)(e),11===e.length&&(!!e.match(/^\d{6}[\-A\+]\d{3}[0-9ABCDEFHJKLMNPRSTUVWXY]{1}$/)&&"0123456789ABCDEFHJKLMNPRSTUVWXY"[(1e3*parseInt(e.slice(0,6),10)+parseInt(e.slice(7,10),10))%31]===e.slice(10,11))},IN:function(e){var t=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],r=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],n=e.trim();if(!/^[1-9]\d{3}\s?\d{4}\s?\d{4}$/.test(n))return!1;var i=0;return n.replace(/\s/g,"").split("").map(Number).reverse().forEach((function(e,n){i=t[i][r[n%8][e]]})),0===i},IR:function(e){if(!e.match(/^\d{10}$/))return!1;if(e="0000".concat(e).slice(e.length-6),0===parseInt(e.slice(3,9),10))return!1;for(var t=parseInt(e.slice(9,10),10),r=0,n=0;n<9;n++)r+=parseInt(e.slice(n,n+1),10)*(10-n);return(r%=11)<2&&t===r||r>=2&&t===11-r},IT:function(e){return 9===e.length&&"CA00000AA"!==e&&e.search(/C[A-Z][0-9]{5}[A-Z]{2}/i)>-1},NO:function(e){var t=e.trim();if(isNaN(Number(t)))return!1;if(11!==t.length)return!1;if("00000000000"===t)return!1;var r=t.split("").map(Number),n=(11-(3*r[0]+7*r[1]+6*r[2]+1*r[3]+8*r[4]+9*r[5]+4*r[6]+5*r[7]+2*r[8])%11)%11,i=(11-(5*r[0]+4*r[1]+3*r[2]+2*r[3]+7*r[4]+6*r[5]+5*r[6]+4*r[7]+3*r[8]+2*n)%11)%11;return n===r[9]&&i===r[10]},TH:function(e){if(!e.match(/^[1-8]\d{12}$/))return!1;for(var t=0,r=0;r<12;r++)t+=parseInt(e[r],10)*(13-r);return e[12]===((11-t%11)%10).toString()},LK:function(e){return!(10!==e.length||!/^[1-9]\d{8}[vx]$/i.test(e))||!(12!==e.length||!/^[1-9]\d{11}$/i.test(e))},"he-IL":function(e){var t=e.trim();if(!/^\d{9}$/.test(t))return!1;for(var r,n=t,i=0,o=0;o<n.length;o++)i+=(r=Number(n[o])*(o%2+1))>9?r-9:r;return i%10==0},"ar-LY":function(e){var t=e.trim();return!!/^(1|2)\d{11}$/.test(t)},"ar-TN":function(e){var t=e.trim();return!!/^\d{8}$/.test(t)},"zh-CN":function(e){var t,r=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],n=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],i=["1","0","X","9","8","7","6","5","4","3","2"],o=function(e){return r.includes(e)},a=function(e){var t=parseInt(e.substring(0,4),10),r=parseInt(e.substring(4,6),10),n=parseInt(e.substring(6),10),i=new Date(t,r-1,n);return!(i>new Date)&&i.getFullYear()===t&&i.getMonth()===r-1&&i.getDate()===n};return!!/^\d{15}|(\d{17}(\d|x|X))$/.test(t=e)&&(15===t.length?function(e){var t=/^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(e);if(!t)return!1;var r=e.substring(0,2);if(!(t=o(r)))return!1;var n="19".concat(e.substring(6,12));return!!(t=a(n))}(t):function(e){var t=/^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(e);if(!t)return!1;var r=e.substring(0,2);if(!(t=o(r)))return!1;var s=e.substring(6,14);return!!(t=a(s))&&function(e){return function(e){for(var t=e.substring(0,17),r=0,o=0;o<17;o++)r+=parseInt(t.charAt(o),10)*parseInt(n[o],10);return i[r%11]}(e)===e.charAt(17).toUpperCase()}(e)}(t))},"zh-HK":function(e){var t=/^[0-9]$/;if(e=(e=e.trim()).toUpperCase(),!/^[A-Z]{1,2}[0-9]{6}((\([0-9A]\))|(\[[0-9A]\])|([0-9A]))$/.test(e))return!1;8===(e=e.replace(/\[|\]|\(|\)/g,"")).length&&(e="3".concat(e));for(var r=0,n=0;n<=7;n++)r+=(t.test(e[n])?e[n]:(e[n].charCodeAt(0)-55)%11)*(9-n);return(0==(r%=11)?"0":1===r?"A":String(11-r))===e[e.length-1]},"zh-TW":function(e){var t={A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:34,J:18,K:19,L:20,M:21,N:22,O:35,P:23,Q:24,R:25,S:26,T:27,U:28,V:29,W:32,X:30,Y:31,Z:33},r=e.trim().toUpperCase();return!!/^[A-Z][0-9]{9}$/.test(r)&&Array.from(r).reduce((function(e,r,n){if(0===n){var i=t[r];return i%10*9+Math.floor(i/10)}return 9===n?(10-e%10-Number(r))%10==0:e+Number(r)*(9-n)}),0)}};e.exports=t.default,e.exports.default=t.default},7228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r;if((0,n.default)(e),"[object Array]"===Object.prototype.toString.call(t)){var o=[];for(r in t)({}).hasOwnProperty.call(t,r)&&(o[r]=(0,i.default)(t[r]));return o.indexOf(e)>=0}return"object"===a(t)?t.hasOwnProperty(e):!(!t||"function"!=typeof t.indexOf)&&t.indexOf(e)>=0};var n=o(r(5571)),i=o(r(1913));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}e.exports=t.default,e.exports.default=t.default},937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=(t=t||{}).hasOwnProperty("allow_leading_zeroes")&&!t.allow_leading_zeroes?o:a,n=!t.hasOwnProperty("min")||e>=t.min,s=!t.hasOwnProperty("max")||e<=t.max,u=!t.hasOwnProperty("lt")||e<t.lt,l=!t.hasOwnProperty("gt")||e>t.gt;return r.test(e)&&n&&s&&u&&l};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,a=/^[-+]?[0-9]+$/;e.exports=t.default,e.exports.default=t.default},1008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e);try{t=(0,i.default)(t,s);var r=[];t.allow_primitives&&(r=[null,!1,!0]);var o=JSON.parse(e);return r.includes(o)||!!o&&"object"===a(o)}catch(e){}return!1};var n=o(r(5571)),i=o(r(4808));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var s={allow_primitives:!1};e.exports=t.default,e.exports.default=t.default},4979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,n.default)(e);var t=e.split("."),r=t.length;return!(r>3||r<2)&&t.reduce((function(e,t){return e&&(0,i.default)(t,{urlSafe:!0})}),!0)};var n=o(r(5571)),i=o(r(2689));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),t=(0,i.default)(t,c),!e.includes(","))return!1;var r=e.split(",");return!(r[0].startsWith("(")&&!r[1].endsWith(")")||r[1].endsWith(")")&&!r[0].startsWith("("))&&(t.checkDMS?u.test(r[0])&&l.test(r[1]):a.test(r[0])&&s.test(r[1]))};var n=o(r(5571)),i=o(r(4808));function o(e){return e&&e.__esModule?e:{default:e}}var a=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,s=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,u=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,l=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,c={checkDMS:!1};e.exports=t.default,e.exports.default=t.default},4958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n;(0,i.default)(e),"object"===o(t)?(r=t.min||0,n=t.max):(r=arguments[1]||0,n=arguments[2]);var a=e.match(/(\uFE0F|\uFE0E)/g)||[],s=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],u=e.length-a.length-s.length;return u>=r&&(void 0===n||u<=n)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}e.exports=t.default,e.exports.default=t.default},6023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t in o)return o[t](e);if("any"===t){for(var r in o)if((0,o[r])(e))return!0;return!1}throw new Error("Invalid locale '".concat(t,"'"))};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={"cs-CZ":function(e){return/^(([ABCDEFHIJKLMNPRSTUVXYZ]|[0-9])-?){5,8}$/.test(e)},"de-DE":function(e){return/^((A|AA|AB|AC|AE|AH|AK|AM|AN|AÖ|AP|AS|AT|AU|AW|AZ|B|BA|BB|BC|BE|BF|BH|BI|BK|BL|BM|BN|BO|BÖ|BS|BT|BZ|C|CA|CB|CE|CO|CR|CW|D|DA|DD|DE|DH|DI|DL|DM|DN|DO|DU|DW|DZ|E|EA|EB|ED|EE|EF|EG|EH|EI|EL|EM|EN|ER|ES|EU|EW|F|FB|FD|FF|FG|FI|FL|FN|FO|FR|FS|FT|FÜ|FW|FZ|G|GA|GC|GD|GE|GF|GG|GI|GK|GL|GM|GN|GÖ|GP|GR|GS|GT|GÜ|GV|GW|GZ|H|HA|HB|HC|HD|HE|HF|HG|HH|HI|HK|HL|HM|HN|HO|HP|HR|HS|HU|HV|HX|HY|HZ|IK|IL|IN|IZ|J|JE|JL|K|KA|KB|KC|KE|KF|KG|KH|KI|KK|KL|KM|KN|KO|KR|KS|KT|KU|KW|KY|L|LA|LB|LC|LD|LF|LG|LH|LI|LL|LM|LN|LÖ|LP|LR|LU|M|MA|MB|MC|MD|ME|MG|MH|MI|MK|ML|MM|MN|MO|MQ|MR|MS|MÜ|MW|MY|MZ|N|NB|ND|NE|NF|NH|NI|NK|NM|NÖ|NP|NR|NT|NU|NW|NY|NZ|OA|OB|OC|OD|OE|OF|OG|OH|OK|OL|OP|OS|OZ|P|PA|PB|PE|PF|PI|PL|PM|PN|PR|PS|PW|PZ|R|RA|RC|RD|RE|RG|RH|RI|RL|RM|RN|RO|RP|RS|RT|RU|RV|RW|RZ|S|SB|SC|SE|SG|SI|SK|SL|SM|SN|SO|SP|SR|ST|SU|SW|SY|SZ|TE|TF|TG|TO|TP|TR|TS|TT|TÜ|ÜB|UE|UH|UL|UM|UN|V|VB|VG|VK|VR|VS|W|WA|WB|WE|WF|WI|WK|WL|WM|WN|WO|WR|WS|WT|WÜ|WW|WZ|Z|ZE|ZI|ZP|ZR|ZW|ZZ)[- ]?[A-Z]{1,2}[- ]?\d{1,4}|(ABG|ABI|AIB|AIC|ALF|ALZ|ANA|ANG|ANK|APD|ARN|ART|ASL|ASZ|AUR|AZE|BAD|BAR|BBG|BCH|BED|BER|BGD|BGL|BID|BIN|BIR|BIT|BIW|BKS|BLB|BLK|BNA|BOG|BOH|BOR|BOT|BRA|BRB|BRG|BRK|BRL|BRV|BSB|BSK|BTF|BÜD|BUL|BÜR|BÜS|BÜZ|CAS|CHA|CLP|CLZ|COC|COE|CUX|DAH|DAN|DAU|DBR|DEG|DEL|DGF|DIL|DIN|DIZ|DKB|DLG|DON|DUD|DÜW|EBE|EBN|EBS|ECK|EIC|EIL|EIN|EIS|EMD|EMS|ERB|ERH|ERK|ERZ|ESB|ESW|FDB|FDS|FEU|FFB|FKB|FLÖ|FOR|FRG|FRI|FRW|FTL|FÜS|GAN|GAP|GDB|GEL|GEO|GER|GHA|GHC|GLA|GMN|GNT|GOA|GOH|GRA|GRH|GRI|GRM|GRZ|GTH|GUB|GUN|GVM|HAB|HAL|HAM|HAS|HBN|HBS|HCH|HDH|HDL|HEB|HEF|HEI|HER|HET|HGN|HGW|HHM|HIG|HIP|HMÜ|HOG|HOH|HOL|HOM|HOR|HÖS|HOT|HRO|HSK|HST|HVL|HWI|IGB|ILL|JÜL|KEH|KEL|KEM|KIB|KLE|KLZ|KÖN|KÖT|KÖZ|KRU|KÜN|KUS|KYF|LAN|LAU|LBS|LBZ|LDK|LDS|LEO|LER|LEV|LIB|LIF|LIP|LÖB|LOS|LRO|LSZ|LÜN|LUP|LWL|MAB|MAI|MAK|MAL|MED|MEG|MEI|MEK|MEL|MER|MET|MGH|MGN|MHL|MIL|MKK|MOD|MOL|MON|MOS|MSE|MSH|MSP|MST|MTK|MTL|MÜB|MÜR|MYK|MZG|NAB|NAI|NAU|NDH|NEA|NEB|NEC|NEN|NES|NEW|NMB|NMS|NOH|NOL|NOM|NOR|NVP|NWM|OAL|OBB|OBG|OCH|OHA|ÖHR|OHV|OHZ|OPR|OSL|OVI|OVL|OVP|PAF|PAN|PAR|PCH|PEG|PIR|PLÖ|PRÜ|QFT|QLB|RDG|REG|REH|REI|RID|RIE|ROD|ROF|ROK|ROL|ROS|ROT|ROW|RSL|RÜD|RÜG|SAB|SAD|SAN|SAW|SBG|SBK|SCZ|SDH|SDL|SDT|SEB|SEE|SEF|SEL|SFB|SFT|SGH|SHA|SHG|SHK|SHL|SIG|SIM|SLE|SLF|SLK|SLN|SLS|SLÜ|SLZ|SMÜ|SOB|SOG|SOK|SÖM|SON|SPB|SPN|SRB|SRO|STA|STB|STD|STE|STL|SUL|SÜW|SWA|SZB|TBB|TDO|TET|TIR|TÖL|TUT|UEM|UER|UFF|USI|VAI|VEC|VER|VIB|VIE|VIT|VOH|WAF|WAK|WAN|WAR|WAT|WBS|WDA|WEL|WEN|WER|WES|WHV|WIL|WIS|WIT|WIZ|WLG|WMS|WND|WOB|WOH|WOL|WOR|WOS|WRN|WSF|WST|WSW|WTL|WTM|WUG|WÜM|WUN|WUR|WZL|ZEL|ZIG)[- ]?(([A-Z][- ]?\d{1,4})|([A-Z]{2}[- ]?\d{1,3})))[- ]?(E|H)?$/.test(e)},"de-LI":function(e){return/^FL[- ]?\d{1,5}[UZ]?$/.test(e)},"en-IN":function(e){return/^[A-Z]{2}[ -]?[0-9]{1,2}(?:[ -]?[A-Z])(?:[ -]?[A-Z]*)?[ -]?[0-9]{4}$/.test(e)},"es-AR":function(e){return/^(([A-Z]{2} ?[0-9]{3} ?[A-Z]{2})|([A-Z]{3} ?[0-9]{3}))$/.test(e)},"fi-FI":function(e){return/^(?=.{4,7})(([A-Z]{1,3}|[0-9]{1,3})[\s-]?([A-Z]{1,3}|[0-9]{1,5}))$/.test(e)},"hu-HU":function(e){return/^((((?!AAA)(([A-NPRSTVZWXY]{1})([A-PR-Z]{1})([A-HJ-NPR-Z]))|(A[ABC]I)|A[ABC]O|A[A-W]Q|BPI|BPO|UCO|UDO|XAO)-(?!000)\d{3})|(M\d{6})|((CK|DT|CD|HC|H[ABEFIKLMNPRSTVX]|MA|OT|R[A-Z]) \d{2}-\d{2})|(CD \d{3}-\d{3})|(C-(C|X) \d{4})|(X-(A|B|C) \d{4})|(([EPVZ]-\d{5}))|(S A[A-Z]{2} \d{2})|(SP \d{2}-\d{2}))$/.test(e)},"pt-BR":function(e){return/^[A-Z]{3}[ -]?[0-9][A-Z][0-9]{2}|[A-Z]{3}[ -]?[0-9]{4}$/.test(e)},"pt-PT":function(e){return/^([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})[ -·]?([A-Z]{2}|[0-9]{2})$/.test(e)},"sq-AL":function(e){return/^[A-Z]{2}[- ]?((\d{3}[- ]?(([A-Z]{2})|T))|(R[- ]?\d{3}))$/.test(e)},"sv-SE":function(e){return/^[A-HJ-PR-UW-Z]{3} ?[\d]{2}[A-HJ-PR-UW-Z1-9]$|(^[A-ZÅÄÖ ]{2,7}$)/.test(e.trim())}};e.exports=t.default,e.exports.default=t.default},7380:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),"en_US_POSIX"===e||"ca_ES_VALENCIA"===e||o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[A-Za-z]{2,4}([_-]([A-Za-z]{4}|[\d]{3}))?([_-]([A-Za-z]{2}|[\d]{3}))?$/;e.exports=t.default,e.exports.default=t.default},3928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e===e.toLowerCase()};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},1592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);for(var t,r,n,o=e.replace(/[- ]+/g,""),a=0,s=o.length-1;s>=0;s--)t=o.substring(s,s+1),r=parseInt(t,10),a+=n&&(r*=2)>=10?r%10+1:r,n=!n;return!(a%10!=0||!o)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},8999:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,r){return(0,i.default)(t),null!=r&&r.eui&&(r.eui=String(r.eui)),null!=r&&r.no_colons||null!=r&&r.no_separators?"48"===r.eui?a.test(t):"64"===r.eui?l.test(t):a.test(t)||l.test(t):"48"===(null==r?void 0:r.eui)?o.test(t)||s.test(t):"64"===(null==r?void 0:r.eui)?u.test(t)||c.test(t):e(t,{eui:"48"})||e(t,{eui:"64"})};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){4}([0-9a-fA-F]{2})$/,a=/^([0-9a-fA-F]){12}$/,s=/^([0-9a-fA-F]{4}\.){2}([0-9a-fA-F]{4})$/,u=/^(?:[0-9a-fA-F]{2}([-:\s]))([0-9a-fA-F]{2}\1){6}([0-9a-fA-F]{2})$/,l=/^([0-9a-fA-F]){16}$/,c=/^([0-9a-fA-F]{4}\.){3}([0-9a-fA-F]{4})$/;e.exports=t.default,e.exports.default=t.default},368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[a-f0-9]{32}$/;e.exports=t.default,e.exports.default=t.default},2776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),0===e.indexOf("magnet:?")&&o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/(?:^magnet:\?|[^?&]&)xt(?:\.1)?=urn:(?:(?:aich|bitprint|btih|ed2k|ed2khash|kzhash|md5|sha1|tree:tiger):[a-z0-9]{32}(?:[a-z0-9]{8})?|btmh:1220[a-z0-9]{64})(?:$|&)/i;e.exports=t.default,e.exports.default=t.default},4554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)||a.test(e)||s.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i,a=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,s=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;e.exports=t.default,e.exports.default=t.default},8355:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){if((0,i.default)(e),r&&r.strictMode&&!e.startsWith("+"))return!1;if(Array.isArray(t))return t.some((function(t){return!(!o.hasOwnProperty(t)||!o[t].test(e))}));if(t in o)return o[t].test(e);if(!t||"any"===t){for(var n in o)if(o.hasOwnProperty(n)&&o[n].test(e))return!0;return!1}throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={"am-AM":/^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};o["en-CA"]=o["en-US"],o["fr-CA"]=o["en-CA"],o["fr-BE"]=o["nl-BE"],o["zh-HK"]=o["en-HK"],o["zh-MO"]=o["en-MO"],o["ga-IE"]=o["en-IE"],o["fr-CH"]=o["de-CH"],o["it-CH"]=o["fr-CH"];var a=Object.keys(o);t.locales=a},9131:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)(e),(0,i.default)(e)&&24===e.length};var n=o(r(5571)),i=o(r(7117));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},3590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/[^\x00-\x7F]/;e.exports=t.default,e.exports.default=t.default},4986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),t&&t.no_symbols?a.test(e):new RegExp("^[+-]?([0-9]*[".concat((t||{}).locale?o.decimal[t.locale]:".","])?[0-9]+$")).test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=r(79),a=/^[0-9]+$/;e.exports=t.default,e.exports.default=t.default},6090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^(0o)?[0-7]+$/i;e.exports=t.default,e.exports.default=t.default},1513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=e.replace(/\s/g,"").toUpperCase();return t.toUpperCase()in o&&o[t].test(r)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{2,3}\d{7,8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/};e.exports=t.default,e.exports.default=t.default},4595:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e,{min:0,max:65535})};var n,i=(n=r(937))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},8140:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t in l)return l[t].test(e);if("any"===t){for(var r in l)if(l.hasOwnProperty(r)&&l[r].test(e))return!0;return!1}throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^\d{3}$/,a=/^\d{4}$/,s=/^\d{5}$/,u=/^\d{6}$/,l={AD:/^AD\d{3}$/,AT:a,AU:a,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:a,BG:a,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:a,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:s,DK:a,DO:s,DZ:s,EE:s,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:s,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:a,ID:s,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:o,IT:s,JP:/^\d{3}\-\d{4}$/,KE:s,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:a,LV:/^LV\-\d{4}$/,LK:s,MG:o,MX:s,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:s,NL:/^\d{4}\s?[a-z]{2}$/i,NO:a,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:a,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:u,RU:u,SA:s,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:u,SI:a,SK:/^\d{3}\s?\d{2}$/,TH:s,TN:a,TW:/^\d{3}(\d{2})?$/,UA:s,US:/^\d{5}(-\d{4})?$/,ZA:a,ZM:s},c=Object.keys(l);t.locales=c},4611:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),d.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/([01][0-9]|2[0-3])/,a=/[0-5][0-9]/,s=new RegExp("[-+]".concat(o.source,":").concat(a.source)),u=new RegExp("([zZ]|".concat(s.source,")")),l=new RegExp("".concat(o.source,":").concat(a.source,":").concat(/([0-5][0-9]|60)/.source).concat(/(\.[0-9]+)?/.source)),c=new RegExp("".concat(/[0-9]{4}/.source,"-").concat(/(0[1-9]|1[0-2])/.source,"-").concat(/([12]\d|0[1-9]|3[01])/.source)),f=new RegExp("".concat(l.source).concat(u.source)),d=new RegExp("^".concat(c.source,"[ tT]").concat(f.source,"$"));e.exports=t.default,e.exports.default=t.default},6454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,i.default)(e),t?o.test(e)||a.test(e)||s.test(e)||u.test(e):o.test(e)||a.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/,a=/^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/,s=/^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/,u=/^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;e.exports=t.default,e.exports.default=t.default},6826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)(e),o.test(e)};var n=i(r(5571));function i(e){return e&&e.__esModule?e:{default:e}}var o=(0,i(r(4731)).default)(["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)","(?:-((?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-z-][0-9a-z-]*))*))","?(?:\\+([0-9a-z-]+(?:\\.[0-9a-z-]+)*))?$"],"i");e.exports=t.default,e.exports.default=t.default},8220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;e.exports=t.default,e.exports.default=t.default},7633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(0,i.default)(e);var r=function(e){var t=function(e){var t={};return Array.from(e).forEach((function(e){t[e]?t[e]+=1:t[e]=1})),t}(e),r={length:e.length,uniqueChars:Object.keys(t).length,uppercaseCount:0,lowercaseCount:0,numberCount:0,symbolCount:0};return Object.keys(t).forEach((function(e){a.test(e)?r.uppercaseCount+=t[e]:s.test(e)?r.lowercaseCount+=t[e]:u.test(e)?r.numberCount+=t[e]:l.test(e)&&(r.symbolCount+=t[e])})),r}(e);return(t=(0,n.default)(t||{},c)).returnScore?function(e,t){var r=0;return r+=e.uniqueChars*t.pointsPerUnique,r+=(e.length-e.uniqueChars)*t.pointsPerRepeat,e.lowercaseCount>0&&(r+=t.pointsForContainingLower),e.uppercaseCount>0&&(r+=t.pointsForContainingUpper),e.numberCount>0&&(r+=t.pointsForContainingNumber),e.symbolCount>0&&(r+=t.pointsForContainingSymbol),r}(r,t):r.length>=t.minLength&&r.lowercaseCount>=t.minLowercase&&r.uppercaseCount>=t.minUppercase&&r.numberCount>=t.minNumbers&&r.symbolCount>=t.minSymbols};var n=o(r(4808)),i=o(r(5571));function o(e){return e&&e.__esModule?e:{default:e}}var a=/^[A-Z]$/,s=/^[a-z]$/,u=/^[0-9]$/,l=/^[-#!$@£%^&*()_+|~=`{}\[\]:";'<>?,.\/ ]$/,c={minLength:8,minLowercase:1,minUppercase:1,minNumbers:1,minSymbols:1,returnScore:!1,pointsPerUnique:1,pointsPerRepeat:.5,pointsForContainingLower:10,pointsForContainingUpper:10,pointsForContainingNumber:10,pointsForContainingSymbol:10};e.exports=t.default,e.exports.default=t.default},2828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;e.exports=t.default,e.exports.default=t.default},3058:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";(0,i.default)(e);var r=e.slice(0);if(t in d)return t in m&&(r=r.replace(m[t],"")),!!d[t].test(r)&&(!(t in h)||h[t](r));throw new Error("Invalid locale '".concat(t,"'"))};var i=u(r(5571)),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(r(3672)),a=u(r(2549));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c={andover:["10","12"],atlanta:["60","67"],austin:["50","53"],brookhaven:["01","02","03","04","05","06","11","13","14","16","21","22","23","25","34","51","52","54","55","56","57","58","59","65"],cincinnati:["30","32","35","36","37","38","61"],fresno:["15","24"],internet:["20","26","27","45","46","47"],kansas:["40","44"],memphis:["94","95"],ogden:["80","90"],philadelphia:["33","39","41","42","43","46","48","62","63","64","66","68","71","72","73","74","75","76","77","81","82","83","84","85","86","87","88","91","92","93","98","99"],sba:["31"]};function f(e){for(var t=!1,r=!1,n=0;n<3;n++)if(!t&&/[AEIOU]/.test(e[n]))t=!0;else if(!r&&t&&"X"===e[n])r=!0;else if(n>0){if(t&&!r&&!/[AEIOU]/.test(e[n]))return!1;if(r&&!/X/.test(e[n]))return!1}return!0}var d={"bg-BG":/^\d{10}$/,"cs-CZ":/^\d{6}\/{0,1}\d{3,4}$/,"de-AT":/^\d{9}$/,"de-DE":/^[1-9]\d{10}$/,"dk-DK":/^\d{6}-{0,1}\d{4}$/,"el-CY":/^[09]\d{7}[A-Z]$/,"el-GR":/^([0-4]|[7-9])\d{8}$/,"en-CA":/^\d{9}$/,"en-GB":/^\d{10}$|^(?!GB|NK|TN|ZZ)(?![DFIQUV])[A-Z](?![DFIQUVO])[A-Z]\d{6}[ABCD ]$/i,"en-IE":/^\d{7}[A-W][A-IW]{0,1}$/i,"en-US":/^\d{2}[- ]{0,1}\d{7}$/,"es-ES":/^(\d{0,8}|[XYZKLM]\d{7})[A-HJ-NP-TV-Z]$/i,"et-EE":/^[1-6]\d{6}(00[1-9]|0[1-9][0-9]|[1-6][0-9]{2}|70[0-9]|710)\d$/,"fi-FI":/^\d{6}[-+A]\d{3}[0-9A-FHJ-NPR-Y]$/i,"fr-BE":/^\d{11}$/,"fr-FR":/^[0-3]\d{12}$|^[0-3]\d\s\d{2}(\s\d{3}){3}$/,"fr-LU":/^\d{13}$/,"hr-HR":/^\d{11}$/,"hu-HU":/^8\d{9}$/,"it-IT":/^[A-Z]{6}[L-NP-V0-9]{2}[A-EHLMPRST][L-NP-V0-9]{2}[A-ILMZ][L-NP-V0-9]{3}[A-Z]$/i,"lv-LV":/^\d{6}-{0,1}\d{5}$/,"mt-MT":/^\d{3,7}[APMGLHBZ]$|^([1-8])\1\d{7}$/i,"nl-NL":/^\d{9}$/,"pl-PL":/^\d{10,11}$/,"pt-BR":/(?:^\d{11}$)|(?:^\d{14}$)/,"pt-PT":/^\d{9}$/,"ro-RO":/^\d{13}$/,"sk-SK":/^\d{6}\/{0,1}\d{3,4}$/,"sl-SI":/^[1-9]\d{7}$/,"sv-SE":/^(\d{6}[-+]{0,1}\d{4}|(18|19|20)\d{6}[-+]{0,1}\d{4})$/};d["lb-LU"]=d["fr-LU"],d["lt-LT"]=d["et-EE"],d["nl-BE"]=d["fr-BE"],d["fr-CA"]=d["en-CA"];var h={"bg-BG":function(e){var t=e.slice(0,2),r=parseInt(e.slice(2,4),10);r>40?(r-=40,t="20".concat(t)):r>20?(r-=20,t="18".concat(t)):t="19".concat(t),r<10&&(r="0".concat(r));var n="".concat(t,"/").concat(r,"/").concat(e.slice(4,6));if(!(0,a.default)(n,"YYYY/MM/DD"))return!1;for(var i=e.split("").map((function(e){return parseInt(e,10)})),o=[2,4,8,5,10,9,7,3,6],s=0,u=0;u<o.length;u++)s+=i[u]*o[u];return(s=s%11==10?0:s%11)===i[9]},"cs-CZ":function(e){e=e.replace(/\W/,"");var t=parseInt(e.slice(0,2),10);if(10===e.length)t=t<54?"20".concat(t):"19".concat(t);else{if("000"===e.slice(6))return!1;if(!(t<54))return!1;t="19".concat(t)}3===t.length&&(t=[t.slice(0,2),"0",t.slice(2)].join(""));var r=parseInt(e.slice(2,4),10);if(r>50&&(r-=50),r>20){if(parseInt(t,10)<2004)return!1;r-=20}r<10&&(r="0".concat(r));var n="".concat(t,"/").concat(r,"/").concat(e.slice(4,6));if(!(0,a.default)(n,"YYYY/MM/DD"))return!1;if(10===e.length&&parseInt(e,10)%11!=0){var i=parseInt(e.slice(0,9),10)%11;if(!(parseInt(t,10)<1986&&10===i))return!1;if(0!==parseInt(e.slice(9),10))return!1}return!0},"de-AT":function(e){return o.luhnCheck(e)},"de-DE":function(e){for(var t=e.split("").map((function(e){return parseInt(e,10)})),r=[],n=0;n<t.length-1;n++){r.push("");for(var i=0;i<t.length-1;i++)t[n]===t[i]&&(r[n]+=i)}if(2!==(r=r.filter((function(e){return e.length>1}))).length&&3!==r.length)return!1;if(3===r[0].length){for(var a=r[0].split("").map((function(e){return parseInt(e,10)})),s=0,u=0;u<a.length-1;u++)a[u]+1===a[u+1]&&(s+=1);if(2===s)return!1}return o.iso7064Check(e)},"dk-DK":function(e){e=e.replace(/\W/,"");var t=parseInt(e.slice(4,6),10);switch(e.slice(6,7)){case"0":case"1":case"2":case"3":t="19".concat(t);break;case"4":case"9":t=t<37?"20".concat(t):"19".concat(t);break;default:if(t<37)t="20".concat(t);else{if(!(t>58))return!1;t="18".concat(t)}}3===t.length&&(t=[t.slice(0,2),"0",t.slice(2)].join(""));var r="".concat(t,"/").concat(e.slice(2,4),"/").concat(e.slice(0,2));if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;for(var n=e.split("").map((function(e){return parseInt(e,10)})),i=0,o=4,s=0;s<9;s++)i+=n[s]*o,1==(o-=1)&&(o=7);return 1!=(i%=11)&&(0===i?0===n[9]:n[9]===11-i)},"el-CY":function(e){for(var t=e.slice(0,8).split("").map((function(e){return parseInt(e,10)})),r=0,n=1;n<t.length;n+=2)r+=t[n];for(var i=0;i<t.length;i+=2)t[i]<2?r+=1-t[i]:(r+=2*(t[i]-2)+5,t[i]>4&&(r+=2));return String.fromCharCode(r%26+65)===e.charAt(8)},"el-GR":function(e){for(var t=e.split("").map((function(e){return parseInt(e,10)})),r=0,n=0;n<8;n++)r+=t[n]*Math.pow(2,8-n);return r%11%10===t[8]},"en-CA":function(e){var t=e.split(""),r=t.filter((function(e,t){return t%2})).map((function(e){return 2*Number(e)})).join("").split("");return t.filter((function(e,t){return!(t%2)})).concat(r).map((function(e){return Number(e)})).reduce((function(e,t){return e+t}))%10==0},"en-IE":function(e){var t=o.reverseMultiplyAndSum(e.split("").slice(0,7).map((function(e){return parseInt(e,10)})),8);return 9===e.length&&"W"!==e[8]&&(t+=9*(e[8].charCodeAt(0)-64)),0==(t%=23)?"W"===e[7].toUpperCase():e[7].toUpperCase()===String.fromCharCode(64+t)},"en-US":function(e){return-1!==function(){var e,t=[];for(var r in c)c.hasOwnProperty(r)&&t.push.apply(t,function(e){if(Array.isArray(e))return l(e)}(e=c[r])||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return t}().indexOf(e.slice(0,2))},"es-ES":function(e){var t=e.toUpperCase().split("");if(isNaN(parseInt(t[0],10))&&t.length>1){var r=0;switch(t[0]){case"Y":r=1;break;case"Z":r=2}t.splice(0,1,r)}else for(;t.length<9;)t.unshift(0);t=t.join("");var n=parseInt(t.slice(0,8),10)%23;return t[8]===["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"][n]},"et-EE":function(e){var t=e.slice(1,3);switch(e.slice(0,1)){case"1":case"2":t="18".concat(t);break;case"3":case"4":t="19".concat(t);break;default:t="20".concat(t)}var r="".concat(t,"/").concat(e.slice(3,5),"/").concat(e.slice(5,7));if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;for(var n=e.split("").map((function(e){return parseInt(e,10)})),i=0,o=1,s=0;s<10;s++)i+=n[s]*o,10===(o+=1)&&(o=1);if(i%11==10){i=0,o=3;for(var u=0;u<10;u++)i+=n[u]*o,10===(o+=1)&&(o=1);if(i%11==10)return 0===n[10]}return i%11===n[10]},"fi-FI":function(e){var t=e.slice(4,6);switch(e.slice(6,7)){case"+":t="18".concat(t);break;case"-":t="19".concat(t);break;default:t="20".concat(t)}var r="".concat(t,"/").concat(e.slice(2,4),"/").concat(e.slice(0,2));if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;var n=parseInt(e.slice(0,6)+e.slice(7,10),10)%31;return n<10?n===parseInt(e.slice(10),10):["A","B","C","D","E","F","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y"][n-=10]===e.slice(10)},"fr-BE":function(e){if("00"!==e.slice(2,4)||"00"!==e.slice(4,6)){var t="".concat(e.slice(0,2),"/").concat(e.slice(2,4),"/").concat(e.slice(4,6));if(!(0,a.default)(t,"YY/MM/DD"))return!1}var r=97-parseInt(e.slice(0,9),10)%97,n=parseInt(e.slice(9,11),10);return r===n||(r=97-parseInt("2".concat(e.slice(0,9)),10)%97)===n},"fr-FR":function(e){return e=e.replace(/\s/g,""),parseInt(e.slice(0,10),10)%511===parseInt(e.slice(10,13),10)},"fr-LU":function(e){var t="".concat(e.slice(0,4),"/").concat(e.slice(4,6),"/").concat(e.slice(6,8));return!!(0,a.default)(t,"YYYY/MM/DD")&&!!o.luhnCheck(e.slice(0,12))&&o.verhoeffCheck("".concat(e.slice(0,11)).concat(e[12]))},"hr-HR":function(e){return o.iso7064Check(e)},"hu-HU":function(e){for(var t=e.split("").map((function(e){return parseInt(e,10)})),r=8,n=1;n<9;n++)r+=t[n]*(n+1);return r%11===t[9]},"it-IT":function(e){var t=e.toUpperCase().split("");if(!f(t.slice(0,3)))return!1;if(!f(t.slice(3,6)))return!1;for(var r={L:"0",M:"1",N:"2",P:"3",Q:"4",R:"5",S:"6",T:"7",U:"8",V:"9"},n=0,i=[6,7,9,10,12,13,14];n<i.length;n++){var o=i[n];t[o]in r&&t.splice(o,1,r[t[o]])}var s={A:"01",B:"02",C:"03",D:"04",E:"05",H:"06",L:"07",M:"08",P:"09",R:"10",S:"11",T:"12"}[t[8]],u=parseInt(t[9]+t[10],10);u>40&&(u-=40),u<10&&(u="0".concat(u));var l="".concat(t[6]).concat(t[7],"/").concat(s,"/").concat(u);if(!(0,a.default)(l,"YY/MM/DD"))return!1;for(var c=0,d=1;d<t.length-1;d+=2){var h=parseInt(t[d],10);isNaN(h)&&(h=t[d].charCodeAt(0)-65),c+=h}for(var p={A:1,B:0,C:5,D:7,E:9,F:13,G:15,H:17,I:19,J:21,K:2,L:4,M:18,N:20,O:11,P:3,Q:6,R:8,S:12,T:14,U:16,V:10,W:22,X:25,Y:24,Z:23,0:1,1:0},m=0;m<t.length-1;m+=2){var y=0;if(t[m]in p)y=p[t[m]];else{var g=parseInt(t[m],10);y=2*g+1,g>4&&(y+=2)}c+=y}return String.fromCharCode(65+c%26)===t[15]},"lv-LV":function(e){var t=(e=e.replace(/\W/,"")).slice(0,2);if("32"!==t){if("00"!==e.slice(2,4)){var r=e.slice(4,6);switch(e[6]){case"0":r="18".concat(r);break;case"1":r="19".concat(r);break;default:r="20".concat(r)}var n="".concat(r,"/").concat(e.slice(2,4),"/").concat(t);if(!(0,a.default)(n,"YYYY/MM/DD"))return!1}for(var i=1101,o=[1,6,3,7,9,10,5,8,4,2],s=0;s<e.length-1;s++)i-=parseInt(e[s],10)*o[s];return parseInt(e[10],10)===i%11}return!0},"mt-MT":function(e){if(9!==e.length){for(var t=e.toUpperCase().split("");t.length<8;)t.unshift(0);switch(e[7]){case"A":case"P":if(0===parseInt(t[6],10))return!1;break;default:var r=parseInt(t.join("").slice(0,5),10);if(r>32e3)return!1;if(r===parseInt(t.join("").slice(5,7),10))return!1}}return!0},"nl-NL":function(e){return o.reverseMultiplyAndSum(e.split("").slice(0,8).map((function(e){return parseInt(e,10)})),9)%11===parseInt(e[8],10)},"pl-PL":function(e){if(10===e.length){for(var t=[6,5,7,2,3,4,5,6,7],r=0,n=0;n<t.length;n++)r+=parseInt(e[n],10)*t[n];return 10!=(r%=11)&&r===parseInt(e[9],10)}var i=e.slice(0,2),o=parseInt(e.slice(2,4),10);o>80?(i="18".concat(i),o-=80):o>60?(i="22".concat(i),o-=60):o>40?(i="21".concat(i),o-=40):o>20?(i="20".concat(i),o-=20):i="19".concat(i),o<10&&(o="0".concat(o));var s="".concat(i,"/").concat(o,"/").concat(e.slice(4,6));if(!(0,a.default)(s,"YYYY/MM/DD"))return!1;for(var u=0,l=1,c=0;c<e.length-1;c++)u+=parseInt(e[c],10)*l%10,(l+=2)>10?l=1:5===l&&(l+=2);return(u=10-u%10)===parseInt(e[10],10)},"pt-BR":function(e){if(11===e.length){var t,r;if(t=0,"11111111111"===e||"22222222222"===e||"33333333333"===e||"44444444444"===e||"55555555555"===e||"66666666666"===e||"77777777777"===e||"88888888888"===e||"99999999999"===e||"00000000000"===e)return!1;for(var n=1;n<=9;n++)t+=parseInt(e.substring(n-1,n),10)*(11-n);if(10==(r=10*t%11)&&(r=0),r!==parseInt(e.substring(9,10),10))return!1;t=0;for(var i=1;i<=10;i++)t+=parseInt(e.substring(i-1,i),10)*(12-i);return 10==(r=10*t%11)&&(r=0),r===parseInt(e.substring(10,11),10)}if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;for(var o=e.length-2,a=e.substring(0,o),s=e.substring(o),u=0,l=o-7,c=o;c>=1;c--)u+=a.charAt(o-c)*l,(l-=1)<2&&(l=9);var f=u%11<2?0:11-u%11;if(f!==parseInt(s.charAt(0),10))return!1;o+=1,a=e.substring(0,o),u=0,l=o-7;for(var d=o;d>=1;d--)u+=a.charAt(o-d)*l,(l-=1)<2&&(l=9);return(f=u%11<2?0:11-u%11)===parseInt(s.charAt(1),10)},"pt-PT":function(e){var t=11-o.reverseMultiplyAndSum(e.split("").slice(0,8).map((function(e){return parseInt(e,10)})),9)%11;return t>9?0===parseInt(e[8],10):t===parseInt(e[8],10)},"ro-RO":function(e){if("9000"!==e.slice(0,4)){var t=e.slice(1,3);switch(e[0]){case"1":case"2":t="19".concat(t);break;case"3":case"4":t="18".concat(t);break;case"5":case"6":t="20".concat(t)}var r="".concat(t,"/").concat(e.slice(3,5),"/").concat(e.slice(5,7));if(8===r.length){if(!(0,a.default)(r,"YY/MM/DD"))return!1}else if(!(0,a.default)(r,"YYYY/MM/DD"))return!1;for(var n=e.split("").map((function(e){return parseInt(e,10)})),i=[2,7,9,1,4,6,3,5,8,2,7,9],o=0,s=0;s<i.length;s++)o+=n[s]*i[s];return o%11==10?1===n[12]:n[12]===o%11}return!0},"sk-SK":function(e){if(9===e.length){if("000"===(e=e.replace(/\W/,"")).slice(6))return!1;var t=parseInt(e.slice(0,2),10);if(t>53)return!1;t=t<10?"190".concat(t):"19".concat(t);var r=parseInt(e.slice(2,4),10);r>50&&(r-=50),r<10&&(r="0".concat(r));var n="".concat(t,"/").concat(r,"/").concat(e.slice(4,6));if(!(0,a.default)(n,"YYYY/MM/DD"))return!1}return!0},"sl-SI":function(e){var t=11-o.reverseMultiplyAndSum(e.split("").slice(0,7).map((function(e){return parseInt(e,10)})),8)%11;return 10===t?0===parseInt(e[7],10):t===parseInt(e[7],10)},"sv-SE":function(e){var t=e.slice(0);e.length>11&&(t=t.slice(2));var r="",n=t.slice(2,4),i=parseInt(t.slice(4,6),10);if(e.length>11)r=e.slice(0,4);else if(r=e.slice(0,2),11===e.length&&i<60){var s=(new Date).getFullYear().toString(),u=parseInt(s.slice(0,2),10);if(s=parseInt(s,10),"-"===e[6])r=parseInt("".concat(u).concat(r),10)>s?"".concat(u-1).concat(r):"".concat(u).concat(r);else if(r="".concat(u-1).concat(r),s-parseInt(r,10)<100)return!1}i>60&&(i-=60),i<10&&(i="0".concat(i));var l="".concat(r,"/").concat(n,"/").concat(i);if(8===l.length){if(!(0,a.default)(l,"YY/MM/DD"))return!1}else if(!(0,a.default)(l,"YYYY/MM/DD"))return!1;return o.luhnCheck(e.replace(/\W/,""))}};h["lb-LU"]=h["fr-LU"],h["lt-LT"]=h["et-EE"],h["nl-BE"]=h["fr-BE"],h["fr-CA"]=h["en-CA"];var p=/[-\\\/!@#$%\^&\*\(\)\+\=\[\]]+/g,m={"de-AT":p,"de-DE":/[\/\\]/g,"fr-BE":p};m["nl-BE"]=m["fr-BE"],e.exports=t.default,e.exports.default=t.default},3494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return t=(0,i.default)(t,o),"string"==typeof e&&a[t.hourFormat][t.mode].test(e)};var n,i=(n=r(4808))&&n.__esModule?n:{default:n},o={hourFormat:"hour24",mode:"default"},a={hour24:{default:/^([01]?[0-9]|2[0-3]):([0-5][0-9])$/,withSeconds:/^([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/},hour12:{default:/^(0?[1-9]|1[0-2]):([0-5][0-9]) (A|P)M$/,withSeconds:/^(0?[1-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (A|P)M$/}};e.exports=t.default,e.exports.default=t.default},2492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),!e||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;if((t=(0,a.default)(t,l)).validate_length&&e.length>=2083)return!1;if(!t.allow_fragments&&e.includes("#"))return!1;if(!t.allow_query_components&&(e.includes("?")||e.includes("&")))return!1;var r,s,d,h,p,m,y,g,v;if(y=e.split("#"),e=y.shift(),y=e.split("?"),e=y.shift(),(y=e.split("://")).length>1){if(r=y.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(r))return!1}else{if(t.require_protocol)return!1;if("//"===e.slice(0,2)){if(!t.allow_protocol_relative_urls)return!1;y[0]=e.slice(2)}}if(""===(e=y.join("://")))return!1;if(y=e.split("/"),""===(e=y.shift())&&!t.require_host)return!0;if((y=e.split("@")).length>1){if(t.disallow_auth)return!1;if(""===y[0])return!1;if((s=y.shift()).indexOf(":")>=0&&s.split(":").length>2)return!1;var b=(2,function(e){if(Array.isArray(e))return e}(v=s.split(":"))||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),2!==r.length);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(v)||function(e,t){if(e){if("string"==typeof e)return u(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,2):void 0}}(v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=b[0],A=b[1];if(""===w&&""===A)return!1}m=null,g=null;var _=(h=y.join("@")).match(c);if(_?(d="",g=_[1],m=_[2]||null):(d=(y=h.split(":")).shift(),y.length&&(m=y.join(":"))),null!==m&&m.length>0){if(p=parseInt(m,10),!/^[0-9]+$/.test(m)||p<=0||p>65535)return!1}else if(t.require_port)return!1;return t.host_whitelist?f(d,t.host_whitelist):""===d&&!t.require_host||!!((0,o.default)(d)||(0,i.default)(d,t)||g&&(0,o.default)(g,6))&&(d=d||g,!t.host_blacklist||!f(d,t.host_blacklist))};var n=s(r(5571)),i=s(r(221)),o=s(r(1028)),a=s(r(4808));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var l={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},c=/^\[([^\]]+)\](?::([0-9]+))?$/;function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(e===n||(i=n,"[object RegExp]"===Object.prototype.toString.call(i)&&n.test(e)))return!0}var i;return!1}e.exports=t.default,e.exports.default=t.default},7278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=o[[void 0,null].includes(t)?"all":t];return!!r&&r.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};e.exports=t.default,e.exports.default=t.default},7245:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e===e.toUpperCase()};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},5977:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,o.default)(e),(0,o.default)(t),t in u)return u[t](e);throw new Error("Invalid country code: '".concat(t,"'"))},t.vatMatchers=void 0;var i,o=(i=r(5571))&&i.__esModule?i:{default:i},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(r(3672));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var u={AT:function(e){return/^(AT)?U\d{8}$/.test(e)},BE:function(e){return/^(BE)?\d{10}$/.test(e)},BG:function(e){return/^(BG)?\d{9,10}$/.test(e)},HR:function(e){return/^(HR)?\d{11}$/.test(e)},CY:function(e){return/^(CY)?\w{9}$/.test(e)},CZ:function(e){return/^(CZ)?\d{8,10}$/.test(e)},DK:function(e){return/^(DK)?\d{8}$/.test(e)},EE:function(e){return/^(EE)?\d{9}$/.test(e)},FI:function(e){return/^(FI)?\d{8}$/.test(e)},FR:function(e){return/^(FR)?\w{2}\d{9}$/.test(e)},DE:function(e){return/^(DE)?\d{9}$/.test(e)},EL:function(e){return/^(EL)?\d{9}$/.test(e)},HU:function(e){return/^(HU)?\d{8}$/.test(e)},IE:function(e){return/^(IE)?\d{7}\w{1}(W)?$/.test(e)},IT:function(e){return/^(IT)?\d{11}$/.test(e)},LV:function(e){return/^(LV)?\d{11}$/.test(e)},LT:function(e){return/^(LT)?\d{9,12}$/.test(e)},LU:function(e){return/^(LU)?\d{8}$/.test(e)},MT:function(e){return/^(MT)?\d{8}$/.test(e)},NL:function(e){return/^(NL)?\d{9}B\d{2}$/.test(e)},PL:function(e){return/^(PL)?(\d{10}|(\d{3}-\d{3}-\d{2}-\d{2})|(\d{3}-\d{2}-\d{2}-\d{3}))$/.test(e)},PT:function(e){var t=e.match(/^(PT)?(\d{9})$/);if(!t)return!1;var r=t[2],n=11-a.reverseMultiplyAndSum(r.split("").slice(0,8).map((function(e){return parseInt(e,10)})),9)%11;return n>9?0===parseInt(r[8],10):n===parseInt(r[8],10)},RO:function(e){return/^(RO)?\d{2,10}$/.test(e)},SK:function(e){return/^(SK)?\d{10}$/.test(e)},SI:function(e){return/^(SI)?\d{8}$/.test(e)},ES:function(e){return/^(ES)?\w\d{7}[A-Z]$/.test(e)},SE:function(e){return/^(SE)?\d{12}$/.test(e)},AL:function(e){return/^(AL)?\w{9}[A-Z]$/.test(e)},MK:function(e){return/^(MK)?\d{13}$/.test(e)},AU:function(e){return/^(AU)?\d{11}$/.test(e)},BY:function(e){return/^(УНП )?\d{9}$/.test(e)},CA:function(e){return/^(CA)?\d{9}$/.test(e)},IS:function(e){return/^(IS)?\d{5,6}$/.test(e)},IN:function(e){return/^(IN)?\d{15}$/.test(e)},ID:function(e){return/^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(e)},IL:function(e){return/^(IL)?\d{9}$/.test(e)},KZ:function(e){return/^(KZ)?\d{9}$/.test(e)},NZ:function(e){return/^(NZ)?\d{9}$/.test(e)},NG:function(e){return/^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(e)},NO:function(e){return/^(NO)?\d{9}MVA$/.test(e)},PH:function(e){return/^(PH)?(\d{12}|\d{3} \d{3} \d{3} \d{3})$/.test(e)},RU:function(e){return/^(RU)?(\d{10}|\d{12})$/.test(e)},SM:function(e){return/^(SM)?\d{5}$/.test(e)},SA:function(e){return/^(SA)?\d{15}$/.test(e)},RS:function(e){return/^(RS)?\d{9}$/.test(e)},CH:function(e){return/^(CH)?(\d{6}|\d{9}|(\d{3}.\d{3})|(\d{3}.\d{3}.\d{3}))(TVA|MWST|IVA)$/.test(e)},TR:function(e){return/^(TR)?\d{10}$/.test(e)},UA:function(e){return/^(UA)?\d{12}$/.test(e)},GB:function(e){return/^GB((\d{3} \d{4} ([0-8][0-9]|9[0-6]))|(\d{9} \d{3})|(((GD[0-4])|(HA[5-9]))[0-9]{2}))$/.test(e)},UZ:function(e){return/^(UZ)?\d{9}$/.test(e)},AR:function(e){return/^(AR)?\d{11}$/.test(e)},BO:function(e){return/^(BO)?\d{7}$/.test(e)},BR:function(e){return/^(BR)?((\d{2}.\d{3}.\d{3}\/\d{4}-\d{2})|(\d{3}.\d{3}.\d{3}-\d{2}))$/.test(e)},CL:function(e){return/^(CL)?\d{8}-\d{1}$/.test(e)},CO:function(e){return/^(CO)?\d{10}$/.test(e)},CR:function(e){return/^(CR)?\d{9,12}$/.test(e)},EC:function(e){return/^(EC)?\d{13}$/.test(e)},SV:function(e){return/^(SV)?\d{4}-\d{6}-\d{3}-\d{1}$/.test(e)},GT:function(e){return/^(GT)?\d{7}-\d{1}$/.test(e)},HN:function(e){return/^(HN)?$/.test(e)},MX:function(e){return/^(MX)?\w{3,4}\d{6}\w{3}$/.test(e)},NI:function(e){return/^(NI)?\d{3}-\d{6}-\d{4}\w{1}$/.test(e)},PA:function(e){return/^(PA)?$/.test(e)},PY:function(e){return/^(PY)?\d{6,8}-\d{1}$/.test(e)},PE:function(e){return/^(PE)?\d{11}$/.test(e)},DO:function(e){return/^(DO)?(\d{11}|(\d{3}-\d{7}-\d{1})|[1,4,5]{1}\d{8}|([1,4,5]{1})-\d{2}-\d{5}-\d{1})$/.test(e)},UY:function(e){return/^(UY)?\d{12}$/.test(e)},VE:function(e){return/^(VE)?[J,G,V,E]{1}-(\d{9}|(\d{8}-\d{1}))$/.test(e)}};t.vatMatchers=u},9019:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.fullWidth.test(e)&&a.halfWidth.test(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n},o=r(7146),a=r(2941);e.exports=t.default,e.exports.default=t.default},8346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);for(var r=e.length-1;r>=0;r--)if(-1===t.indexOf(e[r]))return!1;return!0};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},4959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=t?new RegExp("^[".concat(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+"),"g"):/^\s+/g;return e.replace(r,"")};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){return(0,i.default)(e),"[object RegExp]"!==Object.prototype.toString.call(t)&&(t=new RegExp(t,r)),!!e.match(t)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},2900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){t=(0,i.default)(t,o);var r=e.split("@"),n=r.pop(),f=[r.join("@"),n];if(f[1]=f[1].toLowerCase(),"gmail.com"===f[1]||"googlemail.com"===f[1]){if(t.gmail_remove_subaddress&&(f[0]=f[0].split("+")[0]),t.gmail_remove_dots&&(f[0]=f[0].replace(/\.+/g,c)),!f[0].length)return!1;(t.all_lowercase||t.gmail_lowercase)&&(f[0]=f[0].toLowerCase()),f[1]=t.gmail_convert_googlemaildotcom?"gmail.com":f[1]}else if(a.indexOf(f[1])>=0){if(t.icloud_remove_subaddress&&(f[0]=f[0].split("+")[0]),!f[0].length)return!1;(t.all_lowercase||t.icloud_lowercase)&&(f[0]=f[0].toLowerCase())}else if(s.indexOf(f[1])>=0){if(t.outlookdotcom_remove_subaddress&&(f[0]=f[0].split("+")[0]),!f[0].length)return!1;(t.all_lowercase||t.outlookdotcom_lowercase)&&(f[0]=f[0].toLowerCase())}else if(u.indexOf(f[1])>=0){if(t.yahoo_remove_subaddress){var d=f[0].split("-");f[0]=d.length>1?d.slice(0,-1).join("-"):d[0]}if(!f[0].length)return!1;(t.all_lowercase||t.yahoo_lowercase)&&(f[0]=f[0].toLowerCase())}else l.indexOf(f[1])>=0?((t.all_lowercase||t.yandex_lowercase)&&(f[0]=f[0].toLowerCase()),f[1]="yandex.ru"):t.all_lowercase&&(f[0]=f[0].toLowerCase());return f.join("@")};var n,i=(n=r(4808))&&n.__esModule?n:{default:n},o={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},a=["icloud.com","me.com"],s=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],u=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],l=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function c(e){return e.length>1?e:""}e.exports=t.default,e.exports.default=t.default},9778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t){var r=new RegExp("[".concat(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"]+$"),"g");return e.replace(r,"")}for(var n=e.length-1;/\s/.test(e.charAt(n));)n-=1;return e.slice(0,n+1)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},8035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e);var r=t?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,i.default)(e,r)};var n=o(r(5571)),i=o(r(4928));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},557:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),t?"1"===e||/^true$/i.test(e):"0"!==e&&!/^false$/i.test(e)&&""!==e};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},8469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e=Date.parse(e),isNaN(e)?null:new Date(e)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},7536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e)?parseFloat(e):NaN};var n,i=(n=r(9146))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},1359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),parseInt(e,t||10)};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},4790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)((0,i.default)(e,t),t)};var n=o(r(9778)),i=o(r(4959));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},4816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e.replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#x2F;/g,"/").replace(/&#x5C;/g,"\\").replace(/&#96;/g,"`").replace(/&amp;/g,"&")};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},3672:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iso7064Check=function(e){for(var t=10,r=0;r<e.length-1;r++)t=(parseInt(e[r],10)+t)%10==0?9:(parseInt(e[r],10)+t)%10*2%11;return(t=1===t?0:11-t)===parseInt(e[10],10)},t.luhnCheck=function(e){for(var t=0,r=!1,n=e.length-1;n>=0;n--){if(r){var i=2*parseInt(e[n],10);t+=i>9?i.toString().split("").map((function(e){return parseInt(e,10)})).reduce((function(e,t){return e+t}),0):i}else t+=parseInt(e[n],10);r=!r}return t%10==0},t.reverseMultiplyAndSum=function(e,t){for(var r=0,n=0;n<e.length;n++)r+=e[n]*(t-n);return r},t.verhoeffCheck=function(e){for(var t=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],r=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]],n=e.split("").reverse().join(""),i=0,o=0;o<n.length;o++)i=t[i][r[o%8][parseInt(n[o],10)]];return 0===i}},5571:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t=r(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),new TypeError("Expected a string but received a ".concat(t))}},e.exports=t.default,e.exports.default=t.default},8343:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e,t){return e.some((function(e){return t===e}))},e.exports=t.default,e.exports.default=t.default},4808:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default},4731:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=e.join("");return new RegExp(r,t)},e.exports=t.default,e.exports.default=t.default},1913:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"object"===r(e)&&null!==e?e="function"==typeof e.toString?e.toString():"[object Object]":(null==e||isNaN(e)&&!e.length)&&(e=""),String(e)},e.exports=t.default,e.exports.default=t.default},4714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),e.replace(new RegExp("[^".concat(t,"]+"),"g"),"")};var n,i=(n=r(5571))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},6430:(e,t,r)=>{"use strict";var n=r(4029),i=r(3083),o=r(1924),a=r(7296),s=o("Object.prototype.toString"),u=r(6410)(),l="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),d={},h=Object.getPrototypeOf;u&&a&&h&&n(c,(function(e){if("function"==typeof l[e]){var t=new l[e];if(Symbol.toStringTag in t){var r=h(t),n=a(r,Symbol.toStringTag);if(!n){var i=h(r);n=a(i,Symbol.toStringTag)}d[e]=n.get}}}));var p=r(5692);e.exports=function(e){return!!p(e)&&(u&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):f(s(e),8,-1))}},8677:()=>{},2808:()=>{},9214:()=>{},5568:()=>{},7790:()=>{},6854:()=>{},4616:()=>{},6567:()=>{},3897:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},5372:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:(e,t,r)=>{var n=r(3897);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6115:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:e=>{function t(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=e.apply(r,n);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},9728:(e,t,r)=>{var n=r(4062);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}e.exports=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8416:(e,t,r)=>{var n=r(4062);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},3808:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:(e,t,r)=>{var n=r(6015);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},9498:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},5343:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},4993:(e,t,r)=>{var n=r(8698).default,i=r(6115);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:(e,t,r)=>{var n=r(8698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),s=new k(n||[]);return a(o,"_invoke",{value:M(e,r,s)}),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p={};function m(){}function y(){}function g(){}var v={};f(v,u,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==r&&o.call(w,u)&&(v=w);var A=g.prototype=m.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(i,a,s,u){var l=h(e[i],e,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,u)}))}u(l.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function M(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=h(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function P(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return y.prototype=g,a(A,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:y,configurable:!0}),y.displayName=f(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,f(e,c,"GeneratorFunction")),e.prototype=Object.create(A),e},t.awrap=function(e){return{__await:e}},_(S.prototype),f(S.prototype,l,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new S(d(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(A),f(A,c,"Generator"),f(A,u,(function(){return this})),f(A,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:P(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},6015:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:(e,t,r)=>{var n=r(5372),i=r(8872),o=r(6116),a=r(2218);e.exports=function(e,t){return n(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},861:(e,t,r)=>{var n=r(3405),i=r(9498),o=r(6116),a=r(5343);e.exports=function(e){return n(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:(e,t,r)=>{var n=r(8698).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:(e,t,r)=>{var n=r(8698).default,i=r(5036);e.exports=function(e){var t=i(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:(e,t,r)=>{var n=r(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,r)=>{var n=r(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},3083:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},8597:e=>{"use strict";e.exports={i8:"6.5.4"}},2476:e=>{"use strict";e.exports=JSON.parse('{"contractName":"APENFT721","abi":[{"inputs":[{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"baseUri","type":"string"},{"internalType":"address","name":"apeNFT721AssetProxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"mintNFT","type":"event"},{"inputs":[],"name":"APENFTERC721AssetProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"string[]","name":"uri","type":"string[]"}],"name":"batchMintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"string[]","name":"uri","type":"string[]"}],"name":"batchMintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"name":"setOverrideURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bytecode":"0x60806040523480156200001157600080fd5b50d380156200001f57600080fd5b50d280156200002d57600080fd5b5060405162002df838038062002df8833981016040819052620000509162000425565b83836200006d6301ffc9a760e01b6001600160e01b036200019016565b815162000082906006906020850190620002dc565b50805162000098906007906020840190620002dc565b50620000b46380ac58cd60e01b6001600160e01b036200019016565b620000cf635b5e139f60e01b6001600160e01b036200019016565b620000ea63780e9d6360e01b6001600160e01b036200019016565b5060009050620001026001600160e01b03620001eb16565b600a80546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508151156200016f5781516200016d90600c906020850190620002dc565b505b62000186338260016001600160e01b03620001f016565b5050505062000558565b6001600160e01b03198082161415620001c65760405162461bcd60e51b8152600401620001bd90620004ea565b60405180910390fd5b6001600160e01b0319166000908152602081905260409020805460ff19166001179055565b335b90565b620002036001600160e01b03620001eb16565b6001600160a01b0316826001600160a01b03161415620002375760405162461bcd60e51b8152600401620001bd9062000521565b80600560006200024f6001600160e01b03620001eb16565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff19169215159290921790915562000295620001eb565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051620002cf9190620004df565b60405180910390a3505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200031f57805160ff19168380011785556200034f565b828001600101855582156200034f579182015b828111156200034f57825182559160200191906001019062000332565b506200035d92915062000361565b5090565b620001ed91905b808211156200035d576000815560010162000368565b600082601f8301126200038f578081fd5b81516001600160401b0380821115620003a6578283fd5b6040516020601f8401601f1916820181018381118382101715620003c8578586fd5b80604052508194508382528681858801011115620003e557600080fd5b600092505b83831015620004095785830181015182840182015291820191620003ea565b838311156200041b5760008185840101525b5050505092915050565b600080600080608085870312156200043b578384fd5b84516001600160401b038082111562000452578586fd5b62000460888389016200037e565b9550602087015191508082111562000476578485fd5b62000484888389016200037e565b945060408701519150808211156200049a578384fd5b50620004a9878288016200037e565b606087015190935090506001600160a81b0381168114620004c8578182fd5b9396929550909350506001600160a01b0390911690565b901515815260200190565b6020808252601c908201527f4552433136353a20696e76616c696420696e7465726661636520696400000000604082015260600190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b61289080620005686000396000f3fe608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d2801561002a57600080fd5b50600436106101dd5760003560e01c80636c0360eb116101135780639b73089d116100b1578063c87b56dd1161008b578063c87b56dd1461039c578063dc048cbb146103af578063e985e9c5146103c2578063f2fde38b146103d5576101dd565b80639b73089d14610363578063a22cb46514610376578063b88d4fde14610389576101dd565b8063755edd17116100ed578063755edd171461032d57806383ec2bbb146103405780638da5cb5b1461035357806395d89b411461035b576101dd565b80636c0360eb1461030a57806370a0823114610312578063715018a614610325576101dd565b80632f745c5911610180578063466682601161015a57806346668260146102c95780634f6ccce7146102d157806355f804b3146102e45780636352211e146102f7576101dd565b80632f745c591461029057806342842e0e146102a357806342966c68146102b6576101dd565b8063081812fc116101bc578063081812fc14610235578063095ea7b31461025557806318160ddd1461026857806323b872dd1461027d576101dd565b806275a317146101e257806301ffc9a7146101f757806306fdde0314610220575b600080fd5b6101f56101f0366004611f82565b6103e8565b005b61020a61020536600461205a565b610475565b6040516102179190612212565b60405180910390f35b610228610498565b604051610217919061221d565b6102486102433660046120d2565b61052f565b6040516102179190612191565b6101f5610263366004611fc7565b610572565b610270610605565b6040516102179190612758565b6101f561028b366004611dd8565b61060b565b61027061029e366004611fc7565b610643565b6101f56102b1366004611dd8565b610674565b6101f56102c43660046120d2565b61068f565b6102486106c2565b6102706102df3660046120d2565b6106d1565b6101f56102f2366004612092565b6106ed565b6102486103053660046120d2565b610738565b610228610766565b610270610320366004611d89565b6107c7565b6101f5610810565b6101f561033b366004611d89565b610899565b6101f561034e3660046120ea565b6108f1565b610248610970565b61022861097f565b6101f5610371366004611ff1565b6109e0565b6101f5610384366004611f47565b610ab5565b6101f5610397366004611e25565b610acb565b6102286103aa3660046120d2565b610b0a565b6101f56103bd366004611eeb565b610bef565b61020a6103d0366004611da4565b610c51565b6101f56103e3366004611d89565b610c7f565b6103f0610d40565b6001600160a01b0316610401610970565b6001600160a01b0316146104305760405162461bcd60e51b815260040161042790612572565b60405180910390fd5b6104708383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4492505050565b505050565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105245780601f106104f957610100808354040283529160200191610524565b820191906000526020600020905b81548152906001019060200180831161050757829003601f168201915b505050505090505b90565b600061053a82610da7565b6105565760405162461bcd60e51b815260040161042790612526565b506000908152600460205260409020546001600160a01b031690565b600061057d82610738565b9050806001600160a01b0316836001600160a01b031614156105b15760405162461bcd60e51b81526004016104279061263f565b806001600160a01b03166105c3610d40565b6001600160a01b031614806105df57506105df816103d0610d40565b6105fb5760405162461bcd60e51b815260040161042790612408565b6104708383610dba565b600e5490565b61061c610616610d40565b82610e28565b6106385760405162461bcd60e51b815260040161042790612680565b610470838383610ead565b6001600160a01b038216600090815260016020526040812061066b908363ffffffff610fcd16565b90505b92915050565b61047083838360405180602001604052806000815250610acb565b61069a610616610d40565b6106b65760405162461bcd60e51b815260040161042790612708565b6106bf81610fd9565b50565b600b546001600160a01b031681565b6000806106e560028463ffffffff6110b216565b509392505050565b6106f5610d40565b6001600160a01b0316610706610970565b6001600160a01b03161461072c5760405162461bcd60e51b815260040161042790612572565b610470600c8383611b95565b600061066e82604051806060016040528060298152602001612832602991396002919063ffffffff6110d016565b600c8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105245780601f106104f957610100808354040283529160200191610524565b60006001600160a01b0382166107ef5760405162461bcd60e51b815260040161042790612465565b6001600160a01b038216600090815260016020526040902061066e906110e7565b610818610d40565b6001600160a01b0316610829610970565b6001600160a01b03161461084f5760405162461bcd60e51b815260040161042790612572565b600a546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600a80546001600160a01b0319169055565b6108a1610d40565b6001600160a01b03166108b2610970565b6001600160a01b0316146108d85760405162461bcd60e51b815260040161042790612572565b6106bf8160405180602001604052806000815250610d44565b6108f9610d40565b6001600160a01b031661090a610970565b6001600160a01b0316146109305760405162461bcd60e51b815260040161042790612572565b6104708383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506110f292505050565b600a546001600160a01b031690565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105245780601f106104f957610100808354040283529160200191610524565b6109e8610d40565b6001600160a01b03166109f9610970565b6001600160a01b031614610a1f5760405162461bcd60e51b815260040161042790612572565b60005b83811015610aae57610aa6858583818110610a3957fe5b9050602002016020810190610a4e9190611d89565b848484818110610a5a57fe5b9050602002810190610a6c9190612761565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d4492505050565b600101610a22565b5050505050565b610ac7610ac0610d40565b8383611200565b5050565b610adc610ad6610d40565b83610e28565b610af85760405162461bcd60e51b815260040161042790612680565b610b04848484846112cf565b50505050565b6060610b1582610da7565b610b315760405162461bcd60e51b8152600401610427906123bc565b6000828152600d602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845260609392830182828015610bc65780601f10610b9b57610100808354040283529160200191610bc6565b820191906000526020600020905b815481529060010190602001808311610ba957829003601f168201915b50505050509050600081511115610bde579050610493565b610be783611302565b915050610493565b610bf7610d40565b6001600160a01b0316610c08610970565b6001600160a01b031614610c2e5760405162461bcd60e51b815260040161042790612572565b60005b81811015610b0457610c4984848484818110610a5a57fe5b600101610c31565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b610c87610d40565b6001600160a01b0316610c98610970565b6001600160a01b031614610cbe5760405162461bcd60e51b815260040161042790612572565b6001600160a01b038116610ce45760405162461bcd60e51b8152600401610427906122c4565b600a546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600a80546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b600e805460010190819055610d5a908390611448565b610d66600e54826110f2565b7f1e57691246e45cf368f5bb124cb33e8617ccf0ad1e3f80a3132f8ea85b1b4ef133600e5483604051610d9b939291906121e2565b60405180910390a15050565b600061066e60028363ffffffff61151816565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190610def82610738565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000610e3382610da7565b610e4f5760405162461bcd60e51b8152600401610427906123bc565b6000610e5a83610738565b9050806001600160a01b0316846001600160a01b03161480610e955750836001600160a01b0316610e8a8461052f565b6001600160a01b0316145b80610ea55750610ea58185610c51565b949350505050565b826001600160a01b0316610ec082610738565b6001600160a01b031614610ee65760405162461bcd60e51b8152600401610427906125a7565b6001600160a01b038216610f0c5760405162461bcd60e51b815260040161042790612341565b610f17838383610470565b610f22600082610dba565b6001600160a01b0383166000908152600160205260409020610f4a908263ffffffff61152416565b506001600160a01b0382166000908152600160205260409020610f73908263ffffffff61153016565b50610f866002828463ffffffff61153c16565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600061066b8383611552565b6000610fe482610738565b9050610ff281600084610470565b610ffd600083610dba565b600082815260086020526040902054600260001961010060018416150201909116041561103b57600082815260086020526040812061103b91611c13565b6001600160a01b0381166000908152600160205260409020611063908363ffffffff61152416565b5061107560028363ffffffff61159716565b5060405182906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008080806110c186866115a3565b909450925050505b9250929050565b60006110dd8484846115ff565b90505b9392505050565b600061066e8261165e565b6000828152600d602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156111875780601f1061115c57610100808354040283529160200191611187565b820191906000526020600020905b81548152906001019060200180831161116a57829003601f168201915b505050505090508160405160200161119f9190612147565b60405160208183030381529060405280519060200120816040516020016111c69190612147565b6040516020818303038152906040528051906020012014610470576000838152600d602090815260409091208351610b0492850190611c57565b611208610d40565b6001600160a01b0316826001600160a01b031614156112395760405162461bcd60e51b815260040161042790612385565b8060056000611246610d40565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff19169215159290921790915561128a610d40565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516112c29190612212565b60405180910390a3505050565b6112da848484610ead565b6112e684848484611662565b610b045760405162461bcd60e51b815260040161042790612272565b606061130d82610da7565b6113295760405162461bcd60e51b8152600401610427906125f0565b60008281526008602090815260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452606093928301828280156113be5780601f10611393576101008083540402835291602001916113be565b820191906000526020600020905b8154815290600101906020018083116113a157829003601f168201915b5050505050905060606113cf610766565b90508051600014156113e357509050610493565b8151156114155780826040516020016113fd929190612163565b60405160208183030381529060405292505050610493565b8061141f8561173e565b604051602001611430929190612163565b60405160208183030381529060405292505050919050565b6001600160a01b03821661146e5760405162461bcd60e51b8152600401610427906124f1565b61147781610da7565b156114945760405162461bcd60e51b81526004016104279061230a565b6114a060008383610470565b6001600160a01b03821660009081526001602052604090206114c8908263ffffffff61153016565b506114db6002828463ffffffff61153c16565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600061066b8383611819565b600061066b8383611831565b600061066b83836118f7565b60006110dd84846001600160a01b038516611941565b815460009082106115755760405162461bcd60e51b815260040161042790612230565b82600001828154811061158457fe5b9060005260206000200154905092915050565b600061066b83836119d8565b8154600090819083106115c85760405162461bcd60e51b8152600401610427906124af565b60008460000184815481106115d957fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b6000828152600184016020526040812054828161162f5760405162461bcd60e51b8152600401610427919061221d565b5084600001600182038154811061164257fe5b9060005260206000209060020201600101549150509392505050565b5490565b600061166d84611aac565b61167957506001610ea5565b6060611707630a85bd0160e11b61168e610d40565b8887876040516024016116a494939291906121a5565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001612800603291396001600160a01b038816919063ffffffff611ab216565b905060008180602001905181019061171f9190612076565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b60608161176357506040805180820190915260018152600360fc1b6020820152610493565b8160005b811561177b57600101600a82049150611767565b60608167ffffffffffffffff8111801561179457600080fd5b506040519080825280601f01601f1916602001820160405280156117bf576020820181803683370190505b50859350905060001982015b831561181057600a840660300160f81b828280600190039350815181106117ee57fe5b60200101906001600160f81b031916908160001a905350600a840493506117cb565b50949350505050565b60009081526001919091016020526040902054151590565b600081815260018301602052604081205480156118ed578354600019808301919081019060009087908390811061186457fe5b906000526020600020015490508087600001848154811061188157fe5b6000918252602080832090910192909255828152600189810190925260409020908401905586548790806118b157fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061066e565b600091505061066e565b60006119038383611819565b6119395750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561066e565b50600061066e565b6000828152600184016020526040812054806119a65750506040805180820182528381526020808201848152865460018181018955600089815284812095516002909302909501918255915190820155865486845281880190925292909120556110e0565b828560000160018303815481106119b957fe5b90600052602060002090600202016001018190555060009150506110e0565b600081815260018301602052604081205480156118ed5783546000198083019190810190600090879083908110611a0b57fe5b9060005260206000209060020201905080876000018481548110611a2b57fe5b600091825260208083208454600290930201918255600193840154918401919091558354825289830190526040902090840190558654879080611a6a57fe5b600082815260208082206002600019909401938402018281556001908101839055929093558881528982019092526040822091909155945061066e9350505050565b3b151590565b60606110dd848460008585611ac685611aac565b611ae25760405162461bcd60e51b8152600401610427906126d1565b60006060866001600160a01b03168587604051611aff9190612147565b60006040518083038185875af1925050503d8060008114611b3c576040519150601f19603f3d011682016040523d82523d6000602084013e611b41565b606091505b5091509150611b51828286611b5c565b979650505050505050565b60608315611b6b5750816110e0565b825115611b7b5782518084602001fd5b8160405162461bcd60e51b8152600401610427919061221d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611bd65782800160ff19823516178555611c03565b82800160010185558215611c03579182015b82811115611c03578235825591602001919060010190611be8565b50611c0f929150611cc5565b5090565b50805460018160011615610100020316600290046000825580601f10611c3957506106bf565b601f0160209004906000526020600020908101906106bf9190611cc5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c9857805160ff1916838001178555611c03565b82800160010185558215611c03579182015b82811115611c03578251825591602001919060010190611caa565b61052c91905b80821115611c0f5760008155600101611ccb565b600081356001600160a81b0381168114611cf7578182fd5b6001600160a01b03169392505050565b60008083601f840112611d18578182fd5b50813567ffffffffffffffff811115611d2f578182fd5b60208301915083602080830285010111156110c957600080fd5b60008083601f840112611d5a578182fd5b50813567ffffffffffffffff811115611d71578182fd5b6020830191508360208285010111156110c957600080fd5b600060208284031215611d9a578081fd5b61066b8383611cdf565b60008060408385031215611db6578081fd5b611dc08484611cdf565b9150611dcf8460208501611cdf565b90509250929050565b600080600060608486031215611dec578081fd5b8335611df7816127d4565b6001600160a01b039081169350602085013590611e13826127d4565b93969316945050506040919091013590565b60008060008060808587031215611e3a578081fd5b611e448686611cdf565b93506020611e5487828801611cdf565b935060408601359250606086013567ffffffffffffffff80821115611e77578384fd5b81880189601f820112611e88578485fd5b8035925081831115611e98578485fd5b604051601f8401601f1916810185018381118282101715611eb7578687fd5b60405283815281840185018b1015611ecd578586fd5b83858301868301379283019093019390935294979396509194505050565b600080600060408486031215611eff578283fd5b8335611f0a816127d4565b6001600160a01b03169250602084013567ffffffffffffffff811115611f2e578283fd5b611f3a86828701611d07565b9497909650939450505050565b60008060408385031215611f59578182fd5b611f638484611cdf565b915060208301358015158114611f77578182fd5b809150509250929050565b600080600060408486031215611f96578283fd5b611fa08585611cdf565b9250602084013567ffffffffffffffff811115611fbb578283fd5b611f3a86828701611d49565b60008060408385031215611fd9578182fd5b611fe38484611cdf565b946020939093013593505050565b60008060008060408587031215612006578384fd5b843567ffffffffffffffff8082111561201d578586fd5b61202988838901611d07565b90965094506020870135915080821115612041578384fd5b5061204e87828801611d07565b95989497509550505050565b60006020828403121561206b578081fd5b81356110e0816127e9565b600060208284031215612087578081fd5b81516110e0816127e9565b600080602083850312156120a4578182fd5b823567ffffffffffffffff8111156120ba578283fd5b6120c685828601611d49565b90969095509350505050565b6000602082840312156120e3578081fd5b5035919050565b6000806000604084860312156120fe578081fd5b83359250602084013567ffffffffffffffff811115611fbb578182fd5b600081518084526121338160208601602086016127a8565b601f01601f19169290920160200192915050565b600082516121598184602087016127a8565b9190910192915050565b600083516121758184602088016127a8565b83519083016121888282602088016127a8565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906121d89083018461211b565b9695505050505050565b600060018060a01b038516825283602083015260606040830152612209606083018461211b565b95945050505050565b901515815260200190565b60006020825261066b602083018461211b565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526022908201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526030908201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760408201526f1b995c881b9bdc88185c1c1c9bdd995960821b606082015260800190565b90815260200190565b6000808335601e19843603018112612777578283fd5b8084018035925067ffffffffffffffff831115612792578384fd5b602001925050368190038213156110c957600080fd5b60005b838110156127c35781810151838201526020016127ab565b83811115610b045750506000910152565b6001600160a81b03811681146106bf57600080fd5b6001600160e01b0319811681146106bf57600080fdfe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea26469706673582212208327a6bcc1ccfcb43074aba28c95af6c2bc995afe50900eebb8ad625c14b327064736f6c63430006080033"}')},5076:e=>{"use strict";e.exports=JSON.parse('{"contractName":"APENFTExchange","abi":[{"inputs":[{"internalType":"contract ERC20","name":"tokenAddress","type":"address"},{"internalType":"address","name":"protocolFeeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"exchange","type":"address"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"indexed":true,"internalType":"address","name":"feeRecipient","type":"address"},{"indexed":false,"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"indexed":false,"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"indexed":false,"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"indexed":false,"internalType":"address","name":"target","type":"address"}],"name":"OrderApprovedPartOne","type":"event","stateMutability":"nonpayable"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"dataToCall","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"indexed":false,"internalType":"address","name":"staticTarget","type":"address"},{"indexed":false,"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"indexed":false,"internalType":"address","name":"paymentToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"basePrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"extra","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"listingTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expirationTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"salt","type":"uint256"},{"indexed":false,"internalType":"bool","name":"orderbookInclusionDesired","type":"bool"}],"name":"OrderApprovedPartTwo","type":"event","stateMutability":"nonpayable"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"OrderCancelled","type":"event","stateMutability":"nonpayable"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"buyHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"sellHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"metadata","type":"bytes32"}],"name":"OrdersMatched","type":"event","stateMutability":"nonpayable"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event","stateMutability":"nonpayable"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldToken","type":"address"},{"indexed":false,"internalType":"address","name":"newToken","type":"address"}],"name":"protocolTokenChanged","type":"event","stateMutability":"nonpayable"},{"inputs":[],"name":"INVERSE_BASIS_POINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"internalType":"bool","name":"orderbookInclusionDesired","type":"bool"}],"name":"approveOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"approvedOrders","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetProxy","outputs":[{"internalType":"contract AssetProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order[]","name":"buy","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig[]","name":"buySig","type":"tuple[]"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order[]","name":"sell","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig[]","name":"sellSig","type":"tuple[]"},{"internalType":"bytes32[]","name":"metadata","type":"bytes32[]"}],"name":"batchOrderMatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"sig","type":"tuple"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"cancelledOrFinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinimumMakerProtocolFee","type":"uint256"}],"name":"changeMinimumMakerProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinimumTakerProtocolFee","type":"uint256"}],"name":"changeMinimumTakerProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newProtocolFeeRecipient","type":"address"}],"name":"changeProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"token","type":"address"}],"name":"changeProtocolToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc20Proxy","outputs":[{"internalType":"contract ERC20AssetProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumMakerProtocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumTakerProtocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"buy","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"buySig","type":"tuple"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"sell","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"sellSig","type":"tuple"},{"internalType":"bytes32","name":"metadata","type":"bytes32"}],"name":"orderMatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract AssetProxy","name":"assetAddress","type":"address"},{"internalType":"contract ERC20AssetProxy","name":"tokenProxyAddress","type":"address"}],"name":"setProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"sig","type":"tuple"}],"name":"validateOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]}')},9533:e=>{"use strict";e.exports=JSON.parse('{"contractName":"APENFTSharedAsset","abi":[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"proxyRegistryAddr","type":"address"},{"internalType":"string","name":"defaultURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"creator","type":"address"}],"name":"CreatorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"dao","type":"address"},{"indexed":false,"internalType":"address","name":"preDao","type":"address"}],"name":"DaoChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_amount","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"_DaoAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"_getOverrideURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddr","type":"address"}],"name":"addSharedProxyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"quantities","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"batchMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"checkIsOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"address","name":"_address","type":"address"}],"name":"checkIsProxyForUser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"creator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"newCreator","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"address","name":"tokenCreator","type":"address"}],"name":"hashCreatorModification","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"address","name":"tokenCreator","type":"address"}],"name":"hashURIModification","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddr","type":"address"}],"name":"removeSharedProxyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"newCreator","type":"address"}],"name":"setCreator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"newCreator","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"setCreatorByDaoSig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"daoAddr","type":"address"}],"name":"setDaoAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setDefaultURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddr","type":"address"}],"name":"setProxyRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"setURIByDaoSig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sharedProxyAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"superBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supportsFactoryInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"hash","type":"bytes32"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"validateDaoSig","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]}')},8845:e=>{"use strict";e.exports=JSON.parse('{"contractName":"AuthenticatedProxy","abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReceivedEther","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"ReceivedTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"revoked","type":"bool"}],"name":"Revoked","type":"event"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyType","outputs":[{"internalType":"uint256","name":"proxyTypeId","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"name":"receiveApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract ProxyRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"revoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"upgradeabilityOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"user","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"},{"inputs":[{"internalType":"address","name":"addrUser","type":"address"},{"internalType":"contract ProxyRegistry","name":"addrRegistry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"revoke","type":"bool"}],"name":"setRevoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"proxy","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"dest","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"proxyAssert","outputs":[],"stateMutability":"nonpayable","type":"function"}]}')},2994:e=>{"use strict";e.exports=JSON.parse('{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"URI","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_initialSupply","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"create","outputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creators","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256[]","name":"_quantities","type":"uint256[]"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_operator","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"setURI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}]}')},7489:e=>{"use strict";e.exports=JSON.parse('{"contractName":"ERC20","abi":[{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]}')},9783:e=>{"use strict";e.exports=JSON.parse('{"contractName":"ERC20AssetProxy","abi":[{"inputs":[{"internalType":"address","name":"exchange","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"bool","name":"opt","type":"bool"}],"name":"AuthenticationOperation","type":"event","stateMutability":"nonpayable"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event","stateMutability":"nonpayable"},{"inputs":[],"name":"DELAY_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"endGrantAuthentication","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pending","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"revokeAuthentication","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"startGrantAuthentication","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]}')},8520:e=>{"use strict";e.exports=JSON.parse('{"abi":[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"kittyIndexToApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"allowed","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"partIndexToApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_approved","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_operator","type":"address"},{"indexed":false,"name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"}]}')},9980:e=>{"use strict";e.exports=JSON.parse('{"contractName":"ExchangeHelper","abi":[{"inputs":[{"internalType":"address","name":"proxy","type":"address"},{"internalType":"address","name":"erc20Proxyt","type":"address"},{"internalType":"contract ExchangeCore","name":"core","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"internalType":"bool","name":"orderbookInclusionDesired","type":"bool"}],"name":"approveOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"assetProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"}],"name":"calculateCurrentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"}],"name":"calculateFinalPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"buy","type":"tuple"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"sell","type":"tuple"}],"name":"calculateMatchPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"sig","type":"tuple"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc20Proxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeCore","outputs":[{"internalType":"contract ExchangeCore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"array","type":"bytes"},{"internalType":"bytes","name":"desired","type":"bytes"},{"internalType":"bytes","name":"mask","type":"bytes"}],"name":"guardedArrayReplace","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"}],"name":"hashOrder","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"}],"name":"hashToSign","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"buyCalldata","type":"bytes"},{"internalType":"bytes","name":"buyReplacementPattern","type":"bytes"},{"internalType":"bytes","name":"sellCalldata","type":"bytes"},{"internalType":"bytes","name":"sellReplacementPattern","type":"bytes"}],"name":"orderCalldataCanMatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"buy","type":"tuple"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"sell","type":"tuple"}],"name":"ordersCanMatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"message","type":"string"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"validateMessageSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"sig","type":"tuple"}],"name":"validateOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"makerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"takerRelayerFee","type":"uint256"},{"internalType":"uint256","name":"makerProtocolFee","type":"uint256"},{"internalType":"uint256","name":"takerProtocolFee","type":"uint256"},{"internalType":"address","name":"feeRecipient","type":"address"},{"internalType":"enum DataType.FeeMethod","name":"feeMethod","type":"uint8"},{"internalType":"enum SaleKindInterface.Side","name":"side","type":"uint8"},{"internalType":"enum SaleKindInterface.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum DataType.HowToCall","name":"howToCall","type":"uint8"},{"internalType":"bytes","name":"dataToCall","type":"bytes"},{"internalType":"bytes","name":"replacementPattern","type":"bytes"},{"internalType":"address","name":"staticTarget","type":"address"},{"internalType":"bytes","name":"staticExtradata","type":"bytes"},{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"extra","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"internalType":"struct DataType.Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct DataType.Sig","name":"sig","type":"tuple"},{"internalType":"uint16","name":"tokenType","type":"uint16"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"validateOrderAndBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]}')},8129:e=>{"use strict";e.exports=JSON.parse('{"contractName":"FactoryContract","abi":[]}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.APENFTError=e.NULL_ADDRESS=e.makeBigNumber=e.getSchemaList=e.toBaseUnitAmount=e.AssetFactory=e.OrderSide=e.APENFTSchemaName=e.MakeOrderType=e.Network=e.initApprove=e.APENFTQuery=e.APENFTOrders=void 0;var t=r(4603);Object.defineProperty(e,"APENFTOrders",{enumerable:!0,get:function(){return t.APENFTOrders}});var i=r(2663);Object.defineProperty(e,"APENFTQuery",{enumerable:!0,get:function(){return i.APENFTQuery}});var o=r(7280);Object.defineProperty(e,"initApprove",{enumerable:!0,get:function(){return o.initApprove}});var a=r(307);Object.defineProperty(e,"Network",{enumerable:!0,get:function(){return a.Network}}),Object.defineProperty(e,"MakeOrderType",{enumerable:!0,get:function(){return a.MakeOrderType}}),Object.defineProperty(e,"APENFTSchemaName",{enumerable:!0,get:function(){return a.APENFTSchemaName}}),Object.defineProperty(e,"OrderSide",{enumerable:!0,get:function(){return a.OrderSide}});var s=r(8334);Object.defineProperty(e,"AssetFactory",{enumerable:!0,get:function(){return s.AssetFactory}});var u=r(8033);Object.defineProperty(e,"toBaseUnitAmount",{enumerable:!0,get:function(){return u.toBaseUnitAmount}}),Object.defineProperty(e,"getSchemaList",{enumerable:!0,get:function(){return u.getSchemaList}}),Object.defineProperty(e,"makeBigNumber",{enumerable:!0,get:function(){return u.makeBigNumber}});var l=r(3553);Object.defineProperty(e,"NULL_ADDRESS",{enumerable:!0,get:function(){return l.NULL_ADDRESS}});var c=r(5085);Object.defineProperty(e,"APENFTError",{enumerable:!0,get:function(){return c.APENFTError}})})(),module.exports=n})();