@dodoex/wallet-web3 0.0.22-1 → 0.0.22-2

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 (89) hide show
  1. package/dist/__tslib-dd22ed7d.js +1 -0
  2. package/dist/_commonjs-dynamic-modules-7cfc9805.js +1 -0
  3. package/dist/blocto-69a506f8.js +1 -0
  4. package/dist/bn-3e892825.js +1 -0
  5. package/dist/cjs/__tslib-8344f379.cjs +1 -0
  6. package/dist/cjs/_commonjs-dynamic-modules-f09a98c7.cjs +1 -0
  7. package/dist/cjs/blocto-bdab3cea.cjs +1 -0
  8. package/dist/cjs/bn-ce9dbccd.cjs +1 -0
  9. package/dist/cjs/ethers-767c2337.cjs +1 -0
  10. package/dist/cjs/id-6c4d97dd.cjs +1 -0
  11. package/dist/cjs/index-2428f0a6.cjs +1 -0
  12. package/dist/cjs/index-3d1a3da9.cjs +1 -0
  13. package/dist/cjs/index-4585c950.cjs +1 -0
  14. package/dist/cjs/index-47f3e61d.cjs +1 -0
  15. package/dist/cjs/index-4abb9db3.cjs +1 -0
  16. package/dist/cjs/index-5d7b94fd.cjs +1 -0
  17. package/dist/cjs/index-659dc842.cjs +61 -0
  18. package/dist/cjs/index-67e59d1a.cjs +1 -0
  19. package/dist/cjs/index-795ad993.cjs +46 -0
  20. package/dist/cjs/index-a5fa1e6e.cjs +15 -0
  21. package/dist/cjs/index-aa04e7a3.cjs +1 -0
  22. package/dist/cjs/index-cfe3e391.cjs +10 -0
  23. package/dist/cjs/index-d226aab9.cjs +8 -0
  24. package/dist/cjs/index-e875b498.cjs +1 -0
  25. package/dist/cjs/index-f2c04d55.cjs +1 -0
  26. package/dist/cjs/index.cjs +1 -1
  27. package/dist/cjs/index.es-a3704620.cjs +9 -0
  28. package/dist/cjs/interface-1b54eefa.cjs +1 -0
  29. package/dist/cjs/node-ponyfill-a7a0b431.cjs +1 -0
  30. package/dist/cjs/portis-ec0ce54d.cjs +1 -0
  31. package/dist/cjs/provider-403219c9.cjs +1 -0
  32. package/dist/cjs/rainbow-caa66e39.cjs +1 -0
  33. package/dist/cjs/uAuth-a2d2617a.cjs +1 -0
  34. package/dist/cjs/walletConnect-c57b3b5d.cjs +1 -0
  35. package/dist/cjs/walletLink-f0f9e2a7.cjs +3 -0
  36. package/dist/ethers-51e19435.js +1 -0
  37. package/dist/id-830e09aa.js +1 -0
  38. package/dist/index-0103e089.js +1 -0
  39. package/dist/index-235259d8.js +1 -0
  40. package/dist/index-3158e93a.js +46 -0
  41. package/dist/index-46c2059e.js +1 -0
  42. package/dist/index-5091218e.js +1 -0
  43. package/dist/index-5f9e8321.js +1 -0
  44. package/dist/index-650785ec.js +1 -0
  45. package/dist/index-6bf494b0.js +1 -0
  46. package/dist/index-80483be2.js +8 -0
  47. package/dist/index-82b4fd64.js +60 -0
  48. package/dist/index-88837567.js +1 -0
  49. package/dist/index-c699a924.js +1 -0
  50. package/dist/index-cc453bb1.js +10 -0
  51. package/dist/index-de37f6bb.js +1 -0
  52. package/dist/index-f3052552.js +15 -0
  53. package/dist/index.es-877101c5.js +9 -0
  54. package/dist/index.js +1 -1
  55. package/dist/interface-f97a878a.js +1 -0
  56. package/dist/node-ponyfill-55b945e1.js +1 -0
  57. package/dist/portis-7d46b7ed.js +1 -0
  58. package/dist/provider-453e2483.js +1 -0
  59. package/dist/rainbow-61a52379.js +1 -0
  60. package/dist/uAuth-40d8acab.js +1 -0
  61. package/dist/walletConnect-d6a9aa67.js +1 -0
  62. package/dist/walletLink-106461e6.js +3 -0
  63. package/package.json +1 -1
  64. package/dist/blocto-4a33d5ca.js +0 -1
  65. package/dist/cjs/blocto-c3de72cf.cjs +0 -1
  66. package/dist/cjs/index-00f30b53.cjs +0 -1
  67. package/dist/cjs/index-27eb8948.cjs +0 -1
  68. package/dist/cjs/index-34d28fe1.cjs +0 -1
  69. package/dist/cjs/index-6777aca7.cjs +0 -1
  70. package/dist/cjs/index-8fb559d0.cjs +0 -1
  71. package/dist/cjs/index-e29346ca.cjs +0 -1
  72. package/dist/cjs/portis-698618a3.cjs +0 -1
  73. package/dist/cjs/provider-9c8505bc.cjs +0 -1
  74. package/dist/cjs/rainbow-fa30e364.cjs +0 -1
  75. package/dist/cjs/uAuth-27f2257f.cjs +0 -1
  76. package/dist/cjs/walletConnect-63cd4764.cjs +0 -1
  77. package/dist/cjs/walletLink-6bf8d19c.cjs +0 -1
  78. package/dist/index-09ced70e.js +0 -1
  79. package/dist/index-1ca259fc.js +0 -1
  80. package/dist/index-4ee60b82.js +0 -1
  81. package/dist/index-775efe7e.js +0 -1
  82. package/dist/index-96419f54.js +0 -1
  83. package/dist/index-dec2384f.js +0 -1
  84. package/dist/portis-1fbfa428.js +0 -1
  85. package/dist/provider-df49c5bf.js +0 -1
  86. package/dist/rainbow-52844e55.js +0 -1
  87. package/dist/uAuth-9bf2390c.js +0 -1
  88. package/dist/walletConnect-eb49e4f6.js +0 -1
  89. package/dist/walletLink-103ec7de.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";var t=require("./index-cfe3e391.cjs"),r=require("@ethersproject/bytes");let i=!1,e=!1;const n={debug:1,default:2,info:2,warning:3,error:4,off:5};let o=n.default,h=null;const s=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((r=>{try{if("test"!=="test".normalize(r))throw new Error("bad normalize")}catch(i){t.push(r)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var u,a;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(u||(u={})),exports.ErrorCode=void 0,(a=exports.ErrorCode||(exports.ErrorCode={})).UNKNOWN_ERROR="UNKNOWN_ERROR",a.NOT_IMPLEMENTED="NOT_IMPLEMENTED",a.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",a.NETWORK_ERROR="NETWORK_ERROR",a.SERVER_ERROR="SERVER_ERROR",a.TIMEOUT="TIMEOUT",a.BUFFER_OVERRUN="BUFFER_OVERRUN",a.NUMERIC_FAULT="NUMERIC_FAULT",a.MISSING_NEW="MISSING_NEW",a.INVALID_ARGUMENT="INVALID_ARGUMENT",a.MISSING_ARGUMENT="MISSING_ARGUMENT",a.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",a.CALL_EXCEPTION="CALL_EXCEPTION",a.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",a.NONCE_EXPIRED="NONCE_EXPIRED",a.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",a.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",a.TRANSACTION_REPLACED="TRANSACTION_REPLACED",a.ACTION_REJECTED="ACTION_REJECTED";const l="0123456789abcdef";class m{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,r){const i=t.toLowerCase();null==n[i]&&this.throwArgumentError("invalid log level name","logLevel",t),o>n[i]||console.log.apply(console,r)}debug(...t){this._log(m.levels.DEBUG,t)}info(...t){this._log(m.levels.INFO,t)}warn(...t){this._log(m.levels.WARNING,t)}makeError(t,r,i){if(e)return this.makeError("censored error",r,{});r||(r=m.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach((t=>{const r=i[t];try{if(r instanceof Uint8Array){let i="";for(let t=0;t<r.length;t++)i+=l[r[t]>>4],i+=l[15&r[t]];n.push(t+"=Uint8Array(0x"+i+")")}else n.push(t+"="+JSON.stringify(r))}catch(r){n.push(t+"="+JSON.stringify(i[t].toString()))}})),n.push(`code=${r}`),n.push(`version=${this.version}`);const o=t;let h="";switch(r){case exports.ErrorCode.NUMERIC_FAULT:{h="NUMERIC_FAULT";const r=t;switch(r){case"overflow":case"underflow":case"division-by-zero":h+="-"+r;break;case"negative-power":case"negative-width":h+="-unsupported";break;case"unbound-bitwise-result":h+="-unbound-result"}break}case exports.ErrorCode.CALL_EXCEPTION:case exports.ErrorCode.INSUFFICIENT_FUNDS:case exports.ErrorCode.MISSING_NEW:case exports.ErrorCode.NONCE_EXPIRED:case exports.ErrorCode.REPLACEMENT_UNDERPRICED:case exports.ErrorCode.TRANSACTION_REPLACED:case exports.ErrorCode.UNPREDICTABLE_GAS_LIMIT:h=r}h&&(t+=" [ See: https://links.ethers.org/v5-errors-"+h+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const s=new Error(t);return s.reason=o,s.code=r,Object.keys(i).forEach((function(t){s[t]=i[t]})),s}throwError(t,r,i){throw this.makeError(t,r,i)}throwArgumentError(t,r,i){return this.throwError(t,m.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(t,r,i,e){t||this.throwError(r,i,e)}assertArgument(t,r,i,e){t||this.throwArgumentError(r,i,e)}checkNormalize(t){s&&this.throwError("platform missing String.prototype.normalize",m.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:s})}checkSafeUint53(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,m.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,m.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,i){i=i?": "+i:"",t<r&&this.throwError("missing argument"+i,m.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+i,m.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){t!==Object&&null!=t||this.throwError("missing new",m.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",m.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",m.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return h||(h=new m("logger/5.7.0")),h}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",m.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!t)return;this.globalLogger().throwError("error censorship permanent",m.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}e=!!t,i=!!r}static setLogLevel(t){const r=n[t.toLowerCase()];null!=r?o=r:m.globalLogger().warn("invalid log level - "+t)}static from(t){return new m(t)}}m.errors=exports.ErrorCode,m.levels=u;var f=Object.freeze({__proto__:null,get LogLevel(){return u},get ErrorCode(){return exports.ErrorCode},Logger:m}),d={exports:{}};!function(t,r){function i(t,r){if(!t)throw new Error(r||"Assertion failed")}function e(t,r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}function n(t,r,i){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==r&&"be"!==r||(i=r,r=10),this._init(t||0,r||10,i||"be"))}var o;"object"==typeof t?t.exports=n:r.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(t){}function h(t,r){var e=t.charCodeAt(r);return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void i(!1,"Invalid character in "+t)}function s(t,r,i){var e=h(t,i);return i-1>=r&&(e|=h(t,i-1)<<4),e}function u(t,r,e,n){for(var o=0,h=0,s=Math.min(t.length,e),u=r;u<s;u++){var a=t.charCodeAt(u)-48;o*=n,h=a>=49?a-49+10:a>=17?a-17+10:a,i(a>=0&&h<n,"Invalid character"),o+=h}return o}function a(t,r){t.words=r.words,t.length=r.length,t.negative=r.negative,t.red=r.red}if(n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,r){return t.cmp(r)>0?t:r},n.min=function(t,r){return t.cmp(r)<0?t:r},n.prototype._init=function(t,r,e){if("number"==typeof t)return this._initNumber(t,r,e);if("object"==typeof t)return this._initArray(t,r,e);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===r?this._parseHex(t,n,e):(this._parseBase(t,r,n),"le"===e&&this._initArray(this.toArray(),r,e)))},n.prototype._initNumber=function(t,r,e){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===e&&this._initArray(this.toArray(),r,e)},n.prototype._initArray=function(t,r,e){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,h,s=0;if("be"===e)for(n=t.length-1,o=0;n>=0;n-=3)h=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=h<<s&67108863,this.words[o+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===e)for(n=0,o=0;n<t.length;n+=3)h=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=h<<s&67108863,this.words[o+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},n.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,o=0,h=0;if("be"===i)for(e=t.length-1;e>=r;e-=2)n=s(t,r,e)<<o,this.words[h]|=67108863&n,o>=18?(o-=18,h+=1,this.words[h]|=n>>>26):o+=8;else for(e=(t.length-r)%2==0?r+1:r;e<t.length;e+=2)n=s(t,r,e)<<o,this.words[h]|=67108863&n,o>=18?(o-=18,h+=1,this.words[h]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=r)e++;e--,n=n/r|0;for(var o=t.length-i,h=o%e,s=Math.min(o,o-h)+i,a=0,l=i;l<s;l+=e)a=u(t,l,l+e,r),this.imuln(n),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==h){var m=1;for(a=u(t,l,t.length,r),l=0;l<h;l++)m*=r;this.imuln(m),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}this._strip()},n.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},n.prototype._move=function(t){a(t,this)},n.prototype.clone=function(){var t=new n(null);return this.copy(t),t},n.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var m=["","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 p(t,r,i){i.negative=r.negative^t.negative;var e=t.length+r.length|0;i.length=e,e=e-1|0;var n=0|t.words[0],o=0|r.words[0],h=n*o,s=67108863&h,u=h/67108864|0;i.words[0]=s;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,r.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(h=(n=0|t.words[p])*(o=0|r.words[d])+m)/67108864|0,m=67108863&h}i.words[a]=0|m,u=0|l}return 0!==u?i.words[a]=0|u:i.length--,i._strip()}n.prototype.toString=function(t,r){var e;if(r=0|r||1,16===(t=t||10)||"hex"===t){e="";for(var n=0,o=0,h=0;h<this.length;h++){var s=this.words[h],u=(16777215&(s<<n|o)).toString(16);o=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,h--),e=0!==o||h!==this.length-1?m[6-u.length]+u+e:u+e}for(0!==o&&(e=o.toString(16)+e);e.length%r!=0;)e="0"+e;return 0!==this.negative&&(e="-"+e),e}if(t===(0|t)&&t>=2&&t<=36){var a=f[t],l=d[t];e="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(l).toString(t);e=(p=p.idivn(l)).isZero()?g+e:m[a-g.length]+g+e}for(this.isZero()&&(e="0"+e);e.length%r!=0;)e="0"+e;return 0!==this.negative&&(e="-"+e),e}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(t,r){return this.toArrayLike(o,t,r)}),n.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},n.prototype.toArrayLike=function(t,r,e){this._strip();var n=this.byteLength(),o=e||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var h=function(t,r){return t.allocUnsafe?t.allocUnsafe(r):new t(r)}(t,o);return this["_toArrayLike"+("le"===r?"LE":"BE")](h,n),h},n.prototype._toArrayLikeLE=function(t,r){for(var i=0,e=0,n=0,o=0;n<this.length;n++){var h=this.words[n]<<o|e;t[i++]=255&h,i<t.length&&(t[i++]=h>>8&255),i<t.length&&(t[i++]=h>>16&255),6===o?(i<t.length&&(t[i++]=h>>24&255),e=0,o=0):(e=h>>>24,o+=2)}if(i<t.length)for(t[i++]=e;i<t.length;)t[i++]=0},n.prototype._toArrayLikeBE=function(t,r){for(var i=t.length-1,e=0,n=0,o=0;n<this.length;n++){var h=this.words[n]<<o|e;t[i--]=255&h,i>=0&&(t[i--]=h>>8&255),i>=0&&(t[i--]=h>>16&255),6===o?(i>=0&&(t[i--]=h>>24&255),e=0,o=0):(e=h>>>24,o+=2)}if(i>=0)for(t[i--]=e;i>=0;)t[i--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},n.prototype._zeroBits=function(t){if(0===t)return 26;var r=t,i=0;return 0==(8191&r)&&(i+=13,r>>>=13),0==(127&r)&&(i+=7,r>>>=7),0==(15&r)&&(i+=4,r>>>=4),0==(3&r)&&(i+=2,r>>>=2),0==(1&r)&&i++,i},n.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return 26*(this.length-1)+r},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,26!==i)break}return t},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},n.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this._strip()},n.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},n.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var r;r=this.length>t.length?t:this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this._strip()},n.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},n.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var e=0;e<i.length;e++)this.words[e]=r.words[e]^i.words[e];if(this!==r)for(;e<r.length;e++)this.words[e]=r.words[e];return this.length=r.length,this._strip()},n.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},n.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var r=0|Math.ceil(t/26),e=t%26;this._expand(r),e>0&&r--;for(var n=0;n<r;n++)this.words[n]=67108863&~this.words[n];return e>0&&(this.words[n]=~this.words[n]&67108863>>26-e),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,r){i("number"==typeof t&&t>=0);var e=t/26|0,n=t%26;return this._expand(e+1),this.words[e]=r?this.words[e]|1<<n:this.words[e]&~(1<<n),this._strip()},n.prototype.iadd=function(t){var r,i,e;if(0!==this.negative&&0===t.negative)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();this.length>t.length?(i=this,e=t):(i=t,e=this);for(var n=0,o=0;o<e.length;o++)r=(0|i.words[o])+(0|e.words[o])+n,this.words[o]=67108863&r,n=r>>>26;for(;0!==n&&o<i.length;o++)r=(0|i.words[o])+n,this.words[o]=67108863&r,n=r>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},n.prototype.add=function(t){var r;return 0!==t.negative&&0===this.negative?(t.negative=0,r=this.sub(t),t.negative^=1,r):0===t.negative&&0!==this.negative?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,e=t):(i=t,e=this);for(var o=0,h=0;h<e.length;h++)o=(r=(0|i.words[h])-(0|e.words[h])+o)>>26,this.words[h]=67108863&r;for(;0!==o&&h<i.length;h++)o=(r=(0|i.words[h])+o)>>26,this.words[h]=67108863&r;if(0===o&&h<i.length&&i!==this)for(;h<i.length;h++)this.words[h]=i.words[h];return this.length=Math.max(this.length,h),i!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,r,i){var e,n,o,h=t.words,s=r.words,u=i.words,a=0,l=0|h[0],m=8191&l,f=l>>>13,d=0|h[1],p=8191&d,g=d>>>13,c=0|h[2],M=8191&c,v=c>>>13,w=0|h[3],y=8191&w,E=w>>>13,b=0|h[4],N=8191&b,_=b>>>13,R=0|h[5],U=8191&R,S=R>>>13,x=0|h[6],A=8191&x,I=x>>>13,T=0|h[7],O=8191&T,C=T>>>13,k=0|h[8],L=8191&k,F=k>>>13,P=0|h[9],B=8191&P,D=P>>>13,G=0|s[0],q=8191&G,z=G>>>13,Z=0|s[1],j=8191&Z,X=Z>>>13,K=0|s[2],V=8191&K,W=K>>>13,H=0|s[3],J=8191&H,$=H>>>13,Q=0|s[4],Y=8191&Q,tt=Q>>>13,rt=0|s[5],it=8191&rt,et=rt>>>13,nt=0|s[6],ot=8191&nt,ht=nt>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191&lt,ft=lt>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;i.negative=t.negative^r.negative,i.length=19;var ct=(a+(e=Math.imul(m,q))|0)+((8191&(n=(n=Math.imul(m,z))+Math.imul(f,q)|0))<<13)|0;a=((o=Math.imul(f,z))+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(p,q),n=(n=Math.imul(p,z))+Math.imul(g,q)|0,o=Math.imul(g,z);var Mt=(a+(e=e+Math.imul(m,j)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,j)|0))<<13)|0;a=((o=o+Math.imul(f,X)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,e=Math.imul(M,q),n=(n=Math.imul(M,z))+Math.imul(v,q)|0,o=Math.imul(v,z),e=e+Math.imul(p,j)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,j)|0,o=o+Math.imul(g,X)|0;var vt=(a+(e=e+Math.imul(m,V)|0)|0)+((8191&(n=(n=n+Math.imul(m,W)|0)+Math.imul(f,V)|0))<<13)|0;a=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(y,q),n=(n=Math.imul(y,z))+Math.imul(E,q)|0,o=Math.imul(E,z),e=e+Math.imul(M,j)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(v,j)|0,o=o+Math.imul(v,X)|0,e=e+Math.imul(p,V)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,W)|0;var wt=(a+(e=e+Math.imul(m,J)|0)|0)+((8191&(n=(n=n+Math.imul(m,$)|0)+Math.imul(f,J)|0))<<13)|0;a=((o=o+Math.imul(f,$)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(N,q),n=(n=Math.imul(N,z))+Math.imul(_,q)|0,o=Math.imul(_,z),e=e+Math.imul(y,j)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(E,j)|0,o=o+Math.imul(E,X)|0,e=e+Math.imul(M,V)|0,n=(n=n+Math.imul(M,W)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,W)|0,e=e+Math.imul(p,J)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,$)|0;var yt=(a+(e=e+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,Y)|0))<<13)|0;a=((o=o+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(U,q),n=(n=Math.imul(U,z))+Math.imul(S,q)|0,o=Math.imul(S,z),e=e+Math.imul(N,j)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(_,j)|0,o=o+Math.imul(_,X)|0,e=e+Math.imul(y,V)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,W)|0,e=e+Math.imul(M,J)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,$)|0,e=e+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,tt)|0;var Et=(a+(e=e+Math.imul(m,it)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,it)|0))<<13)|0;a=((o=o+Math.imul(f,et)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,e=Math.imul(A,q),n=(n=Math.imul(A,z))+Math.imul(I,q)|0,o=Math.imul(I,z),e=e+Math.imul(U,j)|0,n=(n=n+Math.imul(U,X)|0)+Math.imul(S,j)|0,o=o+Math.imul(S,X)|0,e=e+Math.imul(N,V)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,e=e+Math.imul(y,J)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,e=e+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,tt)|0,e=e+Math.imul(p,it)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(g,it)|0,o=o+Math.imul(g,et)|0;var bt=(a+(e=e+Math.imul(m,ot)|0)|0)+((8191&(n=(n=n+Math.imul(m,ht)|0)+Math.imul(f,ot)|0))<<13)|0;a=((o=o+Math.imul(f,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(O,q),n=(n=Math.imul(O,z))+Math.imul(C,q)|0,o=Math.imul(C,z),e=e+Math.imul(A,j)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(I,j)|0,o=o+Math.imul(I,X)|0,e=e+Math.imul(U,V)|0,n=(n=n+Math.imul(U,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,e=e+Math.imul(N,J)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,e=e+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,tt)|0,e=e+Math.imul(M,it)|0,n=(n=n+Math.imul(M,et)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,et)|0,e=e+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,ht)|0;var Nt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((o=o+Math.imul(f,at)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(L,q),n=(n=Math.imul(L,z))+Math.imul(F,q)|0,o=Math.imul(F,z),e=e+Math.imul(O,j)|0,n=(n=n+Math.imul(O,X)|0)+Math.imul(C,j)|0,o=o+Math.imul(C,X)|0,e=e+Math.imul(A,V)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,W)|0,e=e+Math.imul(U,J)|0,n=(n=n+Math.imul(U,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|0,e=e+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,tt)|0,e=e+Math.imul(y,it)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(E,it)|0,o=o+Math.imul(E,et)|0,e=e+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,ht)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((o=o+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(B,q),n=(n=Math.imul(B,z))+Math.imul(D,q)|0,o=Math.imul(D,z),e=e+Math.imul(L,j)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(F,j)|0,o=o+Math.imul(F,X)|0,e=e+Math.imul(O,V)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,W)|0,e=e+Math.imul(A,J)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,$)|0,e=e+Math.imul(U,Y)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,tt)|0,e=e+Math.imul(N,it)|0,n=(n=n+Math.imul(N,et)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,et)|0,e=e+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,ht)|0,e=e+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(g,mt)|0,o=o+Math.imul(g,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((o=o+Math.imul(f,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(B,j),n=(n=Math.imul(B,X))+Math.imul(D,j)|0,o=Math.imul(D,X),e=e+Math.imul(L,V)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(F,V)|0,o=o+Math.imul(F,W)|0,e=e+Math.imul(O,J)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,$)|0,e=e+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,tt)|0,e=e+Math.imul(U,it)|0,n=(n=n+Math.imul(U,et)|0)+Math.imul(S,it)|0,o=o+Math.imul(S,et)|0,e=e+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ht)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,at)|0,e=e+Math.imul(M,mt)|0,n=(n=n+Math.imul(M,ft)|0)+Math.imul(v,mt)|0,o=o+Math.imul(v,ft)|0;var Ut=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;a=((o=o+Math.imul(g,gt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,e=Math.imul(B,V),n=(n=Math.imul(B,W))+Math.imul(D,V)|0,o=Math.imul(D,W),e=e+Math.imul(L,J)|0,n=(n=n+Math.imul(L,$)|0)+Math.imul(F,J)|0,o=o+Math.imul(F,$)|0,e=e+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,tt)|0,e=e+Math.imul(A,it)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(I,it)|0,o=o+Math.imul(I,et)|0,e=e+Math.imul(U,ot)|0,n=(n=n+Math.imul(U,ht)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,ht)|0,e=e+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(E,mt)|0,o=o+Math.imul(E,ft)|0;var St=(a+(e=e+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,gt)|0)+Math.imul(v,pt)|0))<<13)|0;a=((o=o+Math.imul(v,gt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(B,J),n=(n=Math.imul(B,$))+Math.imul(D,J)|0,o=Math.imul(D,$),e=e+Math.imul(L,Y)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(F,Y)|0,o=o+Math.imul(F,tt)|0,e=e+Math.imul(O,it)|0,n=(n=n+Math.imul(O,et)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,et)|0,e=e+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,ht)|0,e=e+Math.imul(U,ut)|0,n=(n=n+Math.imul(U,at)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,at)|0,e=e+Math.imul(N,mt)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(_,mt)|0,o=o+Math.imul(_,ft)|0;var xt=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,gt)|0)+Math.imul(E,pt)|0))<<13)|0;a=((o=o+Math.imul(E,gt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(B,Y),n=(n=Math.imul(B,tt))+Math.imul(D,Y)|0,o=Math.imul(D,tt),e=e+Math.imul(L,it)|0,n=(n=n+Math.imul(L,et)|0)+Math.imul(F,it)|0,o=o+Math.imul(F,et)|0,e=e+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,ht)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,ht)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,at)|0,e=e+Math.imul(U,mt)|0,n=(n=n+Math.imul(U,ft)|0)+Math.imul(S,mt)|0,o=o+Math.imul(S,ft)|0;var At=(a+(e=e+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((o=o+Math.imul(_,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(B,it),n=(n=Math.imul(B,et))+Math.imul(D,it)|0,o=Math.imul(D,et),e=e+Math.imul(L,ot)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,ht)|0,e=e+Math.imul(O,ut)|0,n=(n=n+Math.imul(O,at)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,at)|0,e=e+Math.imul(A,mt)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(I,mt)|0,o=o+Math.imul(I,ft)|0;var It=(a+(e=e+Math.imul(U,pt)|0)|0)+((8191&(n=(n=n+Math.imul(U,gt)|0)+Math.imul(S,pt)|0))<<13)|0;a=((o=o+Math.imul(S,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,e=Math.imul(B,ot),n=(n=Math.imul(B,ht))+Math.imul(D,ot)|0,o=Math.imul(D,ht),e=e+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,at)|0,e=e+Math.imul(O,mt)|0,n=(n=n+Math.imul(O,ft)|0)+Math.imul(C,mt)|0,o=o+Math.imul(C,ft)|0;var Tt=(a+(e=e+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,gt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((o=o+Math.imul(I,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(B,ut),n=(n=Math.imul(B,at))+Math.imul(D,ut)|0,o=Math.imul(D,at),e=e+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(F,mt)|0,o=o+Math.imul(F,ft)|0;var Ot=(a+(e=e+Math.imul(O,pt)|0)|0)+((8191&(n=(n=n+Math.imul(O,gt)|0)+Math.imul(C,pt)|0))<<13)|0;a=((o=o+Math.imul(C,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,e=Math.imul(B,mt),n=(n=Math.imul(B,ft))+Math.imul(D,mt)|0,o=Math.imul(D,ft);var Ct=(a+(e=e+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,gt)|0)+Math.imul(F,pt)|0))<<13)|0;a=((o=o+Math.imul(F,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var kt=(a+(e=Math.imul(B,pt))|0)+((8191&(n=(n=Math.imul(B,gt))+Math.imul(D,pt)|0))<<13)|0;return a=((o=Math.imul(D,gt))+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,u[0]=ct,u[1]=Mt,u[2]=vt,u[3]=wt,u[4]=yt,u[5]=Et,u[6]=bt,u[7]=Nt,u[8]=_t,u[9]=Rt,u[10]=Ut,u[11]=St,u[12]=xt,u[13]=At,u[14]=It,u[15]=Tt,u[16]=Ot,u[17]=Ct,u[18]=kt,0!==a&&(u[19]=a,i.length++),i};function c(t,r,i){i.negative=r.negative^t.negative,i.length=t.length+r.length;for(var e=0,n=0,o=0;o<i.length-1;o++){var h=n;n=0;for(var s=67108863&e,u=Math.min(o,r.length-1),a=Math.max(0,o-t.length+1);a<=u;a++){var l=o-a,m=(0|t.words[l])*(0|r.words[a]),f=67108863&m;s=67108863&(f=f+s|0),n+=(h=(h=h+(m/67108864|0)|0)+(f>>>26)|0)>>>26,h&=67108863}i.words[o]=s,e=h,h=n}return 0!==e?i.words[o]=e:i.length--,i._strip()}function M(t,r,i){return c(t,r,i)}Math.imul||(g=p),n.prototype.mulTo=function(t,r){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,r):i<63?p(this,t,r):i<1024?c(this,t,r):M(this,t,r)},n.prototype.mul=function(t){var r=new n(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},n.prototype.mulf=function(t){var r=new n(null);return r.words=new Array(this.length+t.length),M(this,t,r)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var r=t<0;r&&(t=-t),i("number"==typeof t),i(t<67108864);for(var e=0,n=0;n<this.length;n++){var o=(0|this.words[n])*t,h=(67108863&o)+(67108863&e);e>>=26,e+=o/67108864|0,e+=h>>>26,this.words[n]=67108863&h}return 0!==e&&(this.words[n]=e,this.length++),r?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var r=function(t){for(var r=new Array(t.bitLength()),i=0;i<r.length;i++){var e=i/26|0,n=i%26;r[i]=t.words[e]>>>n&1}return r}(t);if(0===r.length)return new n(1);for(var i=this,e=0;e<r.length&&0===r[e];e++,i=i.sqr());if(++e<r.length)for(var o=i.sqr();e<r.length;e++,o=o.sqr())0!==r[e]&&(i=i.mul(o));return i},n.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var r,e=t%26,n=(t-e)/26,o=67108863>>>26-e<<26-e;if(0!==e){var h=0;for(r=0;r<this.length;r++){var s=this.words[r]&o,u=(0|this.words[r])-s<<e;this.words[r]=u|h,h=s>>>26-e}h&&(this.words[r]=h,this.length++)}if(0!==n){for(r=this.length-1;r>=0;r--)this.words[r+n]=this.words[r];for(r=0;r<n;r++)this.words[r]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},n.prototype.iushrn=function(t,r,e){var n;i("number"==typeof t&&t>=0),n=r?(r-r%26)/26:0;var o=t%26,h=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,u=e;if(n-=h,n=Math.max(0,n),u){for(var a=0;a<h;a++)u.words[a]=this.words[a];u.length=h}if(0===h);else if(this.length>h)for(this.length-=h,a=0;a<this.length;a++)this.words[a]=this.words[a+h];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=n);a--){var m=0|this.words[a];this.words[a]=l<<26-o|m>>>o,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,r,e){return i(0===this.negative),this.iushrn(t,r,e)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){i("number"==typeof t&&t>=0);var r=t%26,e=(t-r)/26,n=1<<r;return!(this.length<=e||!(this.words[e]&n))},n.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var r=t%26,e=(t-r)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=e)return this;if(0!==r&&e++,this.length=Math.min(e,this.length),0!==r){var n=67108863^67108863>>>r<<r;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(t){return this.clone().imaskn(t)},n.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},n.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},n.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this._strip()},n.prototype.addn=function(t){return this.clone().iaddn(t)},n.prototype.subn=function(t){return this.clone().isubn(t)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(t,r,e){var n,o,h=t.length+e;this._expand(h);var s=0;for(n=0;n<t.length;n++){o=(0|this.words[n+e])+s;var u=(0|t.words[n])*r;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+e]=67108863&o}for(;n<this.length-e;n++)s=(o=(0|this.words[n+e])+s)>>26,this.words[n+e]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,r){var i=(this.length,t.length),e=this.clone(),o=t,h=0|o.words[o.length-1];0!=(i=26-this._countBits(h))&&(o=o.ushln(i),e.iushln(i),h=0|o.words[o.length-1]);var s,u=e.length-o.length;if("mod"!==r){(s=new n(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a<s.length;a++)s.words[a]=0}var l=e.clone()._ishlnsubmul(o,1,u);0===l.negative&&(e=l,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|e.words[o.length+m])+(0|e.words[o.length+m-1]);for(f=Math.min(f/h|0,67108863),e._ishlnsubmul(o,f,m);0!==e.negative;)f--,e.negative=0,e._ishlnsubmul(o,1,m),e.isZero()||(e.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),e._strip(),"div"!==r&&0!==i&&e.iushrn(i),{div:s||null,mod:e}},n.prototype.divmod=function(t,r,e){return i(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,r),"mod"!==r&&(o=s.div.neg()),"div"!==r&&(h=s.mod.neg(),e&&0!==h.negative&&h.iadd(t)),{div:o,mod:h}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),r),"mod"!==r&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),r),"div"!==r&&(h=s.mod.neg(),e&&0!==h.negative&&h.isub(t)),{div:s.div,mod:h}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===r?{div:this.divn(t.words[0]),mod:null}:"mod"===r?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,r);var o,h,s},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=0!==r.div.negative?r.mod.isub(t):r.mod,e=t.ushrn(1),n=t.andln(1),o=i.cmp(e);return o<0||1===n&&0===o?r.div:0!==r.div.negative?r.div.isubn(1):r.div.iaddn(1)},n.prototype.modrn=function(t){var r=t<0;r&&(t=-t),i(t<=67108863);for(var e=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(e*n+(0|this.words[o]))%t;return r?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var r=t<0;r&&(t=-t),i(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*e;this.words[n]=o/t|0,e=o%t}return this._strip(),r?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var r=this,e=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o=new n(1),h=new n(0),s=new n(0),u=new n(1),a=0;r.isEven()&&e.isEven();)r.iushrn(1),e.iushrn(1),++a;for(var l=e.clone(),m=r.clone();!r.isZero();){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;)(o.isOdd()||h.isOdd())&&(o.iadd(l),h.isub(m)),o.iushrn(1),h.iushrn(1);for(var p=0,g=1;0==(e.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(e.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);r.cmp(e)>=0?(r.isub(e),o.isub(s),h.isub(u)):(e.isub(r),s.isub(o),u.isub(h))}return{a:s,b:u,gcd:e.iushln(a)}},n.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var r=this,e=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o,h=new n(1),s=new n(0),u=e.clone();r.cmpn(1)>0&&e.cmpn(1)>0;){for(var a=0,l=1;0==(r.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(r.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);for(var m=0,f=1;0==(e.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(e.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);r.cmp(e)>=0?(r.isub(e),h.isub(s)):(e.isub(r),s.isub(h))}return(o=0===r.cmpn(1)?h:s).cmpn(0)<0&&o.iadd(t),o},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var e=0;r.isEven()&&i.isEven();e++)r.iushrn(1),i.iushrn(1);for(;;){for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=r.cmp(i);if(n<0){var o=r;r=i,i=o}else if(0===n||0===i.cmpn(1))break;r.isub(i)}return i.iushln(e)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){i("number"==typeof t);var r=t%26,e=(t-r)/26,n=1<<r;if(this.length<=e)return this._expand(e+1),this.words[e]|=n,this;for(var o=n,h=e;0!==o&&h<this.length;h++){var s=0|this.words[h];o=(s+=o)>>>26,s&=67108863,this.words[h]=s}return 0!==o&&(this.words[h]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var r,e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;if(this._strip(),this.length>1)r=1;else{e&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];r=n===t?0:n<t?-1:1}return 0!==this.negative?0|-r:r},n.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var r=this.ucmp(t);return 0!==this.negative?0|-r:r},n.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var e=0|this.words[i],n=0|t.words[i];if(e!==n){e<n?r=-1:e>n&&(r=1);break}}return r},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new _(t)},n.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function w(t,r){this.name=t,this.p=new n(r,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function N(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var r=n._prime(t);this.m=r.p,this.prime=r}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function R(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var r,i=t;do{this.split(i,this.tmp),r=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(r>this.n);var e=r<this.n?-1:i.ucmp(this.p);return 0===e?(i.words[0]=0,i.length=1):e>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},w.prototype.split=function(t,r){t.iushrn(this.n,0,r)},w.prototype.imulK=function(t){return t.imul(this.k)},e(y,w),y.prototype.split=function(t,r){for(var i=4194303,e=Math.min(t.length,9),n=0;n<e;n++)r.words[n]=t.words[n];if(r.length=e,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(r.words[r.length++]=o&i,n=10;n<t.length;n++){var h=0|t.words[n];t.words[n-10]=(h&i)<<4|o>>>22,o=h}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var e=0|t.words[i];r+=977*e,t.words[i]=67108863&r,r=64*e+(r/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},e(E,w),e(b,w),e(N,w),N.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var e=19*(0|t.words[i])+r,n=67108863&e;e>>>=26,t.words[i]=n,r=e}return 0!==r&&(t.words[t.length++]=r),t},n._prime=function(t){if(v[t])return v[t];var r;if("k256"===t)r=new y;else if("p224"===t)r=new E;else if("p192"===t)r=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);r=new N}return v[t]=r,r},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,r){i(0==(t.negative|r.negative),"red works only with positives"),i(t.red&&t.red===r.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},_.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},_.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},_.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},_.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},_.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},_.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(i(r%2==1),3===r){var e=this.m.add(new n(1)).iushrn(2);return this.pow(t,e)}for(var o=this.m.subn(1),h=0;!o.isZero()&&0===o.andln(1);)h++,o.iushrn(1);i(!o.isZero());var s=new n(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,o),f=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=h;0!==d.cmp(s);){for(var g=d,c=0;0!==g.cmp(s);c++)g=g.redSqr();i(c<p);var M=this.pow(m,new n(1).iushln(p-c-1));f=f.redMul(M),m=M.redSqr(),d=d.redMul(m),p=c}return f},_.prototype.invm=function(t){var r=t._invmp(this.m);return 0!==r.negative?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},_.prototype.pow=function(t,r){if(r.isZero())return new n(1).toRed(this);if(0===r.cmpn(1))return t.clone();var i=new Array(16);i[0]=new n(1).toRed(this),i[1]=t;for(var e=2;e<i.length;e++)i[e]=this.mul(i[e-1],t);var o=i[0],h=0,s=0,u=r.bitLength()%26;for(0===u&&(u=26),e=r.length-1;e>=0;e--){for(var a=r.words[e],l=u-1;l>=0;l--){var m=a>>l&1;o!==i[0]&&(o=this.sqr(o)),0!==m||0!==h?(h<<=1,h|=m,(4==++s||0===e&&0===l)&&(o=this.mul(o,i[h]),s=0,h=0)):s=0}u=26}return o},_.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},_.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},n.mont=function(t){return new R(t)},e(R,_),R.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},R.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},R.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),e=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(e).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new n(0)._forceRed(this);var i=t.mul(r),e=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(e).iushrn(this.shift),h=o;return o.cmp(this.m)>=0?h=o.isub(this.m):o.cmpn(0)<0&&(h=o.iadd(this.m)),h._forceRed(this)},R.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(d,t.commonjsGlobal);const p="bignumber/5.7.0";var g=d.exports.BN;const c=new m(p),M={},v=9007199254740991;let w=!1;class y{constructor(t,r){t!==M&&c.throwError("cannot call constructor directly; use BigNumber.from",m.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return b(N(this).fromTwos(t))}toTwos(t){return b(N(this).toTwos(t))}abs(){return"-"===this._hex[0]?y.from(this._hex.substring(1)):this}add(t){return b(N(this).add(N(t)))}sub(t){return b(N(this).sub(N(t)))}div(t){return y.from(t).isZero()&&_("division-by-zero","div"),b(N(this).div(N(t)))}mul(t){return b(N(this).mul(N(t)))}mod(t){const r=N(t);return r.isNeg()&&_("division-by-zero","mod"),b(N(this).umod(r))}pow(t){const r=N(t);return r.isNeg()&&_("negative-power","pow"),b(N(this).pow(r))}and(t){const r=N(t);return(this.isNegative()||r.isNeg())&&_("unbound-bitwise-result","and"),b(N(this).and(r))}or(t){const r=N(t);return(this.isNegative()||r.isNeg())&&_("unbound-bitwise-result","or"),b(N(this).or(r))}xor(t){const r=N(t);return(this.isNegative()||r.isNeg())&&_("unbound-bitwise-result","xor"),b(N(this).xor(r))}mask(t){return(this.isNegative()||t<0)&&_("negative-width","mask"),b(N(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&_("negative-width","shl"),b(N(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&_("negative-width","shr"),b(N(this).shrn(t))}eq(t){return N(this).eq(N(t))}lt(t){return N(this).lt(N(t))}lte(t){return N(this).lte(N(t))}gt(t){return N(this).gt(N(t))}gte(t){return N(this).gte(N(t))}isNegative(){return"-"===this._hex[0]}isZero(){return N(this).isZero()}toNumber(){try{return N(this).toNumber()}catch(t){_("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return c.throwError("this platform does not support BigInt",m.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?w||(w=!0,c.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?c.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",m.errors.UNEXPECTED_ARGUMENT,{}):c.throwError("BigNumber.toString does not accept parameters",m.errors.UNEXPECTED_ARGUMENT,{})),N(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof y)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new y(M,E(t)):t.match(/^-?[0-9]+$/)?new y(M,E(new g(t))):c.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&_("underflow","BigNumber.from",t),(t>=v||t<=-v)&&_("overflow","BigNumber.from",t),y.from(String(t));const i=t;if("bigint"==typeof i)return y.from(i.toString());if(r.isBytes(i))return y.from(r.hexlify(i));if(i)if(i.toHexString){const t=i.toHexString();if("string"==typeof t)return y.from(t)}else{let t=i._hex;if(null==t&&"BigNumber"===i.type&&(t=i.hex),"string"==typeof t&&(r.isHexString(t)||"-"===t[0]&&r.isHexString(t.substring(1))))return y.from(t)}return c.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function E(t){if("string"!=typeof t)return E(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&c.throwArgumentError("invalid hex","value",t),"0x00"===(t=E(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function b(t){return y.from(E(t))}function N(t){const r=y.from(t).toHexString();return"-"===r[0]?new g("-"+r.substring(3),16):new g(r.substring(2),16)}function _(t,r,i){const e={fault:t,operation:r};return null!=i&&(e.value=i),c.throwError(t,m.errors.NUMERIC_FAULT,e)}const R=new m("strings/5.7.0");var U,S;function x(t,r,i,e,n){if(t===exports.Utf8ErrorReason.BAD_PREFIX||t===exports.Utf8ErrorReason.UNEXPECTED_CONTINUE){let t=0;for(let e=r+1;e<i.length&&i[e]>>6==2;e++)t++;return t}return t===exports.Utf8ErrorReason.OVERRUN?i.length-r-1:0}exports.UnicodeNormalizationForm=void 0,(U=exports.UnicodeNormalizationForm||(exports.UnicodeNormalizationForm={})).current="",U.NFC="NFC",U.NFD="NFD",U.NFKC="NFKC",U.NFKD="NFKD",exports.Utf8ErrorReason=void 0,(S=exports.Utf8ErrorReason||(exports.Utf8ErrorReason={})).UNEXPECTED_CONTINUE="unexpected continuation byte",S.BAD_PREFIX="bad codepoint prefix",S.OVERRUN="string overrun",S.MISSING_CONTINUE="missing continuation byte",S.OUT_OF_RANGE="out of UTF-8 range",S.UTF16_SURROGATE="UTF-16 surrogate",S.OVERLONG="overlong representation";const A=Object.freeze({error:function(t,r,i,e,n){return R.throwArgumentError(`invalid codepoint at offset ${r}; ${t}`,"bytes",i)},ignore:x,replace:function(t,r,i,e,n){return t===exports.Utf8ErrorReason.OVERLONG?(e.push(n),0):(e.push(65533),x(t,r,i))}});function I(t,i){null==i&&(i=A.error),t=r.arrayify(t);const e=[];let n=0;for(;n<t.length;){const r=t[n++];if(r>>7==0){e.push(r);continue}let o=null,h=null;if(192==(224&r))o=1,h=127;else if(224==(240&r))o=2,h=2047;else{if(240!=(248&r)){n+=i(128==(192&r)?exports.Utf8ErrorReason.UNEXPECTED_CONTINUE:exports.Utf8ErrorReason.BAD_PREFIX,n-1,t,e);continue}o=3,h=65535}if(n-1+o>=t.length){n+=i(exports.Utf8ErrorReason.OVERRUN,n-1,t,e);continue}let s=r&(1<<8-o-1)-1;for(let r=0;r<o;r++){let r=t[n];if(128!=(192&r)){n+=i(exports.Utf8ErrorReason.MISSING_CONTINUE,n,t,e),s=null;break}s=s<<6|63&r,n++}null!==s&&(s>1114111?n+=i(exports.Utf8ErrorReason.OUT_OF_RANGE,n-1-o,t,e,s):s>=55296&&s<=57343?n+=i(exports.Utf8ErrorReason.UTF16_SURROGATE,n-1-o,t,e,s):s<=h?n+=i(exports.Utf8ErrorReason.OVERLONG,n-1-o,t,e,s):e.push(s))}return e}function T(t,i=exports.UnicodeNormalizationForm.current){i!=exports.UnicodeNormalizationForm.current&&(R.checkNormalize(),t=t.normalize(i));let e=[];for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);if(i<128)e.push(i);else if(i<2048)e.push(i>>6|192),e.push(63&i|128);else if(55296==(64512&i)){r++;const n=t.charCodeAt(r);if(r>=t.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const o=65536+((1023&i)<<10)+(1023&n);e.push(o>>18|240),e.push(o>>12&63|128),e.push(o>>6&63|128),e.push(63&o|128)}else e.push(i>>12|224),e.push(i>>6&63|128),e.push(63&i|128)}return r.arrayify(e)}function O(t){const r="0000"+t.toString(16);return"\\u"+r.substring(r.length-4)}function C(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}exports.BigNumber=y,exports.Logger=m,exports.Utf8ErrorFuncs=A,exports._toEscapedUtf8String=function(t,r){return'"'+I(t,r).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?O(t):O(55296+((t-=65536)>>10&1023))+O(56320+(1023&t))})).join("")+'"'},exports._toUtf8String=C,exports.id=function(r){return t.keccak256(T(r))},exports.isBigNumberish=function(t){return null!=t&&(y.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||r.isHexString(t)||"bigint"==typeof t||r.isBytes(t))},exports.lib_esm=f,exports.toUtf8Bytes=T,exports.toUtf8CodePoints=function(t,r=exports.UnicodeNormalizationForm.current){return I(T(t,r))},exports.toUtf8String=function(t,r){return C(I(t,r))},exports.version=p;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./index-cfe3e391.cjs"),t=require("./node-ponyfill-a7a0b431.cjs"),s=require("./ethers-767c2337.cjs"),r=require("./index-f2c04d55.cjs"),n=require("@ethersproject/providers"),o=require("@ethersproject/contracts"),a=require("./id-6c4d97dd.cjs"),i=require("@ethersproject/constants"),c=require("events"),d=require("stream"),u=require("http"),l=require("url"),f=require("https"),h=require("zlib");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}require("zustand"),require("@ethersproject/address"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),require("punycode"),require("./interface-1b54eefa.cjs"),require("./index-4585c950.cjs"),require("./index-4abb9db3.cjs");var m=g(n),y=g(i),b=p(c),v=p(d),_=p(u),E=p(l),w=p(f),T=p(h),S={},A={},I={},P={},O={},C={name:"@safe-global/safe-apps-sdk",version:"7.10.1",description:"SDK developed to integrate third-party apps with Safe app.",main:"dist/src/index.js",typings:"dist/src/index.d.ts",_files:["dist/**/*","src/**/*","CHANGELOG.md","README.md"],keywords:["Safe","sdk","apps"],scripts:{test:"jest","format-dist":"sed -i '' 's/\"files\":/\"_files\":/' dist/package.json",build:"yarn rimraf dist && tsc && yarn format-dist"},author:"Safe (https://safe.global)",license:"MIT",dependencies:{"@safe-global/safe-gateway-typescript-sdk":"^3.5.3",ethers:"^5.7.2"},devDependencies:{rimraf:"^3.0.2"},repository:{type:"git",url:"git+https://github.com/safe-global/safe-apps-sdk.git"},bugs:{url:"https://github.com/safe-global/safe-apps-sdk/issues"},homepage:"https://github.com/safe-global/safe-apps-sdk#readme",publishConfig:{access:"public"}},M=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O,"__esModule",{value:!0}),O.getSDKVersion=void 0;const j=M(C);O.getSDKVersion=()=>j.default.version.split("-")[0];var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.generateRequestId=void 0;const L=e=>e.toString(16).padStart(2,"0");R.generateRequestId=()=>"undefined"!=typeof window?(e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,L).join("")})(10):(new Date).getTime().toString(36),Object.defineProperty(P,"__esModule",{value:!0}),P.MessageFormatter=void 0;const N=O,x=R;class B{}P.MessageFormatter=B,B.makeRequest=(e,t)=>({id:(0,x.generateRequestId)(),method:e,params:t,env:{sdkVersion:(0,N.getSDKVersion)()}}),B.makeResponse=(e,t,s)=>({id:e,success:!0,version:s,data:t}),B.makeErrorResponse=(e,t,s)=>({id:e,success:!1,error:t,version:s});var D={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.RestrictedMethods=e.Methods=void 0,(t=e.Methods||(e.Methods={})).sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions",(e.RestrictedMethods||(e.RestrictedMethods={})).requestAddressBook="requestAddressBook"}(D),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const n=P;t.default=class{constructor(e=null,t=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer="undefined"==typeof window,this.isValidMessage=({origin:e,data:t,source:s})=>{const r=!t,n=!this.isServer&&s===window.parent,o=(void 0!==t.version&&parseInt(t.version.split(".")[0]))>=1;let a=!0;return Array.isArray(this.allowedOrigins)&&(a=void 0!==this.allowedOrigins.find((t=>t.test(e)))),!r&&n&&o&&a},this.logIncomingMessage=e=>{console.info(`Safe Apps SDK v1: A message was received from origin ${e.origin}. `,e.data)},this.onParentMessage=e=>{this.isValidMessage(e)&&(this.debugMode&&this.logIncomingMessage(e),this.handleIncomingMessage(e.data))},this.handleIncomingMessage=e=>{const{id:t}=e,s=this.callbacks.get(t);s&&(s(e),this.callbacks.delete(t))},this.send=(e,t)=>{const s=n.MessageFormatter.makeRequest(e,t);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(s,"*"),new Promise(((e,t)=>{this.callbacks.set(s.id,(s=>{s.success?e(s):t(new Error(s.error))}))}))},this.allowedOrigins=e,this.debugMode=t,this.isServer||window.addEventListener("message",this.onParentMessage)}},r(D,t)}(I);var k={},H={},G={};Object.defineProperty(G,"__esModule",{value:!0}),G.isObjectEIP712TypedData=void 0;G.isObjectEIP712TypedData=e=>"object"==typeof e&&null!=e&&"domain"in e&&"types"in e&&"message"in e;var q={};Object.defineProperty(q,"__esModule",{value:!0});var U={},$={},F={},V={},W=e.commonjsGlobal&&e.commonjsGlobal.__awaiter||function(e,t,s,r){return new(s||(s=Promise))((function(n,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function i(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,i)}c((r=r.apply(e,t||[])).next())}))},z=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V,"__esModule",{value:!0}),V.fetchData=V.stringifyQuery=V.insertParams=void 0;const K=z(t.nodePonyfill.exports);V.insertParams=function(e,t){return t?Object.keys(t).reduce(((e,s)=>function(e,t,s){return e.replace(new RegExp(`\\{${t}\\}`,"g"),s)}(e,s,String(t[s]))),e):e},V.stringifyQuery=function(e){if(!e)return"";const t=new URLSearchParams;Object.keys(e).forEach((s=>{null!=e[s]&&t.append(s,String(e[s]))}));const s=t.toString();return s?`?${s}`:""},V.fetchData=function(e,t){return W(this,void 0,void 0,(function*(){let s;null!=t&&(s={method:"POST",body:"string"==typeof t?t:JSON.stringify(t),headers:{"Content-Type":"application/json"}});const r=yield(0,K.default)(e,s);let n;try{n=yield r.json()}catch(e){if(r.headers&&"0"!==r.headers.get("content-length"))throw new Error(`Invalid response content: ${r.statusText}`)}if(!r.ok){const e="object"==typeof(o=n)&&null!==o&&"code"in o&&"message"in o?`${n.code}: ${n.message}`:r.statusText;throw new Error(e)}var o;return n}))},Object.defineProperty(F,"__esModule",{value:!0}),F.getEndpoint=F.postEndpoint=void 0;const Y=V;function Q(e,t,s,r){return`${e}${(0,Y.insertParams)(t,s)}${(0,Y.stringifyQuery)(r)}`}F.postEndpoint=function(e,t,s){const r=Q(e,t,null==s?void 0:s.path,null==s?void 0:s.query);return(0,Y.fetchData)(r,null==s?void 0:s.body)},F.getEndpoint=function(e,t,s,r){if(r)return(0,Y.fetchData)(r);const n=Q(e,t,null==s?void 0:s.path,null==s?void 0:s.query);return(0,Y.fetchData)(n)};var X={};Object.defineProperty(X,"__esModule",{value:!0}),X.DEFAULT_BASE_URL=void 0,X.DEFAULT_BASE_URL="https://safe-client.safe.global";var J={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationVersionState=void 0,(t=e.ImplementationVersionState||(e.ImplementationVersionState={})).UP_TO_DATE="UP_TO_DATE",t.OUTDATED="OUTDATED",t.UNKNOWN="UNKNOWN"}(J);var Z={};!function(e){var t,s;Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppSocialPlatforms=e.SafeAppFeatures=e.SafeAppAccessPolicyTypes=void 0,(t=e.SafeAppAccessPolicyTypes||(e.SafeAppAccessPolicyTypes={})).NoRestrictions="NO_RESTRICTIONS",t.DomainAllowlist="DOMAIN_ALLOWLIST",(e.SafeAppFeatures||(e.SafeAppFeatures={})).BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS",(s=e.SafeAppSocialPlatforms||(e.SafeAppSocialPlatforms={})).TWITTER="TWITTER",s.GITHUB="GITHUB",s.DISCORD="DISCORD"}(Z);var ee={};!function(e){var t,s,r,n,o,a,i,c,d,u;Object.defineProperty(e,"__esModule",{value:!0}),e.LabelValue=e.DetailedExecutionInfoType=e.TransactionListItemType=e.ConflictType=e.TransactionInfoType=e.SettingsInfoType=e.TransactionTokenType=e.TransferDirection=e.TransactionStatus=e.Operation=void 0,(t=e.Operation||(e.Operation={}))[t.CALL=0]="CALL",t[t.DELEGATE=1]="DELEGATE",(s=e.TransactionStatus||(e.TransactionStatus={})).AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",s.AWAITING_EXECUTION="AWAITING_EXECUTION",s.CANCELLED="CANCELLED",s.FAILED="FAILED",s.SUCCESS="SUCCESS",(r=e.TransferDirection||(e.TransferDirection={})).INCOMING="INCOMING",r.OUTGOING="OUTGOING",r.UNKNOWN="UNKNOWN",(n=e.TransactionTokenType||(e.TransactionTokenType={})).ERC20="ERC20",n.ERC721="ERC721",n.NATIVE_COIN="NATIVE_COIN",(o=e.SettingsInfoType||(e.SettingsInfoType={})).SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",o.ADD_OWNER="ADD_OWNER",o.REMOVE_OWNER="REMOVE_OWNER",o.SWAP_OWNER="SWAP_OWNER",o.CHANGE_THRESHOLD="CHANGE_THRESHOLD",o.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",o.ENABLE_MODULE="ENABLE_MODULE",o.DISABLE_MODULE="DISABLE_MODULE",o.SET_GUARD="SET_GUARD",o.DELETE_GUARD="DELETE_GUARD",(a=e.TransactionInfoType||(e.TransactionInfoType={})).TRANSFER="Transfer",a.SETTINGS_CHANGE="SettingsChange",a.CUSTOM="Custom",a.CREATION="Creation",(i=e.ConflictType||(e.ConflictType={})).NONE="None",i.HAS_NEXT="HasNext",i.END="End",(c=e.TransactionListItemType||(e.TransactionListItemType={})).TRANSACTION="TRANSACTION",c.LABEL="LABEL",c.CONFLICT_HEADER="CONFLICT_HEADER",c.DATE_LABEL="DATE_LABEL",(d=e.DetailedExecutionInfoType||(e.DetailedExecutionInfoType={})).MULTISIG="MULTISIG",d.MODULE="MODULE",(u=e.LabelValue||(e.LabelValue={})).Queued="Queued",u.Next="Next"}(ee);var te={};!function(e){var t,s,r;Object.defineProperty(e,"__esModule",{value:!0}),e.FEATURES=e.GAS_PRICE_TYPE=e.RPC_AUTHENTICATION=void 0,(t=e.RPC_AUTHENTICATION||(e.RPC_AUTHENTICATION={})).API_KEY_PATH="API_KEY_PATH",t.NO_AUTHENTICATION="NO_AUTHENTICATION",t.UNKNOWN="UNKNOWN",(s=e.GAS_PRICE_TYPE||(e.GAS_PRICE_TYPE={})).ORACLE="ORACLE",s.FIXED="FIXED",s.UNKNOWN="UNKNOWN",(r=e.FEATURES||(e.FEATURES={})).ERC721="ERC721",r.SAFE_APPS="SAFE_APPS",r.CONTRACT_INTERACTION="CONTRACT_INTERACTION",r.DOMAIN_LOOKUP="DOMAIN_LOOKUP",r.SPENDING_LIMIT="SPENDING_LIMIT",r.EIP1559="EIP1559",r.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",r.TX_SIMULATION="TX_SIMULATION",r.EIP1271="EIP1271"}(te);var se={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.TokenType=void 0,(t=e.TokenType||(e.TokenType={})).ERC20="ERC20",t.ERC721="ERC721",t.NATIVE_TOKEN="NATIVE_TOKEN"}(se);var re={};Object.defineProperty(re,"__esModule",{value:!0});var ne={};Object.defineProperty(ne,"__esModule",{value:!0});var oe={};!function(e){var t,s;Object.defineProperty(e,"__esModule",{value:!0}),e.SafeMessageStatus=e.SafeMessageListItemType=void 0,(t=e.SafeMessageListItemType||(e.SafeMessageListItemType={})).DATE_LABEL="DATE_LABEL",t.MESSAGE="MESSAGE",(s=e.SafeMessageStatus||(e.SafeMessageStatus={})).NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",s.CONFIRMED="CONFIRMED"}(oe),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.confirmSafeMessage=t.proposeSafeMessage=t.getSafeMessage=t.getSafeMessages=t.getDecodedData=t.getMasterCopies=t.getSafeApps=t.getChainConfig=t.getChainsConfig=t.proposeTransaction=t.postSafeGasEstimation=t.getTransactionDetails=t.getTransactionQueue=t.getTransactionHistory=t.getCollectiblesPage=t.getCollectibles=t.getOwnedSafes=t.getFiatCurrencies=t.getBalances=t.getMultisigTransactions=t.getModuleTransactions=t.getIncomingTransfers=t.getSafeInfo=t.setBaseUrl=void 0;const n=F,o=X;r(J,t),r(Z,t),r(ee,t),r(te,t),r(se,t),r(re,t),r(ne,t),r(oe,t);let a=o.DEFAULT_BASE_URL;t.setBaseUrl=e=>{a=e},t.getSafeInfo=function(e,t){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:e,address:t}})},t.getIncomingTransfers=function(e,t,s,r){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:e,address:t},query:s},r)},t.getModuleTransactions=function(e,t,s,r){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:e,address:t},query:s},r)},t.getMultisigTransactions=function(e,t,s,r){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:e,address:t},query:s},r)},t.getBalances=function(e,t,s="usd",r={}){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:e,address:t,currency:s},query:r})},t.getFiatCurrencies=function(){return(0,n.getEndpoint)(a,"/v1/balances/supported-fiat-codes")},t.getOwnedSafes=function(e,t){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:e,address:t}})},t.getCollectibles=function(e,t,s={}){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:s})},t.getCollectiblesPage=function(e,t,s={},r){return(0,n.getEndpoint)(a,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:s},r)},t.getTransactionHistory=function(e,t,s){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:e,safe_address:t},query:{}},s)},t.getTransactionQueue=function(e,t,s,r){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:e,safe_address:t},query:{trusted:r}},s)},t.getTransactionDetails=function(e,t){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:e,transactionId:t}})},t.postSafeGasEstimation=function(e,t,s){return(0,n.postEndpoint)(a,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:e,safe_address:t},body:s})},t.proposeTransaction=function(e,t,s){return(0,n.postEndpoint)(a,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:e,safe_address:t},body:s})},t.getChainsConfig=function(e){return(0,n.getEndpoint)(a,"/v1/chains",{query:e})},t.getChainConfig=function(e){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}",{path:{chainId:e}})},t.getSafeApps=function(e,t={}){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safe-apps",{path:{chainId:e},query:t})},t.getMasterCopies=function(e){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:e}})},t.getDecodedData=function(e,t){return(0,n.postEndpoint)(a,"/v1/chains/{chainId}/data-decoder",{path:{chainId:e},body:{data:t}})},t.getSafeMessages=function(e,t,s){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},query:{}},s)},t.getSafeMessage=function(e,t){return(0,n.getEndpoint)(a,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:e,message_hash:t}})},t.proposeSafeMessage=function(e,t,s){return(0,n.postEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},body:s})},t.confirmSafeMessage=function(e,t,s){return(0,n.postEndpoint)(a,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:e,message_hash:t},body:s})}}($),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransferDirection=e.TransactionStatus=e.TokenType=e.Operation=void 0;var t=$;Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return t.Operation}}),Object.defineProperty(e,"TokenType",{enumerable:!0,get:function(){return t.TokenType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return t.TransactionStatus}}),Object.defineProperty(e,"TransferDirection",{enumerable:!0,get:function(){return t.TransferDirection}})}(U);var ae={};Object.defineProperty(ae,"__esModule",{value:!0}),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(G,t),r(q,t),r(U,t),r(ae,t)}(H),Object.defineProperty(k,"__esModule",{value:!0}),k.TXs=void 0;const ie=D,ce=H;k.TXs=class{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(ie.Methods.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){const t={message:e};return(await this.communicator.send(ie.Methods.signMessage,t)).data}async signTypedMessage(e){if(!(0,ce.isObjectEIP712TypedData)(e))throw new Error("Invalid typed data");return(await this.communicator.send(ie.Methods.signTypedMessage,{typedData:e})).data}async send({txs:e,params:t}){if(!e||!e.length)throw new Error("No transactions were passed");const s={txs:e,params:t};return(await this.communicator.send(ie.Methods.sendTransactions,s)).data}};var de={},ue={};Object.defineProperty(ue,"__esModule",{value:!0}),ue.RPC_CALLS=void 0,ue.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},Object.defineProperty(de,"__esModule",{value:!0}),de.Eth=void 0;const le=ue,fe=D,he={defaultBlockParam:(e="latest")=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e};de.Eth=class{constructor(e){this.communicator=e,this.call=this.buildRequest({call:le.RPC_CALLS.eth_call,formatters:[null,he.defaultBlockParam]}),this.getBalance=this.buildRequest({call:le.RPC_CALLS.eth_getBalance,formatters:[null,he.defaultBlockParam]}),this.getCode=this.buildRequest({call:le.RPC_CALLS.eth_getCode,formatters:[null,he.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:le.RPC_CALLS.eth_getStorageAt,formatters:[null,he.blockNumberToHex,he.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:le.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:le.RPC_CALLS.eth_getBlockByHash,formatters:[null,he.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:le.RPC_CALLS.eth_getBlockByNumber,formatters:[he.blockNumberToHex,he.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:le.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:le.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:le.RPC_CALLS.eth_getTransactionCount,formatters:[null,he.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:le.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=e=>this.buildRequest({call:le.RPC_CALLS.eth_estimateGas})([e]),this.setSafeSettings=this.buildRequest({call:le.RPC_CALLS.safe_setSettings})}buildRequest(e){const{call:t,formatters:s}=e;return async e=>{s&&Array.isArray(e)&&s.forEach(((t,s)=>{t&&(e[s]=t(e[s]))}));const r={call:t,params:e||[]};return(await this.communicator.send(fe.Methods.rpcCall,r)).data}}};var pe={};try{const e=window;null==e._ethers&&(e._ethers=s.ethers)}catch(e){}var ge=Object.freeze({__proto__:null,ethers:s.ethers,Signer:r.Signer,Wallet:s.Wallet,VoidSigner:r.VoidSigner,getDefaultProvider:n.getDefaultProvider,providers:m,BaseContract:o.BaseContract,Contract:o.Contract,ContractFactory:o.ContractFactory,BigNumber:a.BigNumber,FixedNumber:s.FixedNumber,constants:y,get errors(){return a.ErrorCode},logger:s.logger,utils:s.utils,wordlists:s.wordlists,version:s.version,Wordlist:s.Wordlist}),me=e.getAugmentedNamespace(ge),ye={};Object.defineProperty(ye,"__esModule",{value:!0}),ye.MAGIC_VALUE_BYTES=ye.MAGIC_VALUE=ye.EIP_1271_BYTES_INTERFACE=ye.EIP_1271_INTERFACE=void 0;const be=me;ye.MAGIC_VALUE="0x1626ba7e";ye.MAGIC_VALUE_BYTES="0x20c13b0b";const ve=new be.ethers.utils.Interface(["function isValidSignature(bytes32 _dataHash, bytes calldata _signature) external view"]);ye.EIP_1271_INTERFACE=ve;const _e=new be.ethers.utils.Interface(["function isValidSignature(bytes calldata _data, bytes calldata _signature) public view"]);ye.EIP_1271_BYTES_INTERFACE=_e;var Ee={},we={},Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.PermissionsError=Te.PERMISSIONS_REQUEST_REJECTED=void 0,Te.PERMISSIONS_REQUEST_REJECTED=4001;class Se extends Error{constructor(e,t,s){super(e),this.code=t,this.data=s,Object.setPrototypeOf(this,Se.prototype)}}Te.PermissionsError=Se,Object.defineProperty(we,"__esModule",{value:!0}),we.Wallet=void 0;const Ae=D,Ie=Te;we.Wallet=class{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(Ae.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new Ie.PermissionsError("Permissions request is invalid",Ie.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(Ae.Methods.wallet_requestPermissions,e)).data}catch(e){throw new Ie.PermissionsError("Permissions rejected",Ie.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(e){return e.every((e=>"object"==typeof e&&Object.keys(e).every((e=>!!Object.values(Ae.RestrictedMethods).includes(e)))))}},Object.defineProperty(Ee,"__esModule",{value:!0});const Pe=we,Oe=Te,Ce=(e,t)=>t.some((t=>t.parentCapability===e));Ee.default=()=>(e,t,s)=>{const r=s.value;return s.value=async function(){const e=new Pe.Wallet(this.communicator);let s=await e.getPermissions();if(Ce(t,s)||(s=await e.requestPermissions([{[t]:{}}])),!Ce(t,s))throw new Oe.PermissionsError("Permissions rejected",Oe.PERMISSIONS_REQUEST_REJECTED);return r.apply(this)},s};var Me=e.commonjsGlobal&&e.commonjsGlobal.__decorate||function(e,t,s,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,r);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(a=(o<3?n(a):o>3?n(t,s,a):n(t,s))||a);return o>3&&a&&Object.defineProperty(t,s,a),a},je=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.Safe=void 0;const Re=me,Le=ye,Ne=D,xe=ue,Be=H,De=je(Ee);class ke{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(Ne.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(Ne.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(Ne.Methods.getSafeBalances,{currency:e})).data}async check1271Signature(e,t="0x"){const s=await this.getInfo(),r=Le.EIP_1271_INTERFACE.encodeFunctionData("isValidSignature",[e,t]),n={call:xe.RPC_CALLS.eth_call,params:[{to:s.safeAddress,data:r},"latest"]};try{return(await this.communicator.send(Ne.Methods.rpcCall,n)).data.slice(0,10).toLowerCase()===Le.MAGIC_VALUE}catch(e){return!1}}async check1271SignatureBytes(e,t="0x"){const s=await this.getInfo(),r=Re.ethers.utils.arrayify(e),n=Le.EIP_1271_BYTES_INTERFACE.encodeFunctionData("isValidSignature",[r,t]),o={call:xe.RPC_CALLS.eth_call,params:[{to:s.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(Ne.Methods.rpcCall,o)).data.slice(0,10).toLowerCase()===Le.MAGIC_VALUE_BYTES}catch(e){return!1}}calculateMessageHash(e){return Re.ethers.utils.hashMessage(e)}calculateTypedMessageHash(e){return Re.ethers.utils._TypedDataEncoder.hash(e.domain,e.types,e.message)}async getOffChainSignature(e){return(await this.communicator.send(Ne.Methods.getOffChainSignature,e)).data}async isMessageSigned(e,t="0x"){let s;if("string"==typeof e&&(s=async()=>{const s=this.calculateMessageHash(e);return await this.isMessageHashSigned(s,t)}),(0,Be.isObjectEIP712TypedData)(e)&&(s=async()=>{const s=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(s,t)}),s){return await s()}throw new Error("Invalid message type")}async isMessageHashSigned(e,t="0x"){const s=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const r of s){if(await r(e,t))return!0}return!1}async getEnvironmentInfo(){return(await this.communicator.send(Ne.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(Ne.Methods.requestAddressBook,void 0)).data}}Me([(0,De.default)()],ke.prototype,"requestAddressBook",null),pe.Safe=ke;var He=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0});const Ge=He(I),qe=k,Ue=de,$e=pe,Fe=we;A.default=class{constructor(e={}){const{allowedDomains:t=null,debug:s=!1}=e;this.communicator=new Ge.default(t,s),this.eth=new Ue.Eth(this.communicator),this.txs=new qe.TXs(this.communicator),this.safe=new $e.Safe(this.communicator),this.wallet=new Fe.Wallet(this.communicator)}},function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)},n=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;const o=n(A);t.default=o.default,r(A,t),r(H,t),r(D,t),r(P,t);var a=O;Object.defineProperty(t,"getSDKVersion",{enumerable:!0,get:function(){return a.getSDKVersion}})}(S);var Ve=e.getDefaultExportFromCjs(S),We={},ze={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getLowerCase=void 0,Ke.getLowerCase=function(e){return e?e.toLowerCase():e},Object.defineProperty(ze,"__esModule",{value:!0}),ze.SafeAppProvider=void 0;const Ye=b.default,Qe=Ke;class Xe extends Ye.EventEmitter{constructor(e,t){super(),this.submittedTxs=new Map,this.safe=e,this.sdk=t}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(e){const{method:t,params:s=[]}=e;switch(t){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return`0x${this.chainId.toString(16)}`;case"personal_sign":{const[e,t]=s;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase())throw new Error("The address or message hash is invalid");return await this.sdk.txs.signMessage(e),"0x"}case"eth_sign":{const[e,t]=s;if(this.safe.safeAddress.toLowerCase()!==e.toLowerCase()||!t.startsWith("0x"))throw new Error("The address or message hash is invalid");return await this.sdk.txs.signMessage(t),"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[e,t]=s,r="string"==typeof t?JSON.parse(t):t;if(this.safe.safeAddress.toLowerCase()!==e.toLowerCase())throw new Error("The address is invalid");return await this.sdk.txs.signTypedMessage(r),"0x"}case"eth_sendTransaction":const t=Object.assign({value:"0",data:"0x"},s[0]);"string"==typeof t.gas&&t.gas.startsWith("0x")&&(t.gas=parseInt(t.gas,16));const r=await this.sdk.txs.send({txs:[t],params:{safeTxGas:t.gas}});return this.submittedTxs.set(r.safeTxHash,{from:this.safe.safeAddress,hash:r.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:t.data,value:t.value,to:t.to,blockHash:null,blockNumber:null,transactionIndex:null}),r.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,Qe.getLowerCase)(s[0]),s[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,Qe.getLowerCase)(s[0]),s[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,Qe.getLowerCase)(s[0]),s[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,Qe.getLowerCase)(s[0]),s[1],s[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([s[0],s[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([s[0],s[1]]);case"eth_getTransactionByHash":let n=s[0];try{n=(await this.sdk.txs.getBySafeTxHash(n)).txHash||n}catch(e){}return this.submittedTxs.has(n)?this.submittedTxs.get(n):this.sdk.eth.getTransactionByHash([n]).then((e=>(e&&(e.hash=s[0]),e)));case"eth_getTransactionReceipt":{let e=s[0];try{e=(await this.sdk.txs.getBySafeTxHash(e)).txHash||e}catch(e){}return this.sdk.eth.getTransactionReceipt([e]).then((e=>(e&&(e.transactionHash=s[0]),e)))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(s[0]);case"eth_call":return this.sdk.eth.call([s[0],s[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([s[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(s[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([s[0]]);default:throw Error(`"${e.method}" not implemented`)}}send(e,t){e||t("Undefined request"),this.request(e).then((s=>t(null,{jsonrpc:"2.0",id:e.id,result:s}))).catch((e=>t(e,null)))}}let Je,Ze;function et(){return e.__awaiter(this,void 0,void 0,(function*(){return Ze||(Ze=new Ve),void 0===Je&&(Je=yield Promise.race([Ze.safe.getInfo(),new Promise((e=>setTimeout(e,200)))])),Je}))}ze.SafeAppProvider=Xe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppProvider=void 0;var t=ze;Object.defineProperty(e,"SafeAppProvider",{enumerable:!0,get:function(){return t.SafeAppProvider}})}(We);var tt={},st={},rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.getTxServiceBaseUrl=void 0,rt.getTxServiceBaseUrl=function(e){return`${e}/api`};var nt={};const ot=v.default.Readable,at=Symbol("buffer"),it=Symbol("type");class ct{constructor(){this[it]="";const e=arguments[0],t=arguments[1],s=[];let r=0;if(e){const t=e,n=Number(t.length);for(let e=0;e<n;e++){const n=t[e];let o;o=n instanceof Buffer?n:ArrayBuffer.isView(n)?Buffer.from(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?Buffer.from(n):n instanceof ct?n[at]:Buffer.from("string"==typeof n?n:String(n)),r+=o.length,s.push(o)}}this[at]=Buffer.concat(s);let n=t&&void 0!==t.type&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[it]=n)}get size(){return this[at].length}get type(){return this[it]}text(){return Promise.resolve(this[at].toString())}arrayBuffer(){const e=this[at],t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new ot;return e._read=function(){},e.push(this[at]),e.push(null),e}toString(){return"[object Blob]"}slice(){const e=this.size,t=arguments[0],s=arguments[1];let r,n;r=void 0===t?0:t<0?Math.max(e+t,0):Math.min(t,e),n=void 0===s?e:s<0?Math.max(e+s,0):Math.min(s,e);const o=Math.max(n-r,0),a=this[at].slice(r,r+o),i=new ct([],{type:arguments[2]});return i[at]=a,i}}function dt(e,t,s){Error.call(this,e),this.message=e,this.type=t,s&&(this.code=this.errno=s.code),Error.captureStackTrace(this,this.constructor)}let ut;Object.defineProperties(ct.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(ct.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),dt.prototype=Object.create(Error.prototype),dt.prototype.constructor=dt,dt.prototype.name="FetchError";try{ut=require("encoding").convert}catch(e){}const lt=Symbol("Body internals"),ft=v.default.PassThrough;function ht(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=s.size;let n=void 0===r?0:r;var o=s.timeout;let a=void 0===o?0:o;null==e?e=null:gt(e)?e=Buffer.from(e.toString()):mt(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof v.default||(e=Buffer.from(String(e)))),this[lt]={body:e,disturbed:!1,error:null},this.size=n,this.timeout=a,e instanceof v.default&&e.on("error",(function(e){const s="AbortError"===e.name?e:new dt(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[lt].error=s}))}function pt(){var e=this;if(this[lt].disturbed)return ht.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[lt].disturbed=!0,this[lt].error)return ht.Promise.reject(this[lt].error);let t=this.body;if(null===t)return ht.Promise.resolve(Buffer.alloc(0));if(mt(t)&&(t=t.stream()),Buffer.isBuffer(t))return ht.Promise.resolve(t);if(!(t instanceof v.default))return ht.Promise.resolve(Buffer.alloc(0));let s=[],r=0,n=!1;return new ht.Promise((function(o,a){let i;e.timeout&&(i=setTimeout((function(){n=!0,a(new dt(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(n=!0,a(t)):a(new dt(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!n&&null!==t){if(e.size&&r+t.length>e.size)return n=!0,void a(new dt(`content size at ${e.url} over limit: ${e.size}`,"max-size"));r+=t.length,s.push(t)}})),t.on("end",(function(){if(!n){clearTimeout(i);try{o(Buffer.concat(s,r))}catch(t){a(new dt(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function gt(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function mt(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function yt(e){let t,s,r=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return r instanceof v.default&&"function"!=typeof r.getBoundary&&(t=new ft,s=new ft,r.pipe(t),r.pipe(s),e[lt].body=t,r=s),r}function bt(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":gt(e)?"application/x-www-form-urlencoded;charset=UTF-8":mt(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof v.default?null:"text/plain;charset=UTF-8"}function vt(e){const t=e.body;return null===t?0:mt(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}ht.prototype={get body(){return this[lt].body},get bodyUsed(){return this[lt].disturbed},arrayBuffer(){return pt.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return pt.call(this).then((function(t){return Object.assign(new ct([],{type:e.toLowerCase()}),{[at]:t})}))},json(){var e=this;return pt.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return ht.Promise.reject(new dt(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return pt.call(this).then((function(e){return e.toString()}))},buffer(){return pt.call(this)},textConverted(){var e=this;return pt.call(this).then((function(t){return function(e,t){if("function"!=typeof ut)throw new Error("The package `encoding` must be installed to use the textConverted() function");const s=t.get("content-type");let r,n,o="utf-8";s&&(r=/charset=([^;]*)/i.exec(s));n=e.slice(0,1024).toString(),!r&&n&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(n));!r&&n&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&n&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n));r&&(o=r.pop(),"gb2312"!==o&&"gbk"!==o||(o="gb18030"));return ut(e,"UTF-8",o).toString()}(t,e.headers)}))}},Object.defineProperties(ht.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),ht.mixIn=function(e){for(const t of Object.getOwnPropertyNames(ht.prototype))if(!(t in e)){const s=Object.getOwnPropertyDescriptor(ht.prototype,t);Object.defineProperty(e,t,s)}},ht.Promise=global.Promise;const _t=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Et=/[^\t\x20-\x7e\x80-\xff]/;function wt(e){if(e=`${e}`,_t.test(e)||""===e)throw new TypeError(`${e} is not a legal HTTP header name`)}function Tt(e){if(e=`${e}`,Et.test(e))throw new TypeError(`${e} is not a legal HTTP header value`)}function St(e,t){t=t.toLowerCase();for(const s in e)if(s.toLowerCase()===t)return s}const At=Symbol("map");class It{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[At]=Object.create(null),e instanceof It){const t=e.raw(),s=Object.keys(t);for(const e of s)for(const s of t[e])this.append(e,s)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const s=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");s.push(Array.from(t))}for(const e of s){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const s=e[t];this.append(t,s)}}}}get(e){wt(e=`${e}`);const t=St(this[At],e);return void 0===t?null:this[At][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,s=Pt(this),r=0;for(;r<s.length;){var n=s[r];const o=n[0],a=n[1];e.call(t,a,o,this),s=Pt(this),r++}}set(e,t){t=`${t}`,wt(e=`${e}`),Tt(t);const s=St(this[At],e);this[At][void 0!==s?s:e]=[t]}append(e,t){t=`${t}`,wt(e=`${e}`),Tt(t);const s=St(this[At],e);void 0!==s?this[At][s].push(t):this[At][e]=[t]}has(e){return wt(e=`${e}`),void 0!==St(this[At],e)}delete(e){wt(e=`${e}`);const t=St(this[At],e);void 0!==t&&delete this[At][t]}raw(){return this[At]}keys(){return Ct(this,"key")}values(){return Ct(this,"value")}[Symbol.iterator](){return Ct(this,"key+value")}}function Pt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";return Object.keys(e[At]).sort().map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[At][t].join(", ")}:function(t){return[t.toLowerCase(),e[At][t].join(", ")]})}It.prototype.entries=It.prototype[Symbol.iterator],Object.defineProperty(It.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(It.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const Ot=Symbol("internal");function Ct(e,t){const s=Object.create(Mt);return s[Ot]={target:e,kind:t,index:0},s}const Mt=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==Mt)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[Ot];const t=e.target,s=e.kind,r=e.index,n=Pt(t,s);return r>=n.length?{value:void 0,done:!0}:(this[Ot].index=r+1,{value:n[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function jt(e){const t=Object.assign({__proto__:null},e[At]),s=St(e[At],"Host");return void 0!==s&&(t[s]=t[s][0]),t}Object.defineProperty(Mt,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const Rt=Symbol("Response internals"),Lt=_.default.STATUS_CODES;class Nt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ht.call(this,e,t);const s=t.status||200,r=new It(t.headers);if(null!=e&&!r.has("Content-Type")){const t=bt(e);t&&r.append("Content-Type",t)}this[Rt]={url:t.url,status:s,statusText:t.statusText||Lt[s],headers:r,counter:t.counter}}get url(){return this[Rt].url||""}get status(){return this[Rt].status}get ok(){return this[Rt].status>=200&&this[Rt].status<300}get redirected(){return this[Rt].counter>0}get statusText(){return this[Rt].statusText}get headers(){return this[Rt].headers}clone(){return new Nt(yt(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}ht.mixIn(Nt.prototype),Object.defineProperties(Nt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Nt.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const xt=Symbol("Request internals"),Bt=E.default.URL||t.publicApi.URL,Dt=E.default.parse,kt=E.default.format;function Ht(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(e)&&(e=new Bt(e).toString()),Dt(e)}const Gt="destroy"in v.default.Readable.prototype;function qt(e){return"object"==typeof e&&"object"==typeof e[xt]}class Ut{constructor(e){let t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qt(e)?t=Ht(e.url):(t=e&&e.href?Ht(e.href):Ht(`${e}`),e={});let r=s.method||e.method||"GET";if(r=r.toUpperCase(),(null!=s.body||qt(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let n=null!=s.body?s.body:qt(e)&&null!==e.body?yt(e):null;ht.call(this,n,{timeout:s.timeout||e.timeout||0,size:s.size||e.size||0});const o=new It(s.headers||e.headers||{});if(null!=n&&!o.has("Content-Type")){const e=bt(n);e&&o.append("Content-Type",e)}let a=qt(e)?e.signal:null;if("signal"in s&&(a=s.signal),null!=a&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(a))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[xt]={method:r,redirect:s.redirect||e.redirect||"follow",headers:o,parsedURL:t,signal:a},this.follow=void 0!==s.follow?s.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==s.compress?s.compress:void 0===e.compress||e.compress,this.counter=s.counter||e.counter||0,this.agent=s.agent||e.agent}get method(){return this[xt].method}get url(){return kt(this[xt].parsedURL)}get headers(){return this[xt].headers}get redirect(){return this[xt].redirect}get signal(){return this[xt].signal}clone(){return new Ut(this)}}function $t(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}ht.mixIn(Ut.prototype),Object.defineProperty(Ut.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Ut.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),$t.prototype=Object.create(Error.prototype),$t.prototype.constructor=$t,$t.prototype.name="AbortError";const Ft=E.default.URL||t.publicApi.URL,Vt=v.default.PassThrough;function Wt(e,t){if(!Wt.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return ht.Promise=Wt.Promise,new Wt.Promise((function(s,r){const n=new Ut(e,t),o=function(e){const t=e[xt].parsedURL,s=new It(e[xt].headers);if(s.has("Accept")||s.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof v.default.Readable&&!Gt)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=vt(e);"number"==typeof t&&(r=String(t))}r&&s.set("Content-Length",r),s.has("User-Agent")||s.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!s.has("Accept-Encoding")&&s.set("Accept-Encoding","gzip,deflate");let n=e.agent;return"function"==typeof n&&(n=n(t)),s.has("Connection")||n||s.set("Connection","close"),Object.assign({},t,{method:e.method,headers:jt(s),agent:n})}(n),a=("https:"===o.protocol?w.default:_.default).request,i=n.signal;let c=null;const d=function(){let e=new $t("The user aborted a request.");r(e),n.body&&n.body instanceof v.default.Readable&&zt(n.body,e),c&&c.body&&c.body.emit("error",e)};if(i&&i.aborted)return void d();const u=function(){d(),h()},l=a(o);let f;function h(){l.abort(),i&&i.removeEventListener("abort",u),clearTimeout(f)}i&&i.addEventListener("abort",u),n.timeout&&l.once("socket",(function(e){f=setTimeout((function(){r(new dt(`network timeout at: ${n.url}`,"request-timeout")),h()}),n.timeout)})),l.on("error",(function(e){r(new dt(`request to ${n.url} failed, reason: ${e.message}`,"system",e)),c&&c.body&&zt(c.body,e),h()})),function(e,t){let s;e.on("socket",(function(e){s=e})),e.on("response",(function(e){const r=e.headers;"chunked"!==r["transfer-encoding"]||r["content-length"]||e.once("close",(function(e){if(s.listenerCount("data")>0&&!e){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}}))}))}(l,(function(e){i&&i.aborted||c&&c.body&&zt(c.body,e)})),parseInt(process.version.substring(1))<14&&l.on("socket",(function(e){e.addListener("close",(function(t){const s=e.listenerCount("data")>0;if(c&&s&&!t&&(!i||!i.aborted)){const e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",c.body.emit("error",e)}}))})),l.on("response",(function(e){clearTimeout(f);const t=function(e){const t=new It;for(const s of Object.keys(e))if(!_t.test(s))if(Array.isArray(e[s]))for(const r of e[s])Et.test(r)||(void 0===t[At][s]?t[At][s]=[r]:t[At][s].push(r));else Et.test(e[s])||(t[At][s]=[e[s]]);return t}(e.headers);if(Wt.isRedirect(e.statusCode)){const a=t.get("Location");let i=null;try{i=null===a?null:new Ft(a,n.url).toString()}catch(e){if("manual"!==n.redirect)return r(new dt(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect")),void h()}switch(n.redirect){case"error":return r(new dt(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),void h();case"manual":if(null!==i)try{t.set("Location",i)}catch(e){r(e)}break;case"follow":if(null===i)break;if(n.counter>=n.follow)return r(new dt(`maximum redirect reached at: ${n.url}`,"max-redirect")),void h();const a={headers:new It(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:n.body,signal:n.signal,timeout:n.timeout,size:n.size};if(!function(e,t){const s=new Ft(t).hostname,r=new Ft(e).hostname;return s===r||"."===s[s.length-r.length-1]&&s.endsWith(r)}(n.url,i)||(o=n.url,new Ft(i).protocol!==new Ft(o).protocol))for(const e of["authorization","www-authenticate","cookie","cookie2"])a.headers.delete(e);return 303!==e.statusCode&&n.body&&null===vt(n)?(r(new dt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void h()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==n.method)||(a.method="GET",a.body=void 0,a.headers.delete("content-length")),s(Wt(new Ut(i,a))),void h())}}var o;e.once("end",(function(){i&&i.removeEventListener("abort",u)}));let a=e.pipe(new Vt);const d={url:n.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:n.size,timeout:n.timeout,counter:n.counter},l=t.get("Content-Encoding");if(!n.compress||"HEAD"===n.method||null===l||204===e.statusCode||304===e.statusCode)return c=new Nt(a,d),void s(c);const p={flush:T.default.Z_SYNC_FLUSH,finishFlush:T.default.Z_SYNC_FLUSH};if("gzip"==l||"x-gzip"==l)return a=a.pipe(T.default.createGunzip(p)),c=new Nt(a,d),void s(c);if("deflate"==l||"x-deflate"==l){const t=e.pipe(new Vt);return t.once("data",(function(e){a=8==(15&e[0])?a.pipe(T.default.createInflate()):a.pipe(T.default.createInflateRaw()),c=new Nt(a,d),s(c)})),void t.on("end",(function(){c||(c=new Nt(a,d),s(c))}))}if("br"==l&&"function"==typeof T.default.createBrotliDecompress)return a=a.pipe(T.default.createBrotliDecompress()),c=new Nt(a,d),void s(c);c=new Nt(a,d),s(c)})),function(e,t){const s=t.body;null===s?e.end():mt(s)?s.stream().pipe(e):Buffer.isBuffer(s)?(e.write(s),e.end()):s.pipe(e)}(l,n)}))}function zt(e,t){e.destroy?e.destroy(t):(e.emit("error",t),e.end())}Wt.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},Wt.Promise=global.Promise;var Kt=Object.freeze({__proto__:null,default:Wt,Headers:It,Request:Ut,Response:Nt,FetchError:dt}),Yt=e.getAugmentedNamespace(Kt);!function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest=t.HttpMethod=void 0;const r=s(Yt);var n;(n=t.HttpMethod||(t.HttpMethod={})).Get="get",n.Post="post",n.Delete="delete",t.sendRequest=async function({url:e,method:t,body:s}){const n=await(0,r.default)(e,{method:t,headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)});let o;try{o=await n.json()}catch(e){if(!n.ok)throw new Error(n.statusText)}if(n.ok)return o;if(o.data)throw new Error(o.data);if(o.detail)throw new Error(o.detail);if(o.message)throw new Error(o.message);if(o.nonFieldErrors)throw new Error(o.nonFieldErrors);if(o.delegate)throw new Error(o.delegate);if(o.safe)throw new Error(o.safe);if(o.delegator)throw new Error(o.delegator);throw new Error(n.statusText)}}(nt);var Qt,Xt,Jt=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldSet||function(e,t,s,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,s):n?n.value=s:t.set(e,s),s},Zt=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldGet||function(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)};Object.defineProperty(st,"__esModule",{value:!0});const es=rt,ts=nt;Qt=new WeakMap,Xt=new WeakMap,st.default=class{constructor({txServiceUrl:e,ethAdapter:t}){Qt.set(this,void 0),Xt.set(this,void 0),Jt(this,Qt,(0,es.getTxServiceBaseUrl)(e),"f"),Jt(this,Xt,t,"f")}async getServiceInfo(){return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/about`,method:ts.HttpMethod.Get})}async getServiceMasterCopiesInfo(){return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/about/master-copies`,method:ts.HttpMethod.Get})}async decodeData(e){if(""===e)throw new Error("Invalid data");return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/data-decoder/`,method:ts.HttpMethod.Post,body:{data:e}})}async getSafesByOwner(e){if(""===e)throw new Error("Invalid owner address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/owners/${t}/safes/`,method:ts.HttpMethod.Get})}async getSafesByModule(e){if(""===e)throw new Error("Invalid module address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/modules/${t}/safes/`,method:ts.HttpMethod.Get})}async getTransaction(e){if(""===e)throw new Error("Invalid safeTxHash");return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/multisig-transactions/${e}/`,method:ts.HttpMethod.Get})}async getTransactionConfirmations(e){if(""===e)throw new Error("Invalid safeTxHash");return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/multisig-transactions/${e}/confirmations/`,method:ts.HttpMethod.Get})}async confirmTransaction(e,t){if(""===e)throw new Error("Invalid safeTxHash");if(""===t)throw new Error("Invalid signature");return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/multisig-transactions/${e}/confirmations/`,method:ts.HttpMethod.Post,body:{signature:t}})}async getSafeInfo(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${t}/`,method:ts.HttpMethod.Get})}async getSafeDelegates({safeAddress:e,delegateAddress:t,delegatorAddress:s,label:r,limit:n,offset:o}){const a=new URL(`${Zt(this,Qt,"f")}/v1/delegates`);if(e){const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);a.searchParams.set("safe",t)}if(t){const{address:e}=await Zt(this,Xt,"f").getEip3770Address(t);a.searchParams.set("delegate",e)}if(s){const{address:e}=await Zt(this,Xt,"f").getEip3770Address(s);a.searchParams.set("delegator",e)}return r&&a.searchParams.set("label",r),n&&a.searchParams.set("limit",n),o&&a.searchParams.set("offset",o),(0,ts.sendRequest)({url:a.toString(),method:ts.HttpMethod.Get})}async addSafeDelegate({safeAddress:e,delegateAddress:t,delegatorAddress:s,label:r,signer:n}){if(""===t)throw new Error("Invalid Safe delegate address");if(""===s)throw new Error("Invalid Safe delegator address");if(""===r)throw new Error("Invalid label");const{address:o}=await Zt(this,Xt,"f").getEip3770Address(t),{address:a}=await Zt(this,Xt,"f").getEip3770Address(s),i=o+Math.floor(Date.now()/1e3/3600),c=await n.signMessage(i),d={safe:e?(await Zt(this,Xt,"f").getEip3770Address(e)).address:null,delegate:o,delegator:a,label:r,signature:c};return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/delegates/`,method:ts.HttpMethod.Post,body:d})}async removeSafeDelegate({delegateAddress:e,delegatorAddress:t,signer:s}){if(""===e)throw new Error("Invalid Safe delegate address");if(""===t)throw new Error("Invalid Safe delegator address");const{address:r}=await Zt(this,Xt,"f").getEip3770Address(e),{address:n}=await Zt(this,Xt,"f").getEip3770Address(t),o=r+Math.floor(Date.now()/1e3/3600),a=await s.signMessage(o);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/delegates/${r}`,method:ts.HttpMethod.Delete,body:{delegate:r,delegator:n,signature:a}})}async getSafeCreationInfo(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${t}/creation/`,method:ts.HttpMethod.Get})}async estimateSafeTransaction(e,t){if(""===e)throw new Error("Invalid Safe address");const{address:s}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${s}/multisig-transactions/estimations/`,method:ts.HttpMethod.Post,body:t})}async proposeTransaction({safeAddress:e,safeTransactionData:t,safeTxHash:s,senderAddress:r,senderSignature:n,origin:o}){if(""===e)throw new Error("Invalid Safe address");const{address:a}=await Zt(this,Xt,"f").getEip3770Address(e),{address:i}=await Zt(this,Xt,"f").getEip3770Address(r);if(""===s)throw new Error("Invalid safeTxHash");return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${a}/multisig-transactions/`,method:ts.HttpMethod.Post,body:{...t,contractTransactionHash:s,sender:i,signature:n,origin:o}})}async getIncomingTransactions(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${t}/incoming-transfers?executed=true`,method:ts.HttpMethod.Get})}async getModuleTransactions(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${t}/module-transactions/`,method:ts.HttpMethod.Get})}async getMultisigTransactions(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${t}/multisig-transactions/`,method:ts.HttpMethod.Get})}async getPendingTransactions(e,t){if(""===e)throw new Error("Invalid Safe address");const{address:s}=await Zt(this,Xt,"f").getEip3770Address(e),r=t||(await this.getSafeInfo(s)).nonce;return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/safes/${s}/multisig-transactions/?executed=false&nonce__gte=${r}`,method:ts.HttpMethod.Get})}async getAllTransactions(e,t){var s,r,n;if(""===e)throw new Error("Invalid Safe address");const{address:o}=await Zt(this,Xt,"f").getEip3770Address(e),a=new URL(`${Zt(this,Qt,"f")}/v1/safes/${o}/all-transactions/`),i=(null===(s=null==t?void 0:t.trusted)||void 0===s?void 0:s.toString())||"true";a.searchParams.set("trusted",i);const c=(null===(r=null==t?void 0:t.queued)||void 0===r?void 0:r.toString())||"true";a.searchParams.set("queued",c);const d=(null===(n=null==t?void 0:t.executed)||void 0===n?void 0:n.toString())||"false";return a.searchParams.set("executed",d),(0,ts.sendRequest)({url:a.toString(),method:ts.HttpMethod.Get})}async getNextNonce(e){if(""===e)throw new Error("Invalid Safe address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e),s=await this.getPendingTransactions(t);if(s.results.length>0){const e=s.results.map((e=>e.nonce));return Math.max(...e)+1}return(await this.getSafeInfo(t)).nonce}async getTokenList(){return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/tokens/`,method:ts.HttpMethod.Get})}async getToken(e){if(""===e)throw new Error("Invalid token address");const{address:t}=await Zt(this,Xt,"f").getEip3770Address(e);return(0,ts.sendRequest)({url:`${Zt(this,Qt,"f")}/v1/tokens/${t}/`,method:ts.HttpMethod.Get})}};var ss={};Object.defineProperty(ss,"__esModule",{value:!0}),function(t){var s=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)},n=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(st);r(ss,t),t.default=o.default}(tt);var rs=e.getDefaultExportFromCjs(tt);const ns={1:"https://safe-transaction-mainnet.safe.global/",5:"https://safe-transaction-goerli.safe.global/",42161:"https://safe-transaction-arbitrum.safe.global/",43114:"https://safe-transaction-avalanche.safe.global/",1313161554:"https://safe-transaction-aurora.safe.global/",56:"https://safe-transaction-bsc.safe.global/",10:"https://safe-transaction-optimism.safe.global/",137:"https://safe-transaction-polygon.safe.global/"};let os;function as(t){return e.__awaiter(this,void 0,void 0,(function*(){if((null==os?void 0:os.chainId)===t)return os.safeService;if(!e.useWalletStore.getState().provider)throw new Error("provider is undefined");const s=function(){return{getEip3770Address:t=>e.__awaiter(this,void 0,void 0,(function*(){const{address:e,prefix:s}=function(e){const t=e.split(":"),s=t.length>1?t[1]:t[0];return{prefix:t.length>1?t[0]:"",address:s}}(t);return{address:e,prefix:s}}))}}(),r=ns[t];if(!r)return;const n=new rs({txServiceUrl:r,ethAdapter:s});return os={safeService:n,chainId:t},os.safeService}))}exports.default=function(t){return e.__awaiter(this,void 0,void 0,(function*(){const s=yield et();if(!s)throw Error("Could not load Safe information");const r=new We.SafeAppProvider(s,Ze);return r.on("connect",t.connect),r.on("disconnect",t.disconnect),r.on("accountsChanged",t.accountsChanged),r.on("chainChanged",t.chainChanged),r.on("message",t.message),e.convertWeb3Provider(r)}))},exports.getAccountIsSafe=function(t,s){return e.__awaiter(this,void 0,void 0,(function*(){if(!s)return!1;const e=yield as(t);if(!e)return!1;try{return!!(yield e.getSafeInfo(s))}catch(e){return console.error(e),!1}}))},exports.getConnectedSafe=et,exports.getIsSafe=function(){return e.__awaiter(this,void 0,void 0,(function*(){return!!(yield et())}))},exports.getSafeHashDetailUrl=function(e,t,s){const r={1:"eth",5:"gor",137:"matic",56:"bnb",42161:"arb1",10:"oeth",43114:"avax",1313161554:"aurora"}[t];if(!r)throw new Error(`Not Supported network: ${t}`);return`https://app.safe.global/transactions/tx?id=multisig_${s}_${e}&safe=${r}%3A${s}`},exports.getSafeTxHash=function(t,s,r){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield as(t);if(!e)return console.error(`chainId: ${t} is not supported safe`),r;if(r!==s)return r;const n=yield e.getMultisigTransactions(r),[o]=n.results;return o.safeTxHash}))},exports.getSafeTxStatus=function(t,s,r){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield as(t);if(!e)throw new Error(`chainId: ${t} is not supported safe`);try{const{results:t}=yield e.getMultisigTransactions(r),n=t.find((e=>e.safeTxHash.toLocaleLowerCase()===s.toLocaleLowerCase()));if(!n)return null;if(t.some((e=>!(e.nonce!==n.nonce||e.safeTxHash.toLocaleLowerCase()===s.toLocaleLowerCase()||!e.isExecuted||!e.isSuccessful))))return"rejected";if(null===n.isExecuted||null===n.isSuccessful)return null;return{status:n.isExecuted&&n.isSuccessful||!1,transactionHash:n.transactionHash,blockNumber:n.blockNumber||null}}catch(e){throw console.error(e),new Error(`safeTxHash: ${s} is not valid.`)}}))};
@@ -0,0 +1 @@
1
+ "use strict";const e=Symbol(),t=Object.getPrototypeOf,s=new WeakMap,o=o=>(e=>e&&(s.has(e)?s.get(e):t(e)===Object.prototype||t(e)===Array.prototype))(o)&&o[e]||null,n=(e,t=!0)=>{s.set(e,t)},a=e=>"object"==typeof e&&null!==e,r=new WeakMap,i=new WeakSet,[l]=((e=Object.is,t=((e,t)=>new Proxy(e,t)),s=(e=>a(e)&&!i.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)),l=(e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}}),c=new WeakMap,d=((e,t,s=l)=>{const o=c.get(e);if((null==o?void 0:o[0])===t)return o[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return n(a,!0),c.set(e,[t,a]),Reflect.ownKeys(e).forEach((t=>{if(Object.getOwnPropertyDescriptor(a,t))return;const o=Reflect.get(e,t),l={value:o,enumerable:!0,configurable:!0};if(i.has(o))n(o,!1);else if(o instanceof Promise)delete l.value,l.get=()=>s(o);else if(r.has(o)){const[e,t]=r.get(o);l.value=d(e,t(),s)}Object.defineProperty(a,t,l)})),Object.preventExtensions(a)}),p=new WeakMap,u=[1,1],h=(n=>{if(!a(n))throw new Error("object required");const l=p.get(n);if(l)return l;let c=u[0];const g=new Set,m=(e,t=++u[0])=>{c!==t&&(c=t,g.forEach((s=>s(e,t))))};let f=u[1];const b=e=>(t,s)=>{const o=[...t];o[1]=[e,...o[1]],m(o,s)},y=new Map,v=e=>{var t;const s=y.get(e);s&&(y.delete(e),null==(t=s[1])||t.call(s))},w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),I=t(w,{deleteProperty(e,t){const s=Reflect.get(e,t);v(t);const o=Reflect.deleteProperty(e,t);return o&&m(["delete",[t],s]),o},set(t,n,l,c){const d=Reflect.has(t,n),u=Reflect.get(t,n,c);if(d&&(e(u,l)||p.has(l)&&e(u,p.get(l))))return!0;v(n),a(l)&&(l=o(l)||l);let f=l;if(l instanceof Promise)l.then((e=>{l.status="fulfilled",l.value=e,m(["resolve",[n],e])})).catch((e=>{l.status="rejected",l.reason=e,m(["reject",[n],e])}));else{!r.has(l)&&s(l)&&(f=h(l));const e=!i.has(f)&&r.get(f);e&&((e,t)=>{if(y.has(e))throw new Error("prop listener already exists");if(g.size){const s=t[3](b(e));y.set(e,[t,s])}else y.set(e,[t])})(n,e)}return Reflect.set(t,n,f,c),m(["set",[n],l,u]),!0}});p.set(n,I);const C=[w,(e=++u[1])=>(f===e||g.size||(f=e,y.forEach((([t])=>{const s=t[1](e);s>c&&(c=s)}))),c),d,e=>{g.add(e),1===g.size&&y.forEach((([e,t],s)=>{if(t)throw new Error("remove already exists");const o=e[3](b(s));y.set(s,[e,o])}));return()=>{g.delete(e),0===g.size&&y.forEach((([e,t],s)=>{t&&(t(),y.set(s,[e]))}))}}];return r.set(I,C),Reflect.ownKeys(n).forEach((e=>{const t=Object.getOwnPropertyDescriptor(n,e);"value"in t&&(I[e]=n[e],delete t.value,delete t.writable),Object.defineProperty(w,e,t)})),I}))=>[h,r,i,e,t,s,l,c,d,p,u])();function c(e={}){return l(e)}function d(e,t,s){const o=r.get(e);let n;o||console.warn("Please use proxy object");const a=[],i=o[3];let l=!1;const c=i((e=>{a.push(e),s?t(a.splice(0)):n||(n=Promise.resolve().then((()=>{n=void 0,l&&t(a.splice(0))})))}));return l=!0,()=>{l=!1,c()}}const p=c({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),u={state:p,subscribe:e=>d(p,(()=>e(p))),push(e,t){e!==p.view&&(p.view=e,t&&(p.data=t),p.history.push(e))},reset(e){p.view=e,p.history=[e]},replace(e){p.history.length>1&&(p.history[p.history.length-1]=e,p.view=e)},goBack(){if(p.history.length>1){p.history.pop();const[e]=p.history.slice(-1);p.view=e}},setData(e){p.data=e}},h={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>typeof window<"u"&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>h.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return h.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,s){if(h.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,s){if(!h.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);return`${o}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise((t=>{setTimeout(t,e)})),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(h.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(h.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(h.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(h.WCM_VERSION,"2.6.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=null==(e=u.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},g=c({enabled:typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),m={state:g,subscribe:e=>d(g.events,(()=>e(function(e,t){const s=r.get(e);s||console.warn("Please use proxy object");const[o,n,a]=s;return a(o,n(),t)}(g.events[g.events.length-1])))),initialize(){g.enabled&&typeof(null==crypto?void 0:crypto.randomUUID)<"u"&&(g.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){g.connectedWalletId=e},click(e){if(g.enabled){const t={type:"CLICK",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}},track(e){if(g.enabled){const t={type:"TRACK",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}},view(e){if(g.enabled){const t={type:"VIEW",name:e.name,userSessionId:g.userSessionId,timestamp:Date.now(),data:e};g.events.push(t)}}},f=c({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:f,subscribe:e=>d(f,(()=>e(f))),setChains(e){f.chains=e},setWalletConnectUri(e){f.walletConnectUri=e},setIsCustomDesktop(e){f.isCustomDesktop=e},setIsCustomMobile(e){f.isCustomMobile=e},setIsDataLoaded(e){f.isDataLoaded=e},setIsUiLoaded(e){f.isUiLoaded=e},setIsAuth(e){f.isAuth=e}},y=c({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),v={state:y,subscribe:e=>d(y,(()=>e(y))),setConfig(e){var t,s;m.initialize(),b.setChains(e.chains),b.setIsAuth(Boolean(e.enableAuthMode)),b.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),b.setIsCustomDesktop(Boolean(null==(s=e.desktopWallets)?void 0:s.length)),h.setModalVersionInStorage(),Object.assign(y,e)}},w="https://explorer-api.walletconnect.com";async function I(e,t){const s=new URL(e,w);return s.searchParams.append("projectId",v.state.projectId),Object.entries(t).forEach((([e,t])=>{t&&s.searchParams.append(e,String(t))})),(await fetch(s)).json()}const C={getDesktopListings:async e=>I("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>I("/w3m/v1/getMobileListings",e),getInjectedListings:async e=>I("/w3m/v1/getInjectedListings",e),getAllListings:async e=>I("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${w}/w3m/v1/getWalletImage/${e}?projectId=${v.state.projectId}`,getAssetImageUrl:e=>`${w}/w3m/v1/getAssetImage/${e}?projectId=${v.state.projectId}`};var W=Object.defineProperty,E=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,A=(e,t,s)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const j=h.isMobile(),M=c({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),U={state:M,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=v.state;if("NONE"===e||"ALL"===t&&!e)return M.recomendedWallets;if(h.isArray(e)){const t={recommendedIds:e.join(",")},{listings:s}=await C.getAllListings(t),o=Object.values(s);o.sort(((t,s)=>e.indexOf(t.id)-e.indexOf(s.id))),M.recomendedWallets=o}else{const{chains:e,isAuth:s}=b.state,o=e?.join(","),n=h.isArray(t),a={page:1,sdks:s?"auth_v1":void 0,entries:h.RECOMMENDED_WALLET_AMOUNT,chains:o,version:2,excludedIds:n?t.join(","):void 0},{listings:r}=j?await C.getMobileListings(a):await C.getDesktopListings(a);M.recomendedWallets=Object.values(r)}return M.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var s in t||(t={}))O.call(t,s)&&A(e,s,t[s]);if(E)for(var s of E(t))L.call(t,s)&&A(e,s,t[s]);return e})({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=v.state,{recomendedWallets:n}=M;if("ALL"===o)return M.wallets;n.length?t.excludedIds=n.map((e=>e.id)).join(","):h.isArray(s)&&(t.excludedIds=s.join(",")),h.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:a,search:r}=e,{listings:i,total:l}=j?await C.getMobileListings(t):await C.getDesktopListings(t),c=Object.values(i),d=r?"search":"wallets";return M[d]={listings:[...M[d].listings,...c],total:l,page:a??1},{listings:c,total:l}},getWalletImageUrl:e=>C.getWalletImageUrl(e),getAssetImageUrl:e=>C.getAssetImageUrl(e),resetSearch(){M.search={listings:[],total:0,page:1}}},x=c({open:!1}),D={state:x,subscribe:e=>d(x,(()=>e(x))),open:async e=>new Promise((t=>{const{isUiLoaded:s,isDataLoaded:o}=b.state;if(b.setWalletConnectUri(e?.uri),b.setChains(e?.chains),u.reset("ConnectWallet"),s&&o)x.open=!0,t();else{const e=setInterval((()=>{const s=b.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(e),x.open=!0,t())}),200)}})),close(){x.open=!1}};var P=Object.defineProperty,k=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,R=(e,t,s)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;const T=c({themeMode:typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),_={state:T,subscribe:e=>d(T,(()=>e(T))),setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=((e,t)=>{for(var s in t||(t={}))S.call(t,s)&&R(e,s,t[s]);if(k)for(var s of k(t))N.call(t,s)&&R(e,s,t[s]);return e})({},s))}},$=c({open:!1,message:"",variant:"success"}),B={state:$,subscribe:e=>d($,(()=>e($))),openToast(e,t){$.open=!0,$.message=e,$.variant=t},closeToast(){$.open=!1}};var H=Object.freeze({__proto__:null,WalletConnectModal:class{constructor(e){this.openModal=D.open,this.closeModal=D.close,this.subscribeModal=D.subscribe,this.setTheme=_.setThemeConfig,_.setThemeConfig(e),v.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then((function(){return require("./index-659dc842.cjs")}));const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),b.setIsUiLoaded(!0)}}}});exports.F=D,exports.G=_,exports.N=u,exports.Q=B,exports.T=m,exports.d=b,exports.f=v,exports.i=h,exports.index=H,exports.q=U;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@ethersproject/bytes"),t=require("@ethersproject/properties"),r=require("./id-6c4d97dd.cjs");function o(t){t=atob(t);const r=[];for(let e=0;e<t.length;e++)r.push(t.charCodeAt(e));return e.arrayify(r)}function n(t){t=e.arrayify(t);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}var s=function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((o=o.apply(e,t||[])).next())}))};function l(t,r){return s(this,void 0,void 0,(function*(){null==r&&(r={});const o={method:r.method||"GET",headers:r.headers||{},body:r.body||void 0};if(!0!==r.skipFetchSetup&&(o.mode="cors",o.cache="no-cache",o.credentials="same-origin",o.redirect="follow",o.referrer="client"),null!=r.fetchOptions){const e=r.fetchOptions;e.mode&&(o.mode=e.mode),e.cache&&(o.cache=e.cache),e.credentials&&(o.credentials=e.credentials),e.redirect&&(o.redirect=e.redirect),e.referrer&&(o.referrer=e.referrer)}const n=yield fetch(t,o),s=yield n.arrayBuffer(),l={};return n.headers.forEach?n.headers.forEach(((e,t)=>{l[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{l[e.toLowerCase()]=n.headers.get(e)})),{headers:l,statusCode:n.status,statusMessage:n.statusText,body:e.arrayify(new Uint8Array(s))}}))}var i=function(e,t,r,o){return new(r||(r=Promise))((function(n,s){function l(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((o=o.apply(e,t||[])).next())}))};const c=new r.Logger("web/5.7.1");function a(e){return new Promise((t=>{setTimeout(t,e)}))}function u(t,o){if(null==t)return null;if("string"==typeof t)return t;if(e.isBytesLike(t)){if(o&&("text"===o.split("/")[0]||"application/json"===o.split(";")[0].trim()))try{return r.toUtf8String(t)}catch(e){}return e.hexlify(t)}return t}function h(e,s,h){const d="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;c.assertArgument(d>0&&d%1==0,"invalid connection throttle limit","connection.throttleLimit",d);const f="object"==typeof e?e.throttleCallback:null,p="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;c.assertArgument(p>0&&p%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",p);const y="object"==typeof e&&!!e.errorPassThrough,m={};let g=null;const E={method:"GET"};let w=!1,b=12e4;if("string"==typeof e)g=e;else if("object"==typeof e){if(null!=e&&null!=e.url||c.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(b=e.timeout),e.headers)for(const t in e.headers)m[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(w=!0);if(E.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&c.throwError("basic authentication requires a secure https url",r.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;m.authorization={key:"Authorization",value:"Basic "+n(r.toUtf8Bytes(t))}}null!=e.skipFetchSetup&&(E.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(E.fetchOptions=t.shallowCopy(e.fetchOptions))}const v=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),R=g?g.match(v):null;if(R)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":R[1]||"text/plain"},body:R[2]?o(R[3]):(C=R[3],r.toUtf8Bytes(C.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return h&&(t=h(e.body,e)),Promise.resolve(t)}catch(e){c.throwError("processing response error",r.Logger.errors.SERVER_ERROR,{body:u(R[1],R[2]),error:e,requestBody:null,requestMethod:"GET",url:g})}var C;s&&(E.method="POST",E.body=s,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(s.length)}));const S={};Object.keys(m).forEach((e=>{const t=m[e];S[t.key]=t.value})),E.headers=S;const L=function(){let e=null;return{promise:new Promise((function(t,o){b&&(e=setTimeout((()=>{null!=e&&(e=null,o(c.makeError("timeout",r.Logger.errors.TIMEOUT,{requestBody:u(E.body,S["content-type"]),requestMethod:E.method,timeout:b,url:g})))}),b))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),O=function(){return i(this,void 0,void 0,(function*(){for(let e=0;e<d;e++){let t=null;try{if(t=yield l(g,E),e<d)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===E.method&&e.match(/^https:/)){g=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(f&&(r=yield f(e,g)),r){let r=0;const o=t.headers["retry-after"];r="string"==typeof o&&o.match(/^[1-9][0-9]*$/)?1e3*parseInt(o):p*parseInt(String(Math.random()*Math.pow(2,e))),yield a(r);continue}}}catch(e){t=e.response,null==t&&(L.cancel(),c.throwError("missing response",r.Logger.errors.SERVER_ERROR,{requestBody:u(E.body,S["content-type"]),requestMethod:E.method,serverError:e,url:g}))}let o=t.body;if(w&&304===t.statusCode?o=null:!y&&(t.statusCode<200||t.statusCode>=300)&&(L.cancel(),c.throwError("bad response",r.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:u(o,t.headers?t.headers["content-type"]:null),requestBody:u(E.body,S["content-type"]),requestMethod:E.method,url:g})),h)try{const e=yield h(o,t);return L.cancel(),e}catch(n){if(n.throttleRetry&&e<d){let t=!0;if(f&&(t=yield f(e,g)),t){const t=p*parseInt(String(Math.random()*Math.pow(2,e)));yield a(t);continue}}L.cancel(),c.throwError("processing response error",r.Logger.errors.SERVER_ERROR,{body:u(o,t.headers?t.headers["content-type"]:null),error:n,requestBody:u(E.body,S["content-type"]),requestMethod:E.method,url:g})}return L.cancel(),o}return c.throwError("failed response",r.Logger.errors.SERVER_ERROR,{requestBody:u(E.body,S["content-type"]),requestMethod:E.method,url:g})}))}();return Promise.race([L.promise,O])}function d(e,o,n){let s=null;if(null!=o){s=r.toUtf8Bytes(o);const n="string"==typeof e?{url:e}:t.shallowCopy(e);if(n.headers){0!==Object.keys(n.headers).filter((e=>"content-type"===e.toLowerCase())).length||(n.headers=t.shallowCopy(n.headers),n.headers["content-type"]="application/json")}else n.headers={"content-type":"application/json"};e=n}return h(e,s,((e,t)=>{let o=null;if(null!=e)try{o=JSON.parse(r.toUtf8String(e))}catch(t){c.throwError("invalid JSON",r.Logger.errors.SERVER_ERROR,{body:e,error:t})}return n&&(o=n(o,t)),o}))}function f(e,r){return r||(r={}),null==(r=t.shallowCopy(r)).floor&&(r.floor=0),null==r.ceiling&&(r.ceiling=1e4),null==r.interval&&(r.interval=250),new Promise((function(t,o){let n=null,s=!1;const l=()=>!s&&(s=!0,n&&clearTimeout(n),!0);r.timeout&&(n=setTimeout((()=>{l()&&o(new Error("timeout"))}),r.timeout));const i=r.retryLimit;let c=0;!function n(){return e().then((function(e){if(void 0!==e)l()&&t(e);else if(r.oncePoll)r.oncePoll.once("poll",n);else if(r.onceBlock)r.onceBlock.once("block",n);else if(!s){if(c++,c>i)return void(l()&&o(new Error("retry limit reached")));let e=r.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<r.floor&&(e=r.floor),e>r.ceiling&&(e=r.ceiling),setTimeout(n,e)}return null}),(function(e){l()&&o(e)}))}()}))}var p=Object.freeze({__proto__:null,_fetchData:h,fetchJson:d,poll:f});exports._fetchData=h,exports.decode=o,exports.encode=n,exports.fetchJson=d,exports.lib_esm=p,exports.poll=f;
@@ -0,0 +1 @@
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("util")),r={exports:{}};var s={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r}=s,i=n,o=(t=e.exports={}).re=[],a=t.src=[],l=t.t={};let h=0;const u=(e,t,r)=>{const s=h++;i(e,s,t),l[e]=s,a[s]=t,o[s]=new RegExp(t,r?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${a[l.NUMERICIDENTIFIER]}|${a[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${a[l.NUMERICIDENTIFIERLOOSE]}|${a[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`),u("FULL",`^${a[l.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`),u("LOOSE",`^${a[l.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${a[l.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`),u("XRANGE",`^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),u("COERCERTL",a[l.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${a[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${a[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(r,r.exports);const i=Object.freeze({loose:!0}),o=Object.freeze({});var a=e=>e?"object"!=typeof e?i:e:o;const l=/^[0-9]+$/,h=(e,t)=>{const r=l.test(e),s=l.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1};var u={compareIdentifiers:h,rcompareIdentifiers:(e,t)=>h(t,e)};const p=n,{MAX_LENGTH:c,MAX_SAFE_INTEGER:E}=s,{re:f,t:v}=r.exports,m=a,{compareIdentifiers:$}=u;class R{constructor(e,r){if(r=m(r),e instanceof R){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${t.default.inspect(e)}`);if(e.length>c)throw new TypeError(`version is longer than ${c} characters`);p("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const s=e.trim().match(r.loose?f[v.LOOSE]:f[v.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>E||this.major<0)throw new TypeError("Invalid major version");if(this.minor>E||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>E||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<E)return t}return e})):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(p("SemVer.compare",this.version,this.options,e),!(e instanceof R)){if("string"==typeof e&&e===this.version)return 0;e=new R(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof R||(e=new R(e,this.options)),$(this.major,e.major)||$(this.minor,e.minor)||$(this.patch,e.patch)}comparePre(e){if(e instanceof R||(e=new R(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;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(p("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return $(r,s)}while(++t)}compareBuild(e){e instanceof R||(e=new R(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(p("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return $(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);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":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===$(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}var I=R;const g=I;var d=(e,t,r=!1)=>{if(e instanceof g)return e;try{return new g(e,t)}catch(e){if(!r)return null;throw e}};const N=d;var A=(e,t)=>{const r=N(e,t);return r?r.version:null};const L=d;var w=(e,t)=>{const r=L(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};const O=I;var T=(e,t,r,s,n)=>{"string"==typeof r&&(n=s,s=r,r=void 0);try{return new O(e instanceof O?e.version:e,r).inc(t,s,n).version}catch(e){return null}};const S=d;var y=(e,t)=>{const r=S(e,null,!0),s=S(t,null,!0),n=r.compare(s);if(0===n)return null;const i=n>0,o=i?s:r,a=!!(i?r:s).prerelease.length,l=a?"pre":"";return r.major!==s.major?l+"major":r.minor!==s.minor?l+"minor":r.patch!==s.patch?l+"patch":a?"prerelease":o.patch?"patch":o.minor?"minor":"major"};const x=I;var P=(e,t)=>new x(e,t).major;const C=I;var D=(e,t)=>new C(e,t).minor;const b=I;var G=(e,t)=>new b(e,t).patch;const M=d;var F=(e,t)=>{const r=M(e,t);return r&&r.prerelease.length?r.prerelease:null};const j=I;var X=(e,t,r)=>new j(e,r).compare(new j(t,r));const U=X;var _=(e,t,r)=>U(t,e,r);const k=X;var V=(e,t)=>k(e,t,!0);const B=I;var H=(e,t,r)=>{const s=new B(e,r),n=new B(t,r);return s.compare(n)||s.compareBuild(n)};const Y=H;var W=(e,t)=>e.sort(((e,r)=>Y(e,r,t)));const z=H;var q=(e,t)=>e.sort(((e,r)=>z(r,e,t)));const Z=X;var J=(e,t,r)=>Z(e,t,r)>0;const K=X;var Q=(e,t,r)=>K(e,t,r)<0;const ee=X;var te=(e,t,r)=>0===ee(e,t,r);const re=X;var se=(e,t,r)=>0!==re(e,t,r);const ne=X;var ie=(e,t,r)=>ne(e,t,r)>=0;const oe=X;var ae=(e,t,r)=>oe(e,t,r)<=0;const le=te,he=se,ue=J,pe=ie,ce=Q,Ee=ae;var fe=(e,t,r,s)=>{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 le(e,r,s);case"!=":return he(e,r,s);case">":return ue(e,r,s);case">=":return pe(e,r,s);case"<":return ce(e,r,s);case"<=":return Ee(e,r,s);default:throw new TypeError(`Invalid operator: ${t}`)}};const ve=I,me=d,{re:$e,t:Re}=r.exports;var Ie,ge,de,Ne,Ae,Le,we,Oe,Te,Se,ye=(e,t)=>{if(e instanceof ve)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=$e[Re.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),$e[Re.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;$e[Re.COERCERTL].lastIndex=-1}else r=e.match($e[Re.COERCE]);return null===r?null:me(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function xe(){if(Ne)return de;function e(t){var r=this;if(r instanceof e||(r=new e),r.tail=null,r.head=null,r.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){r.push(e)}));else if(arguments.length>0)for(var s=0,n=arguments.length;s<n;s++)r.push(arguments[s]);return r}function t(e,t,r){var s=t===e.head?new n(r,null,t,e):new n(r,t,t.next,e);return null===s.next&&(e.tail=s),null===s.prev&&(e.head=s),e.length++,s}function r(e,t){e.tail=new n(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new n(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function n(e,t,r,s){if(!(this instanceof n))return new n(e,t,r,s);this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}Ne=1,de=e,e.Node=n,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,s=0;null!==r;s++)e.call(t,r.value,s,this),r=r.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,s=this.length-1;null!==r;s--)e.call(t,r.value,s,this),r=r.prev},e.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},e.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},e.prototype.map=function(t,r){r=r||this;for(var s=new e,n=this.head;null!==n;)s.push(t.call(r,n.value,this)),n=n.next;return s},e.prototype.mapReverse=function(t,r){r=r||this;for(var s=new e,n=this.tail;null!==n;)s.push(t.call(r,n.value,this)),n=n.prev;return s},e.prototype.reduce=function(e,t){var r,s=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");s=this.head.next,r=this.head.value}for(var n=0;null!==s;n++)r=e(r,s.value,n),s=s.next;return r},e.prototype.reduceReverse=function(e,t){var r,s=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");s=this.tail.prev,r=this.tail.value}for(var n=this.length-1;null!==s;n--)r=e(r,s.value,n),s=s.prev;return r},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},e.prototype.slice=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var s=new e;if(r<t||r<0)return s;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=0,i=this.head;null!==i&&n<t;n++)i=i.next;for(;null!==i&&n<r;n++,i=i.next)s.push(i.value);return s},e.prototype.sliceReverse=function(t,r){(r=r||this.length)<0&&(r+=this.length),(t=t||0)<0&&(t+=this.length);var s=new e;if(r<t||r<0)return s;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=this.length,i=this.tail;null!==i&&n>r;n--)i=i.prev;for(;null!==i&&n>t;n--,i=i.prev)s.push(i.value);return s},e.prototype.splice=function(e,r,...s){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<r;n++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(n=0;n<s.length;n++)i=t(this,i,s[n]);return o},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var s=r.prev;r.prev=r.next,r.next=s}return this.head=t,this.tail=e,this};try{(ge?Ie:(ge=1,Ie=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return de}function Pe(){if(Oe)return we;Oe=1;class e{constructor(t,r){if(r=o(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof l)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t,this.set=t.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!R(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=((this.options.includePrerelease&&m)|(this.options.loose&&$))+":"+e,r=i.get(t);if(r)return r;const s=this.options.loose,n=s?p[c.HYPHENRANGELOOSE]:p[c.HYPHENRANGE];e=e.replace(n,C(this.options.includePrerelease)),h("hyphen replace",e),e=e.replace(p[c.COMPARATORTRIM],E),h("comparator trim",e);let o=(e=(e=(e=e.replace(p[c.TILDETRIM],f)).replace(p[c.CARETTRIM],v)).split(/\s+/).join(" ")).split(" ").map((e=>N(e,this.options))).join(" ").split(/\s+/).map((e=>P(e,this.options)));s&&(o=o.filter((e=>(h("loose invalid filter",e,this.options),!!e.match(p[c.COMPARATORLOOSE]))))),h("range list",o);const a=new Map,u=o.map((e=>new l(e,this.options)));for(const e of u){if(R(e))return[e];a.set(e.value,e)}a.size>1&&a.has("")&&a.delete("");const I=[...a.values()];return i.set(t,I),I}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>d(e,r)&&t.set.some((t=>d(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(D(this.set[t],e,this.options))return!0;return!1}}we=e;const t=function(){if(Le)return Ae;Le=1;const e=xe(),t=Symbol("max"),r=Symbol("length"),s=Symbol("lengthCalculator"),n=Symbol("allowStale"),i=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),l=Symbol("lruList"),h=Symbol("cache"),u=Symbol("updateAgeOnGet"),p=()=>1,c=(e,t,r)=>{const s=e[h].get(t);if(s){const t=s.value;if(E(e,t)){if(v(e,s),!e[n])return}else r&&(e[u]&&(s.value.now=Date.now()),e[l].unshiftNode(s));return t.value}},E=(e,t)=>{if(!t||!t.maxAge&&!e[i])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[i]&&r>e[i]},f=e=>{if(e[r]>e[t])for(let s=e[l].tail;e[r]>e[t]&&null!==s;){const t=s.prev;v(e,s),s=t}},v=(e,t)=>{if(t){const s=t.value;e[o]&&e[o](s.key,s.value),e[r]-=s.length,e[h].delete(s.key),e[l].removeNode(t)}};class m{constructor(e,t,r,s,n){this.key=e,this.value=t,this.length=r,this.now=s,this.maxAge=n||0}}const $=(e,t,r,s)=>{let i=r.value;E(e,i)&&(v(e,r),e[n]||(i=void 0)),i&&t.call(s,i.value,i.key,e)};return Ae=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const r=e.length||p;if(this[s]="function"!=typeof r?p:r,this[n]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[i]=e.maxAge||0,this[o]=e.dispose,this[a]=e.noDisposeOnSet||!1,this[u]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,f(this)}get max(){return this[t]}set allowStale(e){this[n]=!!e}get allowStale(){return this[n]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[i]=e,f(this)}get maxAge(){return this[i]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[r]=0,this[l].forEach((e=>{e.length=this[s](e.value,e.key),this[r]+=e.length}))),f(this)}get lengthCalculator(){return this[s]}get length(){return this[r]}get itemCount(){return this[l].length}rforEach(e,t){t=t||this;for(let r=this[l].tail;null!==r;){const s=r.prev;$(this,e,r,t),r=s}}forEach(e,t){t=t||this;for(let r=this[l].head;null!==r;){const s=r.next;$(this,e,r,t),r=s}}keys(){return this[l].toArray().map((e=>e.key))}values(){return this[l].toArray().map((e=>e.value))}reset(){this[o]&&this[l]&&this[l].length&&this[l].forEach((e=>this[o](e.key,e.value))),this[h]=new Map,this[l]=new e,this[r]=0}dump(){return this[l].map((e=>!E(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[l]}set(e,n,u){if((u=u||this[i])&&"number"!=typeof u)throw new TypeError("maxAge must be a number");const p=u?Date.now():0,c=this[s](n,e);if(this[h].has(e)){if(c>this[t])return v(this,this[h].get(e)),!1;const s=this[h].get(e).value;return this[o]&&(this[a]||this[o](e,s.value)),s.now=p,s.maxAge=u,s.value=n,this[r]+=c-s.length,s.length=c,this.get(e),f(this),!0}const E=new m(e,n,c,p,u);return E.length>this[t]?(this[o]&&this[o](e,n),!1):(this[r]+=E.length,this[l].unshift(E),this[h].set(e,this[l].head),f(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!E(this,t)}get(e){return c(this,e,!0)}peek(e){return c(this,e,!1)}pop(){const e=this[l].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const s=e[r],n=s.e||0;if(0===n)this.set(s.k,s.v);else{const e=n-t;e>0&&this.set(s.k,s.v,e)}}}prune(){this[h].forEach(((e,t)=>c(this,t,!1)))}}}(),i=new t({max:1e3}),o=a,l=Ce(),h=n,u=I,{re:p,t:c,comparatorTrimReplace:E,tildeTrimReplace:f,caretTrimReplace:v}=r.exports,{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:$}=s,R=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,d=(e,t)=>{let r=!0;const s=e.slice();let n=s.pop();for(;r&&s.length;)r=s.every((e=>n.intersects(e,t))),n=s.pop();return r},N=(e,t)=>(h("comp",e,t),e=O(e,t),h("caret",e),e=L(e,t),h("tildes",e),e=S(e,t),h("xrange",e),e=x(e,t),h("stars",e),e),A=e=>!e||"x"===e.toLowerCase()||"*"===e,L=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?p[c.TILDELOOSE]:p[c.TILDE];return e.replace(r,((t,r,s,n,i)=>{let o;return h("tilde",e,t,r,s,n,i),A(r)?o="":A(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:A(n)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:i?(h("replaceTilde pr",i),o=`>=${r}.${s}.${n}-${i} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${n} <${r}.${+s+1}.0-0`,h("tilde return",o),o}))},O=(e,t)=>e.trim().split(/\s+/).map((e=>T(e,t))).join(" "),T=(e,t)=>{h("caret",e,t);const r=t.loose?p[c.CARETLOOSE]:p[c.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,((t,r,n,i,o)=>{let a;return h("caret",e,t,r,n,i,o),A(r)?a="":A(n)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:A(i)?a="0"===r?`>=${r}.${n}.0${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${s} <${+r+1}.0.0-0`:o?(h("replaceCaret pr",o),a="0"===r?"0"===n?`>=${r}.${n}.${i}-${o} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i}-${o} <${+r+1}.0.0-0`):(h("no pr"),a="0"===r?"0"===n?`>=${r}.${n}.${i}${s} <${r}.${n}.${+i+1}-0`:`>=${r}.${n}.${i}${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${i} <${+r+1}.0.0-0`),h("caret return",a),a}))},S=(e,t)=>(h("replaceXRanges",e,t),e.split(/\s+/).map((e=>y(e,t))).join(" ")),y=(e,t)=>{e=e.trim();const r=t.loose?p[c.XRANGELOOSE]:p[c.XRANGE];return e.replace(r,((r,s,n,i,o,a)=>{h("xRange",e,r,s,n,i,o,a);const l=A(n),u=l||A(i),p=u||A(o),c=p;return"="===s&&c&&(s=""),a=t.includePrerelease?"-0":"",l?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&c?(u&&(i=0),o=0,">"===s?(s=">=",u?(n=+n+1,i=0,o=0):(i=+i+1,o=0)):"<="===s&&(s="<",u?n=+n+1:i=+i+1),"<"===s&&(a="-0"),r=`${s+n}.${i}.${o}${a}`):u?r=`>=${n}.0.0${a} <${+n+1}.0.0-0`:p&&(r=`>=${n}.${i}.0${a} <${n}.${+i+1}.0-0`),h("xRange return",r),r}))},x=(e,t)=>(h("replaceStars",e,t),e.trim().replace(p[c.STAR],"")),P=(e,t)=>(h("replaceGTE0",e,t),e.trim().replace(p[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),C=e=>(t,r,s,n,i,o,a,l,h,u,p,c,E)=>`${r=A(s)?"":A(n)?`>=${s}.0.0${e?"-0":""}`:A(i)?`>=${s}.${n}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=A(h)?"":A(u)?`<${+h+1}.0.0-0`:A(p)?`<${h}.${+u+1}.0-0`:c?`<=${h}.${u}.${p}-${c}`:e?`<${h}.${u}.${+p+1}-0`:`<=${l}`}`.trim(),D=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(h(e[r].semver),e[r].semver!==l.ANY&&e[r].semver.prerelease.length>0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0};return we}function Ce(){if(Se)return Te;Se=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,n){if(n=s(n),r instanceof t){if(r.loose===!!n.loose)return r;r=r.value}h("comparator",r,n),this.options=n,this.loose=!!n.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}parse(t){const r=this.options.loose?i[o.COMPARATORLOOSE]:i[o.COMPARATOR],s=t.match(r);if(!s)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new u(s[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(h("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new u(t,this.options)}catch(e){return!1}return l(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,r).test(this.value):""===e.operator?""===e.value||new p(this.value,r).test(e.semver):(!(r=s(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Te=t;const s=a,{re:i,t:o}=r.exports,l=fe,h=n,u=I,p=Pe();return Te}const De=Pe();var be=(e,t,r)=>{try{t=new De(t,r)}catch(e){return!1}return t.test(e)};const Ge=Pe();var Me=(e,t)=>new Ge(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Fe=I,je=Pe();var Xe=(e,t,r)=>{let s=null,n=null,i=null;try{i=new je(t,r)}catch(e){return null}return e.forEach((e=>{i.test(e)&&(s&&-1!==n.compare(e)||(s=e,n=new Fe(s,r)))})),s};const Ue=I,_e=Pe();var ke=(e,t,r)=>{let s=null,n=null,i=null;try{i=new _e(t,r)}catch(e){return null}return e.forEach((e=>{i.test(e)&&(s&&1!==n.compare(e)||(s=e,n=new Ue(s,r)))})),s};const Ve=I,Be=Pe(),He=J;var Ye=(e,t)=>{e=new Be(e,t);let r=new Ve("0.0.0");if(e.test(r))return r;if(r=new Ve("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let n=null;s.forEach((e=>{const t=new Ve(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!He(t,n)||(n=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!n||r&&!He(r,n)||(r=n)}return r&&e.test(r)?r:null};const We=Pe();var ze=(e,t)=>{try{return new We(e,t).range||"*"}catch(e){return null}};const qe=I,Ze=Ce(),{ANY:Je}=Ze,Ke=Pe(),Qe=be,et=J,tt=Q,rt=ae,st=ie;var nt=(e,t,r,s)=>{let n,i,o,a,l;switch(e=new qe(e,s),t=new Ke(t,s),r){case">":n=et,i=rt,o=tt,a=">",l=">=";break;case"<":n=tt,i=st,o=et,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Qe(e,t,s))return!1;for(let r=0;r<t.set.length;++r){const h=t.set[r];let u=null,p=null;if(h.forEach((e=>{e.semver===Je&&(e=new Ze(">=0.0.0")),u=u||e,p=p||e,n(e.semver,u.semver,s)?u=e:o(e.semver,p.semver,s)&&(p=e)})),u.operator===a||u.operator===l)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===l&&o(e,p.semver))return!1}return!0};const it=nt;var ot=(e,t,r)=>it(e,t,">",r);const at=nt;var lt=(e,t,r)=>at(e,t,"<",r);const ht=Pe();var ut=(e,t,r)=>(e=new ht(e,r),t=new ht(t,r),e.intersects(t,r));const pt=be,ct=X;const Et=Pe(),ft=Ce(),{ANY:vt}=ft,mt=be,$t=X,Rt=[new ft(">=0.0.0-0")],It=[new ft(">=0.0.0")],gt=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===vt){if(1===t.length&&t[0].semver===vt)return!0;e=r.includePrerelease?Rt:It}if(1===t.length&&t[0].semver===vt){if(r.includePrerelease)return!0;t=It}const s=new Set;let n,i,o,a,l,h,u;for(const t of e)">"===t.operator||">="===t.operator?n=dt(n,t,r):"<"===t.operator||"<="===t.operator?i=Nt(i,t,r):s.add(t.semver);if(s.size>1)return null;if(n&&i){if(o=$t(n.semver,i.semver,r),o>0)return null;if(0===o&&(">="!==n.operator||"<="!==i.operator))return null}for(const e of s){if(n&&!mt(e,String(n),r))return null;if(i&&!mt(e,String(i),r))return null;for(const s of t)if(!mt(e,String(s),r))return!1;return!0}let p=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver,c=!(!n||r.includePrerelease||!n.semver.prerelease.length)&&n.semver;p&&1===p.prerelease.length&&"<"===i.operator&&0===p.prerelease[0]&&(p=!1);for(const e of t){if(u=u||">"===e.operator||">="===e.operator,h=h||"<"===e.operator||"<="===e.operator,n)if(c&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===c.major&&e.semver.minor===c.minor&&e.semver.patch===c.patch&&(c=!1),">"===e.operator||">="===e.operator){if(a=dt(n,e,r),a===e&&a!==n)return!1}else if(">="===n.operator&&!mt(n.semver,String(e),r))return!1;if(i)if(p&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===p.major&&e.semver.minor===p.minor&&e.semver.patch===p.patch&&(p=!1),"<"===e.operator||"<="===e.operator){if(l=Nt(i,e,r),l===e&&l!==i)return!1}else if("<="===i.operator&&!mt(i.semver,String(e),r))return!1;if(!e.operator&&(i||n)&&0!==o)return!1}return!(n&&h&&!i&&0!==o)&&(!(i&&u&&!n&&0!==o)&&(!c&&!p))},dt=(e,t,r)=>{if(!e)return t;const s=$t(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},Nt=(e,t,r)=>{if(!e)return t;const s=$t(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};var At=(e,t,r={})=>{if(e===t)return!0;e=new Et(e,r),t=new Et(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=gt(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0};const Lt=r.exports,wt=s,Ot=I,Tt=u,St=(e,t,r)=>{const s=[];let n=null,i=null;const o=e.sort(((e,t)=>ct(e,t,r)));for(const e of o){pt(e,t,r)?(i=e,n||(n=e)):(i&&s.push([n,i]),i=null,n=null)}n&&s.push([n,null]);const a=[];for(const[e,t]of s)e===t?a.push(e):t||e!==o[0]?t?e===o[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const l=a.join(" || "),h="string"==typeof t.raw?t.raw:String(t);return l.length<h.length?l:t};var yt={parse:d,valid:A,clean:w,inc:T,diff:y,major:P,minor:D,patch:G,prerelease:F,compare:X,rcompare:_,compareLoose:V,compareBuild:H,sort:W,rsort:q,gt:J,lt:Q,eq:te,neq:se,gte:ie,lte:ae,cmp:fe,coerce:ye,Comparator:Ce(),Range:Pe(),satisfies:be,toComparators:Me,maxSatisfying:Xe,minSatisfying:ke,minVersion:Ye,validRange:ze,outside:nt,gtr:ot,ltr:lt,intersects:ut,simplifyRange:St,subset:At,SemVer:Ot,re:Lt.re,src:Lt.src,tokens:Lt.t,SEMVER_SPEC_VERSION:wt.SEMVER_SPEC_VERSION,RELEASE_TYPES:wt.RELEASE_TYPES,compareIdentifiers:Tt.compareIdentifiers,rcompareIdentifiers:Tt.rcompareIdentifiers};exports.semver=yt;
@@ -0,0 +1 @@
1
+ "use strict";var r=require("@ethersproject/bytes"),t=require("./id-6c4d97dd.cjs");const o=new t.Logger("rlp/5.7.0");function e(r){const t=[];for(;r;)t.unshift(255&r),r>>=8;return t}function n(r,t,o){let e=0;for(let n=0;n<o;n++)e=256*e+r[t+n];return e}function s(t){if(Array.isArray(t)){let r=[];if(t.forEach((function(t){r=r.concat(s(t))})),r.length<=55)return r.unshift(192+r.length),r;const o=e(r.length);return o.unshift(247+o.length),o.concat(r)}r.isBytesLike(t)||o.throwArgumentError("RLP object must be BytesLike","object",t);const n=Array.prototype.slice.call(r.arrayify(t));if(1===n.length&&n[0]<=127)return n;if(n.length<=55)return n.unshift(128+n.length),n;const c=e(n.length);return c.unshift(183+c.length),c.concat(n)}function c(t){return r.hexlify(s(t))}function h(r,e,n,s){const c=[];for(;n<e+1+s;){const h=u(r,n);c.push(h.result),(n+=h.consumed)>e+1+s&&o.throwError("child data too short",t.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+s,result:c}}function u(e,s){if(0===e.length&&o.throwError("data too short",t.Logger.errors.BUFFER_OVERRUN,{}),e[s]>=248){const r=e[s]-247;s+1+r>e.length&&o.throwError("data short segment too short",t.Logger.errors.BUFFER_OVERRUN,{});const c=n(e,s+1,r);return s+1+r+c>e.length&&o.throwError("data long segment too short",t.Logger.errors.BUFFER_OVERRUN,{}),h(e,s,s+1+r,r+c)}if(e[s]>=192){const r=e[s]-192;return s+1+r>e.length&&o.throwError("data array too short",t.Logger.errors.BUFFER_OVERRUN,{}),h(e,s,s+1,r)}if(e[s]>=184){const c=e[s]-183;s+1+c>e.length&&o.throwError("data array too short",t.Logger.errors.BUFFER_OVERRUN,{});const h=n(e,s+1,c);s+1+c+h>e.length&&o.throwError("data array too short",t.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+c+h,result:r.hexlify(e.slice(s+1+c,s+1+c+h))}}if(e[s]>=128){const n=e[s]-128;s+1+n>e.length&&o.throwError("data too short",t.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+n,result:r.hexlify(e.slice(s+1,s+1+n))}}return{consumed:1,result:r.hexlify(e[s])}}function l(t){const e=r.arrayify(t),n=u(e,0);return n.consumed!==e.length&&o.throwArgumentError("invalid rlp data","data",t),n.result}var i=Object.freeze({__proto__:null,encode:c,decode:l});exports.decode=l,exports.encode=c,exports.lib_esm=i;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./index-cfe3e391.cjs"),r=require("./interface-1b54eefa.cjs"),t=Object.freeze({__proto__:null,ConstructorFragment:r.ConstructorFragment,ErrorFragment:r.ErrorFragment,EventFragment:r.EventFragment,Fragment:r.Fragment,FunctionFragment:r.FunctionFragment,ParamType:r.ParamType,FormatTypes:r.FormatTypes,AbiCoder:r.AbiCoder,defaultAbiCoder:r.defaultAbiCoder,Interface:r.Interface,Indexed:r.Indexed,checkResultErrors:r.checkResultErrors,LogDescription:r.LogDescription,TransactionDescription:r.TransactionDescription}),n=e.getAugmentedNamespace(t);exports.require$$0=n;