@defdone/annon 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/CLI.md +378 -0
  3. package/LICENSE +201 -0
  4. package/NOTICE +7 -0
  5. package/README.md +581 -2
  6. package/dist/api/annon-types.d.ts +108 -0
  7. package/dist/api/annon-types.js +2 -0
  8. package/dist/api/annon.d.ts +117 -0
  9. package/dist/api/annon.js +1152 -0
  10. package/dist/api/hosted-record.d.ts +13 -0
  11. package/dist/api/hosted-record.js +149 -0
  12. package/dist/api/sharing-types.d.ts +109 -0
  13. package/dist/api/sharing-types.js +1 -0
  14. package/dist/api/sharing.d.ts +36 -0
  15. package/dist/api/sharing.js +879 -0
  16. package/dist/browser/download.d.ts +19 -0
  17. package/dist/browser/download.js +52 -0
  18. package/dist/browser/index.d.ts +23 -0
  19. package/dist/browser/index.js +22 -0
  20. package/dist/browser/login-bundle.js +116 -0
  21. package/dist/browser/login.d.ts +1 -0
  22. package/dist/browser/login.js +177 -0
  23. package/dist/browser/purchase-bundle.js +84 -0
  24. package/dist/browser/purchases.d.ts +98 -0
  25. package/dist/browser/purchases.js +735 -0
  26. package/dist/browser/record.d.ts +55 -0
  27. package/dist/browser/record.js +16 -0
  28. package/dist/browser/selling.d.ts +146 -0
  29. package/dist/browser/selling.js +418 -0
  30. package/dist/browser/wallets.d.ts +53 -0
  31. package/dist/browser/wallets.js +286 -0
  32. package/dist/bytes.d.ts +4 -0
  33. package/dist/bytes.js +16 -0
  34. package/dist/download/download.d.ts +59 -0
  35. package/dist/download/download.js +384 -0
  36. package/dist/download/host.d.ts +56 -0
  37. package/dist/download/host.js +161 -0
  38. package/dist/download/http.d.ts +23 -0
  39. package/dist/download/http.js +87 -0
  40. package/dist/download/proof.d.ts +20 -0
  41. package/dist/download/proof.js +79 -0
  42. package/dist/download/upload.d.ts +130 -0
  43. package/dist/download/upload.js +408 -0
  44. package/dist/envelope/evm.d.ts +4 -0
  45. package/dist/envelope/evm.js +32 -0
  46. package/dist/envelope/pay2.d.ts +176 -0
  47. package/dist/envelope/pay2.js +541 -0
  48. package/dist/envelope/replay.d.ts +45 -0
  49. package/dist/envelope/replay.js +186 -0
  50. package/dist/envelope/stream.d.ts +78 -0
  51. package/dist/envelope/stream.js +372 -0
  52. package/dist/errors.d.ts +21 -0
  53. package/dist/errors.js +300 -0
  54. package/dist/index.d.ts +25 -0
  55. package/dist/index.js +23 -0
  56. package/dist/keys/near-ckd.d.ts +47 -0
  57. package/dist/keys/near-ckd.js +96 -0
  58. package/dist/limits.d.ts +4 -0
  59. package/dist/limits.js +4 -0
  60. package/dist/near/nep413.d.ts +22 -0
  61. package/dist/near/nep413.js +39 -0
  62. package/dist/near/rpc.d.ts +170 -0
  63. package/dist/near/rpc.js +423 -0
  64. package/dist/near/texts.d.ts +39 -0
  65. package/dist/near/texts.js +60 -0
  66. package/dist/net/ip.d.ts +7 -0
  67. package/dist/net/ip.js +62 -0
  68. package/dist/net/retry.d.ts +3 -0
  69. package/dist/net/retry.js +31 -0
  70. package/dist/node/adapter-checks.d.ts +6 -0
  71. package/dist/node/adapter-checks.js +13 -0
  72. package/dist/node/adapter.d.ts +8 -0
  73. package/dist/node/adapter.js +99 -0
  74. package/dist/node/agent.d.ts +49 -0
  75. package/dist/node/agent.js +266 -0
  76. package/dist/node/amounts.d.ts +2 -0
  77. package/dist/node/amounts.js +20 -0
  78. package/dist/node/browser-login.d.ts +18 -0
  79. package/dist/node/browser-login.js +212 -0
  80. package/dist/node/budget.d.ts +24 -0
  81. package/dist/node/budget.js +59 -0
  82. package/dist/node/buy-commands.d.ts +24 -0
  83. package/dist/node/buy-commands.js +301 -0
  84. package/dist/node/cli.d.ts +60 -0
  85. package/dist/node/cli.js +201 -0
  86. package/dist/node/command-context.d.ts +82 -0
  87. package/dist/node/command-context.js +77 -0
  88. package/dist/node/config.d.ts +37 -0
  89. package/dist/node/config.js +189 -0
  90. package/dist/node/core-adapter.d.ts +43 -0
  91. package/dist/node/core-adapter.js +122 -0
  92. package/dist/node/errors.d.ts +8 -0
  93. package/dist/node/errors.js +12 -0
  94. package/dist/node/index.d.ts +7 -0
  95. package/dist/node/index.js +5 -0
  96. package/dist/node/io.d.ts +13 -0
  97. package/dist/node/io.js +112 -0
  98. package/dist/node/keychain.d.ts +10 -0
  99. package/dist/node/keychain.js +67 -0
  100. package/dist/node/main.d.ts +2 -0
  101. package/dist/node/main.js +21 -0
  102. package/dist/node/offers.d.ts +16 -0
  103. package/dist/node/offers.js +91 -0
  104. package/dist/node/origin.d.ts +11 -0
  105. package/dist/node/origin.js +80 -0
  106. package/dist/node/paths.d.ts +3 -0
  107. package/dist/node/paths.js +71 -0
  108. package/dist/node/payment-terms.d.ts +26 -0
  109. package/dist/node/payment-terms.js +127 -0
  110. package/dist/node/purchase-commands.d.ts +16 -0
  111. package/dist/node/purchase-commands.js +237 -0
  112. package/dist/node/purchase-guard.d.ts +19 -0
  113. package/dist/node/purchase-guard.js +53 -0
  114. package/dist/node/relay-transport.d.ts +6 -0
  115. package/dist/node/relay-transport.js +173 -0
  116. package/dist/node/resources.d.ts +2 -0
  117. package/dist/node/resources.js +26 -0
  118. package/dist/node/retry-gate.d.ts +15 -0
  119. package/dist/node/retry-gate.js +53 -0
  120. package/dist/node/seller-commands.d.ts +12 -0
  121. package/dist/node/seller-commands.js +207 -0
  122. package/dist/node/sharing.d.ts +3 -0
  123. package/dist/node/sharing.js +28 -0
  124. package/dist/node/shops.d.ts +17 -0
  125. package/dist/node/shops.js +74 -0
  126. package/dist/node/signer-mock.d.ts +11 -0
  127. package/dist/node/signer-mock.js +79 -0
  128. package/dist/node/signer-wallet.d.ts +8 -0
  129. package/dist/node/signer-wallet.js +147 -0
  130. package/dist/node/signing.d.ts +29 -0
  131. package/dist/node/signing.js +200 -0
  132. package/dist/node/storage-commands.d.ts +11 -0
  133. package/dist/node/storage-commands.js +50 -0
  134. package/dist/node/sync-dir.d.ts +1 -0
  135. package/dist/node/sync-dir.js +11 -0
  136. package/dist/node/wallets.d.ts +13 -0
  137. package/dist/node/wallets.js +146 -0
  138. package/dist/oneclick/oneclick.d.ts +132 -0
  139. package/dist/oneclick/oneclick.js +342 -0
  140. package/dist/pay/backup.d.ts +70 -0
  141. package/dist/pay/backup.js +402 -0
  142. package/dist/pay/base.d.ts +135 -0
  143. package/dist/pay/base.js +393 -0
  144. package/dist/pay/eip3009.d.ts +59 -0
  145. package/dist/pay/eip3009.js +72 -0
  146. package/dist/pay/pay.d.ts +86 -0
  147. package/dist/pay/pay.js +297 -0
  148. package/dist/pay/purchase.d.ts +103 -0
  149. package/dist/pay/purchase.js +20 -0
  150. package/dist/pay/recover.d.ts +31 -0
  151. package/dist/pay/recover.js +34 -0
  152. package/dist/pay/seller.d.ts +130 -0
  153. package/dist/pay/seller.js +444 -0
  154. package/dist/pay/settle.d.ts +96 -0
  155. package/dist/pay/settle.js +308 -0
  156. package/dist/pay/split.d.ts +115 -0
  157. package/dist/pay/split.js +256 -0
  158. package/dist/pay/store-node.d.ts +8 -0
  159. package/dist/pay/store-node.js +224 -0
  160. package/dist/pay/store.d.ts +54 -0
  161. package/dist/pay/store.js +135 -0
  162. package/dist/pay/x402.d.ts +95 -0
  163. package/dist/pay/x402.js +136 -0
  164. package/dist/relay/admission.d.ts +8 -0
  165. package/dist/relay/admission.js +58 -0
  166. package/dist/relay/capabilities.d.ts +36 -0
  167. package/dist/relay/capabilities.js +232 -0
  168. package/dist/relay/fees.d.ts +17 -0
  169. package/dist/relay/fees.js +105 -0
  170. package/dist/relay/index.d.ts +10 -0
  171. package/dist/relay/index.js +8 -0
  172. package/dist/relay/keeper-balance.d.ts +17 -0
  173. package/dist/relay/keeper-balance.js +46 -0
  174. package/dist/relay/keeper-runner.d.ts +114 -0
  175. package/dist/relay/keeper-runner.js +703 -0
  176. package/dist/relay/keeper.d.ts +38 -0
  177. package/dist/relay/keeper.js +73 -0
  178. package/dist/relay/ledger.d.ts +155 -0
  179. package/dist/relay/ledger.js +392 -0
  180. package/dist/relay/relay-checks.d.ts +3 -0
  181. package/dist/relay/relay-checks.js +244 -0
  182. package/dist/relay/relay-reconciliation.d.ts +15 -0
  183. package/dist/relay/relay-reconciliation.js +293 -0
  184. package/dist/relay/relay-request.d.ts +6 -0
  185. package/dist/relay/relay-request.js +139 -0
  186. package/dist/relay/relay-transactions.d.ts +23 -0
  187. package/dist/relay/relay-transactions.js +182 -0
  188. package/dist/relay/relay-types.d.ts +128 -0
  189. package/dist/relay/relay-types.js +17 -0
  190. package/dist/relay/relay.d.ts +102 -0
  191. package/dist/relay/relay.js +426 -0
  192. package/dist/relay/reservation.d.ts +29 -0
  193. package/dist/relay/reservation.js +132 -0
  194. package/dist/relay/sponsorship.d.ts +42 -0
  195. package/dist/relay/sponsorship.js +184 -0
  196. package/dist/routes.d.ts +2 -0
  197. package/dist/routes.js +1 -0
  198. package/dist/settle-near/codec.d.ts +17 -0
  199. package/dist/settle-near/codec.js +86 -0
  200. package/dist/settle-near/identity.d.ts +27 -0
  201. package/dist/settle-near/identity.js +80 -0
  202. package/dist/settle-near/purchase.d.ts +40 -0
  203. package/dist/settle-near/purchase.js +153 -0
  204. package/dist/settle-near/terms.d.ts +37 -0
  205. package/dist/settle-near/terms.js +89 -0
  206. package/dist/shops/discovery.d.ts +95 -0
  207. package/dist/shops/discovery.js +384 -0
  208. package/dist/wallet/account-only.d.ts +11 -0
  209. package/dist/wallet/account-only.js +6 -0
  210. package/dist/wallet/uncertain.d.ts +8 -0
  211. package/dist/wallet/uncertain.js +13 -0
  212. package/dist/wallet/wallet.d.ts +100 -0
  213. package/dist/wallet/wallet.js +204 -0
  214. package/package.json +135 -3
@@ -0,0 +1,116 @@
1
+ "use strict";(()=>{var CU=Object.create;var Ig=Object.defineProperty;var OU=Object.getOwnPropertyDescriptor;var kU=Object.getOwnPropertyNames;var MU=Object.getPrototypeOf,$U=Object.prototype.hasOwnProperty;var U=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var ee=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},hE=(t,e)=>{for(var r in e)Ig(t,r,{get:e[r],enumerable:!0})},NU=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of kU(e))!$U.call(t,o)&&o!==r&&Ig(t,o,{get:()=>e[o],enumerable:!(n=OU(e,o))||n.enumerable});return t};var cn=(t,e,r)=>(r=t!=null?CU(MU(t)):{},NU(e||!t||!t.__esModule?Ig(r,"default",{value:t,enumerable:!0}):r,t));var mE=ee((_g,Bg)=>{(function(t,e){typeof _g=="object"&&typeof Bg<"u"?Bg.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.Mustache=e())})(_g,(function(){"use strict";var t=Object.prototype.toString,e=Array.isArray||function(l){return t.call(l)==="[object Array]"};function r(v){return typeof v=="function"}function n(v){return e(v)?"array":typeof v}function o(v){return v.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(v,l){return v!=null&&typeof v=="object"&&l in v}function a(v,l){return v!=null&&typeof v!="object"&&v.hasOwnProperty&&v.hasOwnProperty(l)}var s=RegExp.prototype.test;function c(v,l){return s.call(v,l)}var f=/\S/;function u(v){return!c(f,v)}var d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function m(v){return String(v).replace(/[&<>"'`=\/]/g,function(h){return d[h]})}var b=/\s*/,w=/\s+/,T=/\s*=/,P=/\s*\}/,R=/#|\^|\/|>|\{|&|=|!/;function k(v,l){if(!v)return[];var h=!1,y=[],g=[],x=[],E=!1,S=!1,A="",p=0;function I(){if(E&&!S)for(;x.length;)delete g[x.pop()];else x=[];E=!1,S=!1}var C,L,j;function D(te){if(typeof te=="string"&&(te=te.split(w,2)),!e(te)||te.length!==2)throw new Error("Invalid tags: "+te);C=new RegExp(o(te[0])+"\\s*"),L=new RegExp("\\s*"+o(te[1])),j=new RegExp("\\s*"+o("}"+te[1]))}D(l||M.tags);for(var z=new $(v),W,G,K,Y,X,Z;!z.eos();){if(W=z.pos,K=z.scanUntil(C),K)for(var J=0,ie=K.length;J<ie;++J)Y=K.charAt(J),u(Y)?(x.push(g.length),A+=Y):(S=!0,h=!0,A+=" "),g.push(["text",Y,W,W+1]),W+=1,Y===`
2
+ `&&(I(),A="",p=0,h=!1);if(!z.scan(C))break;if(E=!0,G=z.scan(R)||"name",z.scan(b),G==="="?(K=z.scanUntil(T),z.scan(T),z.scanUntil(L)):G==="{"?(K=z.scanUntil(j),z.scan(P),z.scanUntil(L),G="&"):K=z.scanUntil(L),!z.scan(L))throw new Error("Unclosed tag at "+z.pos);if(G==">"?X=[G,K,W,z.pos,A,p,h]:X=[G,K,W,z.pos],p++,g.push(X),G==="#"||G==="^")y.push(X);else if(G==="/"){if(Z=y.pop(),!Z)throw new Error('Unopened section "'+K+'" at '+W);if(Z[1]!==K)throw new Error('Unclosed section "'+Z[1]+'" at '+W)}else G==="name"||G==="{"||G==="&"?S=!0:G==="="&&D(K)}if(I(),Z=y.pop(),Z)throw new Error('Unclosed section "'+Z[1]+'" at '+z.pos);return O(_(g))}function _(v){for(var l=[],h,y,g=0,x=v.length;g<x;++g)h=v[g],h&&(h[0]==="text"&&y&&y[0]==="text"?(y[1]+=h[1],y[3]=h[3]):(l.push(h),y=h));return l}function O(v){for(var l=[],h=l,y=[],g,x,E=0,S=v.length;E<S;++E)switch(g=v[E],g[0]){case"#":case"^":h.push(g),y.push(g),h=g[4]=[];break;case"/":x=y.pop(),x[5]=g[2],h=y.length>0?y[y.length-1][4]:l;break;default:h.push(g)}return l}function $(v){this.string=v,this.tail=v,this.pos=0}$.prototype.eos=function(){return this.tail===""},$.prototype.scan=function(l){var h=this.tail.match(l);if(!h||h.index!==0)return"";var y=h[0];return this.tail=this.tail.substring(y.length),this.pos+=y.length,y},$.prototype.scanUntil=function(l){var h=this.tail.search(l),y;switch(h){case-1:y=this.tail,this.tail="";break;case 0:y="";break;default:y=this.tail.substring(0,h),this.tail=this.tail.substring(h)}return this.pos+=y.length,y};function B(v,l){this.view=v,this.cache={".":this.view},this.parent=l}B.prototype.push=function(l){return new B(l,this)},B.prototype.lookup=function(l){var h=this.cache,y;if(h.hasOwnProperty(l))y=h[l];else{for(var g=this,x,E,S,A=!1;g;){if(l.indexOf(".")>0)for(x=g.view,E=l.split("."),S=0;x!=null&&S<E.length;)S===E.length-1&&(A=i(x,E[S])||a(x,E[S])),x=x[E[S++]];else x=g.view[l],A=i(g.view,l);if(A){y=x;break}g=g.parent}h[l]=y}return r(y)&&(y=y.call(this.view)),y};function N(){this.templateCache={_cache:{},set:function(l,h){this._cache[l]=h},get:function(l){return this._cache[l]},clear:function(){this._cache={}}}}N.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},N.prototype.parse=function(l,h){var y=this.templateCache,g=l+":"+(h||M.tags).join(":"),x=typeof y<"u",E=x?y.get(g):void 0;return E==null&&(E=k(l,h),x&&y.set(g,E)),E},N.prototype.render=function(l,h,y,g){var x=this.parse(l,g),E=h instanceof B?h:new B(h,void 0);return this.renderTokens(x,E,y,l,g)},N.prototype.renderTokens=function(l,h,y,g,x){for(var E="",S,A,p,I=0,C=l.length;I<C;++I)p=void 0,S=l[I],A=S[0],A==="#"?p=this.renderSection(S,h,y,g):A==="^"?p=this.renderInverted(S,h,y,g):A===">"?p=this.renderPartial(S,h,y,x):A==="&"?p=this.unescapedValue(S,h):A==="name"?p=this.escapedValue(S,h):A==="text"&&(p=this.rawValue(S)),p!==void 0&&(E+=p);return E},N.prototype.renderSection=function(l,h,y,g){var x=this,E="",S=h.lookup(l[1]);function A(C){return x.render(C,h,y)}if(S){if(e(S))for(var p=0,I=S.length;p<I;++p)E+=this.renderTokens(l[4],h.push(S[p]),y,g);else if(typeof S=="object"||typeof S=="string"||typeof S=="number")E+=this.renderTokens(l[4],h.push(S),y,g);else if(r(S)){if(typeof g!="string")throw new Error("Cannot use higher-order sections without the original template");S=S.call(h.view,g.slice(l[3],l[5]),A),S!=null&&(E+=S)}else E+=this.renderTokens(l[4],h,y,g);return E}},N.prototype.renderInverted=function(l,h,y,g){var x=h.lookup(l[1]);if(!x||e(x)&&x.length===0)return this.renderTokens(l[4],h,y,g)},N.prototype.indentPartial=function(l,h,y){for(var g=h.replace(/[^ \t]/g,""),x=l.split(`
3
+ `),E=0;E<x.length;E++)x[E].length&&(E>0||!y)&&(x[E]=g+x[E]);return x.join(`
4
+ `)},N.prototype.renderPartial=function(l,h,y,g){if(y){var x=r(y)?y(l[1]):y[l[1]];if(x!=null){var E=l[6],S=l[5],A=l[4],p=x;return S==0&&A&&(p=this.indentPartial(x,A,E)),this.renderTokens(this.parse(p,g),h,y,p)}}},N.prototype.unescapedValue=function(l,h){var y=h.lookup(l[1]);if(y!=null)return y},N.prototype.escapedValue=function(l,h){var y=h.lookup(l[1]);if(y!=null)return M.escape(y)},N.prototype.rawValue=function(l){return l[1]};var M={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(v){F.templateCache=v},get templateCache(){return F.templateCache}},F=new N;return M.clearCache=function(){return F.clearCache()},M.parse=function(l,h){return F.parse(l,h)},M.render=function(l,h,y,g){if(typeof l!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+n(l)+'" was given as the first argument for mustache#render(template, view, partials)');return F.render(l,h,y,g)},M.escape=m,M.Scanner=$,M.Context=B,M.Writer=N,M}))});function LU(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function yE(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(r=>typeof r=="string"):e.every(r=>Number.isSafeInteger(r)):!1}function Rg(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function gE(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Pg(t){if(!Array.isArray(t))throw new Error("array expected")}function vE(t,e){if(!yE(!0,e))throw new Error(`${t}: array of strings expected`)}function UU(t,e){if(!yE(!1,e))throw new Error(`${t}: array of numbers expected`)}function jU(...t){let e=i=>i,r=(i,a)=>s=>i(a(s)),n=t.map(i=>i.encode).reduceRight(r,e),o=t.map(i=>i.decode).reduce(r,e);return{encode:n,decode:o}}function DU(t){let e=typeof t=="string"?t.split(""):t,r=e.length;vE("alphabet",e);let n=new Map(e.map((o,i)=>[o,i]));return{encode:o=>(Pg(o),o.map(i=>{if(!Number.isSafeInteger(i)||i<0||i>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${t}`);return e[i]})),decode:o=>(Pg(o),o.map(i=>{Rg("alphabet.decode",i);let a=n.get(i);if(a===void 0)throw new Error(`Unknown letter: "${i}". Allowed: ${t}`);return a}))}}function zU(t=""){return Rg("join",t),{encode:e=>(vE("join.decode",e),e.join(t)),decode:e=>(Rg("join.decode",e),e.split(t))}}function bE(t,e,r){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Pg(t),!t.length)return[];let n=0,o=[],i=Array.from(t,s=>{if(gE(s),s<0||s>=e)throw new Error(`invalid integer: ${s}`);return s}),a=i.length;for(;;){let s=0,c=!0;for(let f=n;f<a;f++){let u=i[f],d=e*s,m=d+u;if(!Number.isSafeInteger(m)||d/e!==s||m-u!==d)throw new Error("convertRadix: carry overflow");let b=m/r;s=m%r;let w=Math.floor(b);if(i[f]=w,!Number.isSafeInteger(w)||w*r+s!==m)throw new Error("convertRadix: carry overflow");if(c)w?c=!1:n=f;else continue}if(o.push(s),c)break}for(let s=0;s<t.length-1&&t[s]===0;s++)o.push(0);return o.reverse()}function qU(t){gE(t);let e=2**8;return{encode:r=>{if(!LU(r))throw new Error("radix.encode input should be Uint8Array");return bE(Array.from(r),e,t)},decode:r=>(UU("radix.decode",r),Uint8Array.from(bE(r,t,e)))}}var HU,Cg,xE=U(()=>{HU=t=>jU(qU(58),DU(t),zU("")),Cg=HU("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")});var Qu=ee((zye,wE)=>{"use strict";wE.exports=WU;function WU(t){if(!t)throw new TypeError("argument namespace is required");function e(r){}return e._file=void 0,e._ignored=!0,e._namespace=t,e._traced=!1,e._warned=Object.create(null),e.function=KU,e.property=GU,e}function KU(t,e){if(typeof t!="function")throw new TypeError("argument fn must be a function");return t}function GU(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(t,e);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable")}});var za,m9=U(()=>{za=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function UD(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function qa(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Kn(t,...e){if(!UD(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function b9(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");qa(t.outputLen),qa(t.blockLen)}function ko(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function mp(t,e){Kn(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function y9(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Gn(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function bp(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function pn(t,e){return t<<32-e|t>>>e}function DD(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function zD(t){for(let e=0;e<t.length;e++)t[e]=DD(t[e]);return t}function qD(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Ha(t){return typeof t=="string"&&(t=qD(t)),Kn(t),t}function g9(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];Kn(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}function yp(t){let e=n=>t().update(Ha(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Ri(t=32){if(za&&typeof za.getRandomValues=="function")return za.getRandomValues(new Uint8Array(t));if(za&&typeof za.randomBytes=="function")return Uint8Array.from(za.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}var jD,fv,Bi,Vn=U(()=>{m9();jD=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;fv=jD?t=>t:zD;Bi=class{}});var x9=ee((ive,v9)=>{var fe={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function jr(t,e){if(!t)throw new Error(e)}function ce(t,e,r){if(jr(e instanceof Uint8Array,`Expected ${t} to be an Uint8Array`),r!==void 0)if(Array.isArray(r)){let n=r.join(", "),o=`Expected ${t} to be an Uint8Array with length [${n}]`;jr(r.includes(e.length),o)}else{let n=`Expected ${t} to be an Uint8Array with length ${r}`;jr(e.length===r,n)}}function Wa(t){jr(cc(t)==="Boolean","Expected compressed to be a Boolean")}function hn(t=r=>new Uint8Array(r),e){return typeof t=="function"&&(t=t(e)),ce("output",t,e),t}function cc(t){return Object.prototype.toString.call(t).slice(8,-1)}v9.exports=t=>({contextRandomize(e){if(jr(e===null||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),e!==null&&ce("seed",e,32),t.contextRandomize(e)===1)throw new Error(fe.CONTEXT_RANDOMIZE_UNKNOW)},privateKeyVerify(e){return ce("private key",e,32),t.privateKeyVerify(e)===0},privateKeyNegate(e){switch(ce("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(fe.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(e,r){switch(ce("private key",e,32),ce("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(fe.TWEAK_ADD)}},privateKeyTweakMul(e,r){switch(ce("private key",e,32),ce("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(fe.TWEAK_MUL)}},publicKeyVerify(e){return ce("public key",e,[33,65]),t.publicKeyVerify(e)===0},publicKeyCreate(e,r=!0,n){switch(ce("private key",e,32),Wa(r),n=hn(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(fe.SECKEY_INVALID);case 2:throw new Error(fe.PUBKEY_SERIALIZE)}},publicKeyConvert(e,r=!0,n){switch(ce("public key",e,[33,65]),Wa(r),n=hn(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(fe.PUBKEY_PARSE);case 2:throw new Error(fe.PUBKEY_SERIALIZE)}},publicKeyNegate(e,r=!0,n){switch(ce("public key",e,[33,65]),Wa(r),n=hn(n,r?33:65),t.publicKeyNegate(n,e)){case 0:return n;case 1:throw new Error(fe.PUBKEY_PARSE);case 2:throw new Error(fe.IMPOSSIBLE_CASE);case 3:throw new Error(fe.PUBKEY_SERIALIZE)}},publicKeyCombine(e,r=!0,n){jr(Array.isArray(e),"Expected public keys to be an Array"),jr(e.length>0,"Expected public keys array will have more than zero items");for(let o of e)ce("public key",o,[33,65]);switch(Wa(r),n=hn(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(fe.PUBKEY_PARSE);case 2:throw new Error(fe.PUBKEY_COMBINE);case 3:throw new Error(fe.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(e,r,n=!0,o){switch(ce("public key",e,[33,65]),ce("tweak",r,32),Wa(n),o=hn(o,n?33:65),t.publicKeyTweakAdd(o,e,r)){case 0:return o;case 1:throw new Error(fe.PUBKEY_PARSE);case 2:throw new Error(fe.TWEAK_ADD)}},publicKeyTweakMul(e,r,n=!0,o){switch(ce("public key",e,[33,65]),ce("tweak",r,32),Wa(n),o=hn(o,n?33:65),t.publicKeyTweakMul(o,e,r)){case 0:return o;case 1:throw new Error(fe.PUBKEY_PARSE);case 2:throw new Error(fe.TWEAK_MUL)}},signatureNormalize(e){switch(ce("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(fe.SIG_PARSE)}},signatureExport(e,r){ce("signature",e,64),r=hn(r,72);let n={output:r,outputlen:72};switch(t.signatureExport(n,e)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(fe.SIG_PARSE);case 2:throw new Error(fe.IMPOSSIBLE_CASE)}},signatureImport(e,r){switch(ce("signature",e),r=hn(r,64),t.signatureImport(r,e)){case 0:return r;case 1:throw new Error(fe.SIG_PARSE);case 2:throw new Error(fe.IMPOSSIBLE_CASE)}},ecdsaSign(e,r,n={},o){ce("message",e,32),ce("private key",r,32),jr(cc(n)==="Object","Expected options to be an Object"),n.data!==void 0&&ce("options.data",n.data),n.noncefn!==void 0&&jr(cc(n.noncefn)==="Function","Expected options.noncefn to be a Function"),o=hn(o,64);let i={signature:o,recid:null};switch(t.ecdsaSign(i,e,r,n.data,n.noncefn)){case 0:return i;case 1:throw new Error(fe.SIGN);case 2:throw new Error(fe.IMPOSSIBLE_CASE)}},ecdsaVerify(e,r,n){switch(ce("signature",e,64),ce("message",r,32),ce("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(fe.SIG_PARSE);case 2:throw new Error(fe.PUBKEY_PARSE)}},ecdsaRecover(e,r,n,o=!0,i){switch(ce("signature",e,64),jr(cc(r)==="Number"&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),ce("message",n,32),Wa(o),i=hn(i,o?33:65),t.ecdsaRecover(i,e,r,n)){case 0:return i;case 1:throw new Error(fe.SIG_PARSE);case 2:throw new Error(fe.RECOVER);case 3:throw new Error(fe.IMPOSSIBLE_CASE)}},ecdh(e,r,n={},o){switch(ce("public key",e,[33,65]),ce("private key",r,32),jr(cc(n)==="Object","Expected options to be an Object"),n.data!==void 0&&ce("options.data",n.data),n.hashfn!==void 0?(jr(cc(n.hashfn)==="Function","Expected options.hashfn to be a Function"),n.xbuf!==void 0&&ce("options.xbuf",n.xbuf,32),n.ybuf!==void 0&&ce("options.ybuf",n.ybuf,32),ce("output",o)):o=hn(o,32),t.ecdh(o,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return o;case 1:throw new Error(fe.PUBKEY_PARSE);case 2:throw new Error(fe.ECDH)}}})});var w9=ee((ave,HD)=>{HD.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var E9=ee(()=>{});var Yn=ee((A9,uv)=>{(function(t,e){"use strict";function r(v,l){if(!v)throw new Error(l||"Assertion failed")}function n(v,l){v.super_=l;var h=function(){};h.prototype=l.prototype,v.prototype=new h,v.prototype.constructor=v}function o(v,l,h){if(o.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((l==="le"||l==="be")&&(h=l,l=10),this._init(v||0,l||10,h||"be"))}typeof t=="object"?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;var i;try{typeof window<"u"&&typeof window.Buffer<"u"?i=window.Buffer:i=E9().Buffer}catch{}o.isBN=function(l){return l instanceof o?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===o.wordSize&&Array.isArray(l.words)},o.max=function(l,h){return l.cmp(h)>0?l:h},o.min=function(l,h){return l.cmp(h)<0?l:h},o.prototype._init=function(l,h,y){if(typeof l=="number")return this._initNumber(l,h,y);if(typeof l=="object")return this._initArray(l,h,y);h==="hex"&&(h=16),r(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var g=0;l[0]==="-"&&(g++,this.negative=1),g<l.length&&(h===16?this._parseHex(l,g,y):(this._parseBase(l,h,g),y==="le"&&this._initArray(this.toArray(),h,y)))},o.prototype._initNumber=function(l,h,y){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(r(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),h,y)},o.prototype._initArray=function(l,h,y){if(r(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var x,E,S=0;if(y==="be")for(g=l.length-1,x=0;g>=0;g-=3)E=l[g]|l[g-1]<<8|l[g-2]<<16,this.words[x]|=E<<S&67108863,this.words[x+1]=E>>>26-S&67108863,S+=24,S>=26&&(S-=26,x++);else if(y==="le")for(g=0,x=0;g<l.length;g+=3)E=l[g]|l[g+1]<<8|l[g+2]<<16,this.words[x]|=E<<S&67108863,this.words[x+1]=E>>>26-S&67108863,S+=24,S>=26&&(S-=26,x++);return this.strip()};function a(v,l){var h=v.charCodeAt(l);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function s(v,l,h){var y=a(v,h);return h-1>=l&&(y|=a(v,h-1)<<4),y}o.prototype._parseHex=function(l,h,y){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var x=0,E=0,S;if(y==="be")for(g=l.length-1;g>=h;g-=2)S=s(l,h,g)<<x,this.words[E]|=S&67108863,x>=18?(x-=18,E+=1,this.words[E]|=S>>>26):x+=8;else{var A=l.length-h;for(g=A%2===0?h+1:h;g<l.length;g+=2)S=s(l,h,g)<<x,this.words[E]|=S&67108863,x>=18?(x-=18,E+=1,this.words[E]|=S>>>26):x+=8}this.strip()};function c(v,l,h,y){for(var g=0,x=Math.min(v.length,h),E=l;E<x;E++){var S=v.charCodeAt(E)-48;g*=y,S>=49?g+=S-49+10:S>=17?g+=S-17+10:g+=S}return g}o.prototype._parseBase=function(l,h,y){this.words=[0],this.length=1;for(var g=0,x=1;x<=67108863;x*=h)g++;g--,x=x/h|0;for(var E=l.length-y,S=E%g,A=Math.min(E,E-S)+y,p=0,I=y;I<A;I+=g)p=c(l,I,I+g,h),this.imuln(x),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(S!==0){var C=1;for(p=c(l,I,l.length,h),I=0;I<S;I++)C*=h;this.imuln(C),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(l){l.words=new Array(this.length);for(var h=0;h<this.length;h++)l.words[h]=this.words[h];l.length=this.length,l.negative=this.negative,l.red=this.red},o.prototype.clone=function(){var l=new o(null);return this.copy(l),l},o.prototype._expand=function(l){for(;this.length<l;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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"],u=[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];o.prototype.toString=function(l,h){l=l||10,h=h|0||1;var y;if(l===16||l==="hex"){y="";for(var g=0,x=0,E=0;E<this.length;E++){var S=this.words[E],A=((S<<g|x)&16777215).toString(16);x=S>>>24-g&16777215,g+=2,g>=26&&(g-=26,E--),x!==0||E!==this.length-1?y=f[6-A.length]+A+y:y=A+y}for(x!==0&&(y=x.toString(16)+y);y.length%h!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(l===(l|0)&&l>=2&&l<=36){var p=u[l],I=d[l];y="";var C=this.clone();for(C.negative=0;!C.isZero();){var L=C.modn(I).toString(l);C=C.idivn(I),C.isZero()?y=L+y:y=f[p-L.length]+L+y}for(this.isZero()&&(y="0"+y);y.length%h!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(l,h){return r(typeof i<"u"),this.toArrayLike(i,l,h)},o.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)},o.prototype.toArrayLike=function(l,h,y){var g=this.byteLength(),x=y||Math.max(1,g);r(g<=x,"byte array longer than desired length"),r(x>0,"Requested array length <= 0"),this.strip();var E=h==="le",S=new l(x),A,p,I=this.clone();if(E){for(p=0;!I.isZero();p++)A=I.andln(255),I.iushrn(8),S[p]=A;for(;p<x;p++)S[p]=0}else{for(p=0;p<x-g;p++)S[p]=0;for(p=0;!I.isZero();p++)A=I.andln(255),I.iushrn(8),S[x-p-1]=A}return S},Math.clz32?o.prototype._countBits=function(l){return 32-Math.clz32(l)}:o.prototype._countBits=function(l){var h=l,y=0;return h>=4096&&(y+=13,h>>>=13),h>=64&&(y+=7,h>>>=7),h>=8&&(y+=4,h>>>=4),h>=2&&(y+=2,h>>>=2),y+h},o.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,y=0;return(h&8191)===0&&(y+=13,h>>>=13),(h&127)===0&&(y+=7,h>>>=7),(h&15)===0&&(y+=4,h>>>=4),(h&3)===0&&(y+=2,h>>>=2),(h&1)===0&&y++,y},o.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function m(v){for(var l=new Array(v.bitLength()),h=0;h<l.length;h++){var y=h/26|0,g=h%26;l[h]=(v.words[y]&1<<g)>>>g}return l}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;h<this.length;h++){var y=this._zeroBits(this.words[h]);if(l+=y,y!==26)break}return l},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},o.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]|l.words[h];return this.strip()},o.prototype.ior=function(l){return r((this.negative|l.negative)===0),this.iuor(l)},o.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},o.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},o.prototype.iuand=function(l){var h;this.length>l.length?h=l:h=this;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]&l.words[y];return this.length=h.length,this.strip()},o.prototype.iand=function(l){return r((this.negative|l.negative)===0),this.iuand(l)},o.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},o.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},o.prototype.iuxor=function(l){var h,y;this.length>l.length?(h=this,y=l):(h=l,y=this);for(var g=0;g<y.length;g++)this.words[g]=h.words[g]^y.words[g];if(this!==h)for(;g<h.length;g++)this.words[g]=h.words[g];return this.length=h.length,this.strip()},o.prototype.ixor=function(l){return r((this.negative|l.negative)===0),this.iuxor(l)},o.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},o.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},o.prototype.inotn=function(l){r(typeof l=="number"&&l>=0);var h=Math.ceil(l/26)|0,y=l%26;this._expand(h),y>0&&h--;for(var g=0;g<h;g++)this.words[g]=~this.words[g]&67108863;for(y>0&&(this.words[g]=~this.words[g]&67108863>>26-y,g++);g<this.length;g++)this.words[g]=0;return this.strip()},o.prototype.notn=function(l){return this.clone().inotn(l)},o.prototype.setn=function(l,h){r(typeof l=="number"&&l>=0);var y=l/26|0,g=l%26;return this._expand(y+1),h?this.words[y]=this.words[y]|1<<g:this.words[y]=this.words[y]&~(1<<g),this.strip()},o.prototype.iadd=function(l){var h;if(this.negative!==0&&l.negative===0)return this.negative=0,h=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,h=this.isub(l),l.negative=1,h._normSign();var y,g;this.length>l.length?(y=this,g=l):(y=l,g=this);for(var x=0,E=0;E<g.length;E++)h=(y.words[E]|0)+(g.words[E]|0)+x,this.words[E]=h&67108863,x=h>>>26;for(;x!==0&&E<y.length;E++)h=(y.words[E]|0)+x,this.words[E]=h&67108863,x=h>>>26;if(this.length=y.length,x!==0)this.words[this.length]=x,this.length++;else if(y!==this)for(;E<y.length;E++)this.words[E]=y.words[E];return this},o.prototype.add=function(l){var h;return l.negative!==0&&this.negative===0?(l.negative=0,h=this.sub(l),l.negative^=1,h):l.negative===0&&this.negative!==0?(this.negative=0,h=l.sub(this),this.negative=1,h):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},o.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var y=this.cmp(l);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,x;y>0?(g=this,x=l):(g=l,x=this);for(var E=0,S=0;S<x.length;S++)h=(g.words[S]|0)-(x.words[S]|0)+E,E=h>>26,this.words[S]=h&67108863;for(;E!==0&&S<g.length;S++)h=(g.words[S]|0)+E,E=h>>26,this.words[S]=h&67108863;if(E===0&&S<g.length&&g!==this)for(;S<g.length;S++)this.words[S]=g.words[S];return this.length=Math.max(this.length,S),g!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(l){return this.clone().isub(l)};function b(v,l,h){h.negative=l.negative^v.negative;var y=v.length+l.length|0;h.length=y,y=y-1|0;var g=v.words[0]|0,x=l.words[0]|0,E=g*x,S=E&67108863,A=E/67108864|0;h.words[0]=S;for(var p=1;p<y;p++){for(var I=A>>>26,C=A&67108863,L=Math.min(p,l.length-1),j=Math.max(0,p-v.length+1);j<=L;j++){var D=p-j|0;g=v.words[D]|0,x=l.words[j]|0,E=g*x+C,I+=E/67108864|0,C=E&67108863}h.words[p]=C|0,A=I|0}return A!==0?h.words[p]=A|0:h.length--,h.strip()}var w=function(l,h,y){var g=l.words,x=h.words,E=y.words,S=0,A,p,I,C=g[0]|0,L=C&8191,j=C>>>13,D=g[1]|0,z=D&8191,W=D>>>13,G=g[2]|0,K=G&8191,Y=G>>>13,X=g[3]|0,Z=X&8191,J=X>>>13,ie=g[4]|0,te=ie&8191,Q=ie>>>13,be=g[5]|0,Ae=be&8191,_e=be>>>13,qn=g[6]|0,Be=qn&8191,Re=qn>>>13,vi=g[7]|0,ke=vi&8191,Me=vi>>>13,Xu=g[8]|0,$e=Xu&8191,Ne=Xu>>>13,L0=g[9]|0,Ue=L0&8191,je=L0>>>13,U0=x[0]|0,Ze=U0&8191,Je=U0>>>13,iE=x[1]|0,Xe=iE&8191,Qe=iE>>>13,aE=x[2]|0,et=aE&8191,tt=aE>>>13,sE=x[3]|0,rt=sE&8191,nt=sE>>>13,cE=x[4]|0,ot=cE&8191,it=cE>>>13,fE=x[5]|0,at=fE&8191,st=fE>>>13,uE=x[6]|0,ct=uE&8191,ft=uE>>>13,dE=x[7]|0,ut=dE&8191,dt=dE>>>13,lE=x[8]|0,lt=lE&8191,pt=lE>>>13,pE=x[9]|0,ht=pE&8191,mt=pE>>>13;y.negative=l.negative^h.negative,y.length=19,A=Math.imul(L,Ze),p=Math.imul(L,Je),p=p+Math.imul(j,Ze)|0,I=Math.imul(j,Je);var ag=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(ag>>>26)|0,ag&=67108863,A=Math.imul(z,Ze),p=Math.imul(z,Je),p=p+Math.imul(W,Ze)|0,I=Math.imul(W,Je),A=A+Math.imul(L,Xe)|0,p=p+Math.imul(L,Qe)|0,p=p+Math.imul(j,Xe)|0,I=I+Math.imul(j,Qe)|0;var sg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(sg>>>26)|0,sg&=67108863,A=Math.imul(K,Ze),p=Math.imul(K,Je),p=p+Math.imul(Y,Ze)|0,I=Math.imul(Y,Je),A=A+Math.imul(z,Xe)|0,p=p+Math.imul(z,Qe)|0,p=p+Math.imul(W,Xe)|0,I=I+Math.imul(W,Qe)|0,A=A+Math.imul(L,et)|0,p=p+Math.imul(L,tt)|0,p=p+Math.imul(j,et)|0,I=I+Math.imul(j,tt)|0;var cg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(cg>>>26)|0,cg&=67108863,A=Math.imul(Z,Ze),p=Math.imul(Z,Je),p=p+Math.imul(J,Ze)|0,I=Math.imul(J,Je),A=A+Math.imul(K,Xe)|0,p=p+Math.imul(K,Qe)|0,p=p+Math.imul(Y,Xe)|0,I=I+Math.imul(Y,Qe)|0,A=A+Math.imul(z,et)|0,p=p+Math.imul(z,tt)|0,p=p+Math.imul(W,et)|0,I=I+Math.imul(W,tt)|0,A=A+Math.imul(L,rt)|0,p=p+Math.imul(L,nt)|0,p=p+Math.imul(j,rt)|0,I=I+Math.imul(j,nt)|0;var fg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(fg>>>26)|0,fg&=67108863,A=Math.imul(te,Ze),p=Math.imul(te,Je),p=p+Math.imul(Q,Ze)|0,I=Math.imul(Q,Je),A=A+Math.imul(Z,Xe)|0,p=p+Math.imul(Z,Qe)|0,p=p+Math.imul(J,Xe)|0,I=I+Math.imul(J,Qe)|0,A=A+Math.imul(K,et)|0,p=p+Math.imul(K,tt)|0,p=p+Math.imul(Y,et)|0,I=I+Math.imul(Y,tt)|0,A=A+Math.imul(z,rt)|0,p=p+Math.imul(z,nt)|0,p=p+Math.imul(W,rt)|0,I=I+Math.imul(W,nt)|0,A=A+Math.imul(L,ot)|0,p=p+Math.imul(L,it)|0,p=p+Math.imul(j,ot)|0,I=I+Math.imul(j,it)|0;var ug=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(ug>>>26)|0,ug&=67108863,A=Math.imul(Ae,Ze),p=Math.imul(Ae,Je),p=p+Math.imul(_e,Ze)|0,I=Math.imul(_e,Je),A=A+Math.imul(te,Xe)|0,p=p+Math.imul(te,Qe)|0,p=p+Math.imul(Q,Xe)|0,I=I+Math.imul(Q,Qe)|0,A=A+Math.imul(Z,et)|0,p=p+Math.imul(Z,tt)|0,p=p+Math.imul(J,et)|0,I=I+Math.imul(J,tt)|0,A=A+Math.imul(K,rt)|0,p=p+Math.imul(K,nt)|0,p=p+Math.imul(Y,rt)|0,I=I+Math.imul(Y,nt)|0,A=A+Math.imul(z,ot)|0,p=p+Math.imul(z,it)|0,p=p+Math.imul(W,ot)|0,I=I+Math.imul(W,it)|0,A=A+Math.imul(L,at)|0,p=p+Math.imul(L,st)|0,p=p+Math.imul(j,at)|0,I=I+Math.imul(j,st)|0;var dg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(dg>>>26)|0,dg&=67108863,A=Math.imul(Be,Ze),p=Math.imul(Be,Je),p=p+Math.imul(Re,Ze)|0,I=Math.imul(Re,Je),A=A+Math.imul(Ae,Xe)|0,p=p+Math.imul(Ae,Qe)|0,p=p+Math.imul(_e,Xe)|0,I=I+Math.imul(_e,Qe)|0,A=A+Math.imul(te,et)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(Q,et)|0,I=I+Math.imul(Q,tt)|0,A=A+Math.imul(Z,rt)|0,p=p+Math.imul(Z,nt)|0,p=p+Math.imul(J,rt)|0,I=I+Math.imul(J,nt)|0,A=A+Math.imul(K,ot)|0,p=p+Math.imul(K,it)|0,p=p+Math.imul(Y,ot)|0,I=I+Math.imul(Y,it)|0,A=A+Math.imul(z,at)|0,p=p+Math.imul(z,st)|0,p=p+Math.imul(W,at)|0,I=I+Math.imul(W,st)|0,A=A+Math.imul(L,ct)|0,p=p+Math.imul(L,ft)|0,p=p+Math.imul(j,ct)|0,I=I+Math.imul(j,ft)|0;var lg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(lg>>>26)|0,lg&=67108863,A=Math.imul(ke,Ze),p=Math.imul(ke,Je),p=p+Math.imul(Me,Ze)|0,I=Math.imul(Me,Je),A=A+Math.imul(Be,Xe)|0,p=p+Math.imul(Be,Qe)|0,p=p+Math.imul(Re,Xe)|0,I=I+Math.imul(Re,Qe)|0,A=A+Math.imul(Ae,et)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(_e,et)|0,I=I+Math.imul(_e,tt)|0,A=A+Math.imul(te,rt)|0,p=p+Math.imul(te,nt)|0,p=p+Math.imul(Q,rt)|0,I=I+Math.imul(Q,nt)|0,A=A+Math.imul(Z,ot)|0,p=p+Math.imul(Z,it)|0,p=p+Math.imul(J,ot)|0,I=I+Math.imul(J,it)|0,A=A+Math.imul(K,at)|0,p=p+Math.imul(K,st)|0,p=p+Math.imul(Y,at)|0,I=I+Math.imul(Y,st)|0,A=A+Math.imul(z,ct)|0,p=p+Math.imul(z,ft)|0,p=p+Math.imul(W,ct)|0,I=I+Math.imul(W,ft)|0,A=A+Math.imul(L,ut)|0,p=p+Math.imul(L,dt)|0,p=p+Math.imul(j,ut)|0,I=I+Math.imul(j,dt)|0;var pg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(pg>>>26)|0,pg&=67108863,A=Math.imul($e,Ze),p=Math.imul($e,Je),p=p+Math.imul(Ne,Ze)|0,I=Math.imul(Ne,Je),A=A+Math.imul(ke,Xe)|0,p=p+Math.imul(ke,Qe)|0,p=p+Math.imul(Me,Xe)|0,I=I+Math.imul(Me,Qe)|0,A=A+Math.imul(Be,et)|0,p=p+Math.imul(Be,tt)|0,p=p+Math.imul(Re,et)|0,I=I+Math.imul(Re,tt)|0,A=A+Math.imul(Ae,rt)|0,p=p+Math.imul(Ae,nt)|0,p=p+Math.imul(_e,rt)|0,I=I+Math.imul(_e,nt)|0,A=A+Math.imul(te,ot)|0,p=p+Math.imul(te,it)|0,p=p+Math.imul(Q,ot)|0,I=I+Math.imul(Q,it)|0,A=A+Math.imul(Z,at)|0,p=p+Math.imul(Z,st)|0,p=p+Math.imul(J,at)|0,I=I+Math.imul(J,st)|0,A=A+Math.imul(K,ct)|0,p=p+Math.imul(K,ft)|0,p=p+Math.imul(Y,ct)|0,I=I+Math.imul(Y,ft)|0,A=A+Math.imul(z,ut)|0,p=p+Math.imul(z,dt)|0,p=p+Math.imul(W,ut)|0,I=I+Math.imul(W,dt)|0,A=A+Math.imul(L,lt)|0,p=p+Math.imul(L,pt)|0,p=p+Math.imul(j,lt)|0,I=I+Math.imul(j,pt)|0;var hg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(hg>>>26)|0,hg&=67108863,A=Math.imul(Ue,Ze),p=Math.imul(Ue,Je),p=p+Math.imul(je,Ze)|0,I=Math.imul(je,Je),A=A+Math.imul($e,Xe)|0,p=p+Math.imul($e,Qe)|0,p=p+Math.imul(Ne,Xe)|0,I=I+Math.imul(Ne,Qe)|0,A=A+Math.imul(ke,et)|0,p=p+Math.imul(ke,tt)|0,p=p+Math.imul(Me,et)|0,I=I+Math.imul(Me,tt)|0,A=A+Math.imul(Be,rt)|0,p=p+Math.imul(Be,nt)|0,p=p+Math.imul(Re,rt)|0,I=I+Math.imul(Re,nt)|0,A=A+Math.imul(Ae,ot)|0,p=p+Math.imul(Ae,it)|0,p=p+Math.imul(_e,ot)|0,I=I+Math.imul(_e,it)|0,A=A+Math.imul(te,at)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(Q,at)|0,I=I+Math.imul(Q,st)|0,A=A+Math.imul(Z,ct)|0,p=p+Math.imul(Z,ft)|0,p=p+Math.imul(J,ct)|0,I=I+Math.imul(J,ft)|0,A=A+Math.imul(K,ut)|0,p=p+Math.imul(K,dt)|0,p=p+Math.imul(Y,ut)|0,I=I+Math.imul(Y,dt)|0,A=A+Math.imul(z,lt)|0,p=p+Math.imul(z,pt)|0,p=p+Math.imul(W,lt)|0,I=I+Math.imul(W,pt)|0,A=A+Math.imul(L,ht)|0,p=p+Math.imul(L,mt)|0,p=p+Math.imul(j,ht)|0,I=I+Math.imul(j,mt)|0;var mg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(mg>>>26)|0,mg&=67108863,A=Math.imul(Ue,Xe),p=Math.imul(Ue,Qe),p=p+Math.imul(je,Xe)|0,I=Math.imul(je,Qe),A=A+Math.imul($e,et)|0,p=p+Math.imul($e,tt)|0,p=p+Math.imul(Ne,et)|0,I=I+Math.imul(Ne,tt)|0,A=A+Math.imul(ke,rt)|0,p=p+Math.imul(ke,nt)|0,p=p+Math.imul(Me,rt)|0,I=I+Math.imul(Me,nt)|0,A=A+Math.imul(Be,ot)|0,p=p+Math.imul(Be,it)|0,p=p+Math.imul(Re,ot)|0,I=I+Math.imul(Re,it)|0,A=A+Math.imul(Ae,at)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(_e,at)|0,I=I+Math.imul(_e,st)|0,A=A+Math.imul(te,ct)|0,p=p+Math.imul(te,ft)|0,p=p+Math.imul(Q,ct)|0,I=I+Math.imul(Q,ft)|0,A=A+Math.imul(Z,ut)|0,p=p+Math.imul(Z,dt)|0,p=p+Math.imul(J,ut)|0,I=I+Math.imul(J,dt)|0,A=A+Math.imul(K,lt)|0,p=p+Math.imul(K,pt)|0,p=p+Math.imul(Y,lt)|0,I=I+Math.imul(Y,pt)|0,A=A+Math.imul(z,ht)|0,p=p+Math.imul(z,mt)|0,p=p+Math.imul(W,ht)|0,I=I+Math.imul(W,mt)|0;var bg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(bg>>>26)|0,bg&=67108863,A=Math.imul(Ue,et),p=Math.imul(Ue,tt),p=p+Math.imul(je,et)|0,I=Math.imul(je,tt),A=A+Math.imul($e,rt)|0,p=p+Math.imul($e,nt)|0,p=p+Math.imul(Ne,rt)|0,I=I+Math.imul(Ne,nt)|0,A=A+Math.imul(ke,ot)|0,p=p+Math.imul(ke,it)|0,p=p+Math.imul(Me,ot)|0,I=I+Math.imul(Me,it)|0,A=A+Math.imul(Be,at)|0,p=p+Math.imul(Be,st)|0,p=p+Math.imul(Re,at)|0,I=I+Math.imul(Re,st)|0,A=A+Math.imul(Ae,ct)|0,p=p+Math.imul(Ae,ft)|0,p=p+Math.imul(_e,ct)|0,I=I+Math.imul(_e,ft)|0,A=A+Math.imul(te,ut)|0,p=p+Math.imul(te,dt)|0,p=p+Math.imul(Q,ut)|0,I=I+Math.imul(Q,dt)|0,A=A+Math.imul(Z,lt)|0,p=p+Math.imul(Z,pt)|0,p=p+Math.imul(J,lt)|0,I=I+Math.imul(J,pt)|0,A=A+Math.imul(K,ht)|0,p=p+Math.imul(K,mt)|0,p=p+Math.imul(Y,ht)|0,I=I+Math.imul(Y,mt)|0;var yg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(yg>>>26)|0,yg&=67108863,A=Math.imul(Ue,rt),p=Math.imul(Ue,nt),p=p+Math.imul(je,rt)|0,I=Math.imul(je,nt),A=A+Math.imul($e,ot)|0,p=p+Math.imul($e,it)|0,p=p+Math.imul(Ne,ot)|0,I=I+Math.imul(Ne,it)|0,A=A+Math.imul(ke,at)|0,p=p+Math.imul(ke,st)|0,p=p+Math.imul(Me,at)|0,I=I+Math.imul(Me,st)|0,A=A+Math.imul(Be,ct)|0,p=p+Math.imul(Be,ft)|0,p=p+Math.imul(Re,ct)|0,I=I+Math.imul(Re,ft)|0,A=A+Math.imul(Ae,ut)|0,p=p+Math.imul(Ae,dt)|0,p=p+Math.imul(_e,ut)|0,I=I+Math.imul(_e,dt)|0,A=A+Math.imul(te,lt)|0,p=p+Math.imul(te,pt)|0,p=p+Math.imul(Q,lt)|0,I=I+Math.imul(Q,pt)|0,A=A+Math.imul(Z,ht)|0,p=p+Math.imul(Z,mt)|0,p=p+Math.imul(J,ht)|0,I=I+Math.imul(J,mt)|0;var gg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(gg>>>26)|0,gg&=67108863,A=Math.imul(Ue,ot),p=Math.imul(Ue,it),p=p+Math.imul(je,ot)|0,I=Math.imul(je,it),A=A+Math.imul($e,at)|0,p=p+Math.imul($e,st)|0,p=p+Math.imul(Ne,at)|0,I=I+Math.imul(Ne,st)|0,A=A+Math.imul(ke,ct)|0,p=p+Math.imul(ke,ft)|0,p=p+Math.imul(Me,ct)|0,I=I+Math.imul(Me,ft)|0,A=A+Math.imul(Be,ut)|0,p=p+Math.imul(Be,dt)|0,p=p+Math.imul(Re,ut)|0,I=I+Math.imul(Re,dt)|0,A=A+Math.imul(Ae,lt)|0,p=p+Math.imul(Ae,pt)|0,p=p+Math.imul(_e,lt)|0,I=I+Math.imul(_e,pt)|0,A=A+Math.imul(te,ht)|0,p=p+Math.imul(te,mt)|0,p=p+Math.imul(Q,ht)|0,I=I+Math.imul(Q,mt)|0;var vg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(vg>>>26)|0,vg&=67108863,A=Math.imul(Ue,at),p=Math.imul(Ue,st),p=p+Math.imul(je,at)|0,I=Math.imul(je,st),A=A+Math.imul($e,ct)|0,p=p+Math.imul($e,ft)|0,p=p+Math.imul(Ne,ct)|0,I=I+Math.imul(Ne,ft)|0,A=A+Math.imul(ke,ut)|0,p=p+Math.imul(ke,dt)|0,p=p+Math.imul(Me,ut)|0,I=I+Math.imul(Me,dt)|0,A=A+Math.imul(Be,lt)|0,p=p+Math.imul(Be,pt)|0,p=p+Math.imul(Re,lt)|0,I=I+Math.imul(Re,pt)|0,A=A+Math.imul(Ae,ht)|0,p=p+Math.imul(Ae,mt)|0,p=p+Math.imul(_e,ht)|0,I=I+Math.imul(_e,mt)|0;var xg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(xg>>>26)|0,xg&=67108863,A=Math.imul(Ue,ct),p=Math.imul(Ue,ft),p=p+Math.imul(je,ct)|0,I=Math.imul(je,ft),A=A+Math.imul($e,ut)|0,p=p+Math.imul($e,dt)|0,p=p+Math.imul(Ne,ut)|0,I=I+Math.imul(Ne,dt)|0,A=A+Math.imul(ke,lt)|0,p=p+Math.imul(ke,pt)|0,p=p+Math.imul(Me,lt)|0,I=I+Math.imul(Me,pt)|0,A=A+Math.imul(Be,ht)|0,p=p+Math.imul(Be,mt)|0,p=p+Math.imul(Re,ht)|0,I=I+Math.imul(Re,mt)|0;var wg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(wg>>>26)|0,wg&=67108863,A=Math.imul(Ue,ut),p=Math.imul(Ue,dt),p=p+Math.imul(je,ut)|0,I=Math.imul(je,dt),A=A+Math.imul($e,lt)|0,p=p+Math.imul($e,pt)|0,p=p+Math.imul(Ne,lt)|0,I=I+Math.imul(Ne,pt)|0,A=A+Math.imul(ke,ht)|0,p=p+Math.imul(ke,mt)|0,p=p+Math.imul(Me,ht)|0,I=I+Math.imul(Me,mt)|0;var Eg=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(Eg>>>26)|0,Eg&=67108863,A=Math.imul(Ue,lt),p=Math.imul(Ue,pt),p=p+Math.imul(je,lt)|0,I=Math.imul(je,pt),A=A+Math.imul($e,ht)|0,p=p+Math.imul($e,mt)|0,p=p+Math.imul(Ne,ht)|0,I=I+Math.imul(Ne,mt)|0;var Ag=(S+A|0)+((p&8191)<<13)|0;S=(I+(p>>>13)|0)+(Ag>>>26)|0,Ag&=67108863,A=Math.imul(Ue,ht),p=Math.imul(Ue,mt),p=p+Math.imul(je,ht)|0,I=Math.imul(je,mt);var Sg=(S+A|0)+((p&8191)<<13)|0;return S=(I+(p>>>13)|0)+(Sg>>>26)|0,Sg&=67108863,E[0]=ag,E[1]=sg,E[2]=cg,E[3]=fg,E[4]=ug,E[5]=dg,E[6]=lg,E[7]=pg,E[8]=hg,E[9]=mg,E[10]=bg,E[11]=yg,E[12]=gg,E[13]=vg,E[14]=xg,E[15]=wg,E[16]=Eg,E[17]=Ag,E[18]=Sg,S!==0&&(E[19]=S,y.length++),y};Math.imul||(w=b);function T(v,l,h){h.negative=l.negative^v.negative,h.length=v.length+l.length;for(var y=0,g=0,x=0;x<h.length-1;x++){var E=g;g=0;for(var S=y&67108863,A=Math.min(x,l.length-1),p=Math.max(0,x-v.length+1);p<=A;p++){var I=x-p,C=v.words[I]|0,L=l.words[p]|0,j=C*L,D=j&67108863;E=E+(j/67108864|0)|0,D=D+S|0,S=D&67108863,E=E+(D>>>26)|0,g+=E>>>26,E&=67108863}h.words[x]=S,y=E,E=g}return y!==0?h.words[x]=y:h.length--,h.strip()}function P(v,l,h){var y=new R;return y.mulp(v,l,h)}o.prototype.mulTo=function(l,h){var y,g=this.length+l.length;return this.length===10&&l.length===10?y=w(this,l,h):g<63?y=b(this,l,h):g<1024?y=T(this,l,h):y=P(this,l,h),y};function R(v,l){this.x=v,this.y=l}R.prototype.makeRBT=function(l){for(var h=new Array(l),y=o.prototype._countBits(l)-1,g=0;g<l;g++)h[g]=this.revBin(g,y,l);return h},R.prototype.revBin=function(l,h,y){if(l===0||l===y-1)return l;for(var g=0,x=0;x<h;x++)g|=(l&1)<<h-x-1,l>>=1;return g},R.prototype.permute=function(l,h,y,g,x,E){for(var S=0;S<E;S++)g[S]=h[l[S]],x[S]=y[l[S]]},R.prototype.transform=function(l,h,y,g,x,E){this.permute(E,l,h,y,g,x);for(var S=1;S<x;S<<=1)for(var A=S<<1,p=Math.cos(2*Math.PI/A),I=Math.sin(2*Math.PI/A),C=0;C<x;C+=A)for(var L=p,j=I,D=0;D<S;D++){var z=y[C+D],W=g[C+D],G=y[C+D+S],K=g[C+D+S],Y=L*G-j*K;K=L*K+j*G,G=Y,y[C+D]=z+G,g[C+D]=W+K,y[C+D+S]=z-G,g[C+D+S]=W-K,D!==A&&(Y=p*L-I*j,j=p*j+I*L,L=Y)}},R.prototype.guessLen13b=function(l,h){var y=Math.max(h,l)|1,g=y&1,x=0;for(y=y/2|0;y;y=y>>>1)x++;return 1<<x+1+g},R.prototype.conjugate=function(l,h,y){if(!(y<=1))for(var g=0;g<y/2;g++){var x=l[g];l[g]=l[y-g-1],l[y-g-1]=x,x=h[g],h[g]=-h[y-g-1],h[y-g-1]=-x}},R.prototype.normalize13b=function(l,h){for(var y=0,g=0;g<h/2;g++){var x=Math.round(l[2*g+1]/h)*8192+Math.round(l[2*g]/h)+y;l[g]=x&67108863,x<67108864?y=0:y=x/67108864|0}return l},R.prototype.convert13b=function(l,h,y,g){for(var x=0,E=0;E<h;E++)x=x+(l[E]|0),y[2*E]=x&8191,x=x>>>13,y[2*E+1]=x&8191,x=x>>>13;for(E=2*h;E<g;++E)y[E]=0;r(x===0),r((x&-8192)===0)},R.prototype.stub=function(l){for(var h=new Array(l),y=0;y<l;y++)h[y]=0;return h},R.prototype.mulp=function(l,h,y){var g=2*this.guessLen13b(l.length,h.length),x=this.makeRBT(g),E=this.stub(g),S=new Array(g),A=new Array(g),p=new Array(g),I=new Array(g),C=new Array(g),L=new Array(g),j=y.words;j.length=g,this.convert13b(l.words,l.length,S,g),this.convert13b(h.words,h.length,I,g),this.transform(S,E,A,p,g,x),this.transform(I,E,C,L,g,x);for(var D=0;D<g;D++){var z=A[D]*C[D]-p[D]*L[D];p[D]=A[D]*L[D]+p[D]*C[D],A[D]=z}return this.conjugate(A,p,g),this.transform(A,p,j,E,g,x),this.conjugate(j,E,g),this.normalize13b(j,g),y.negative=l.negative^h.negative,y.length=l.length+h.length,y.strip()},o.prototype.mul=function(l){var h=new o(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},o.prototype.mulf=function(l){var h=new o(null);return h.words=new Array(this.length+l.length),P(this,l,h)},o.prototype.imul=function(l){return this.clone().mulTo(l,this)},o.prototype.imuln=function(l){r(typeof l=="number"),r(l<67108864);for(var h=0,y=0;y<this.length;y++){var g=(this.words[y]|0)*l,x=(g&67108863)+(h&67108863);h>>=26,h+=g/67108864|0,h+=x>>>26,this.words[y]=x&67108863}return h!==0&&(this.words[y]=h,this.length++),l===0&&(this.length=1,this._normSign()),this},o.prototype.muln=function(l){return this.clone().imuln(l)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(l){var h=m(l);if(h.length===0)return new o(1);for(var y=this,g=0;g<h.length&&h[g]===0;g++,y=y.sqr());if(++g<h.length)for(var x=y.sqr();g<h.length;g++,x=x.sqr())h[g]!==0&&(y=y.mul(x));return y},o.prototype.iushln=function(l){r(typeof l=="number"&&l>=0);var h=l%26,y=(l-h)/26,g=67108863>>>26-h<<26-h,x;if(h!==0){var E=0;for(x=0;x<this.length;x++){var S=this.words[x]&g,A=(this.words[x]|0)-S<<h;this.words[x]=A|E,E=S>>>26-h}E&&(this.words[x]=E,this.length++)}if(y!==0){for(x=this.length-1;x>=0;x--)this.words[x+y]=this.words[x];for(x=0;x<y;x++)this.words[x]=0;this.length+=y}return this.strip()},o.prototype.ishln=function(l){return r(this.negative===0),this.iushln(l)},o.prototype.iushrn=function(l,h,y){r(typeof l=="number"&&l>=0);var g;h?g=(h-h%26)/26:g=0;var x=l%26,E=Math.min((l-x)/26,this.length),S=67108863^67108863>>>x<<x,A=y;if(g-=E,g=Math.max(0,g),A){for(var p=0;p<E;p++)A.words[p]=this.words[p];A.length=E}if(E!==0)if(this.length>E)for(this.length-=E,p=0;p<this.length;p++)this.words[p]=this.words[p+E];else this.words[0]=0,this.length=1;var I=0;for(p=this.length-1;p>=0&&(I!==0||p>=g);p--){var C=this.words[p]|0;this.words[p]=I<<26-x|C>>>x,I=C&S}return A&&I!==0&&(A.words[A.length++]=I),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(l,h,y){return r(this.negative===0),this.iushrn(l,h,y)},o.prototype.shln=function(l){return this.clone().ishln(l)},o.prototype.ushln=function(l){return this.clone().iushln(l)},o.prototype.shrn=function(l){return this.clone().ishrn(l)},o.prototype.ushrn=function(l){return this.clone().iushrn(l)},o.prototype.testn=function(l){r(typeof l=="number"&&l>=0);var h=l%26,y=(l-h)/26,g=1<<h;if(this.length<=y)return!1;var x=this.words[y];return!!(x&g)},o.prototype.imaskn=function(l){r(typeof l=="number"&&l>=0);var h=l%26,y=(l-h)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(h!==0&&y++,this.length=Math.min(y,this.length),h!==0){var g=67108863^67108863>>>h<<h;this.words[this.length-1]&=g}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.maskn=function(l){return this.clone().imaskn(l)},o.prototype.iaddn=function(l){return r(typeof l=="number"),r(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},o.prototype._iaddn=function(l){this.words[0]+=l;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},o.prototype.isubn=function(l){if(r(typeof l=="number"),r(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this.strip()},o.prototype.addn=function(l){return this.clone().iaddn(l)},o.prototype.subn=function(l){return this.clone().isubn(l)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(l,h,y){var g=l.length+y,x;this._expand(g);var E,S=0;for(x=0;x<l.length;x++){E=(this.words[x+y]|0)+S;var A=(l.words[x]|0)*h;E-=A&67108863,S=(E>>26)-(A/67108864|0),this.words[x+y]=E&67108863}for(;x<this.length-y;x++)E=(this.words[x+y]|0)+S,S=E>>26,this.words[x+y]=E&67108863;if(S===0)return this.strip();for(r(S===-1),S=0,x=0;x<this.length;x++)E=-(this.words[x]|0)+S,S=E>>26,this.words[x]=E&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(l,h){var y=this.length-l.length,g=this.clone(),x=l,E=x.words[x.length-1]|0,S=this._countBits(E);y=26-S,y!==0&&(x=x.ushln(y),g.iushln(y),E=x.words[x.length-1]|0);var A=g.length-x.length,p;if(h!=="mod"){p=new o(null),p.length=A+1,p.words=new Array(p.length);for(var I=0;I<p.length;I++)p.words[I]=0}var C=g.clone()._ishlnsubmul(x,1,A);C.negative===0&&(g=C,p&&(p.words[A]=1));for(var L=A-1;L>=0;L--){var j=(g.words[x.length+L]|0)*67108864+(g.words[x.length+L-1]|0);for(j=Math.min(j/E|0,67108863),g._ishlnsubmul(x,j,L);g.negative!==0;)j--,g.negative=0,g._ishlnsubmul(x,1,L),g.isZero()||(g.negative^=1);p&&(p.words[L]=j)}return p&&p.strip(),g.strip(),h!=="div"&&y!==0&&g.iushrn(y),{div:p||null,mod:g}},o.prototype.divmod=function(l,h,y){if(r(!l.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var g,x,E;return this.negative!==0&&l.negative===0?(E=this.neg().divmod(l,h),h!=="mod"&&(g=E.div.neg()),h!=="div"&&(x=E.mod.neg(),y&&x.negative!==0&&x.iadd(l)),{div:g,mod:x}):this.negative===0&&l.negative!==0?(E=this.divmod(l.neg(),h),h!=="mod"&&(g=E.div.neg()),{div:g,mod:E.mod}):(this.negative&l.negative)!==0?(E=this.neg().divmod(l.neg(),h),h!=="div"&&(x=E.mod.neg(),y&&x.negative!==0&&x.isub(l)),{div:E.div,mod:x}):l.length>this.length||this.cmp(l)<0?{div:new o(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="mod"?{div:null,mod:new o(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new o(this.modn(l.words[0]))}:this._wordDiv(l,h)},o.prototype.div=function(l){return this.divmod(l,"div",!1).div},o.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},o.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},o.prototype.divRound=function(l){var h=this.divmod(l);if(h.mod.isZero())return h.div;var y=h.mod.abs(),g=l.abs().iushrn(1),x=l.words[0]&1,E=y.cmp(g);if(E<0||x===1&&E===0)return h.div;var S=new o(1);return S.negative=this.negative^l.negative,h.div.iadd(S)},o.prototype.modn=function(l){r(l<=67108863);for(var h=(1<<26)%l,y=0,g=this.length-1;g>=0;g--)y=(h*y+(this.words[g]|0))%l;return y},o.prototype.idivn=function(l){r(l<=67108863);for(var h=0,y=this.length-1;y>=0;y--){var g=(this.words[y]|0)+h*67108864;this.words[y]=g/l|0,h=g%l}return this.strip()},o.prototype.divn=function(l){return this.clone().idivn(l)},o.prototype.egcd=function(l){r(l.negative===0),r(!l.isZero());var h=this,y=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var g=new o(1),x=new o(0),E=new o(0),S=new o(1),A=0;h.isEven()&&y.isEven();)h.iushrn(1),y.iushrn(1),++A;for(var p=y.clone(),I=h.clone();!h.isZero();){for(var C=0,L=1;(h.words[0]&L)===0&&C<26;++C,L<<=1);if(C>0)for(h.iushrn(C);C-- >0;)(g.isOdd()||x.isOdd())&&(g.iadd(p),x.isub(I)),g.iushrn(1),x.iushrn(1);for(var j=0,D=1;(y.words[0]&D)===0&&j<26;++j,D<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(E.isOdd()||S.isOdd())&&(E.iadd(p),S.isub(I)),E.iushrn(1),S.iushrn(1);h.cmp(y)>=0?(h.isub(y),g.isub(E),x.isub(S)):(y.isub(h),E.isub(g),S.isub(x))}return{a:E,b:S,gcd:y.iushln(A)}},o.prototype._invmp=function(l){r(l.negative===0),r(!l.isZero());var h=this,y=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var g=new o(1),x=new o(0),E=y.clone();h.cmpn(1)>0&&y.cmpn(1)>0;){for(var S=0,A=1;(h.words[0]&A)===0&&S<26;++S,A<<=1);if(S>0)for(h.iushrn(S);S-- >0;)g.isOdd()&&g.iadd(E),g.iushrn(1);for(var p=0,I=1;(y.words[0]&I)===0&&p<26;++p,I<<=1);if(p>0)for(y.iushrn(p);p-- >0;)x.isOdd()&&x.iadd(E),x.iushrn(1);h.cmp(y)>=0?(h.isub(y),g.isub(x)):(y.isub(h),x.isub(g))}var C;return h.cmpn(1)===0?C=g:C=x,C.cmpn(0)<0&&C.iadd(l),C},o.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var h=this.clone(),y=l.clone();h.negative=0,y.negative=0;for(var g=0;h.isEven()&&y.isEven();g++)h.iushrn(1),y.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;y.isEven();)y.iushrn(1);var x=h.cmp(y);if(x<0){var E=h;h=y,y=E}else if(x===0||y.cmpn(1)===0)break;h.isub(y)}while(!0);return y.iushln(g)},o.prototype.invm=function(l){return this.egcd(l).a.umod(l)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(l){return this.words[0]&l},o.prototype.bincn=function(l){r(typeof l=="number");var h=l%26,y=(l-h)/26,g=1<<h;if(this.length<=y)return this._expand(y+1),this.words[y]|=g,this;for(var x=g,E=y;x!==0&&E<this.length;E++){var S=this.words[E]|0;S+=x,x=S>>>26,S&=67108863,this.words[E]=S}return x!==0&&(this.words[E]=x,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var y;if(this.length>1)y=1;else{h&&(l=-l),r(l<=67108863,"Number is too big");var g=this.words[0]|0;y=g===l?0:g<l?-1:1}return this.negative!==0?-y|0:y},o.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var h=this.ucmp(l);return this.negative!==0?-h|0:h},o.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var h=0,y=this.length-1;y>=0;y--){var g=this.words[y]|0,x=l.words[y]|0;if(g!==x){g<x?h=-1:g>x&&(h=1);break}}return h},o.prototype.gtn=function(l){return this.cmpn(l)===1},o.prototype.gt=function(l){return this.cmp(l)===1},o.prototype.gten=function(l){return this.cmpn(l)>=0},o.prototype.gte=function(l){return this.cmp(l)>=0},o.prototype.ltn=function(l){return this.cmpn(l)===-1},o.prototype.lt=function(l){return this.cmp(l)===-1},o.prototype.lten=function(l){return this.cmpn(l)<=0},o.prototype.lte=function(l){return this.cmp(l)<=0},o.prototype.eqn=function(l){return this.cmpn(l)===0},o.prototype.eq=function(l){return this.cmp(l)===0},o.red=function(l){return new M(l)},o.prototype.toRed=function(l){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(l){return this.red=l,this},o.prototype.forceRed=function(l){return r(!this.red,"Already a number in reduction context"),this._forceRed(l)},o.prototype.redAdd=function(l){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},o.prototype.redIAdd=function(l){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},o.prototype.redSub=function(l){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},o.prototype.redISub=function(l){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},o.prototype.redShl=function(l){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},o.prototype.redMul=function(l){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},o.prototype.redIMul=function(l){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(l){return r(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var k={k256:null,p224:null,p192:null,p25519:null};function _(v,l){this.name=v,this.p=new o(l,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_.prototype._tmp=function(){var l=new o(null);return l.words=new Array(Math.ceil(this.n/13)),l},_.prototype.ireduce=function(l){var h=l,y;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),y=h.bitLength();while(y>this.n);var g=y<this.n?-1:h.ucmp(this.p);return g===0?(h.words[0]=0,h.length=1):g>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},_.prototype.split=function(l,h){l.iushrn(this.n,0,h)},_.prototype.imulK=function(l){return l.imul(this.k)};function O(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(O,_),O.prototype.split=function(l,h){for(var y=4194303,g=Math.min(l.length,9),x=0;x<g;x++)h.words[x]=l.words[x];if(h.length=g,l.length<=9){l.words[0]=0,l.length=1;return}var E=l.words[9];for(h.words[h.length++]=E&y,x=10;x<l.length;x++){var S=l.words[x]|0;l.words[x-10]=(S&y)<<4|E>>>22,E=S}E>>>=22,l.words[x-10]=E,E===0&&l.length>10?l.length-=10:l.length-=9},O.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,y=0;y<l.length;y++){var g=l.words[y]|0;h+=g*977,l.words[y]=h&67108863,h=g*64+(h/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function $(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n($,_);function B(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(B,_);function N(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(N,_),N.prototype.imulK=function(l){for(var h=0,y=0;y<l.length;y++){var g=(l.words[y]|0)*19+h,x=g&67108863;g>>>=26,l.words[y]=x,h=g}return h!==0&&(l.words[l.length++]=h),l},o._prime=function(l){if(k[l])return k[l];var h;if(l==="k256")h=new O;else if(l==="p224")h=new $;else if(l==="p192")h=new B;else if(l==="p25519")h=new N;else throw new Error("Unknown prime "+l);return k[l]=h,h};function M(v){if(typeof v=="string"){var l=o._prime(v);this.m=l.p,this.prime=l}else r(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}M.prototype._verify1=function(l){r(l.negative===0,"red works only with positives"),r(l.red,"red works only with red numbers")},M.prototype._verify2=function(l,h){r((l.negative|h.negative)===0,"red works only with positives"),r(l.red&&l.red===h.red,"red works only with red numbers")},M.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},M.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},M.prototype.add=function(l,h){this._verify2(l,h);var y=l.add(h);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},M.prototype.iadd=function(l,h){this._verify2(l,h);var y=l.iadd(h);return y.cmp(this.m)>=0&&y.isub(this.m),y},M.prototype.sub=function(l,h){this._verify2(l,h);var y=l.sub(h);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},M.prototype.isub=function(l,h){this._verify2(l,h);var y=l.isub(h);return y.cmpn(0)<0&&y.iadd(this.m),y},M.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},M.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},M.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},M.prototype.isqr=function(l){return this.imul(l,l.clone())},M.prototype.sqr=function(l){return this.mul(l,l)},M.prototype.sqrt=function(l){if(l.isZero())return l.clone();var h=this.m.andln(3);if(r(h%2===1),h===3){var y=this.m.add(new o(1)).iushrn(2);return this.pow(l,y)}for(var g=this.m.subn(1),x=0;!g.isZero()&&g.andln(1)===0;)x++,g.iushrn(1);r(!g.isZero());var E=new o(1).toRed(this),S=E.redNeg(),A=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,A).cmp(S)!==0;)p.redIAdd(S);for(var I=this.pow(p,g),C=this.pow(l,g.addn(1).iushrn(1)),L=this.pow(l,g),j=x;L.cmp(E)!==0;){for(var D=L,z=0;D.cmp(E)!==0;z++)D=D.redSqr();r(z<j);var W=this.pow(I,new o(1).iushln(j-z-1));C=C.redMul(W),I=W.redSqr(),L=L.redMul(I),j=z}return C},M.prototype.invm=function(l){var h=l._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},M.prototype.pow=function(l,h){if(h.isZero())return new o(1).toRed(this);if(h.cmpn(1)===0)return l.clone();var y=4,g=new Array(1<<y);g[0]=new o(1).toRed(this),g[1]=l;for(var x=2;x<g.length;x++)g[x]=this.mul(g[x-1],l);var E=g[0],S=0,A=0,p=h.bitLength()%26;for(p===0&&(p=26),x=h.length-1;x>=0;x--){for(var I=h.words[x],C=p-1;C>=0;C--){var L=I>>C&1;if(E!==g[0]&&(E=this.sqr(E)),L===0&&S===0){A=0;continue}S<<=1,S|=L,A++,!(A!==y&&(x!==0||C!==0))&&(E=this.mul(E,g[S]),A=0,S=0)}p=26}return E},M.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},M.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},o.mont=function(l){return new F(l)};function F(v){M.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(F,M),F.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},F.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},F.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var y=l.imul(h),g=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=y.isub(g).iushrn(this.shift),E=x;return x.cmp(this.m)>=0?E=x.isub(this.m):x.cmpn(0)<0&&(E=x.iadd(this.m)),E._forceRed(this)},F.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new o(0)._forceRed(this);var y=l.mul(h),g=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),x=y.isub(g).iushrn(this.shift),E=x;return x.cmp(this.m)>=0?E=x.isub(this.m):x.cmpn(0)<0&&(E=x.iadd(this.m)),E._forceRed(this)},F.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof uv>"u"||uv,A9)});var Pi=ee((fve,I9)=>{I9.exports=S9;function S9(t,e){if(!t)throw new Error(e||"Assertion failed")}S9.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)}});var dv=ee(B9=>{"use strict";var gp=B9;function WD(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t!="string"){for(var n=0;n<t.length;n++)r[n]=t[n]|0;return r}if(e==="hex"){t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var o=t.charCodeAt(n),i=o>>8,a=o&255;i?r.push(i,a):r.push(a)}return r}gp.toArray=WD;function T9(t){return t.length===1?"0"+t:t}gp.zero2=T9;function _9(t){for(var e="",r=0;r<t.length;r++)e+=T9(t[r].toString(16));return e}gp.toHex=_9;gp.encode=function(e,r){return r==="hex"?_9(e):e}});var Rr=ee(R9=>{"use strict";var mn=R9,KD=Yn(),GD=Pi(),vp=dv();mn.assert=GD;mn.toArray=vp.toArray;mn.zero2=vp.zero2;mn.toHex=vp.toHex;mn.encode=vp.encode;function VD(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1),o;for(o=0;o<n.length;o+=1)n[o]=0;var i=1<<e+1,a=t.clone();for(o=0;o<n.length;o++){var s,c=a.andln(i-1);a.isOdd()?(c>(i>>1)-1?s=(i>>1)-c:s=c,a.isubn(s)):s=0,n[o]=s,a.iushrn(1)}return n}mn.getNAF=VD;function YD(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,o=0,i;t.cmpn(-n)>0||e.cmpn(-o)>0;){var a=t.andln(3)+n&3,s=e.andln(3)+o&3;a===3&&(a=-1),s===3&&(s=-1);var c;(a&1)===0?c=0:(i=t.andln(7)+n&7,(i===3||i===5)&&s===2?c=-a:c=a),r[0].push(c);var f;(s&1)===0?f=0:(i=e.andln(7)+o&7,(i===3||i===5)&&a===2?f=-s:f=s),r[1].push(f),2*n===c+1&&(n=1-n),2*o===f+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r}mn.getJSF=YD;function ZD(t,e,r){var n="_"+e;t.prototype[e]=function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)}}mn.cachedProperty=ZD;function JD(t){return typeof t=="string"?mn.toArray(t,"hex"):t}mn.parseBytes=JD;function XD(t){return new KD(t,"hex","le")}mn.intFromLE=XD});var P9=ee(()=>{});var mv=ee((hve,hv)=>{var lv;hv.exports=function(e){return lv||(lv=new Ci(null)),lv.generate(e)};function Ci(t){this.rand=t}hv.exports.Rand=Ci;Ci.prototype.generate=function(e){return this._rand(e)};Ci.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n<r.length;n++)r[n]=this.rand.getByte();return r};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Ci.prototype._rand=function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Ci.prototype._rand=function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Ci.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(pv=P9(),typeof pv.randomBytes!="function")throw new Error("Not supported");Ci.prototype._rand=function(e){return pv.randomBytes(e)}}catch{}var pv});var sd=ee((mve,C9)=>{"use strict";var Ka=Yn(),ad=Rr(),xp=ad.getNAF,QD=ad.getJSF,wp=ad.assert;function Oi(t,e){this.type=t,this.p=new Ka(e.p,16),this.red=e.prime?Ka.red(e.prime):Ka.mont(this.p),this.zero=new Ka(0).toRed(this.red),this.one=new Ka(1).toRed(this.red),this.two=new Ka(2).toRed(this.red),this.n=e.n&&new Ka(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}C9.exports=Oi;Oi.prototype.point=function(){throw new Error("Not implemented")};Oi.prototype.validate=function(){throw new Error("Not implemented")};Oi.prototype._fixedNafMul=function(e,r){wp(e.precomputed);var n=e._getDoubles(),o=xp(r,1,this._bitLength),i=(1<<n.step+1)-(n.step%2===0?2:1);i/=3;var a=[],s,c;for(s=0;s<o.length;s+=n.step){c=0;for(var f=s+n.step-1;f>=s;f--)c=(c<<1)+o[f];a.push(c)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),m=i;m>0;m--){for(s=0;s<a.length;s++)c=a[s],c===m?d=d.mixedAdd(n.points[s]):c===-m&&(d=d.mixedAdd(n.points[s].neg()));u=u.add(d)}return u.toP()};Oi.prototype._wnafMul=function(e,r){var n=4,o=e._getNAFPoints(n);n=o.wnd;for(var i=o.points,a=xp(r,n,this._bitLength),s=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&a[c]===0;c--)f++;if(c>=0&&f++,s=s.dblp(f),c<0)break;var u=a[c];wp(u!==0),e.type==="affine"?u>0?s=s.mixedAdd(i[u-1>>1]):s=s.mixedAdd(i[-u-1>>1].neg()):u>0?s=s.add(i[u-1>>1]):s=s.add(i[-u-1>>1].neg())}return e.type==="affine"?s.toP():s};Oi.prototype._wnafMulAdd=function(e,r,n,o,i){var a=this._wnafT1,s=this._wnafT2,c=this._wnafT3,f=0,u,d,m;for(u=0;u<o;u++){m=r[u];var b=m._getNAFPoints(e);a[u]=b.wnd,s[u]=b.points}for(u=o-1;u>=1;u-=2){var w=u-1,T=u;if(a[w]!==1||a[T]!==1){c[w]=xp(n[w],a[w],this._bitLength),c[T]=xp(n[T],a[T],this._bitLength),f=Math.max(c[w].length,f),f=Math.max(c[T].length,f);continue}var P=[r[w],null,null,r[T]];r[w].y.cmp(r[T].y)===0?(P[1]=r[w].add(r[T]),P[2]=r[w].toJ().mixedAdd(r[T].neg())):r[w].y.cmp(r[T].y.redNeg())===0?(P[1]=r[w].toJ().mixedAdd(r[T]),P[2]=r[w].add(r[T].neg())):(P[1]=r[w].toJ().mixedAdd(r[T]),P[2]=r[w].toJ().mixedAdd(r[T].neg()));var R=[-3,-1,-5,-7,0,7,5,1,3],k=QD(n[w],n[T]);for(f=Math.max(k[0].length,f),c[w]=new Array(f),c[T]=new Array(f),d=0;d<f;d++){var _=k[0][d]|0,O=k[1][d]|0;c[w][d]=R[(_+1)*3+(O+1)],c[T][d]=0,s[w]=P}}var $=this.jpoint(null,null,null),B=this._wnafT4;for(u=f;u>=0;u--){for(var N=0;u>=0;){var M=!0;for(d=0;d<o;d++)B[d]=c[d][u]|0,B[d]!==0&&(M=!1);if(!M)break;N++,u--}if(u>=0&&N++,$=$.dblp(N),u<0)break;for(d=0;d<o;d++){var F=B[d];F!==0&&(F>0?m=s[d][F-1>>1]:F<0&&(m=s[d][-F-1>>1].neg()),m.type==="affine"?$=$.mixedAdd(m):$=$.add(m))}}for(u=0;u<o;u++)s[u]=null;return i?$:$.toP()};function Dr(t,e){this.curve=t,this.type=e,this.precomputed=null}Oi.BasePoint=Dr;Dr.prototype.eq=function(){throw new Error("Not implemented")};Dr.prototype.validate=function(){return this.curve.validate(this)};Oi.prototype.decodePoint=function(e,r){e=ad.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?wp(e[e.length-1]%2===0):e[0]===7&&wp(e[e.length-1]%2===1);var o=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return o}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};Dr.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Dr.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};Dr.prototype.encode=function(e,r){return ad.encode(this._encode(r),e)};Dr.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};Dr.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};Dr.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],o=this,i=0;i<r;i+=e){for(var a=0;a<e;a++)o=o.dbl();n.push(o)}return{step:e,points:n}};Dr.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,o=n===1?null:this.dbl(),i=1;i<n;i++)r[i]=r[i-1].add(o);return{wnd:e,points:r}};Dr.prototype._getBeta=function(){return null};Dr.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r}});var cd=ee((bve,bv)=>{typeof Object.create=="function"?bv.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:bv.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var k9=ee((yve,O9)=>{"use strict";var ez=Rr(),ze=Yn(),yv=cd(),fc=sd(),tz=ez.assert;function zr(t){fc.call(this,"short",t),this.a=new ze(t.a,16).toRed(this.red),this.b=new ze(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}yv(zr,fc);O9.exports=zr;zr.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ze(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=o[0].cmp(o[1])<0?o[0]:o[1],r=r.toRed(this.red)}if(e.lambda)n=new ze(e.lambda,16);else{var i=this._getEndoRoots(this.n);this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))===0?n=i[0]:(n=i[1],tz(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(s){return{a:new ze(s.a,16),b:new ze(s.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};zr.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:ze.mont(e),n=new ze(2).toRed(r).redInvm(),o=n.redNeg(),i=new ze(3).toRed(r).redNeg().redSqrt().redMul(n),a=o.redAdd(i).fromRed(),s=o.redSub(i).fromRed();return[a,s]};zr.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,o=this.n.clone(),i=new ze(1),a=new ze(0),s=new ze(0),c=new ze(1),f,u,d,m,b,w,T,P=0,R,k;n.cmpn(0)!==0;){var _=o.div(n);R=o.sub(_.mul(n)),k=s.sub(_.mul(i));var O=c.sub(_.mul(a));if(!d&&R.cmp(r)<0)f=T.neg(),u=i,d=R.neg(),m=k;else if(d&&++P===2)break;T=R,o=n,n=R,s=i,i=k,c=a,a=O}b=R.neg(),w=k;var $=d.sqr().add(m.sqr()),B=b.sqr().add(w.sqr());return B.cmp($)>=0&&(b=f,w=u),d.negative&&(d=d.neg(),m=m.neg()),b.negative&&(b=b.neg(),w=w.neg()),[{a:d,b:m},{a:b,b:w}]};zr.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],o=r[1],i=o.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),s=i.mul(n.a),c=a.mul(o.a),f=i.mul(n.b),u=a.mul(o.b),d=e.sub(s).sub(c),m=f.add(u).neg();return{k1:d,k2:m}};zr.prototype.pointFromX=function(e,r){e=new ze(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),o=n.redSqrt();if(o.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var i=o.fromRed().isOdd();return(r&&!i||!r&&i)&&(o=o.redNeg()),this.point(e,o)};zr.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,o=this.a.redMul(r),i=r.redSqr().redMul(r).redIAdd(o).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0};zr.prototype._endoWnafMulAdd=function(e,r,n){for(var o=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var s=this._endoSplit(r[a]),c=e[a],f=c._getBeta();s.k1.negative&&(s.k1.ineg(),c=c.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),o[a*2]=c,o[a*2+1]=f,i[a*2]=s.k1,i[a*2+1]=s.k2}for(var u=this._wnafMulAdd(1,o,i,a*2,n),d=0;d<a*2;d++)o[d]=null,i[d]=null;return u};function Tt(t,e,r,n){fc.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ze(e,16),this.y=new ze(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}yv(Tt,fc.BasePoint);zr.prototype.point=function(e,r,n){return new Tt(this,e,r,n)};zr.prototype.pointFromJSON=function(e,r){return Tt.fromJSON(this,e,r)};Tt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,o=function(i){return n.point(i.x.redMul(n.endo.beta),i.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(o)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(o)}}}return r}};Tt.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Tt.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var o=e.point(r[0],r[1],n);if(!r[2])return o;function i(s){return e.point(s[0],s[1],n)}var a=r[2];return o.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[o].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[o].concat(a.naf.points.map(i))}},o};Tt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Tt.prototype.isInfinity=function(){return this.inf};Tt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)};Tt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),o=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(o),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)};Tt.prototype.getX=function(){return this.x.fromRed()};Tt.prototype.getY=function(){return this.y.fromRed()};Tt.prototype.mul=function(e){return e=new ze(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Tt.prototype.mulAdd=function(e,r,n){var o=[this,r],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(o,i):this.curve._wnafMulAdd(1,o,i,2)};Tt.prototype.jmulAdd=function(e,r,n){var o=[this,r],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(o,i,!0):this.curve._wnafMulAdd(1,o,i,2,!0)};Tt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Tt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,o=function(i){return i.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(o)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(o)}}}return r};Tt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Mt(t,e,r,n){fc.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ze(0)):(this.x=new ze(e,16),this.y=new ze(r,16),this.z=new ze(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}yv(Mt,fc.BasePoint);zr.prototype.jpoint=function(e,r,n){return new Mt(this,e,r,n)};Mt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),o=this.y.redMul(r).redMul(e);return this.curve.point(n,o)};Mt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Mt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),o=this.x.redMul(r),i=e.x.redMul(n),a=this.y.redMul(r.redMul(e.z)),s=e.y.redMul(n.redMul(this.z)),c=o.redSub(i),f=a.redSub(s);if(c.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),d=u.redMul(c),m=o.redMul(u),b=f.redSqr().redIAdd(d).redISub(m).redISub(m),w=f.redMul(m.redISub(b)).redISub(a.redMul(d)),T=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(b,w,T)};Mt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,o=e.x.redMul(r),i=this.y,a=e.y.redMul(r).redMul(this.z),s=n.redSub(o),c=i.redSub(a);if(s.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),u=f.redMul(s),d=n.redMul(f),m=c.redSqr().redIAdd(u).redISub(d).redISub(d),b=c.redMul(d.redISub(m)).redISub(i.redMul(u)),w=this.z.redMul(s);return this.curve.jpoint(m,b,w)};Mt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var o=this.curve.a,i=this.curve.tinv,a=this.x,s=this.y,c=this.z,f=c.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<e;r++){var d=a.redSqr(),m=u.redSqr(),b=m.redSqr(),w=d.redAdd(d).redIAdd(d).redIAdd(o.redMul(f)),T=a.redMul(m),P=w.redSqr().redISub(T.redAdd(T)),R=T.redISub(P),k=w.redMul(R);k=k.redIAdd(k).redISub(b);var _=u.redMul(c);r+1<e&&(f=f.redMul(b)),a=P,c=_,u=k}return this.curve.jpoint(a,u.redMul(i),c)};Mt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Mt.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var o=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(o).redISub(a);s=s.redIAdd(s);var c=o.redAdd(o).redIAdd(o),f=c.redSqr().redISub(s).redISub(s),u=a.redIAdd(a);u=u.redIAdd(u),u=u.redIAdd(u),e=f,r=c.redMul(s.redISub(f)).redISub(u),n=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),m=this.y.redSqr(),b=m.redSqr(),w=this.x.redAdd(m).redSqr().redISub(d).redISub(b);w=w.redIAdd(w);var T=d.redAdd(d).redIAdd(d),P=T.redSqr(),R=b.redIAdd(b);R=R.redIAdd(R),R=R.redIAdd(R),e=P.redISub(w).redISub(w),r=T.redMul(w.redISub(e)).redISub(R),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};Mt.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var o=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(o).redISub(a);s=s.redIAdd(s);var c=o.redAdd(o).redIAdd(o).redIAdd(this.curve.a),f=c.redSqr().redISub(s).redISub(s);e=f;var u=a.redIAdd(a);u=u.redIAdd(u),u=u.redIAdd(u),r=c.redMul(s.redISub(f)).redISub(u),n=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),m=this.y.redSqr(),b=this.x.redMul(m),w=this.x.redSub(d).redMul(this.x.redAdd(d));w=w.redAdd(w).redIAdd(w);var T=b.redIAdd(b);T=T.redIAdd(T);var P=T.redAdd(T);e=w.redSqr().redISub(P),n=this.y.redAdd(this.z).redSqr().redISub(m).redISub(d);var R=m.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R),r=w.redMul(T.redISub(e)).redISub(R)}return this.curve.jpoint(e,r,n)};Mt.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,o=this.z,i=o.redSqr().redSqr(),a=r.redSqr(),s=n.redSqr(),c=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),f=r.redAdd(r);f=f.redIAdd(f);var u=f.redMul(s),d=c.redSqr().redISub(u.redAdd(u)),m=u.redISub(d),b=s.redSqr();b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var w=c.redMul(m).redISub(b),T=n.redAdd(n).redMul(o);return this.curve.jpoint(d,w,T)};Mt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),o=r.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),s=this.x.redAdd(r).redSqr().redISub(e).redISub(o);s=s.redIAdd(s),s=s.redAdd(s).redIAdd(s),s=s.redISub(a);var c=s.redSqr(),f=o.redIAdd(o);f=f.redIAdd(f),f=f.redIAdd(f),f=f.redIAdd(f);var u=i.redIAdd(s).redSqr().redISub(a).redISub(c).redISub(f),d=r.redMul(u);d=d.redIAdd(d),d=d.redIAdd(d);var m=this.x.redMul(c).redISub(d);m=m.redIAdd(m),m=m.redIAdd(m);var b=this.y.redMul(u.redMul(f.redISub(u)).redISub(s.redMul(c)));b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var w=this.z.redAdd(s).redSqr().redISub(n).redISub(c);return this.curve.jpoint(m,b,w)};Mt.prototype.mul=function(e,r){return e=new ze(e,r),this.curve._wnafMul(this,e)};Mt.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var o=r.redMul(this.z),i=n.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(o)).cmpn(0)===0};Mt.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var o=e.clone(),i=this.curve.redN.redMul(r);;){if(o.iadd(this.curve.n),o.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}};Mt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Mt.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var N9=ee((gve,$9)=>{"use strict";var uc=Yn(),M9=cd(),Ep=sd(),rz=Rr();function dc(t){Ep.call(this,"mont",t),this.a=new uc(t.a,16).toRed(this.red),this.b=new uc(t.b,16).toRed(this.red),this.i4=new uc(4).toRed(this.red).redInvm(),this.two=new uc(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}M9(dc,Ep);$9.exports=dc;dc.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),o=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),i=o.redSqrt();return i.redSqr().cmp(o)===0};function _t(t,e,r){Ep.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new uc(e,16),this.z=new uc(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}M9(_t,Ep.BasePoint);dc.prototype.decodePoint=function(e,r){return this.point(rz.toArray(e,r),1)};dc.prototype.point=function(e,r){return new _t(this,e,r)};dc.prototype.pointFromJSON=function(e){return _t.fromJSON(this,e)};_t.prototype.precompute=function(){};_t.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};_t.fromJSON=function(e,r){return new _t(e,r[0],r[1]||e.one)};_t.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};_t.prototype.isInfinity=function(){return this.z.cmpn(0)===0};_t.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),o=n.redSqr(),i=r.redSub(o),a=r.redMul(o),s=i.redMul(o.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,s)};_t.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};_t.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),o=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z),s=a.redMul(n),c=i.redMul(o),f=r.z.redMul(s.redAdd(c).redSqr()),u=r.x.redMul(s.redISub(c).redSqr());return this.curve.point(f,u)};_t.prototype.mul=function(e){for(var r=e.clone(),n=this,o=this.curve.point(null,null),i=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var s=a.length-1;s>=0;s--)a[s]===0?(n=n.diffAdd(o,i),o=o.dbl()):(o=n.diffAdd(o,i),n=n.dbl());return o};_t.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};_t.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};_t.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};_t.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};_t.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var U9=ee((vve,L9)=>{"use strict";var nz=Rr(),Mo=Yn(),F9=cd(),Ap=sd(),oz=nz.assert;function Zn(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Ap.call(this,"edwards",t),this.a=new Mo(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Mo(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Mo(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),oz(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}F9(Zn,Ap);L9.exports=Zn;Zn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Zn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Zn.prototype.jpoint=function(e,r,n,o){return this.point(e,r,n,o)};Zn.prototype.pointFromX=function(e,r){e=new Mo(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),o=this.c2.redSub(this.a.redMul(n)),i=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=o.redMul(i.redInvm()),s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var c=s.fromRed().isOdd();return(r&&!c||!r&&c)&&(s=s.redNeg()),this.point(e,s)};Zn.prototype.pointFromY=function(e,r){e=new Mo(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),o=n.redSub(this.c2),i=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=o.redMul(i.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(s.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return s.fromRed().isOdd()!==r&&(s=s.redNeg()),this.point(s,e)};Zn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),o=r.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return o.cmp(i)===0};function Ie(t,e,r,n,o){Ap.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Mo(e,16),this.y=new Mo(r,16),this.z=n?new Mo(n,16):this.curve.one,this.t=o&&new Mo(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}F9(Ie,Ap.BasePoint);Zn.prototype.pointFromJSON=function(e){return Ie.fromJSON(this,e)};Zn.prototype.point=function(e,r,n,o){return new Ie(this,e,r,n,o)};Ie.fromJSON=function(e,r){return new Ie(e,r[0],r[1],r[2])};Ie.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Ie.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Ie.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var o=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=o.redAdd(r),s=a.redSub(n),c=o.redSub(r),f=i.redMul(s),u=a.redMul(c),d=i.redMul(c),m=s.redMul(a);return this.curve.point(f,u,m,d)};Ie.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),o,i,a,s,c,f;if(this.curve.twisted){s=this.curve._mulA(r);var u=s.redAdd(n);this.zOne?(o=e.redSub(r).redSub(n).redMul(u.redSub(this.curve.two)),i=u.redMul(s.redSub(n)),a=u.redSqr().redSub(u).redSub(u)):(c=this.z.redSqr(),f=u.redSub(c).redISub(c),o=e.redSub(r).redISub(n).redMul(f),i=u.redMul(s.redSub(n)),a=u.redMul(f))}else s=r.redAdd(n),c=this.curve._mulC(this.z).redSqr(),f=s.redSub(c).redSub(c),o=this.curve._mulC(e.redISub(s)).redMul(f),i=this.curve._mulC(s).redMul(r.redISub(n)),a=s.redMul(f);return this.curve.point(o,i,a)};Ie.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Ie.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),o=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(r),s=i.redSub(o),c=i.redAdd(o),f=n.redAdd(r),u=a.redMul(s),d=c.redMul(f),m=a.redMul(f),b=s.redMul(c);return this.curve.point(u,d,b,m)};Ie.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),o=this.x.redMul(e.x),i=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(i),s=n.redSub(a),c=n.redAdd(a),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(i),u=r.redMul(s).redMul(f),d,m;return this.curve.twisted?(d=r.redMul(c).redMul(i.redSub(this.curve._mulA(o))),m=s.redMul(c)):(d=r.redMul(c).redMul(i.redSub(o)),m=this.curve._mulC(s).redMul(c)),this.curve.point(u,d,m)};Ie.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Ie.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Ie.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};Ie.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};Ie.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Ie.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Ie.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Ie.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Ie.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Ie.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),o=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),this.x.cmp(r)===0)return!0}};Ie.prototype.toP=Ie.prototype.normalize;Ie.prototype.mixedAdd=Ie.prototype.add});var gv=ee(j9=>{"use strict";var Sp=j9;Sp.base=sd();Sp.short=k9();Sp.mont=N9();Sp.edwards=U9()});var bn=ee(xe=>{"use strict";var iz=Pi(),az=cd();xe.inherits=az;function sz(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function cz(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),o=0;o<t.length;o+=2)r.push(parseInt(t[o]+t[o+1],16))}else for(var n=0,o=0;o<t.length;o++){var i=t.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=i&63|128):sz(t,o)?(i=65536+((i&1023)<<10)+(t.charCodeAt(++o)&1023),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=i&63|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=i&63|128)}else for(o=0;o<t.length;o++)r[o]=t[o]|0;return r}xe.toArray=cz;function fz(t){for(var e="",r=0;r<t.length;r++)e+=z9(t[r].toString(16));return e}xe.toHex=fz;function D9(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}xe.htonl=D9;function uz(t,e){for(var r="",n=0;n<t.length;n++){var o=t[n];e==="little"&&(o=D9(o)),r+=q9(o.toString(16))}return r}xe.toHex32=uz;function z9(t){return t.length===1?"0"+t:t}xe.zero2=z9;function q9(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}xe.zero8=q9;function dz(t,e,r,n){var o=r-e;iz(o%4===0);for(var i=new Array(o/4),a=0,s=e;a<i.length;a++,s+=4){var c;n==="big"?c=t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:c=t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],i[a]=c>>>0}return i}xe.join32=dz;function lz(t,e){for(var r=new Array(t.length*4),n=0,o=0;n<t.length;n++,o+=4){var i=t[n];e==="big"?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=i&255):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=i&255)}return r}xe.split32=lz;function pz(t,e){return t>>>e|t<<32-e}xe.rotr32=pz;function hz(t,e){return t<<e|t>>>32-e}xe.rotl32=hz;function mz(t,e){return t+e>>>0}xe.sum32=mz;function bz(t,e,r){return t+e+r>>>0}xe.sum32_3=bz;function yz(t,e,r,n){return t+e+r+n>>>0}xe.sum32_4=yz;function gz(t,e,r,n,o){return t+e+r+n+o>>>0}xe.sum32_5=gz;function vz(t,e,r,n){var o=t[e],i=t[e+1],a=n+i>>>0,s=(a<n?1:0)+r+o;t[e]=s>>>0,t[e+1]=a}xe.sum64=vz;function xz(t,e,r,n){var o=e+n>>>0,i=(o<e?1:0)+t+r;return i>>>0}xe.sum64_hi=xz;function wz(t,e,r,n){var o=e+n;return o>>>0}xe.sum64_lo=wz;function Ez(t,e,r,n,o,i,a,s){var c=0,f=e;f=f+n>>>0,c+=f<e?1:0,f=f+i>>>0,c+=f<i?1:0,f=f+s>>>0,c+=f<s?1:0;var u=t+r+o+a+c;return u>>>0}xe.sum64_4_hi=Ez;function Az(t,e,r,n,o,i,a,s){var c=e+n+i+s;return c>>>0}xe.sum64_4_lo=Az;function Sz(t,e,r,n,o,i,a,s,c,f){var u=0,d=e;d=d+n>>>0,u+=d<e?1:0,d=d+i>>>0,u+=d<i?1:0,d=d+s>>>0,u+=d<s?1:0,d=d+f>>>0,u+=d<f?1:0;var m=t+r+o+a+c+u;return m>>>0}xe.sum64_5_hi=Sz;function Iz(t,e,r,n,o,i,a,s,c,f){var u=e+n+i+s+f;return u>>>0}xe.sum64_5_lo=Iz;function Tz(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}xe.rotr64_hi=Tz;function _z(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}xe.rotr64_lo=_z;function Bz(t,e,r){return t>>>r}xe.shr64_hi=Bz;function Rz(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}xe.shr64_lo=Rz});var lc=ee(W9=>{"use strict";var H9=bn(),Pz=Pi();function Ip(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}W9.BlockHash=Ip;Ip.prototype.update=function(e,r){if(e=H9.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=H9.join32(e,0,e.length-n,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this};Ip.prototype.digest=function(e){return this.update(this._pad()),Pz(this.pending===null),this._digest(e)};Ip.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,o=new Array(n+this.padLength);o[0]=128;for(var i=1;i<n;i++)o[i]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)o[i++]=0;o[i++]=0,o[i++]=0,o[i++]=0,o[i++]=0,o[i++]=e>>>24&255,o[i++]=e>>>16&255,o[i++]=e>>>8&255,o[i++]=e&255}else for(o[i++]=e&255,o[i++]=e>>>8&255,o[i++]=e>>>16&255,o[i++]=e>>>24&255,o[i++]=0,o[i++]=0,o[i++]=0,o[i++]=0,a=8;a<this.padLength;a++)o[i++]=0;return o}});var vv=ee($o=>{"use strict";var Cz=bn(),Jn=Cz.rotr32;function Oz(t,e,r,n){if(t===0)return K9(e,r,n);if(t===1||t===3)return V9(e,r,n);if(t===2)return G9(e,r,n)}$o.ft_1=Oz;function K9(t,e,r){return t&e^~t&r}$o.ch32=K9;function G9(t,e,r){return t&e^t&r^e&r}$o.maj32=G9;function V9(t,e,r){return t^e^r}$o.p32=V9;function kz(t){return Jn(t,2)^Jn(t,13)^Jn(t,22)}$o.s0_256=kz;function Mz(t){return Jn(t,6)^Jn(t,11)^Jn(t,25)}$o.s1_256=Mz;function $z(t){return Jn(t,7)^Jn(t,18)^t>>>3}$o.g0_256=$z;function Nz(t){return Jn(t,17)^Jn(t,19)^t>>>10}$o.g1_256=Nz});var J9=ee((Sve,Z9)=>{"use strict";var pc=bn(),Fz=lc(),Lz=vv(),xv=pc.rotl32,fd=pc.sum32,Uz=pc.sum32_5,jz=Lz.ft_1,Y9=Fz.BlockHash,Dz=[1518500249,1859775393,2400959708,3395469782];function Xn(){if(!(this instanceof Xn))return new Xn;Y9.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}pc.inherits(Xn,Y9);Z9.exports=Xn;Xn.blockSize=512;Xn.outSize=160;Xn.hmacStrength=80;Xn.padLength=64;Xn.prototype._update=function(e,r){for(var n=this.W,o=0;o<16;o++)n[o]=e[r+o];for(;o<n.length;o++)n[o]=xv(n[o-3]^n[o-8]^n[o-14]^n[o-16],1);var i=this.h[0],a=this.h[1],s=this.h[2],c=this.h[3],f=this.h[4];for(o=0;o<n.length;o++){var u=~~(o/20),d=Uz(xv(i,5),jz(u,a,s,c),f,n[o],Dz[u]);f=c,c=s,s=xv(a,30),a=i,i=d}this.h[0]=fd(this.h[0],i),this.h[1]=fd(this.h[1],a),this.h[2]=fd(this.h[2],s),this.h[3]=fd(this.h[3],c),this.h[4]=fd(this.h[4],f)};Xn.prototype._digest=function(e){return e==="hex"?pc.toHex32(this.h,"big"):pc.split32(this.h,"big")}});var wv=ee((Ive,Q9)=>{"use strict";var hc=bn(),zz=lc(),mc=vv(),qz=Pi(),yn=hc.sum32,Hz=hc.sum32_4,Wz=hc.sum32_5,Kz=mc.ch32,Gz=mc.maj32,Vz=mc.s0_256,Yz=mc.s1_256,Zz=mc.g0_256,Jz=mc.g1_256,X9=zz.BlockHash,Xz=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Qn(){if(!(this instanceof Qn))return new Qn;X9.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Xz,this.W=new Array(64)}hc.inherits(Qn,X9);Q9.exports=Qn;Qn.blockSize=512;Qn.outSize=256;Qn.hmacStrength=192;Qn.padLength=64;Qn.prototype._update=function(e,r){for(var n=this.W,o=0;o<16;o++)n[o]=e[r+o];for(;o<n.length;o++)n[o]=Hz(Jz(n[o-2]),n[o-7],Zz(n[o-15]),n[o-16]);var i=this.h[0],a=this.h[1],s=this.h[2],c=this.h[3],f=this.h[4],u=this.h[5],d=this.h[6],m=this.h[7];for(qz(this.k.length===n.length),o=0;o<n.length;o++){var b=Wz(m,Yz(f),Kz(f,u,d),this.k[o],n[o]),w=yn(Vz(i),Gz(i,a,s));m=d,d=u,u=f,f=yn(c,b),c=s,s=a,a=i,i=yn(b,w)}this.h[0]=yn(this.h[0],i),this.h[1]=yn(this.h[1],a),this.h[2]=yn(this.h[2],s),this.h[3]=yn(this.h[3],c),this.h[4]=yn(this.h[4],f),this.h[5]=yn(this.h[5],u),this.h[6]=yn(this.h[6],d),this.h[7]=yn(this.h[7],m)};Qn.prototype._digest=function(e){return e==="hex"?hc.toHex32(this.h,"big"):hc.split32(this.h,"big")}});var rA=ee((Tve,tA)=>{"use strict";var Ev=bn(),eA=wv();function No(){if(!(this instanceof No))return new No;eA.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Ev.inherits(No,eA);tA.exports=No;No.blockSize=512;No.outSize=224;No.hmacStrength=192;No.padLength=64;No.prototype._digest=function(e){return e==="hex"?Ev.toHex32(this.h.slice(0,7),"big"):Ev.split32(this.h.slice(0,7),"big")}});var Iv=ee((_ve,aA)=>{"use strict";var pr=bn(),Qz=lc(),eq=Pi(),eo=pr.rotr64_hi,to=pr.rotr64_lo,nA=pr.shr64_hi,oA=pr.shr64_lo,ki=pr.sum64,Av=pr.sum64_hi,Sv=pr.sum64_lo,tq=pr.sum64_4_hi,rq=pr.sum64_4_lo,nq=pr.sum64_5_hi,oq=pr.sum64_5_lo,iA=Qz.BlockHash,iq=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function gn(){if(!(this instanceof gn))return new gn;iA.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=iq,this.W=new Array(160)}pr.inherits(gn,iA);aA.exports=gn;gn.blockSize=1024;gn.outSize=512;gn.hmacStrength=192;gn.padLength=128;gn.prototype._prepareBlock=function(e,r){for(var n=this.W,o=0;o<32;o++)n[o]=e[r+o];for(;o<n.length;o+=2){var i=bq(n[o-4],n[o-3]),a=yq(n[o-4],n[o-3]),s=n[o-14],c=n[o-13],f=hq(n[o-30],n[o-29]),u=mq(n[o-30],n[o-29]),d=n[o-32],m=n[o-31];n[o]=tq(i,a,s,c,f,u,d,m),n[o+1]=rq(i,a,s,c,f,u,d,m)}};gn.prototype._update=function(e,r){this._prepareBlock(e,r);var n=this.W,o=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],f=this.h[5],u=this.h[6],d=this.h[7],m=this.h[8],b=this.h[9],w=this.h[10],T=this.h[11],P=this.h[12],R=this.h[13],k=this.h[14],_=this.h[15];eq(this.k.length===n.length);for(var O=0;O<n.length;O+=2){var $=k,B=_,N=lq(m,b),M=pq(m,b),F=aq(m,b,w,T,P,R),v=sq(m,b,w,T,P,R),l=this.k[O],h=this.k[O+1],y=n[O],g=n[O+1],x=nq($,B,N,M,F,v,l,h,y,g),E=oq($,B,N,M,F,v,l,h,y,g);$=uq(o,i),B=dq(o,i),N=cq(o,i,a,s,c,f),M=fq(o,i,a,s,c,f);var S=Av($,B,N,M),A=Sv($,B,N,M);k=P,_=R,P=w,R=T,w=m,T=b,m=Av(u,d,x,E),b=Sv(d,d,x,E),u=c,d=f,c=a,f=s,a=o,s=i,o=Av(x,E,S,A),i=Sv(x,E,S,A)}ki(this.h,0,o,i),ki(this.h,2,a,s),ki(this.h,4,c,f),ki(this.h,6,u,d),ki(this.h,8,m,b),ki(this.h,10,w,T),ki(this.h,12,P,R),ki(this.h,14,k,_)};gn.prototype._digest=function(e){return e==="hex"?pr.toHex32(this.h,"big"):pr.split32(this.h,"big")};function aq(t,e,r,n,o){var i=t&r^~t&o;return i<0&&(i+=4294967296),i}function sq(t,e,r,n,o,i){var a=e&n^~e&i;return a<0&&(a+=4294967296),a}function cq(t,e,r,n,o){var i=t&r^t&o^r&o;return i<0&&(i+=4294967296),i}function fq(t,e,r,n,o,i){var a=e&n^e&i^n&i;return a<0&&(a+=4294967296),a}function uq(t,e){var r=eo(t,e,28),n=eo(e,t,2),o=eo(e,t,7),i=r^n^o;return i<0&&(i+=4294967296),i}function dq(t,e){var r=to(t,e,28),n=to(e,t,2),o=to(e,t,7),i=r^n^o;return i<0&&(i+=4294967296),i}function lq(t,e){var r=eo(t,e,14),n=eo(t,e,18),o=eo(e,t,9),i=r^n^o;return i<0&&(i+=4294967296),i}function pq(t,e){var r=to(t,e,14),n=to(t,e,18),o=to(e,t,9),i=r^n^o;return i<0&&(i+=4294967296),i}function hq(t,e){var r=eo(t,e,1),n=eo(t,e,8),o=nA(t,e,7),i=r^n^o;return i<0&&(i+=4294967296),i}function mq(t,e){var r=to(t,e,1),n=to(t,e,8),o=oA(t,e,7),i=r^n^o;return i<0&&(i+=4294967296),i}function bq(t,e){var r=eo(t,e,19),n=eo(e,t,29),o=nA(t,e,6),i=r^n^o;return i<0&&(i+=4294967296),i}function yq(t,e){var r=to(t,e,19),n=to(e,t,29),o=oA(t,e,6),i=r^n^o;return i<0&&(i+=4294967296),i}});var fA=ee((Bve,cA)=>{"use strict";var Tv=bn(),sA=Iv();function Fo(){if(!(this instanceof Fo))return new Fo;sA.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Tv.inherits(Fo,sA);cA.exports=Fo;Fo.blockSize=1024;Fo.outSize=384;Fo.hmacStrength=192;Fo.padLength=128;Fo.prototype._digest=function(e){return e==="hex"?Tv.toHex32(this.h.slice(0,12),"big"):Tv.split32(this.h.slice(0,12),"big")}});var uA=ee(bc=>{"use strict";bc.sha1=J9();bc.sha224=rA();bc.sha256=wv();bc.sha384=fA();bc.sha512=Iv()});var bA=ee(mA=>{"use strict";var Ga=bn(),gq=lc(),Tp=Ga.rotl32,dA=Ga.sum32,ud=Ga.sum32_3,lA=Ga.sum32_4,hA=gq.BlockHash;function ro(){if(!(this instanceof ro))return new ro;hA.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ga.inherits(ro,hA);mA.ripemd160=ro;ro.blockSize=512;ro.outSize=160;ro.hmacStrength=192;ro.padLength=64;ro.prototype._update=function(e,r){for(var n=this.h[0],o=this.h[1],i=this.h[2],a=this.h[3],s=this.h[4],c=n,f=o,u=i,d=a,m=s,b=0;b<80;b++){var w=dA(Tp(lA(n,pA(b,o,i,a),e[wq[b]+r],vq(b)),Aq[b]),s);n=s,s=a,a=Tp(i,10),i=o,o=w,w=dA(Tp(lA(c,pA(79-b,f,u,d),e[Eq[b]+r],xq(b)),Sq[b]),m),c=m,m=d,d=Tp(u,10),u=f,f=w}w=ud(this.h[1],i,d),this.h[1]=ud(this.h[2],a,m),this.h[2]=ud(this.h[3],s,c),this.h[3]=ud(this.h[4],n,f),this.h[4]=ud(this.h[0],o,u),this.h[0]=w};ro.prototype._digest=function(e){return e==="hex"?Ga.toHex32(this.h,"little"):Ga.split32(this.h,"little")};function pA(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function vq(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function xq(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var wq=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Eq=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Aq=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Sq=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var gA=ee((Cve,yA)=>{"use strict";var Iq=bn(),Tq=Pi();function yc(t,e,r){if(!(this instanceof yc))return new yc(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Iq.toArray(e,r))}yA.exports=yc;yc.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),Tq(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)};yc.prototype.update=function(e,r){return this.inner.update(e,r),this};yc.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}});var _p=ee(vA=>{var $t=vA;$t.utils=bn();$t.common=lc();$t.sha=uA();$t.ripemd=bA();$t.hmac=gA();$t.sha1=$t.sha.sha1;$t.sha256=$t.sha.sha256;$t.sha224=$t.sha.sha224;$t.sha384=$t.sha.sha384;$t.sha512=$t.sha.sha512;$t.ripemd160=$t.ripemd.ripemd160});var wA=ee((kve,xA)=>{xA.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var Bp=ee(SA=>{"use strict";var Bv=SA,Mi=_p(),_v=gv(),_q=Rr(),EA=_q.assert;function AA(t){t.type==="short"?this.curve=new _v.short(t):t.type==="edwards"?this.curve=new _v.edwards(t):this.curve=new _v.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,EA(this.g.validate(),"Invalid curve"),EA(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Bv.PresetCurve=AA;function $i(t,e){Object.defineProperty(Bv,t,{configurable:!0,enumerable:!0,get:function(){var r=new AA(e);return Object.defineProperty(Bv,t,{configurable:!0,enumerable:!0,value:r}),r}})}$i("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Mi.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});$i("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Mi.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});$i("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Mi.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});$i("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Mi.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});$i("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Mi.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});$i("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Mi.sha256,gRed:!1,g:["9"]});$i("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Mi.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Rv;try{Rv=wA()}catch{Rv=void 0}$i("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Mi.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Rv]})});var _A=ee(($ve,TA)=>{"use strict";var Bq=_p(),Va=dv(),IA=Pi();function Ni(t){if(!(this instanceof Ni))return new Ni(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Va.toArray(t.entropy,t.entropyEnc||"hex"),r=Va.toArray(t.nonce,t.nonceEnc||"hex"),n=Va.toArray(t.pers,t.persEnc||"hex");IA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}TA.exports=Ni;Ni.prototype._init=function(e,r,n){var o=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(o),this._reseed=1,this.reseedInterval=281474976710656};Ni.prototype._hmac=function(){return new Bq.hmac(this.hash,this.K)};Ni.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};Ni.prototype.reseed=function(e,r,n,o){typeof r!="string"&&(o=n,n=r,r=null),e=Va.toArray(e,r),n=Va.toArray(n,o),IA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ni.prototype.generate=function(e,r,n,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(o=n,n=r,r=null),n&&(n=Va.toArray(n,o||"hex"),this._update(n));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(n),this._reseed++,Va.encode(a,r)}});var RA=ee((Nve,BA)=>{"use strict";var Rq=Yn(),Pq=Rr(),Pv=Pq.assert;function jt(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}BA.exports=jt;jt.fromPublic=function(e,r,n){return r instanceof jt?r:new jt(e,{pub:r,pubEnc:n})};jt.fromPrivate=function(e,r,n){return r instanceof jt?r:new jt(e,{priv:r,privEnc:n})};jt.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};jt.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};jt.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};jt.prototype._importPrivate=function(e,r){this.priv=new Rq(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};jt.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?Pv(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Pv(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};jt.prototype.derive=function(e){return e.validate()||Pv(e.validate(),"public point not validated"),e.mul(this.priv).getX()};jt.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};jt.prototype.verify=function(e,r,n){return this.ec.verify(e,r,this,void 0,n)};jt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var OA=ee((Fve,CA)=>{"use strict";var Rp=Yn(),kv=Rr(),Cq=kv.assert;function Pp(t,e){if(t instanceof Pp)return t;this._importDER(t,e)||(Cq(t.r&&t.s,"Signature without r or s"),this.r=new Rp(t.r,16),this.s=new Rp(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}CA.exports=Pp;function Oq(){this.place=0}function Cv(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var o=0,i=0,a=e.place;i<n;i++,a++)o<<=8,o|=t[a],o>>>=0;return o<=127?!1:(e.place=a,o)}function PA(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Pp.prototype._importDER=function(e,r){e=kv.toArray(e,r);var n=new Oq;if(e[n.place++]!==48)return!1;var o=Cv(e,n);if(o===!1||o+n.place!==e.length||e[n.place++]!==2)return!1;var i=Cv(e,n);if(i===!1||(e[n.place]&128)!==0)return!1;var a=e.slice(n.place,i+n.place);if(n.place+=i,e[n.place++]!==2)return!1;var s=Cv(e,n);if(s===!1||e.length!==s+n.place||(e[n.place]&128)!==0)return!1;var c=e.slice(n.place,s+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new Rp(a),this.s=new Rp(c),this.recoveryParam=null,!0};function Ov(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Pp.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=PA(r),n=PA(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var o=[2];Ov(o,r.length),o=o.concat(r),o.push(2),Ov(o,n.length);var i=o.concat(n),a=[48];return Ov(a,i.length),a=a.concat(i),kv.encode(a,e)}});var $A=ee((Lve,MA)=>{"use strict";var vn=Yn(),kA=_A(),kq=Rr(),Mv=Bp(),Mq=mv(),Ya=kq.assert,$v=RA(),Cp=OA();function qr(t){if(!(this instanceof qr))return new qr(t);typeof t=="string"&&(Ya(Object.prototype.hasOwnProperty.call(Mv,t),"Unknown curve "+t),t=Mv[t]),t instanceof Mv.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}MA.exports=qr;qr.prototype.keyPair=function(e){return new $v(this,e)};qr.prototype.keyFromPrivate=function(e,r){return $v.fromPrivate(this,e,r)};qr.prototype.keyFromPublic=function(e,r){return $v.fromPublic(this,e,r)};qr.prototype.genKeyPair=function(e){e||(e={});for(var r=new kA({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Mq(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),o=this.n.sub(new vn(2));;){var i=new vn(r.generate(n));if(!(i.cmp(o)>0))return i.iaddn(1),this.keyFromPrivate(i)}};qr.prototype._truncateToN=function(e,r,n){var o;if(vn.isBN(e)||typeof e=="number")e=new vn(e,16),o=e.byteLength();else if(typeof e=="object")o=e.length,e=new vn(e,16);else{var i=e.toString();o=i.length+1>>>1,e=new vn(i,16)}typeof n!="number"&&(n=o*8);var a=n-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};qr.prototype.sign=function(e,r,n,o){if(typeof n=="object"&&(o=n,n=null),o||(o={}),typeof e!="string"&&typeof e!="number"&&!vn.isBN(e)){Ya(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Ya(e.length>>>0===e.length);for(var i=0;i<e.length;i++)Ya((e[i]&255)===e[i])}r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,o.msgBitLength),Ya(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),s=r.getPrivate().toArray("be",a),c=e.toArray("be",a);Ya(new vn(c).eq(e),"Can not sign message");for(var f=new kA({hash:this.hash,entropy:s,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),u=this.n.sub(new vn(1)),d=0;;d++){var m=o.k?o.k(d):new vn(f.generate(this.n.byteLength()));if(m=this._truncateToN(m,!0),!(m.cmpn(1)<=0||m.cmp(u)>=0)){var b=this.g.mul(m);if(!b.isInfinity()){var w=b.getX(),T=w.umod(this.n);if(T.cmpn(0)!==0){var P=m.invm(this.n).mul(T.mul(r.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var R=(b.getY().isOdd()?1:0)|(w.cmp(T)!==0?2:0);return o.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),R^=1),new Cp({r:T,s:P,recoveryParam:R})}}}}}};qr.prototype.verify=function(e,r,n,o,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),n=this.keyFromPublic(n,o),r=new Cp(r,"hex");var a=r.r,s=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var c=s.invm(this.n),f=c.mul(e).umod(this.n),u=c.mul(a).umod(this.n),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(f,n.getPublic(),u),d.isInfinity()?!1:d.eqXToP(a)):(d=this.g.mulAdd(f,n.getPublic(),u),d.isInfinity()?!1:d.getX().umod(this.n).cmp(a)===0)};qr.prototype.recoverPubKey=function(t,e,r,n){Ya((3&r)===r,"The recovery param is more than two bits"),e=new Cp(e,n);var o=this.n,i=new vn(t),a=e.r,s=e.s,c=r&1,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");f?a=this.curve.pointFromX(a.add(this.curve.n),c):a=this.curve.pointFromX(a,c);var u=e.r.invm(o),d=o.sub(i).mul(u).umod(o),m=s.mul(u).umod(o);return this.g.mulAdd(d,a,m)};qr.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Cp(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(t,e,o)}catch{continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")}});var UA=ee((Uve,LA)=>{"use strict";var dd=Rr(),FA=dd.assert,NA=dd.parseBytes,gc=dd.cachedProperty;function Bt(t,e){this.eddsa=t,this._secret=NA(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=NA(e.pub)}Bt.fromPublic=function(e,r){return r instanceof Bt?r:new Bt(e,{pub:r})};Bt.fromSecret=function(e,r){return r instanceof Bt?r:new Bt(e,{secret:r})};Bt.prototype.secret=function(){return this._secret};gc(Bt,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});gc(Bt,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});gc(Bt,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,o=r.slice(0,e.encodingLength);return o[0]&=248,o[n]&=127,o[n]|=64,o});gc(Bt,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});gc(Bt,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});gc(Bt,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Bt.prototype.sign=function(e){return FA(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Bt.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Bt.prototype.getSecret=function(e){return FA(this._secret,"KeyPair is public only"),dd.encode(this.secret(),e)};Bt.prototype.getPublic=function(e){return dd.encode(this.pubBytes(),e)};LA.exports=Bt});var zA=ee((jve,DA)=>{"use strict";var $q=Yn(),Op=Rr(),jA=Op.assert,kp=Op.cachedProperty,Nq=Op.parseBytes;function Za(t,e){this.eddsa=t,typeof e!="object"&&(e=Nq(e)),Array.isArray(e)&&(jA(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),jA(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof $q&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}kp(Za,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});kp(Za,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});kp(Za,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});kp(Za,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Za.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Za.prototype.toHex=function(){return Op.encode(this.toBytes(),"hex").toUpperCase()};DA.exports=Za});var GA=ee((Dve,KA)=>{"use strict";var Fq=_p(),Lq=Bp(),vc=Rr(),Uq=vc.assert,HA=vc.parseBytes,WA=UA(),qA=zA();function hr(t){if(Uq(t==="ed25519","only tested with ed25519 so far"),!(this instanceof hr))return new hr(t);t=Lq[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Fq.sha512}KA.exports=hr;hr.prototype.sign=function(e,r){e=HA(e);var n=this.keyFromSecret(r),o=this.hashInt(n.messagePrefix(),e),i=this.g.mul(o),a=this.encodePoint(i),s=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),c=o.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:a})};hr.prototype.verify=function(e,r,n){if(e=HA(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var o=this.keyFromPublic(n),i=this.hashInt(r.Rencoded(),o.pubBytes(),e),a=this.g.mul(r.S()),s=r.R().add(o.pub().mul(i));return s.eq(a)};hr.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return vc.intFromLE(e.digest()).umod(this.curve.n)};hr.prototype.keyFromPublic=function(e){return WA.fromPublic(this,e)};hr.prototype.keyFromSecret=function(e){return WA.fromSecret(this,e)};hr.prototype.makeSignature=function(e){return e instanceof qA?e:new qA(this,e)};hr.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r};hr.prototype.decodePoint=function(e){e=vc.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),o=(e[r]&128)!==0,i=vc.intFromLE(n);return this.curve.pointFromY(i,o)};hr.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};hr.prototype.decodeInt=function(e){return vc.intFromLE(e)};hr.prototype.isPoint=function(e){return e instanceof this.pointClass}});var YA=ee(VA=>{"use strict";var Ja=VA;Ja.version=w9().version;Ja.utils=Rr();Ja.rand=mv();Ja.curve=gv();Ja.curves=Bp();Ja.ec=$A();Ja.eddsa=GA()});var JA=ee((qve,ZA)=>{var jq=YA().ec,no=new jq("secp256k1"),ae=no.curve,we=ae.n.constructor;function Dq(t,e){let r=new we(e);if(r.cmp(ae.p)>=0)return null;r=r.toRed(ae.red);let n=r.redSqr().redIMul(r).redIAdd(ae.b).redSqrt();t===3!==n.isOdd()&&(n=n.redNeg());let o=r.redSqr().redIMul(r);return n.redSqr().redISub(o.redIAdd(ae.b)).isZero()?no.keyPair({pub:{x:r,y:n}}):null}function zq(t,e,r){let n=new we(e),o=new we(r);if(n.cmp(ae.p)>=0||o.cmp(ae.p)>=0||(n=n.toRed(ae.red),o=o.toRed(ae.red),(t===6||t===7)&&o.isOdd()!==(t===7)))return null;let i=n.redSqr().redIMul(n);return o.redSqr().redISub(i.redIAdd(ae.b)).isZero()?no.keyPair({pub:{x:n,y:o}}):null}function Fi(t){let e=t[0];switch(e){case 2:case 3:return t.length!==33?null:Dq(e,t.subarray(1,33));case 4:case 6:case 7:return t.length!==65?null:zq(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function Xa(t,e){let r=e.encode(null,t.length===33);for(let n=0;n<t.length;++n)t[n]=r[n]}ZA.exports={contextRandomize(){return 0},privateKeyVerify(t){let e=new we(t);return e.cmp(ae.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){let e=new we(t),r=ae.n.sub(e).umod(ae.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){let r=new we(e);if(r.cmp(ae.n)>=0||(r.iadd(new we(t)),r.cmp(ae.n)>=0&&r.isub(ae.n),r.isZero()))return 1;let n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new we(e);if(r.cmp(ae.n)>=0||r.isZero())return 1;r.imul(new we(t)),r.cmp(ae.n)>=0&&(r=r.umod(ae.n));let n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify(t){return Fi(t)===null?1:0},publicKeyCreate(t,e){let r=new we(e);if(r.cmp(ae.n)>=0||r.isZero())return 1;let n=no.keyFromPrivate(e).getPublic();return Xa(t,n),0},publicKeyConvert(t,e){let r=Fi(e);if(r===null)return 1;let n=r.getPublic();return Xa(t,n),0},publicKeyNegate(t,e){let r=Fi(e);if(r===null)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),Xa(t,n),0},publicKeyCombine(t,e){let r=new Array(e.length);for(let o=0;o<e.length;++o)if(r[o]=Fi(e[o]),r[o]===null)return 1;let n=r[0].getPublic();for(let o=1;o<r.length;++o)n=n.add(r[o].pub);return n.isInfinity()?2:(Xa(t,n),0)},publicKeyTweakAdd(t,e,r){let n=Fi(e);if(n===null)return 1;if(r=new we(r),r.cmp(ae.n)>=0)return 2;let o=n.getPublic().add(ae.g.mul(r));return o.isInfinity()?2:(Xa(t,o),0)},publicKeyTweakMul(t,e,r){let n=Fi(e);if(n===null)return 1;if(r=new we(r),r.cmp(ae.n)>=0||r.isZero())return 2;let o=n.getPublic().mul(r);return Xa(t,o),0},signatureNormalize(t){let e=new we(t.subarray(0,32)),r=new we(t.subarray(32,64));return e.cmp(ae.n)>=0||r.cmp(ae.n)>=0?1:(r.cmp(no.nh)===1&&t.set(ae.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){let r=e.subarray(0,32),n=e.subarray(32,64);if(new we(r).cmp(ae.n)>=0||new we(n).cmp(ae.n)>=0)return 1;let{output:o}=t,i=o.subarray(4,37);i[0]=0,i.set(r,1);let a=33,s=0;for(;a>1&&i[s]===0&&!(i[s+1]&128);--a,++s);if(i=i.subarray(s),i[0]&128||a>1&&i[0]===0&&!(i[1]&128))return 1;let c=o.subarray(39,72);c[0]=0,c.set(n,1);let f=33,u=0;for(;f>1&&c[u]===0&&!(c[u+1]&128);--f,++u);return c=c.subarray(u),c[0]&128||f>1&&c[0]===0&&!(c[1]&128)?1:(t.outputlen=6+a+f,o[0]=48,o[1]=t.outputlen-2,o[2]=2,o[3]=i.length,o.set(i,4),o[4+a]=2,o[5+a]=c.length,o.set(c,6+a),0)},signatureImport(t,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;let r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;let n=e[5+r];if(n===0||6+r+n!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||n>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let o=e.subarray(4,4+r);if(o.length===33&&o[0]===0&&(o=o.subarray(1)),o.length>32)return 1;let i=e.subarray(6+r);if(i.length===33&&i[0]===0&&(i=i.slice(1)),i.length>32)throw new Error("S length is too long");let a=new we(o);a.cmp(ae.n)>=0&&(a=new we(0));let s=new we(e.subarray(6+r));return s.cmp(ae.n)>=0&&(s=new we(0)),t.set(a.toArrayLike(Uint8Array,"be",32),0),t.set(s.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,n,o){if(o){let s=o;o=c=>{let f=s(e,r,null,n,c);if(!(f instanceof Uint8Array&&f.length===32))throw new Error("This is the way");return new we(f)}}let i=new we(r);if(i.cmp(ae.n)>=0||i.isZero())return 1;let a;try{a=no.sign(e,r,{canonical:!0,k:o,pers:n})}catch{return 1}return t.signature.set(a.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(a.s.toArrayLike(Uint8Array,"be",32),32),t.recid=a.recoveryParam,0},ecdsaVerify(t,e,r){let n={r:t.subarray(0,32),s:t.subarray(32,64)},o=new we(n.r),i=new we(n.s);if(o.cmp(ae.n)>=0||i.cmp(ae.n)>=0)return 1;if(i.cmp(no.nh)===1||o.isZero()||i.isZero())return 3;let a=Fi(r);if(a===null)return 2;let s=a.getPublic();return no.verify(e,n,s)?0:3},ecdsaRecover(t,e,r,n){let o={r:e.slice(0,32),s:e.slice(32,64)},i=new we(o.r),a=new we(o.s);if(i.cmp(ae.n)>=0||a.cmp(ae.n)>=0)return 1;if(i.isZero()||a.isZero())return 2;let s;try{s=no.recoverPubKey(n,o,r)}catch{return 2}return Xa(t,s),0},ecdh(t,e,r,n,o,i,a){let s=Fi(e);if(s===null)return 1;let c=new we(r);if(c.cmp(ae.n)>=0||c.isZero())return 2;let f=s.getPublic().mul(c);if(o===void 0){let u=f.encode(null,!0),d=no.hash().update(u).digest();for(let m=0;m<32;++m)t[m]=d[m]}else{i||(i=new Uint8Array(32));let u=f.getX().toArray("be",32);for(let w=0;w<32;++w)i[w]=u[w];a||(a=new Uint8Array(32));let d=f.getY().toArray("be",32);for(let w=0;w<32;++w)a[w]=d[w];let m=o(i,a,n);if(!(m instanceof Uint8Array&&m.length===t.length))return 2;t.set(m)}return 0}}});var Nv=ee((Hve,XA)=>{XA.exports=x9()(JA())});var e7=ee(md=>{"use strict";var $p=md&&md.__assign||function(){return $p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},$p.apply(this,arguments)};Object.defineProperty(md,"__esModule",{value:!0});var Gq={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function Vq(t){var e=$p($p({},Gq),t);return e.numOfAttempts<1&&(e.numOfAttempts=1),e}md.getSanitizedOptions=Vq});var t7=ee(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});function Yq(t){var e=Math.random()*t;return Math.round(e)}Lv.fullJitter=Yq});var r7=ee(Uv=>{"use strict";Object.defineProperty(Uv,"__esModule",{value:!0});function Zq(t){return t}Uv.noJitter=Zq});var n7=ee(jv=>{"use strict";Object.defineProperty(jv,"__esModule",{value:!0});var Jq=t7(),Xq=r7();function Qq(t){return t.jitter==="full"?Jq.fullJitter:Xq.noJitter}jv.JitterFactory=Qq});var zv=ee(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});var eH=n7(),tH=(function(){function t(e){this.options=e,this.attempt=0}return t.prototype.apply=function(){var e=this;return new Promise(function(r){return setTimeout(r,e.jitteredDelay)})},t.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(t.prototype,"jitteredDelay",{get:function(){var e=eH.JitterFactory(this.options);return e(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"delay",{get:function(){var e=this.options.startingDelay,r=this.options.timeMultiple,n=this.numOfDelayedAttempts,o=e*Math.pow(r,n);return Math.min(o,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),t})();Dv.Delay=tH});var o7=ee(Lo=>{"use strict";var rH=Lo&&Lo.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),nH=Lo&&Lo.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{f(n.next(u))}catch(d){a(d)}}function c(u){try{f(n.throw(u))}catch(d){a(d)}}function f(u){u.done?i(u.value):o(u.value).then(s,c)}f((n=n.apply(t,e||[])).next())})},oH=Lo&&Lo.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(f){return function(u){return c([f,u])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=f[0]&2?o.return:f[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,f[1])).done)return i;switch(o=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,o=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(u){f=[6,u],o=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}};Object.defineProperty(Lo,"__esModule",{value:!0});var iH=zv(),aH=(function(t){rH(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.apply=function(){return nH(this,void 0,void 0,function(){return oH(this,function(r){return[2,this.isFirstAttempt?!0:t.prototype.apply.call(this)]})})},Object.defineProperty(e.prototype,"isFirstAttempt",{get:function(){return this.attempt===0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),e})(iH.Delay);Lo.SkipFirstDelay=aH});var i7=ee(bd=>{"use strict";var sH=bd&&bd.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(bd,"__esModule",{value:!0});var cH=zv(),fH=(function(t){sH(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(cH.Delay);bd.AlwaysDelay=fH});var a7=ee(qv=>{"use strict";Object.defineProperty(qv,"__esModule",{value:!0});var uH=o7(),dH=i7();function lH(t,e){var r=pH(t);return r.setAttemptNumber(e),r}qv.DelayFactory=lH;function pH(t){return t.delayFirstAttempt?new dH.AlwaysDelay(t):new uH.SkipFirstDelay(t)}});var s7=ee(Qa=>{"use strict";var Hv=Qa&&Qa.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{f(n.next(u))}catch(d){a(d)}}function c(u){try{f(n.throw(u))}catch(d){a(d)}}function f(u){u.done?i(u.value):o(u.value).then(s,c)}f((n=n.apply(t,e||[])).next())})},Wv=Qa&&Qa.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(f){return function(u){return c([f,u])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=f[0]&2?o.return:f[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,f[1])).done)return i;switch(o=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,o=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=e.call(t,r)}catch(u){f=[6,u],o=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}};Object.defineProperty(Qa,"__esModule",{value:!0});var hH=e7(),mH=a7();function bH(t,e){return e===void 0&&(e={}),Hv(this,void 0,void 0,function(){var r,n;return Wv(this,function(o){switch(o.label){case 0:return r=hH.getSanitizedOptions(e),n=new yH(t,r),[4,n.execute()];case 1:return[2,o.sent()]}})})}Qa.backOff=bH;var yH=(function(){function t(e,r){this.request=e,this.options=r,this.attemptNumber=0}return t.prototype.execute=function(){return Hv(this,void 0,void 0,function(){var e,r;return Wv(this,function(n){switch(n.label){case 0:if(this.attemptLimitReached)return[3,7];n.label=1;case 1:return n.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return n.sent(),[4,this.request()];case 3:return[2,n.sent()];case 4:return e=n.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(r=n.sent(),!r||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}})})},Object.defineProperty(t.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),t.prototype.applyDelay=function(){return Hv(this,void 0,void 0,function(){var e;return Wv(this,function(r){switch(r.label){case 0:return e=mH.DelayFactory(this.options,this.attemptNumber),[4,e.apply()];case 1:return r.sent(),[2]}})})},t})()});var E7=ee((q2e,Kv)=>{"use strict";var xc=typeof Reflect=="object"?Reflect:null,l7=xc&&typeof xc.apply=="function"?xc.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Np;xc&&typeof xc.ownKeys=="function"?Np=xc.ownKeys:Object.getOwnPropertySymbols?Np=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Np=function(e){return Object.getOwnPropertyNames(e)};function SH(t){console&&console.warn&&console.warn(t)}var h7=Number.isNaN||function(e){return e!==e};function ye(){ye.init.call(this)}Kv.exports=ye;Kv.exports.once=BH;ye.EventEmitter=ye;ye.prototype._events=void 0;ye.prototype._eventsCount=0;ye.prototype._maxListeners=void 0;var p7=10;function Fp(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(ye,"defaultMaxListeners",{enumerable:!0,get:function(){return p7},set:function(t){if(typeof t!="number"||t<0||h7(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");p7=t}});ye.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ye.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||h7(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function m7(t){return t._maxListeners===void 0?ye.defaultMaxListeners:t._maxListeners}ye.prototype.getMaxListeners=function(){return m7(this)};ye.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var o=e==="error",i=this._events;if(i!==void 0)o=o&&i.error===void 0;else if(!o)return!1;if(o){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(c===void 0)return!1;if(typeof c=="function")l7(c,this,r);else for(var f=c.length,u=x7(c,f),n=0;n<f;++n)l7(u[n],this,r);return!0};function b7(t,e,r,n){var o,i,a;if(Fp(r),i=t._events,i===void 0?(i=t._events=Object.create(null),t._eventsCount=0):(i.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),a=i[e]),a===void 0)a=i[e]=r,++t._eventsCount;else if(typeof a=="function"?a=i[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),o=m7(t),o>0&&a.length>o&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,SH(s)}return t}ye.prototype.addListener=function(e,r){return b7(this,e,r,!1)};ye.prototype.on=ye.prototype.addListener;ye.prototype.prependListener=function(e,r){return b7(this,e,r,!0)};function IH(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y7(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=IH.bind(n);return o.listener=r,n.wrapFn=o,o}ye.prototype.once=function(e,r){return Fp(r),this.on(e,y7(this,e,r)),this};ye.prototype.prependOnceListener=function(e,r){return Fp(r),this.prependListener(e,y7(this,e,r)),this};ye.prototype.removeListener=function(e,r){var n,o,i,a,s;if(Fp(r),o=this._events,o===void 0)return this;if(n=o[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():TH(n,i),n.length===1&&(o[e]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};ye.prototype.off=ye.prototype.removeListener;ye.prototype.removeAllListeners=function(e){var r,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(o=0;o<i.length;++o)a=i[o],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(o=r.length-1;o>=0;o--)this.removeListener(e,r[o]);return this};function g7(t,e,r){var n=t._events;if(n===void 0)return[];var o=n[e];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?_H(o):x7(o,o.length)}ye.prototype.listeners=function(e){return g7(this,e,!0)};ye.prototype.rawListeners=function(e){return g7(this,e,!1)};ye.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):v7.call(t,e)};ye.prototype.listenerCount=v7;function v7(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}ye.prototype.eventNames=function(){return this._eventsCount>0?Np(this._events):[]};function x7(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function TH(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function _H(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function BH(t,e){return new Promise(function(r,n){function o(a){t.removeListener(e,i),n(a)}function i(){typeof t.removeListener=="function"&&t.removeListener("error",o),r([].slice.call(arguments))}w7(t,e,i,{once:!0}),e!=="error"&&RH(t,o,{once:!0})})}function RH(t,e,r){typeof t.on=="function"&&w7(t,"error",e,r)}function w7(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function o(i){n.once&&t.removeEventListener(e,o),r(i)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var V7=ee((O6e,Hp)=>{(function(){"use strict";var t="input is invalid type",e=typeof window=="object",r=e?window:{};r.JS_SHA256_NO_WINDOW&&(e=!1);var n=!e&&typeof self=="object",o=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?r=global:n&&(r=self);var i=!r.JS_SHA256_NO_COMMON_JS&&typeof Hp=="object"&&Hp.exports,a=typeof define=="function"&&define.amd,s=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],u=[24,16,8,0],d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],m=["hex","array","digest","arrayBuffer"],b=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(B){return Object.prototype.toString.call(B)==="[object Array]"}),s&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(B){return typeof B=="object"&&B.buffer&&B.buffer.constructor===ArrayBuffer});var w=function(B,N){return function(M){return new _(N,!0).update(M)[B]()}},T=function(B){var N=w("hex",B);o&&(N=P(N,B)),N.create=function(){return new _(B)},N.update=function(v){return N.create().update(v)};for(var M=0;M<m.length;++M){var F=m[M];N[F]=w(F,B)}return N},P=function(B){return B},R=function(B,N){return function(M,F){return new O(M,N,!0).update(F)[B]()}},k=function(B){var N=R("hex",B);N.create=function(v){return new O(v,B)},N.update=function(v,l){return N.create(v).update(l)};for(var M=0;M<m.length;++M){var F=m[M];N[F]=R(F,B)}return N};function _(B,N){N?(b[0]=b[16]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=b[9]=b[10]=b[11]=b[12]=b[13]=b[14]=b[15]=0,this.blocks=b):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],B?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=B}_.prototype.update=function(B){if(!this.finalized){var N,M=typeof B;if(M!=="string"){if(M==="object"){if(B===null)throw new Error(t);if(s&&B.constructor===ArrayBuffer)B=new Uint8Array(B);else if(!Array.isArray(B)&&(!s||!ArrayBuffer.isView(B)))throw new Error(t)}else throw new Error(t);N=!0}for(var F,v=0,l,h=B.length,y=this.blocks;v<h;){if(this.hashed&&(this.hashed=!1,y[0]=this.block,y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0),N)for(l=this.start;v<h&&l<64;++v)y[l>>2]|=B[v]<<u[l++&3];else for(l=this.start;v<h&&l<64;++v)F=B.charCodeAt(v),F<128?y[l>>2]|=F<<u[l++&3]:F<2048?(y[l>>2]|=(192|F>>6)<<u[l++&3],y[l>>2]|=(128|F&63)<<u[l++&3]):F<55296||F>=57344?(y[l>>2]|=(224|F>>12)<<u[l++&3],y[l>>2]|=(128|F>>6&63)<<u[l++&3],y[l>>2]|=(128|F&63)<<u[l++&3]):(F=65536+((F&1023)<<10|B.charCodeAt(++v)&1023),y[l>>2]|=(240|F>>18)<<u[l++&3],y[l>>2]|=(128|F>>12&63)<<u[l++&3],y[l>>2]|=(128|F>>6&63)<<u[l++&3],y[l>>2]|=(128|F&63)<<u[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=64?(this.block=y[16],this.start=l-64,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},_.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var B=this.blocks,N=this.lastByteIndex;B[16]=this.block,B[N>>2]|=f[N&3],this.block=B[16],N>=56&&(this.hashed||this.hash(),B[0]=this.block,B[16]=B[1]=B[2]=B[3]=B[4]=B[5]=B[6]=B[7]=B[8]=B[9]=B[10]=B[11]=B[12]=B[13]=B[14]=B[15]=0),B[14]=this.hBytes<<3|this.bytes>>>29,B[15]=this.bytes<<3,this.hash()}},_.prototype.hash=function(){var B=this.h0,N=this.h1,M=this.h2,F=this.h3,v=this.h4,l=this.h5,h=this.h6,y=this.h7,g=this.blocks,x,E,S,A,p,I,C,L,j,D,z;for(x=16;x<64;++x)p=g[x-15],E=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,p=g[x-2],S=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,g[x]=g[x-16]+E+g[x-7]+S<<0;for(z=N&M,x=0;x<64;x+=4)this.first?(this.is224?(L=300032,p=g[0]-1413257819,y=p-150054599<<0,F=p+24177077<<0):(L=704751109,p=g[0]-210244248,y=p-1521486534<<0,F=p+143694565<<0),this.first=!1):(E=(B>>>2|B<<30)^(B>>>13|B<<19)^(B>>>22|B<<10),S=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),L=B&N,A=L^B&M^z,C=v&l^~v&h,p=y+S+C+d[x]+g[x],I=E+A,y=F+p<<0,F=p+I<<0),E=(F>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),S=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),j=F&B,A=j^F&N^L,C=y&v^~y&l,p=h+S+C+d[x+1]+g[x+1],I=E+A,h=M+p<<0,M=p+I<<0,E=(M>>>2|M<<30)^(M>>>13|M<<19)^(M>>>22|M<<10),S=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),D=M&F,A=D^M&B^j,C=h&y^~h&v,p=l+S+C+d[x+2]+g[x+2],I=E+A,l=N+p<<0,N=p+I<<0,E=(N>>>2|N<<30)^(N>>>13|N<<19)^(N>>>22|N<<10),S=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),z=N&M,A=z^N&F^D,C=l&h^~l&y,p=v+S+C+d[x+3]+g[x+3],I=E+A,v=B+p<<0,B=p+I<<0;this.h0=this.h0+B<<0,this.h1=this.h1+N<<0,this.h2=this.h2+M<<0,this.h3=this.h3+F<<0,this.h4=this.h4+v<<0,this.h5=this.h5+l<<0,this.h6=this.h6+h<<0,this.h7=this.h7+y<<0},_.prototype.hex=function(){this.finalize();var B=this.h0,N=this.h1,M=this.h2,F=this.h3,v=this.h4,l=this.h5,h=this.h6,y=this.h7,g=c[B>>28&15]+c[B>>24&15]+c[B>>20&15]+c[B>>16&15]+c[B>>12&15]+c[B>>8&15]+c[B>>4&15]+c[B&15]+c[N>>28&15]+c[N>>24&15]+c[N>>20&15]+c[N>>16&15]+c[N>>12&15]+c[N>>8&15]+c[N>>4&15]+c[N&15]+c[M>>28&15]+c[M>>24&15]+c[M>>20&15]+c[M>>16&15]+c[M>>12&15]+c[M>>8&15]+c[M>>4&15]+c[M&15]+c[F>>28&15]+c[F>>24&15]+c[F>>20&15]+c[F>>16&15]+c[F>>12&15]+c[F>>8&15]+c[F>>4&15]+c[F&15]+c[v>>28&15]+c[v>>24&15]+c[v>>20&15]+c[v>>16&15]+c[v>>12&15]+c[v>>8&15]+c[v>>4&15]+c[v&15]+c[l>>28&15]+c[l>>24&15]+c[l>>20&15]+c[l>>16&15]+c[l>>12&15]+c[l>>8&15]+c[l>>4&15]+c[l&15]+c[h>>28&15]+c[h>>24&15]+c[h>>20&15]+c[h>>16&15]+c[h>>12&15]+c[h>>8&15]+c[h>>4&15]+c[h&15];return this.is224||(g+=c[y>>28&15]+c[y>>24&15]+c[y>>20&15]+c[y>>16&15]+c[y>>12&15]+c[y>>8&15]+c[y>>4&15]+c[y&15]),g},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var B=this.h0,N=this.h1,M=this.h2,F=this.h3,v=this.h4,l=this.h5,h=this.h6,y=this.h7,g=[B>>24&255,B>>16&255,B>>8&255,B&255,N>>24&255,N>>16&255,N>>8&255,N&255,M>>24&255,M>>16&255,M>>8&255,M&255,F>>24&255,F>>16&255,F>>8&255,F&255,v>>24&255,v>>16&255,v>>8&255,v&255,l>>24&255,l>>16&255,l>>8&255,l&255,h>>24&255,h>>16&255,h>>8&255,h&255];return this.is224||g.push(y>>24&255,y>>16&255,y>>8&255,y&255),g},_.prototype.array=_.prototype.digest,_.prototype.arrayBuffer=function(){this.finalize();var B=new ArrayBuffer(this.is224?28:32),N=new DataView(B);return N.setUint32(0,this.h0),N.setUint32(4,this.h1),N.setUint32(8,this.h2),N.setUint32(12,this.h3),N.setUint32(16,this.h4),N.setUint32(20,this.h5),N.setUint32(24,this.h6),this.is224||N.setUint32(28,this.h7),B};function O(B,N,M){var F,v=typeof B;if(v==="string"){var l=[],h=B.length,y=0,g;for(F=0;F<h;++F)g=B.charCodeAt(F),g<128?l[y++]=g:g<2048?(l[y++]=192|g>>6,l[y++]=128|g&63):g<55296||g>=57344?(l[y++]=224|g>>12,l[y++]=128|g>>6&63,l[y++]=128|g&63):(g=65536+((g&1023)<<10|B.charCodeAt(++F)&1023),l[y++]=240|g>>18,l[y++]=128|g>>12&63,l[y++]=128|g>>6&63,l[y++]=128|g&63);B=l}else if(v==="object"){if(B===null)throw new Error(t);if(s&&B.constructor===ArrayBuffer)B=new Uint8Array(B);else if(!Array.isArray(B)&&(!s||!ArrayBuffer.isView(B)))throw new Error(t)}else throw new Error(t);B.length>64&&(B=new _(N,!0).update(B).array());var x=[],E=[];for(F=0;F<64;++F){var S=B[F]||0;x[F]=92^S,E[F]=54^S}_.call(this,N,M),this.update(E),this.oKeyPad=x,this.inner=!0,this.sharedMemory=M}O.prototype=new _,O.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var B=this.array();_.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(B),_.prototype.finalize.call(this)}};var $=T();$.sha256=$,$.sha224=T(!0),$.sha256.hmac=k(),$.sha224.hmac=k(!0),i?Hp.exports=$:(r.sha256=$.sha256,r.sha224=$.sha224,a&&define(function(){return $}))})()});var fk=ee(Km=>{"use strict";Km.byteLength=she;Km.toByteArray=fhe;Km.fromByteArray=lhe;var ho=[],Xr=[],ahe=typeof Uint8Array<"u"?Uint8Array:Array,i8="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ss=0,sk=i8.length;Ss<sk;++Ss)ho[Ss]=i8[Ss],Xr[i8.charCodeAt(Ss)]=Ss;var Ss,sk;Xr[45]=62;Xr[95]=63;function ck(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function she(t){var e=ck(t),r=e[0],n=e[1];return(r+n)*3/4-n}function che(t,e,r){return(e+r)*3/4-r}function fhe(t){var e,r=ck(t),n=r[0],o=r[1],i=new ahe(che(t,n,o)),a=0,s=o>0?n-4:n,c;for(c=0;c<s;c+=4)e=Xr[t.charCodeAt(c)]<<18|Xr[t.charCodeAt(c+1)]<<12|Xr[t.charCodeAt(c+2)]<<6|Xr[t.charCodeAt(c+3)],i[a++]=e>>16&255,i[a++]=e>>8&255,i[a++]=e&255;return o===2&&(e=Xr[t.charCodeAt(c)]<<2|Xr[t.charCodeAt(c+1)]>>4,i[a++]=e&255),o===1&&(e=Xr[t.charCodeAt(c)]<<10|Xr[t.charCodeAt(c+1)]<<4|Xr[t.charCodeAt(c+2)]>>2,i[a++]=e>>8&255,i[a++]=e&255),i}function uhe(t){return ho[t>>18&63]+ho[t>>12&63]+ho[t>>6&63]+ho[t&63]}function dhe(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),o.push(uhe(n));return o.join("")}function lhe(t){for(var e,r=t.length,n=r%3,o=[],i=16383,a=0,s=r-n;a<s;a+=i)o.push(dhe(t,a,a+i>s?s:a+i));return n===1?(e=t[r-1],o.push(ho[e>>2]+ho[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(ho[e>>10]+ho[e>>4&63]+ho[e<<2&63]+"=")),o.join("")}});var uk=ee(a8=>{a8.read=function(t,e,r,n,o){var i,a,s=o*8-n-1,c=(1<<s)-1,f=c>>1,u=-7,d=r?o-1:0,m=r?-1:1,b=t[e+d];for(d+=m,i=b&(1<<-u)-1,b>>=-u,u+=s;u>0;i=i*256+t[e+d],d+=m,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=a*256+t[e+d],d+=m,u-=8);if(i===0)i=1-f;else{if(i===c)return a?NaN:(b?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-f}return(b?-1:1)*a*Math.pow(2,i-n)};a8.write=function(t,e,r,n,o,i){var a,s,c,f=i*8-o-1,u=(1<<f)-1,d=u>>1,m=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:i-1,w=n?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?e+=m/c:e+=m*Math.pow(2,1-d),e*c>=2&&(a++,c/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(e*c-1)*Math.pow(2,o),a=a+d):(s=e*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;t[r+b]=s&255,b+=w,s/=256,o-=8);for(a=a<<o|s,f+=o;f>0;t[r+b]=a&255,b+=w,a/=256,f-=8);t[r+b-w]|=T*128}});var _k=ee(Ef=>{"use strict";var s8=fk(),xf=uk(),dk=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ef.Buffer=H;Ef.SlowBuffer=ghe;Ef.INSPECT_MAX_BYTES=50;var Gm=2147483647;Ef.kMaxLength=Gm;H.TYPED_ARRAY_SUPPORT=phe();!H.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function phe(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(H.prototype,"parent",{enumerable:!0,get:function(){if(H.isBuffer(this))return this.buffer}});Object.defineProperty(H.prototype,"offset",{enumerable:!0,get:function(){if(H.isBuffer(this))return this.byteOffset}});function Zo(t){if(t>Gm)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,H.prototype),e}function H(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d8(t)}return mk(t,e,r)}H.poolSize=8192;function mk(t,e,r){if(typeof t=="string")return mhe(t,e);if(ArrayBuffer.isView(t))return bhe(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(mo(t,ArrayBuffer)||t&&mo(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(mo(t,SharedArrayBuffer)||t&&mo(t.buffer,SharedArrayBuffer)))return f8(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return H.from(n,e,r);let o=yhe(t);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return H.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}H.from=function(t,e,r){return mk(t,e,r)};Object.setPrototypeOf(H.prototype,Uint8Array.prototype);Object.setPrototypeOf(H,Uint8Array);function bk(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function hhe(t,e,r){return bk(t),t<=0?Zo(t):e!==void 0?typeof r=="string"?Zo(t).fill(e,r):Zo(t).fill(e):Zo(t)}H.alloc=function(t,e,r){return hhe(t,e,r)};function d8(t){return bk(t),Zo(t<0?0:l8(t)|0)}H.allocUnsafe=function(t){return d8(t)};H.allocUnsafeSlow=function(t){return d8(t)};function mhe(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!H.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=yk(t,e)|0,n=Zo(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}function c8(t){let e=t.length<0?0:l8(t.length)|0,r=Zo(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function bhe(t){if(mo(t,Uint8Array)){let e=new Uint8Array(t);return f8(e.buffer,e.byteOffset,e.byteLength)}return c8(t)}function f8(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,H.prototype),n}function yhe(t){if(H.isBuffer(t)){let e=l8(t.length)|0,r=Zo(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||h8(t.length)?Zo(0):c8(t);if(t.type==="Buffer"&&Array.isArray(t.data))return c8(t.data)}function l8(t){if(t>=Gm)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Gm.toString(16)+" bytes");return t|0}function ghe(t){return+t!=t&&(t=0),H.alloc(+t)}H.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==H.prototype};H.compare=function(e,r){if(mo(e,Uint8Array)&&(e=H.from(e,e.offset,e.byteLength)),mo(r,Uint8Array)&&(r=H.from(r,r.offset,r.byteLength)),!H.isBuffer(e)||!H.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,o=r.length;for(let i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};H.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};H.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return H.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let o=H.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){let a=e[n];if(mo(a,Uint8Array))i+a.length>o.length?(H.isBuffer(a)||(a=H.from(a)),a.copy(o,i)):Uint8Array.prototype.set.call(o,a,i);else if(H.isBuffer(a))a.copy(o,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=a.length}return o};function yk(t,e){if(H.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||mo(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return u8(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Tk(t).length;default:if(o)return n?-1:u8(t).length;e=(""+e).toLowerCase(),o=!0}}H.byteLength=yk;function vhe(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Rhe(this,e,r);case"utf8":case"utf-8":return vk(this,e,r);case"ascii":return _he(this,e,r);case"latin1":case"binary":return Bhe(this,e,r);case"base64":return Ihe(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Phe(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}H.prototype._isBuffer=!0;function Is(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}H.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Is(this,r,r+1);return this};H.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Is(this,r,r+3),Is(this,r+1,r+2);return this};H.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Is(this,r,r+7),Is(this,r+1,r+6),Is(this,r+2,r+5),Is(this,r+3,r+4);return this};H.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?vk(this,0,e):vhe.apply(this,arguments)};H.prototype.toLocaleString=H.prototype.toString;H.prototype.equals=function(e){if(!H.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:H.compare(this,e)===0};H.prototype.inspect=function(){let e="",r=Ef.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};dk&&(H.prototype[dk]=H.prototype.inspect);H.prototype.compare=function(e,r,n,o,i){if(mo(e,Uint8Array)&&(e=H.from(e,e.offset,e.byteLength)),!H.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;let a=i-o,s=n-r,c=Math.min(a,s),f=this.slice(o,i),u=e.slice(r,n);for(let d=0;d<c;++d)if(f[d]!==u[d]){a=f[d],s=u[d];break}return a<s?-1:s<a?1:0};function gk(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,h8(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=H.from(e,n)),H.isBuffer(e))return e.length===0?-1:lk(t,e,r,n,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):lk(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function lk(t,e,r,n,o){let i=1,a=t.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,s/=2,r/=2}function c(u,d){return i===1?u[d]:u.readUInt16BE(d*i)}let f;if(o){let u=-1;for(f=r;f<a;f++)if(c(t,f)===c(e,u===-1?0:f-u)){if(u===-1&&(u=f),f-u+1===s)return u*i}else u!==-1&&(f-=f-u),u=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){let u=!0;for(let d=0;d<s;d++)if(c(t,f+d)!==c(e,d)){u=!1;break}if(u)return f}return-1}H.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};H.prototype.indexOf=function(e,r,n){return gk(this,e,r,n,!0)};H.prototype.lastIndexOf=function(e,r,n){return gk(this,e,r,n,!1)};function xhe(t,e,r,n){r=Number(r)||0;let o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;let i=e.length;n>i/2&&(n=i/2);let a;for(a=0;a<n;++a){let s=parseInt(e.substr(a*2,2),16);if(h8(s))return a;t[r+a]=s}return a}function whe(t,e,r,n){return Vm(u8(e,t.length-r),t,r,n)}function Ehe(t,e,r,n){return Vm(Mhe(e),t,r,n)}function Ahe(t,e,r,n){return Vm(Tk(e),t,r,n)}function She(t,e,r,n){return Vm($he(e,t.length-r),t,r,n)}H.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let a=!1;for(;;)switch(o){case"hex":return xhe(this,e,r,n);case"utf8":case"utf-8":return whe(this,e,r,n);case"ascii":case"latin1":case"binary":return Ehe(this,e,r,n);case"base64":return Ahe(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return She(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};H.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ihe(t,e,r){return e===0&&r===t.length?s8.fromByteArray(t):s8.fromByteArray(t.slice(e,r))}function vk(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let i=t[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(o+s<=r){let c,f,u,d;switch(s){case 1:i<128&&(a=i);break;case 2:c=t[o+1],(c&192)===128&&(d=(i&31)<<6|c&63,d>127&&(a=d));break;case 3:c=t[o+1],f=t[o+2],(c&192)===128&&(f&192)===128&&(d=(i&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=t[o+1],f=t[o+2],u=t[o+3],(c&192)===128&&(f&192)===128&&(u&192)===128&&(d=(i&15)<<18|(c&63)<<12|(f&63)<<6|u&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=s}return The(n)}var pk=4096;function The(t){let e=t.length;if(e<=pk)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=pk));return r}function _he(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function Bhe(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function Rhe(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let i=e;i<r;++i)o+=Nhe[t[i]];return o}function Phe(t,e,r){let n=t.slice(e,r),o="";for(let i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}H.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let o=this.subarray(e,r);return Object.setPrototypeOf(o,H.prototype),o};function Ct(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}H.prototype.readUintLE=H.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Ct(e,r,this.length);let o=this[e],i=1,a=0;for(;++a<r&&(i*=256);)o+=this[e+a]*i;return o};H.prototype.readUintBE=H.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Ct(e,r,this.length);let o=this[e+--r],i=1;for(;r>0&&(i*=256);)o+=this[e+--r]*i;return o};H.prototype.readUint8=H.prototype.readUInt8=function(e,r){return e=e>>>0,r||Ct(e,1,this.length),this[e]};H.prototype.readUint16LE=H.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Ct(e,2,this.length),this[e]|this[e+1]<<8};H.prototype.readUint16BE=H.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Ct(e,2,this.length),this[e]<<8|this[e+1]};H.prototype.readUint32LE=H.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Ct(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};H.prototype.readUint32BE=H.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Ct(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};H.prototype.readBigUInt64LE=oa(function(e){e=e>>>0,wf(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Pl(e,this.length-8);let o=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(o)+(BigInt(i)<<BigInt(32))});H.prototype.readBigUInt64BE=oa(function(e){e=e>>>0,wf(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Pl(e,this.length-8);let o=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(o)<<BigInt(32))+BigInt(i)});H.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Ct(e,r,this.length);let o=this[e],i=1,a=0;for(;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};H.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Ct(e,r,this.length);let o=r,i=1,a=this[e+--o];for(;o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};H.prototype.readInt8=function(e,r){return e=e>>>0,r||Ct(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};H.prototype.readInt16LE=function(e,r){e=e>>>0,r||Ct(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};H.prototype.readInt16BE=function(e,r){e=e>>>0,r||Ct(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};H.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Ct(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};H.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Ct(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};H.prototype.readBigInt64LE=oa(function(e){e=e>>>0,wf(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Pl(e,this.length-8);let o=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});H.prototype.readBigInt64BE=oa(function(e){e=e>>>0,wf(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Pl(e,this.length-8);let o=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(o)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});H.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Ct(e,4,this.length),xf.read(this,e,!0,23,4)};H.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Ct(e,4,this.length),xf.read(this,e,!1,23,4)};H.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Ct(e,8,this.length),xf.read(this,e,!0,52,8)};H.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Ct(e,8,this.length),xf.read(this,e,!1,52,8)};function vr(t,e,r,n,o,i){if(!H.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}H.prototype.writeUintLE=H.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r>>>0,n=n>>>0,!o){let s=Math.pow(2,8*n)-1;vr(this,e,r,n,s,0)}let i=1,a=0;for(this[r]=e&255;++a<n&&(i*=256);)this[r+a]=e/i&255;return r+n};H.prototype.writeUintBE=H.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r>>>0,n=n>>>0,!o){let s=Math.pow(2,8*n)-1;vr(this,e,r,n,s,0)}let i=n-1,a=1;for(this[r+i]=e&255;--i>=0&&(a*=256);)this[r+i]=e/a&255;return r+n};H.prototype.writeUint8=H.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,1,255,0),this[r]=e&255,r+1};H.prototype.writeUint16LE=H.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};H.prototype.writeUint16BE=H.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};H.prototype.writeUint32LE=H.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};H.prototype.writeUint32BE=H.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function xk(t,e,r,n,o){Ik(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function wk(t,e,r,n,o){Ik(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i=i>>8,t[r+6]=i,i=i>>8,t[r+5]=i,i=i>>8,t[r+4]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}H.prototype.writeBigUInt64LE=oa(function(e,r=0){return xk(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});H.prototype.writeBigUInt64BE=oa(function(e,r=0){return wk(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});H.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r>>>0,!o){let c=Math.pow(2,8*n-1);vr(this,e,r,n,c-1,-c)}let i=0,a=1,s=0;for(this[r]=e&255;++i<n&&(a*=256);)e<0&&s===0&&this[r+i-1]!==0&&(s=1),this[r+i]=(e/a>>0)-s&255;return r+n};H.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r>>>0,!o){let c=Math.pow(2,8*n-1);vr(this,e,r,n,c-1,-c)}let i=n-1,a=1,s=0;for(this[r+i]=e&255;--i>=0&&(a*=256);)e<0&&s===0&&this[r+i+1]!==0&&(s=1),this[r+i]=(e/a>>0)-s&255;return r+n};H.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};H.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};H.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};H.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};H.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||vr(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};H.prototype.writeBigInt64LE=oa(function(e,r=0){return xk(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});H.prototype.writeBigInt64BE=oa(function(e,r=0){return wk(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ek(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ak(t,e,r,n,o){return e=+e,r=r>>>0,o||Ek(t,e,r,4,34028234663852886e22,-34028234663852886e22),xf.write(t,e,r,n,23,4),r+4}H.prototype.writeFloatLE=function(e,r,n){return Ak(this,e,r,!0,n)};H.prototype.writeFloatBE=function(e,r,n){return Ak(this,e,r,!1,n)};function Sk(t,e,r,n,o){return e=+e,r=r>>>0,o||Ek(t,e,r,8,17976931348623157e292,-17976931348623157e292),xf.write(t,e,r,n,52,8),r+8}H.prototype.writeDoubleLE=function(e,r,n){return Sk(this,e,r,!0,n)};H.prototype.writeDoubleBE=function(e,r,n){return Sk(this,e,r,!1,n)};H.prototype.copy=function(e,r,n,o){if(!H.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);let i=o-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,o):Uint8Array.prototype.set.call(e,this.subarray(n,o),r),i};H.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!H.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(e.length===1){let a=e.charCodeAt(0);(o==="utf8"&&a<128||o==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=r;i<n;++i)this[i]=e;else{let a=H.isBuffer(e)?e:H.from(e,o),s=a.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-r;++i)this[i+r]=a[i%s]}return this};var vf={};function p8(t,e,r){vf[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}p8("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);p8("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);p8("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=hk(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=hk(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n},RangeError);function hk(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Che(t,e,r){wf(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Pl(e,t.length-(r+1))}function Ik(t,e,r,n,o,i){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",s;throw i>3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(i+1)*8}${a}`:s=`>= -(2${a} ** ${(i+1)*8-1}${a}) and < 2 ** ${(i+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new vf.ERR_OUT_OF_RANGE("value",s,t)}Che(n,o,i)}function wf(t,e){if(typeof t!="number")throw new vf.ERR_INVALID_ARG_TYPE(e,"number",t)}function Pl(t,e,r){throw Math.floor(t)!==t?(wf(t,r),new vf.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new vf.ERR_BUFFER_OUT_OF_BOUNDS:new vf.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Ohe=/[^+/0-9A-Za-z-_]/g;function khe(t){if(t=t.split("=")[0],t=t.trim().replace(Ohe,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function u8(t,e){e=e||1/0;let r,n=t.length,o=null,i=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function Mhe(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function $he(t,e){let r,n,o,i=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function Tk(t){return s8.toByteArray(khe(t))}function Vm(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function mo(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function h8(t){return t!==t}var Nhe=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e})();function oa(t){return typeof BigInt>"u"?Fhe:t}function Fhe(){throw new Error("BigInt not supported")}});var Ok,kk=U(()=>{Ok="1.2.3"});var Et,Af=U(()=>{kk();Et=class t extends Error{constructor(e,r={}){let n=r.cause instanceof t?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof t&&r.cause.docsPath||r.docsPath,i=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${Ok}`].join(`
5
+ `);super(i),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.shortMessage=e}}});function Nr(t,e){return t.exec(e)?.groups}var g8,v8,Ym,Cl=U(()=>{g8=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,v8=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Ym=/^\(.+?\).*?$/});function Zm(t){let e=t.type;if(Mk.test(t.type)&&"components"in t){e="(";let r=t.components.length;for(let o=0;o<r;o++){let i=t.components[o];e+=Zm(i),o<r-1&&(e+=", ")}let n=Nr(Mk,t.type);return e+=`)${n?.array||""}`,Zm({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e} indexed`),t.name?`${e} ${t.name}`:e}var Mk,$k=U(()=>{Cl();Mk=/^tuple(?<array>(\[(\d*)\])*)$/});function Sf(t){let e="",r=t.length;for(let n=0;n<r;n++){let o=t[n];e+=Zm(o),n!==r-1&&(e+=", ")}return e}var Nk=U(()=>{$k()});function x8(t){return t.type==="function"?`function ${t.name}(${Sf(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${Sf(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${Sf(t.inputs)})`:t.type==="error"?`error ${t.name}(${Sf(t.inputs)})`:t.type==="constructor"?`constructor(${Sf(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var Fk=U(()=>{Nk()});function Uk(t){return Lk.test(t)}function jk(t){return Nr(Lk,t)}function zk(t){return Dk.test(t)}function qk(t){return Nr(Dk,t)}function Wk(t){return Hk.test(t)}function Kk(t){return Nr(Hk,t)}function Jm(t){return Gk.test(t)}function Vk(t){return Nr(Gk,t)}function Zk(t){return Yk.test(t)}function Jk(t){return Nr(Yk,t)}function Qk(t){return Xk.test(t)}function eM(t){return Nr(Xk,t)}function tM(t){return Yhe.test(t)}var Lk,Dk,Hk,Gk,Yk,Xk,Yhe,rM,Xm,Qm=U(()=>{Cl();Lk=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;Dk=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;Hk=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;Gk=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;Yk=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;Xk=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;Yhe=/^receive\(\) external payable$/;rM=new Set(["indexed"]),Xm=new Set(["calldata","memory","storage"])});var eb,tb,w8=U(()=>{Af();eb=class extends Et{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},tb=class extends Et{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var rb,nb,ob,ib,ab,E8=U(()=>{Af();rb=class extends Et{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},nb=class extends Et{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},ob=class extends Et{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},ib=class extends Et{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},ab=class extends Et{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var bo,sb,cb,A8=U(()=>{Af();bo=class extends Et{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},sb=class extends Et{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},cb=class extends Et{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var fb,nM=U(()=>{Af();fb=class extends Et{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var ub,oM=U(()=>{Af();ub=class extends Et{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function iM(t,e,r){let n="";if(r)for(let o of Object.entries(r)){if(!o)continue;let i="";for(let a of o[1])i+=`[${a.type}${a.name?`:${a.name}`:""}]`;n+=`(${o[0]}{${i}})`}return e?`${e}:${t}${n}`:`${t}${n}`}var db,aM=U(()=>{db=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function sM(t,e={}){if(Wk(t))return Zhe(t,e);if(zk(t))return Jhe(t,e);if(Uk(t))return Xhe(t,e);if(Zk(t))return Qhe(t,e);if(Qk(t))return eme(t);if(tM(t))return{type:"receive",stateMutability:"payable"};throw new sb({signature:t})}function Zhe(t,e={}){let r=Kk(t);if(!r)throw new bo({signature:t,type:"function"});let n=Cn(r.parameters),o=[],i=n.length;for(let s=0;s<i;s++)o.push(ia(n[s],{modifiers:Xm,structs:e,type:"function"}));let a=[];if(r.returns){let s=Cn(r.returns),c=s.length;for(let f=0;f<c;f++)a.push(ia(s[f],{modifiers:Xm,structs:e,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:o,outputs:a}}function Jhe(t,e={}){let r=qk(t);if(!r)throw new bo({signature:t,type:"event"});let n=Cn(r.parameters),o=[],i=n.length;for(let a=0;a<i;a++)o.push(ia(n[a],{modifiers:rM,structs:e,type:"event"}));return{name:r.name,type:"event",inputs:o}}function Xhe(t,e={}){let r=jk(t);if(!r)throw new bo({signature:t,type:"error"});let n=Cn(r.parameters),o=[],i=n.length;for(let a=0;a<i;a++)o.push(ia(n[a],{structs:e,type:"error"}));return{name:r.name,type:"error",inputs:o}}function Qhe(t,e={}){let r=Jk(t);if(!r)throw new bo({signature:t,type:"constructor"});let n=Cn(r.parameters),o=[],i=n.length;for(let a=0;a<i;a++)o.push(ia(n[a],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:o}}function eme(t){let e=eM(t);if(!e)throw new bo({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}function ia(t,e){let r=iM(t,e?.type,e?.structs);if(db.has(r))return db.get(r);let n=Ym.test(t),o=Nr(n?rme:tme,t);if(!o)throw new rb({param:t});if(o.name&&ime(o.name))throw new nb({param:t,name:o.name});let i=o.name?{name:o.name}:{},a=o.modifier==="indexed"?{indexed:!0}:{},s=e?.structs??{},c,f={};if(n){c="tuple";let d=Cn(o.type),m=[],b=d.length;for(let w=0;w<b;w++)m.push(ia(d[w],{structs:s}));f={components:m}}else if(o.type in s)c="tuple",f={components:s[o.type]};else if(nme.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,e?.type!=="struct"&&!S8(c))throw new tb({type:c});if(o.modifier){if(!e?.modifiers?.has?.(o.modifier))throw new ob({param:t,type:e?.type,modifier:o.modifier});if(Xm.has(o.modifier)&&!ame(c,!!o.array))throw new ib({param:t,type:e?.type,modifier:o.modifier})}let u={type:`${c}${o.array??""}`,...i,...a,...f};return db.set(r,u),u}function Cn(t,e=[],r="",n=0){let o=t.trim().length;for(let i=0;i<o;i++){let a=t[i],s=t.slice(i+1);switch(a){case",":return n===0?Cn(s,[...e,r.trim()]):Cn(s,e,`${r}${a}`,n);case"(":return Cn(s,e,`${r}${a}`,n+1);case")":return Cn(s,e,`${r}${a}`,n-1);default:return Cn(s,e,`${r}${a}`,n)}}if(r==="")return e;if(n!==0)throw new ub({current:r,depth:n});return e.push(r.trim()),e}function S8(t){return t==="address"||t==="bool"||t==="function"||t==="string"||g8.test(t)||v8.test(t)}function ime(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||g8.test(t)||v8.test(t)||ome.test(t)}function ame(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}var tme,rme,nme,ome,I8=U(()=>{Cl();w8();E8();A8();oM();aM();Qm();tme=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,rme=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,nme=/^u?int$/;ome=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function cM(t){let e={},r=t.length;for(let a=0;a<r;a++){let s=t[a];if(!Jm(s))continue;let c=Vk(s);if(!c)throw new bo({signature:s,type:"struct"});let f=c.properties.split(";"),u=[],d=f.length;for(let m=0;m<d;m++){let w=f[m].trim();if(!w)continue;let T=ia(w,{type:"struct"});u.push(T)}if(!u.length)throw new cb({signature:s});e[c.name]=u}let n={},o=Object.entries(e),i=o.length;for(let a=0;a<i;a++){let[s,c]=o[a];n[s]=fM(c,e)}return n}function fM(t=[],e={},r=new Set){let n=[],o=t.length;for(let i=0;i<o;i++){let a=t[i];if(Ym.test(a.type))n.push(a);else{let c=Nr(sme,a.type);if(!c?.type)throw new ab({abiParameter:a});let{array:f,type:u}=c;if(u in e){if(r.has(u))throw new fb({type:u});n.push({...a,type:`tuple${f??""}`,components:fM(e[u],e,new Set([...r,u]))})}else if(S8(u))n.push(a);else throw new eb({type:u})}}return n}var sme,uM=U(()=>{Cl();w8();E8();A8();nM();Qm();I8();sme=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function lb(t){let e=cM(t),r=[],n=t.length;for(let o=0;o<n;o++){let i=t[o];Jm(i)||r.push(sM(i,e))}return r}var dM=U(()=>{Qm();uM();I8()});var T8=U(()=>{Fk();dM()});function re(t,e,r){let n=t[e.name];if(typeof n=="function")return n;let o=t[r];return typeof o=="function"?o:i=>e(t,i)}var Kt=U(()=>{});function Lt(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new pb(t.type);return`${t.name}(${Ol(t.inputs,{includeName:e})})`}function Ol(t,{includeName:e=!1}={}){return t?t.map(r=>cme(r,{includeName:e})).join(e?", ":","):""}function cme(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Ol(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}var aa=U(()=>{Gt()});function Ut(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}var Jo=U(()=>{});function ue(t){return Ut(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}var On=U(()=>{Jo()});var _8,lM=U(()=>{_8="2.57.10"});function pM(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?pM(t.cause,e):e?null:t}var B8,q,se=U(()=>{lM();B8={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${_8}`},q=class t extends Error{constructor(e,r={}){let n=r.cause instanceof t?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof t&&r.cause.docsPath||r.docsPath,i=B8.getDocsUrl?.({...r,docsPath:o}),a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...B8.version?[`Version: ${B8.version}`]:[]].join(`
6
+ `);super(a,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=_8}walk(e){return pM(this,e)}}});var hb,kl,If,sa,mb,bb,yb,gb,Ml,Tf,vb,xb,kn,_f,wb,Eb,Ab,$l,Sb,Ib,Tb,Bf,pb,Gt=U(()=>{aa();On();se();hb=class extends q{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
7
+ `),{docsPath:e,name:"AbiConstructorNotFoundError"})}},kl=class extends q{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
8
+ `),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}},If=class extends q{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
9
+ `),{metaMessages:[`Params: (${Ol(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}},sa=class extends q{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}},mb=class extends q{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(`
10
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}},bb=class extends q{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ue(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},yb=class extends q{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(`
11
+ `),{name:"AbiEncodingLengthMismatchError"})}},gb=class extends q{constructor(e,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
12
+ `),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}},Ml=class extends q{constructor(e,{docsPath:r}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
13
+ `),{docsPath:r,name:"AbiErrorNotFoundError"})}},Tf=class extends q{constructor(e,{docsPath:r,cause:n}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
14
+ `),{docsPath:r,name:"AbiErrorSignatureNotFoundError",cause:n}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}},vb=class extends q{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}},xb=class extends q{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
15
+ `),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}},kn=class extends q{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
16
+ `),{docsPath:r,name:"AbiFunctionNotFoundError"})}},_f=class extends q{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
17
+ `),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}},wb=class extends q{constructor(e,{docsPath:r}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(`
18
+ `),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}},Eb=class extends q{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Lt(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Lt(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},Ab=class extends q{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}},$l=class extends q{constructor({abiItem:e,data:r,params:n,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
19
+ `),{metaMessages:[`Params: (${Ol(n,{includeName:!0})})`,`Data: ${r} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=o}},Sb=class extends q{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Lt(e,{includeName:!0})}".`].join(`
20
+ `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}},Ib=class extends q{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
21
+ `),{docsPath:r,name:"InvalidAbiEncodingType"})}},Tb=class extends q{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
22
+ `),{docsPath:r,name:"InvalidAbiDecodingType"})}},Bf=class extends q{constructor(e){super([`Value "${e}" is not a valid array.`].join(`
23
+ `),{name:"InvalidArrayError"})}},pb=class extends q{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
24
+ `),{name:"InvalidDefinitionTypeError"})}}});var Nl,Fl,Ll,_b=U(()=>{se();Nl=class extends q{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},Fl=class extends q{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}},Ll=class extends q{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}});function ca(t,{dir:e,size:r=32}={}){return typeof t=="string"?Xo(t,{dir:e,size:r}):fme(t,{dir:e,size:r})}function Xo(t,{dir:e,size:r=32}={}){if(r===null)return t;let n=t.replace("0x","");if(n.length>r*2)throw new Fl({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function fme(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new Fl({size:t.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let o=0;o<r;o++){let i=e==="right";n[i?o:r-o-1]=t[i?o:t.length-o-1]}return n}var Bb=U(()=>{_b()});var fa,Rb,Pb,Ul=U(()=>{se();fa=class extends q{constructor({max:e,min:r,signed:n,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Rb=class extends q{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}},Pb=class extends q{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}});function yo(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let o=0;o<r.length-1&&r[e==="left"?o:r.length-o-1].toString()==="0";o++)n++;return r=e==="left"?r.slice(n):r.slice(0,r.length-n),typeof t=="string"?(r.length===1&&e==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}var Cb=U(()=>{});function Fr(t,{size:e}){if(ue(t)>e)throw new Pb({givenSize:ue(t),maxSize:e})}function qe(t,e={}){let{signed:r}=e;e.size&&Fr(t,{size:e.size});let n=BigInt(t);if(!r)return n;let o=Math.ceil((t.length-2)/2),i=(1n<<BigInt(o)*8n-1n)-1n;return n<=i?n:n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function gt(t,e={}){let r=qe(t,e),n=Number(r);if(!Number.isSafeInteger(n))throw new fa({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${r}n`});return n}var ar=U(()=>{Ul();On()});function Vt(t,e={}){return typeof t=="number"||typeof t=="bigint"?V(t,e):typeof t=="string"?jl(t,e):typeof t=="boolean"?R8(t,e):Ce(t,e)}function R8(t,e={}){let r=`0x${Number(t)}`;return typeof e.size=="number"?(Fr(r,{size:e.size}),ca(r,{size:e.size})):r}function Ce(t,e={}){let r="";for(let o=0;o<t.length;o++)r+=ume[t[o]];let n=`0x${r}`;return typeof e.size=="number"?(Fr(n,{size:e.size}),ca(n,{dir:"right",size:e.size})):n}function V(t,e={}){let{signed:r,size:n}=e,o=BigInt(t),i;n?r?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof i=="bigint"&&r?-i-1n:0;if(i&&o>i||o<a){let c=typeof t=="bigint"?"n":"";throw new fa({max:i?`${i}${c}`:void 0,min:`${a}${c}`,signed:r,size:n,value:`${t}${c}`})}let s=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?ca(s,{size:n}):s}function jl(t,e={}){let r=dme.encode(t);return Ce(r,e)}var ume,dme,pe=U(()=>{Ul();Bb();ar();ume=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));dme=new TextEncoder});function ua(t,e={}){return typeof t=="number"||typeof t=="bigint"?hme(t,e):typeof t=="boolean"?pme(t,e):Ut(t)?sr(t,e):Dl(t,e)}function pme(t,e={}){let r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(Fr(r,{size:e.size}),ca(r,{size:e.size})):r}function hM(t){if(t>=Qo.zero&&t<=Qo.nine)return t-Qo.zero;if(t>=Qo.A&&t<=Qo.F)return t-(Qo.A-10);if(t>=Qo.a&&t<=Qo.f)return t-(Qo.a-10)}function sr(t,e={}){let r=t;e.size&&(Fr(r,{size:e.size}),r=ca(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let o=n.length/2,i=new Uint8Array(o);for(let a=0,s=0;a<o;a++){let c=hM(n.charCodeAt(s++)),f=hM(n.charCodeAt(s++));if(c===void 0||f===void 0)throw new q(`Invalid byte sequence ("${n[s-2]}${n[s-1]}" in "${n}").`);i[a]=c*16+f}return i}function hme(t,e){let r=V(t,e);return sr(r)}function Dl(t,e={}){let r=lme.encode(t);return typeof e.size=="number"?(Fr(r,{size:e.size}),ca(r,{dir:"right",size:e.size})):r}var lme,Qo,Qr=U(()=>{se();Jo();Bb();ar();pe();lme=new TextEncoder;Qo={zero:48,nine:57,A:65,F:70,a:97,f:102}});function mme(t,e=!1){return e?{h:Number(t&Ob),l:Number(t>>mM&Ob)}:{h:Number(t>>mM&Ob)|0,l:Number(t&Ob)|0}}function bM(t,e=!1){let r=t.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){let{h:a,l:s}=mme(t[i],e);[n[i],o[i]]=[a,s]}return[n,o]}var Ob,mM,yM,gM,vM,xM,wM=U(()=>{Ob=BigInt(4294967295),mM=BigInt(32);yM=(t,e,r)=>t<<r|e>>>32-r,gM=(t,e,r)=>e<<r|t>>>32-r,vM=(t,e,r)=>e<<r-32|t>>>64-r,xM=(t,e,r)=>t<<r-32|e>>>64-r});function Ame(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){let s=(a+8)%10,c=(a+2)%10,f=r[c],u=r[c+1],d=EM(f,u,1)^r[s],m=AM(f,u,1)^r[s+1];for(let b=0;b<50;b+=10)t[a+b]^=d,t[a+b+1]^=m}let o=t[2],i=t[3];for(let a=0;a<24;a++){let s=IM[a],c=EM(o,i,s),f=AM(o,i,s),u=SM[a];o=t[u],i=t[u+1],t[u]=c,t[u+1]=f}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)r[s]=t[a+s];for(let s=0;s<10;s++)t[a+s]^=~r[(s+2)%10]&r[(s+4)%10]}t[0]^=wme[n],t[1]^=Eme[n]}Gn(r)}var bme,zl,yme,gme,vme,xme,SM,IM,TM,_M,wme,Eme,EM,AM,P8,Sme,BM,RM=U(()=>{wM();Vn();bme=BigInt(0),zl=BigInt(1),yme=BigInt(2),gme=BigInt(7),vme=BigInt(256),xme=BigInt(113),SM=[],IM=[],TM=[];for(let t=0,e=zl,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],SM.push(2*(5*n+r)),IM.push((t+1)*(t+2)/2%64);let o=bme;for(let i=0;i<7;i++)e=(e<<zl^(e>>gme)*xme)%vme,e&yme&&(o^=zl<<(zl<<BigInt(i))-zl);TM.push(o)}_M=bM(TM,!0),wme=_M[0],Eme=_M[1],EM=(t,e,r)=>r>32?vM(t,e,r):yM(t,e,r),AM=(t,e,r)=>r>32?xM(t,e,r):gM(t,e,r);P8=class t extends Bi{constructor(e,r,n,o=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,qa(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=y9(this.state)}clone(){return this._cloneInto()}keccak(){fv(this.state32),Ame(this.state32,this.rounds),fv(this.state32),this.posOut=0,this.pos=0}update(e){ko(this),e=Ha(e),Kn(e);let{blockLen:r,state:n}=this,o=e.length;for(let i=0;i<o;){let a=Math.min(r-this.pos,o-i);for(let s=0;s<a;s++)n[this.pos++]^=e[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:o}=this;e[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),e[o-1]^=128,this.keccak()}writeInto(e){ko(this,!1),Kn(e),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,i=e.length;o<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-o);e.set(r.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return qa(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(mp(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Gn(this.state)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:a}=this;return e||(e=new t(r,n,o,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=o,e.enableXOF=a,e.destroyed=this.destroyed,e}},Sme=(t,e,r)=>yp(()=>new P8(e,t,r)),BM=Sme(1,136,256/8)});function Mn(t,e){let r=e||"hex",n=BM(Ut(t,{strict:!1})?ua(t):t);return r==="bytes"?n:Vt(n)}var Rf=U(()=>{RM();Jo();Qr();pe()});function PM(t){return Ime(t)}var Ime,CM=U(()=>{Qr();Rf();Ime=t=>Mn(ua(t))});function OM(t){let e=!0,r="",n=0,o="",i=!1;for(let a=0;a<t.length;a++){let s=t[a];if(["(",")",","].includes(s)&&(e=!0),s==="("&&n++,s===")"&&n--,!!e){if(n===0){if(s===" "&&["event","function",""].includes(o))o="";else if(o+=s,s===")"){i=!0;break}continue}if(s===" "){!r.endsWith(",")&&!r.endsWith("(")&&(r="",e=!1);continue}o+=s,r+=s}}if(!i)throw new q("Unable to normalize signature.");return o}var kM=U(()=>{se()});var MM,$M=U(()=>{T8();kM();MM=t=>{let e=typeof t=="string"?t:x8(t);return OM(e)}});function kb(t){return PM(MM(t))}var C8=U(()=>{CM();$M()});var Pf,Mb=U(()=>{C8();Pf=kb});var Te,go=U(()=>{se();Te=class extends q{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var xr,Ts=U(()=>{xr=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let r=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,r)),r}set(e,r){if(super.has(e)&&super.delete(e),super.set(e,r),this.maxSize&&this.size>this.maxSize){let n=super.keys().next().value;n!==void 0&&super.delete(n)}return this}}});function ei(t,e){if(O8.has(`${t}.${e}`))return O8.get(`${t}.${e}`);let r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=Mn(Dl(r),"bytes"),o=(e?r.substring(`${e}0x`.length):r).split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&o[a]&&(o[a]=o[a].toUpperCase()),(n[a>>1]&15)>=8&&o[a+1]&&(o[a+1]=o[a+1].toUpperCase());let i=`0x${o.join("")}`;return O8.set(`${t}.${e}`,i),i}function NM(t,e){if(!de(t,{strict:!1}))throw new Te({address:t});return ei(t,e)}var O8,Cf=U(()=>{go();Qr();Rf();Ts();en();O8=new xr(8192)});function de(t,e){let{strict:r=!0}=e??{},n=`${t}.${r}`;if(k8.has(n))return k8.get(n);let o=Tme.test(t)?t.toLowerCase()===t?!0:r?ei(t)===t:!0:!1;return k8.set(n,o),o}var Tme,k8,en=U(()=>{Ts();Cf();Tme=/^0x[a-fA-F0-9]{40}$/,k8=new xr(8192)});function $n(t){return typeof t[0]=="string"?Fe(t):_me(t)}function _me(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function Fe(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}var tn=U(()=>{});function rn(t,e,r,{strict:n}={}){return Ut(t,{strict:!1})?$b(t,e,r,{strict:n}):M8(t,e,r,{strict:n})}function FM(t,e){if(typeof e=="number"&&e>0&&e>ue(t)-1)throw new Nl({offset:e,position:"start",size:ue(t)})}function LM(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ue(t)!==r-e)throw new Nl({offset:r,position:"end",size:ue(t)})}function M8(t,e,r,{strict:n}={}){FM(t,e);let o=t.slice(e,r);return n&&LM(o,e,r),o}function $b(t,e,r,{strict:n}={}){FM(t,e);let o=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&LM(o,e,r),o}var da=U(()=>{_b();Jo();On()});var UM,Nb,$8=U(()=>{UM=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Nb=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function vo(t,e){if(t.length!==e.length)throw new yb({expectedLength:t.length,givenLength:e.length});let r=Bme({params:t,values:e});return L8(r)}function Bme({params:t,values:e}){let r=[];for(let n=0;n<t.length;n++)r.push(F8({param:t[n],value:e[n]}));return r}function F8({param:t,value:e}){let r=ql(t.type);if(r){let[n,o]=r;return Pme(e,{length:n,param:{...t,type:o}})}if(t.type==="tuple")return $me(e,{param:t});if(t.type==="address")return Rme(e);if(t.type==="bool")return Ome(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){let n=t.type.startsWith("int"),[,,o="256"]=Nb.exec(t.type)??[];return kme(e,{signed:n,size:Number(o)})}if(t.type.startsWith("bytes"))return Cme(e,{param:t});if(t.type==="string")return Mme(e);throw new Ib(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function L8(t){let e=0;for(let i=0;i<t.length;i++){let{dynamic:a,encoded:s}=t[i];a?e+=32:e+=ue(s)}let r=[],n=[],o=0;for(let i=0;i<t.length;i++){let{dynamic:a,encoded:s}=t[i];a?(r.push(V(e+o,{size:32})),n.push(s),o+=ue(s)):r.push(s)}return Fe([...r,...n])}function Rme(t){if(!de(t))throw new Te({address:t});return{dynamic:!1,encoded:Xo(t.toLowerCase())}}function Pme(t,{length:e,param:r}){let n=e===null;if(!Array.isArray(t))throw new Bf(t);if(!n&&t.length!==e)throw new mb({expectedLength:e,givenLength:t.length,type:`${r.type}[${e}]`});let o=t.length===0&&N8(r),i=[];for(let a=0;a<t.length;a++){let s=F8({param:r,value:t[a]});s.dynamic&&(o=!0),i.push(s)}if(n||o){let a=L8(i);if(n){let s=V(i.length,{size:32});return{dynamic:!0,encoded:Fe([s,a])}}if(o)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Fe(i.map(({encoded:a})=>a))}}function Cme(t,{param:e}){let[,r]=e.type.split("bytes"),n=ue(t);if(!r){let o=t;return n%32!==0&&(o=Xo(o,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Fe([Xo(V(n,{size:32})),o])}}if(n!==Number.parseInt(r,10))throw new bb({expectedSize:Number.parseInt(r,10),value:t});return{dynamic:!1,encoded:Xo(t,{dir:"right"})}}function Ome(t){if(typeof t!="boolean")throw new q(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Xo(R8(t))}}function kme(t,{signed:e,size:r=256}){if(typeof r=="number"){let n=2n**(BigInt(r)-(e?1n:0n))-1n,o=e?-n-1n:0n;if(t>n||t<o)throw new fa({max:n.toString(),min:o.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:V(t,{size:32,signed:e})}}function Mme(t){let e=jl(t),r=Math.ceil(ue(e)/32),n=[];for(let o=0;o<r;o++)n.push(Xo(rn(e,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Fe([Xo(V(ue(e),{size:32})),...n])}}function $me(t,{param:e}){let r=!1,n=[];for(let o=0;o<e.components.length;o++){let i=e.components[o],a=Array.isArray(t)?o:i.name,s=F8({param:i,value:t[a]});n.push(s),s.dynamic&&(r=!0)}return{dynamic:r,encoded:r?L8(n):Fe(n.map(({encoded:o})=>o))}}function ql(t){let e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function N8(t){let{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return t.components.some(N8);let r=ql(e);return r?N8({...t,type:r[1]}):!1}var _s=U(()=>{Gt();go();se();Ul();en();tn();Bb();On();da();pe();$8()});var xo,Of=U(()=>{da();C8();xo=t=>rn(kb(t),0,4)});function wo(t){let{abi:e,args:r=[],name:n}=t,o=Ut(n,{strict:!1}),i=e.filter(s=>o?s.type==="function"?xo(s)===n:s.type==="event"?Pf(s)===n:!1:"name"in s&&s.name===n);if(i.length===0)return;if(i.length===1)return i[0];let a;for(let s of i){if(!("inputs"in s))continue;if(!r||r.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==r.length)continue;if(r.every((f,u)=>{let d="inputs"in s&&s.inputs[u];return d?U8(f,d):!1})){if(a&&"inputs"in a&&a.inputs){let f=jM(s.inputs,a.inputs,r);if(f)throw new Eb({abiItem:s,type:f[0]},{abiItem:a,type:f[1]})}a=s}}return a||i[0]}function U8(t,e){let r=typeof t,n=e.type;switch(n){case"address":return de(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((o,i)=>r==="object"&&U8(Object.values(t)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(o=>U8(o,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function jM(t,e,r){for(let n in t){let o=t[n],i=e[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return jM(o.components,i.components,r[n]);let a=[o.type,i.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?de(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?de(r[n],{strict:!1}):!1)return a}}var kf=U(()=>{Gt();Jo();en();Mb();Of()});function oe(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}var vt=U(()=>{});function zM(t){let{abi:e,args:r,functionName:n}=t,o=e[0];if(n){let i=wo({abi:e,args:r,name:n});if(!i)throw new kn(n,{docsPath:DM});o=i}if(o.type!=="function")throw new kn(void 0,{docsPath:DM});return{abi:[o],functionName:xo(Lt(o))}}var DM,qM=U(()=>{Gt();Of();aa();kf();DM="/docs/contract/encodeFunctionData"});function Lr(t){let{args:e}=t,{abi:r,functionName:n}=t.abi.length===1&&t.functionName?.startsWith("0x")?t:zM(t),o=r[0],i=n,a="inputs"in o&&o.inputs?vo(o.inputs,e??[]):void 0;return Fe([i,a??"0x"])}var Bs=U(()=>{tn();_s();qM()});var HM,Fb,WM,Lb=U(()=>{HM={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Fb={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},WM={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});var Hl,Mf,Ub,j8=U(()=>{se();Hl=class extends q{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Mf=class extends q{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}},Ub=class extends q{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function $f(t,{recursiveReadLimit:e=8192}={}){let r=Object.create(Nme);return r.bytes=t,r.dataView=new DataView(t.buffer??t,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}var Nme,jb=U(()=>{j8();Nme={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Ub({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new Mf({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new Hl({offset:t});let e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new Hl({offset:t});let e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){let r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){let e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){let e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){let e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();let r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();let t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();let t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();let t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();let t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){let e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}}});function KM(t,e={}){typeof e.size<"u"&&Fr(t,{size:e.size});let r=Ce(t);return qe(r,e)}function GM(t,e={}){let r=t;if(typeof e.size<"u"&&(Fr(r,{size:e.size}),r=yo(r)),r.length>1||r[0]>1)throw new Rb(r);return!!r[0]}function Eo(t,e={}){typeof e.size<"u"&&Fr(t,{size:e.size});let r=Ce(t);return gt(r,e)}function VM(t,e={}){let r=t;return typeof e.size<"u"&&(Fr(r,{size:e.size}),r=yo(r,{dir:"right"})),new TextDecoder().decode(r)}var YM=U(()=>{Ul();Cb();ar();pe()});function ti(t,e){let r=typeof e=="string"?sr(e):e,n=$f(r);if(ue(r)===0&&t.length>0)throw new sa;if(ue(e)&&ue(e)<32)throw new If({data:typeof e=="string"?e:Ce(e),params:t,size:ue(e)});let o=0,i=[];for(let a=0;a<t.length;++a){let s=t[a];o<r.length&&n.setPosition(o);let[c,f]=Nf(n,s,{staticPosition:0});o+=f,i.push(c)}return i}function Nf(t,e,{staticPosition:r}){let n=ql(e.type);if(n){let[o,i]=n;return Lme(t,{...e,type:i},{length:o,staticPosition:r})}if(e.type==="tuple")return zme(t,e,{staticPosition:r});if(e.type==="address")return Fme(t);if(e.type==="bool")return Ume(t);if(e.type.startsWith("bytes"))return jme(t,e,{staticPosition:r});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Dme(t,e);if(e.type==="string")return qme(t,{staticPosition:r});throw new Tb(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function Fme(t){let e=t.readBytes(32);return[ei(Ce(M8(e,-20))),32]}function Lme(t,e,{length:r,staticPosition:n}){if(r===null){let a=Eo(t.readBytes(D8)),s=n+a,c=s+ZM;t.setPosition(s);let f=Eo(t.readBytes(ZM)),u=Wl(e),d=0,m=[];for(let b=0;b<f;++b){t.setPosition(c+(u?b*32:d));let[w,T]=Nf(t,e,{staticPosition:c});d+=T,m.push(w),T===0&&(t.assertReadLimit(),t._touch())}return t.setPosition(n+32),[m,32]}if(Wl(e)){let a=Eo(t.readBytes(D8)),s=n+a,c=[];for(let f=0;f<r;++f){t.setPosition(s+f*32);let[u]=Nf(t,e,{staticPosition:s});c.push(u)}return t.setPosition(n+32),[c,32]}let o=0,i=[];for(let a=0;a<r;++a){let[s,c]=Nf(t,e,{staticPosition:n+o});o+=c,i.push(s),c===0&&(t.assertReadLimit(),t._touch())}return[i,o]}function Ume(t){return[GM(t.readBytes(32),{size:32}),32]}function jme(t,e,{staticPosition:r}){let[n,o]=e.type.split("bytes");if(!o){let a=Eo(t.readBytes(32));t.setPosition(r+a);let s=Eo(t.readBytes(32));if(s===0)return t.setPosition(r+32),["0x",32];let c=t.readBytes(s);return t.setPosition(r+32),[Ce(c),32]}return[Ce(t.readBytes(Number.parseInt(o,10),32)),32]}function Dme(t,e){let r=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256",10),o=t.readBytes(32);return[n>48?KM(o,{signed:r}):Eo(o,{signed:r}),32]}function zme(t,e,{staticPosition:r}){let n=e.components.length===0||e.components.some(({name:a})=>!a),o=n?[]:{},i=0;if(Wl(e)){let a=Eo(t.readBytes(D8)),s=r+a;for(let c=0;c<e.components.length;++c){let f=e.components[c];t.setPosition(s+i);let[u,d]=Nf(t,f,{staticPosition:s});i+=d,o[n?c:f?.name]=u}return t.setPosition(r+32),[o,32]}for(let a=0;a<e.components.length;++a){let s=e.components[a],[c,f]=Nf(t,s,{staticPosition:r});o[n?a:s?.name]=c,i+=f}return[o,i]}function qme(t,{staticPosition:e}){let r=Eo(t.readBytes(32)),n=e+r;t.setPosition(n);let o=Eo(t.readBytes(32));if(o===0)return t.setPosition(e+32),["",32];let i=t.readBytes(o,32),a=VM(i);return t.setPosition(e+32),[a,32]}function Wl(t){let{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return t.components?.some(Wl);let r=ql(t.type);return!!(r&&Wl({...t,type:r[1]}))}var ZM,D8,Kl=U(()=>{Gt();Cf();jb();On();da();YM();Qr();pe();_s();ZM=32,D8=32});function Db(t){let{abi:e,data:r,cause:n}=t,o=rn(r,0,4);if(o==="0x")throw new sa({cause:n});let a=[...e||[],Fb,WM].find(s=>s.type==="error"&&o===xo(Lt(s)));if(!a)throw new Tf(o,{docsPath:"/docs/contract/decodeErrorResult",cause:n});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?ti(a.inputs,rn(r,4)):void 0,errorName:a.name}}var z8=U(()=>{Lb();Gt();da();Of();Kl();aa()});var He,Nn=U(()=>{He=(t,e,r)=>JSON.stringify(t,(n,o)=>{let i=typeof o=="bigint"?o.toString():o;return typeof e=="function"?e(n,i):i},r)});function q8({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((o,i)=>`${n&&o.name?`${o.name}: `:""}${typeof e[i]=="object"?He(e[i]):e[i]}`).join(", ")})`}var JM=U(()=>{Nn()});function Hb(t,e=0){if(!Number.isInteger(e)||e<0)throw new qb({decimals:e});let r=t.toString(),n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[o,i]=[r.slice(0,r.length-e),r.slice(r.length-e)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${i?`.${i}`:""}`}function XM(t,e="wei"){return Hb(t,zb.ether-zb[e])}function QM(t,e="wei"){return Hb(t,zb.gwei-zb[e])}function e$(t,e=0){if(!Number.isInteger(e)||e<0)throw new qb({decimals:e});if(!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(t))throw new H8({value:t});let[r="",n="0"]=t.split("."),o=r.startsWith("-");if(o&&(r=r.slice(1)),r===""&&(r="0"),n=n.replace(/(0+)$/,""),e===0)n.length>0&&Number.parseInt(n[0],10)>=5&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){let i=n.slice(0,e);if(Number.parseInt(n.slice(e,e+1),10)>=5){let s=Hme(i);s.length>e?(n=s.slice(1),r=`${BigInt(r)+1n}`):n=s}else n=i}else n=n.padEnd(e,"0");return BigInt(`${o?"-":""}${r}${n}`)}function Hme(t){let e=t.split(""),r=e.length-1;for(;r>=0;){let n=Number.parseInt(e[r],10)+1;if(n<10)return e[r]=String(n),e.join("");e[r]="0",r--}return`1${e.join("")}`}var zb,H8,qb,Gl=U(()=>{zb={wei:0,gwei:9,szabo:12,finney:15,ether:18};H8=class extends Error{constructor({value:e}){super(`Value \`${e}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}},qb=class extends Error{constructor({decimals:e}){super(`\`decimals\` must be a non-negative integer. Got \`${e}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}});function Ff(t,e="wei"){return XM(t,e)}var Kb=U(()=>{Gl()});function At(t,e="wei"){return QM(t,e)}var Lf=U(()=>{Gl()});function t$(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n}
25
+ `,"")}function r$(t){return t.reduce((e,{address:r,...n})=>{let o=`${e} ${r}:
26
+ `;return n.nonce&&(o+=` nonce: ${n.nonce}
27
+ `),n.balance&&(o+=` balance: ${n.balance}
28
+ `),n.code&&(o+=` code: ${n.code}
29
+ `),n.state&&(o+=` state:
30
+ `,o+=t$(n.state)),n.stateDiff&&(o+=` stateDiff:
31
+ `,o+=t$(n.stateDiff)),o},` State Override:
32
+ `).slice(0,-1)}var Gb,Vb,W8=U(()=>{se();Gb=class extends q{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}},Vb=class extends q{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}});function Ps(t){let e=Object.entries(t).map(([n,o])=>o===void 0||o===!1?null:[n,o]).filter(Boolean),r=e.reduce((n,[o])=>Math.max(n,o.length),0);return e.map(([n,o])=>` ${`${n}:`.padEnd(r+1)} ${o}`).join(`
33
+ `)}var Uf,Yb,Zb,Jb,Xb,jf,Df,Rs,Qb,wr=U(()=>{Kb();Lf();se();Uf=class extends q{constructor({filledNonce:e,requestedNonce:r}){super("The filled transaction nonce does not match the requested nonce.",{metaMessages:[`Requested Nonce: ${r}`,`Filled Nonce: ${e}`],name:"FeePayerNonceMismatchError"})}},Yb=class extends q{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}},Zb=class extends q{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ps(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}},Jb=class extends q{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}},Xb=class extends q{constructor(e,{account:r,docsPath:n,chain:o,data:i,gas:a,gasPrice:s,maxFeePerGas:c,maxPriorityFeePerGas:f,nonce:u,to:d,value:m}){let b=Ps({chain:o&&`${o?.name} (id: ${o?.id})`,from:r?.address,to:d,value:typeof m<"u"&&`${Ff(m)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:a,gasPrice:typeof s<"u"&&`${At(s)} gwei`,maxFeePerGas:typeof c<"u"&&`${At(c)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${At(f)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",b].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}},jf=class extends q{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:o,index:i}){let a="Transaction";n&&i!==void 0&&(a=`Transaction at block time "${n}" at index "${i}"`),e&&i!==void 0&&(a=`Transaction at block hash "${e}" at index "${i}"`),r&&i!==void 0&&(a=`Transaction at block number "${r}" at index "${i}"`),o&&(a=`Transaction with hash "${o}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}},Df=class extends q{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}},Rs=class extends q{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}},Qb=class extends q{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}});function Yt(t){if(t?.reason)return t.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");let e=new Error("This operation was aborted");return e.name="AbortError",e}function Ao(t){return typeof t=="object"&&t!==null&&"name"in t&&t.name==="AbortError"}var n$,zf,ri=U(()=>{n$=t=>t;zf=t=>{try{let e=new URL(t);return!e.username&&!e.password?t:(e.username="",e.password="",e.toString())}catch{return t}}});var e1,t1,r1,n1,o1,qf,i1=U(()=>{vt();Lb();z8();aa();JM();kf();Kb();Lf();Gt();se();W8();wr();ri();e1=class extends q{constructor(e,{account:r,docsPath:n,chain:o,data:i,gas:a,gasPrice:s,maxFeePerGas:c,maxPriorityFeePerGas:f,nonce:u,to:d,value:m,stateOverride:b}){let w=r?oe(r):void 0,T=Ps({from:w?.address,to:d,value:typeof m<"u"&&`${Ff(m)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:a,gasPrice:typeof s<"u"&&`${At(s)} gwei`,maxFeePerGas:typeof c<"u"&&`${At(c)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${At(f)} gwei`,nonce:u});b&&(T+=`
34
+ ${r$(b)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",T].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}},t1=class extends q{constructor(e,{abi:r,args:n,contractAddress:o,docsPath:i,functionName:a,sender:s}){let c=wo({abi:r,args:n,name:a}),f=c?q8({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Lt(c,{includeName:!0}):void 0,d=Ps({address:o&&n$(o),function:u,args:f&&f!=="()"&&`${[...Array(a?.length??0).keys()].map(()=>" ").join("")}${f}`,sender:s});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=o,this.functionName=a,this.sender=s}},r1=class extends q{constructor({abi:e,data:r,functionName:n,message:o,cause:i}){let a,s,c,f;if(r&&r!=="0x")try{s=Db({abi:e,data:r,cause:i});let{abiItem:d,errorName:m,args:b}=s;if(m==="Error")f=b[0];else if(m==="Panic"){let[w]=b;f=HM[w]}else{let w=d?Lt(d,{includeName:!0}):void 0,T=d&&b?q8({abiItem:d,args:b,includeFunctionName:!1,includeName:!1}):void 0;c=[w?`Error: ${w}`:"",T&&T!=="()"?` ${[...Array(m?.length??0).keys()].map(()=>" ").join("")}${T}`:""]}}catch(d){a=d}else o&&(f=o);let u;a instanceof Tf&&(u=a.signature,c=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${u}.`]),super(f&&f!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,f||u].join(`
35
+ `):`The contract function "${n}" reverted.`,{cause:a??i,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.raw=r,this.reason=f,this.signature=u}},n1=class extends q{constructor({functionName:e,cause:r}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:r})}},o1=class extends q{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}},qf=class extends q{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}});var la,Hf,Vl=U(()=>{Nn();se();ri();la=class extends q{constructor({body:e,cause:r,details:n,headers:o,status:i,url:a}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[i&&`Status: ${i}`,`URL: ${zf(a)}`,e&&`Request body: ${He(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=o,this.status=i,this.url=a}},Hf=class extends q{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${zf(n)}`,`Request body: ${He(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data,this.url=n}}});var Wme,Zt,Jt,Wf,Kf,Gf,Vf,ni,pa,Yf,Zf,Jf,ha,Cs,Xf,Os,Qf,eu,tu,ru,nu,ma,ou,iu,au,su,cu,ba,fu,a1,s1=U(()=>{se();Vl();Wme=-1,Zt=class extends q{constructor(e,{code:r,docsPath:n,metaMessages:o,name:i,shortMessage:a}){super(a,{cause:e,docsPath:n,metaMessages:o||e?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||e.name,this.code=e instanceof Hf?e.code:r??Wme}},Jt=class extends Zt{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}},Wf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(Wf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});Kf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(Kf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});Gf=class t extends Zt{constructor(e,{method:r}={}){super(e,{code:t.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}};Object.defineProperty(Gf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});Vf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
36
+ `)})}};Object.defineProperty(Vf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});ni=class t extends Zt{constructor(e){super(e,{code:t.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(ni,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});pa=class t extends Zt{constructor(e){super(e,{code:t.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
37
+ `)})}};Object.defineProperty(pa,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});Yf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Yf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});Zf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(Zf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});Jf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(Jf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});ha=class t extends Zt{constructor(e,{method:r}={}){super(e,{code:t.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}};Object.defineProperty(ha,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});Cs=class t extends Zt{constructor(e){super(e,{code:t.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(Cs,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});Xf=class t extends Zt{constructor(e){super(e,{code:t.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(Xf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});Os=class t extends Jt{constructor(e){super(e,{code:t.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(Os,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});Qf=class t extends Jt{constructor(e){super(e,{code:t.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(Qf,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});eu=class t extends Jt{constructor(e,{method:r}={}){super(e,{code:t.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}};Object.defineProperty(eu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});tu=class t extends Jt{constructor(e){super(e,{code:t.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(tu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});ru=class t extends Jt{constructor(e){super(e,{code:t.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(ru,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});nu=class t extends Jt{constructor(e){super(e,{code:t.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(nu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});ma=class t extends Jt{constructor(e){super(e,{code:t.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};Object.defineProperty(ma,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});ou=class t extends Jt{constructor(e){super(e,{code:t.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};Object.defineProperty(ou,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});iu=class t extends Jt{constructor(e){super(e,{code:t.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};Object.defineProperty(iu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});au=class t extends Jt{constructor(e){super(e,{code:t.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};Object.defineProperty(au,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});su=class t extends Jt{constructor(e){super(e,{code:t.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};Object.defineProperty(su,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});cu=class t extends Jt{constructor(e){super(e,{code:t.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};Object.defineProperty(cu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});ba=class t extends Jt{constructor(e){super(e,{code:t.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};Object.defineProperty(ba,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});fu=class t extends Jt{constructor(e){super(e,{code:t.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}};Object.defineProperty(fu,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});a1=class extends Zt{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}});function uu(t,{abi:e,address:r,args:n,docsPath:o,functionName:i,sender:a}){let s=t instanceof qf?t:t instanceof q?t.walk(w=>typeof w=="object"&&w!==null&&"data"in w)||t.walk():{},{code:c,data:f,details:u,message:d,shortMessage:m}=s,b=t instanceof sa?new n1({functionName:i,cause:t}):[Kme,ni.code].includes(c)&&(f||u||d||m)||c===pa.code&&u==="execution reverted"&&f?new r1({abi:e,data:typeof f=="object"?f.data:f,functionName:i,message:s instanceof Hf?u:m??d,cause:t}):t;return new t1(b,{abi:e,args:n,contractAddress:r,docsPath:o,functionName:i,sender:a})}var Kme,c1=U(()=>{Gt();se();i1();Vl();s1();Kme=3});function o$(t){let e=Mn(`0x${t.substring(4)}`).substring(26);return ei(`0x${e}`)}var i$=U(()=>{Cf();Rf()});function Gme(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),c=n?4:0,f=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+f,s,n)}function a$(t,e,r){return t&e^~t&r}function s$(t,e,r){return t&e^t&r^e&r}var f1,oi,c$=U(()=>{Vn();f1=class extends Bi{constructor(e,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(e),this.view=bp(this.buffer)}update(e){ko(this),e=Ha(e),Kn(e);let{view:r,buffer:n,blockLen:o}=this,i=e.length;for(let a=0;a<i;){let s=Math.min(o-this.pos,i-a);if(s===o){let c=bp(e);for(;o<=i-a;a+=o)this.process(c,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ko(this),mp(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:a}=this;r[a++]=128,Gn(this.buffer.subarray(a)),this.padOffset>o-a&&(this.process(n,0),a=0);for(let d=a;d<o;d++)r[d]=0;Gme(n,o-8,BigInt(this.length*8),i),this.process(n,0);let s=bp(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=c/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)s.setUint32(4*d,u[d],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=i,e.length=o,e.pos=s,o%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}},oi=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var Vme,ya,u1,ks,K8=U(()=>{c$();Vn();Vme=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ya=new Uint32Array(64),u1=class extends f1{constructor(e=32){super(64,e,8,!1),this.A=oi[0]|0,this.B=oi[1]|0,this.C=oi[2]|0,this.D=oi[3]|0,this.E=oi[4]|0,this.F=oi[5]|0,this.G=oi[6]|0,this.H=oi[7]|0}get(){let{A:e,B:r,C:n,D:o,E:i,F:a,G:s,H:c}=this;return[e,r,n,o,i,a,s,c]}set(e,r,n,o,i,a,s,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)ya[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){let m=ya[d-15],b=ya[d-2],w=pn(m,7)^pn(m,18)^m>>>3,T=pn(b,17)^pn(b,19)^b>>>10;ya[d]=T+ya[d-7]+w+ya[d-16]|0}let{A:n,B:o,C:i,D:a,E:s,F:c,G:f,H:u}=this;for(let d=0;d<64;d++){let m=pn(s,6)^pn(s,11)^pn(s,25),b=u+m+a$(s,c,f)+Vme[d]+ya[d]|0,T=(pn(n,2)^pn(n,13)^pn(n,22))+s$(n,o,i)|0;u=f,f=c,c=s,s=a+b|0,a=i,i=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,o,i,a,s,c,f,u)}roundClean(){Gn(ya)}destroy(){this.set(0,0,0,0,0,0,0,0),Gn(this.buffer)}},ks=yp(()=>new u1)});var d1,G8,f$=U(()=>{Vn();d1=class extends Bi{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,b9(e);let n=Ha(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?e.create().update(n).digest():n);for(let a=0;a<i.length;a++)i[a]^=54;this.iHash.update(i),this.oHash=e.create();for(let a=0;a<i.length;a++)i[a]^=106;this.oHash.update(i),Gn(i)}update(e){return ko(this),this.iHash.update(e),this}digestInto(e){ko(this),Kn(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:o,destroyed:i,blockLen:a,outputLen:s}=this;return e=e,e.finished=o,e.destroyed=i,e.blockLen=a,e.outputLen=s,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},G8=(t,e,r)=>new d1(t,e).update(r).digest();G8.create=(t,e)=>new d1(t,e)});function du(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ai(t){if(!du(t))throw new Error("Uint8Array expected")}function lu(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function Yl(t){let e=t.toString(16);return e.length&1?"0"+e:e}function l$(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?J8:BigInt("0x"+t)}function pu(t){if(ai(t),p$)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=Yme[t[r]];return e}function u$(t){if(t>=ii._0&&t<=ii._9)return t-ii._0;if(t>=ii.A&&t<=ii.F)return t-(ii.A-10);if(t>=ii.a&&t<=ii.f)return t-(ii.a-10)}function Zl(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(p$)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let a=u$(t.charCodeAt(i)),s=u$(t.charCodeAt(i+1));if(a===void 0||s===void 0){let c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=a*16+s}return n}function Er(t){return l$(pu(t))}function X8(t){return ai(t),l$(pu(Uint8Array.from(t).reverse()))}function So(t,e){return Zl(t.toString(16).padStart(e*2,"0"))}function Q8(t,e){return So(t,e).reverse()}function xt(t,e,r){let n;if(typeof e=="string")try{n=Zl(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(du(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(t+" of length "+r+" expected, got "+o);return n}function cr(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];ai(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}function l1(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Ms(t,e,r){return V8(t)&&V8(e)&&V8(r)&&e<=t&&t<r}function si(t,e,r,n){if(!Ms(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function h$(t){let e;for(e=0;t>J8;t>>=Z8,e+=1);return e}function m$(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Y8(t),o=Y8(t),i=0,a=()=>{n.fill(1),o.fill(0),i=0},s=(...d)=>r(o,n,...d),c=(d=Y8(0))=>{o=s(d$([0]),d),n=s(),d.length!==0&&(o=s(d$([1]),d),n=s())},f=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,m=[];for(;d<e;){n=s();let b=n.slice();m.push(b),d+=n.length}return cr(...m)};return(d,m)=>{a(),c(d);let b;for(;!(b=m(f()));)c();return a(),b}}function ci(t,e,r={}){let n=(o,i,a)=>{let s=Zme[i];if(typeof s!="function")throw new Error("invalid validator function");let c=t[o];if(!(a&&c===void 0)&&!s(c,t))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+c)};for(let[o,i]of Object.entries(e))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return t}function e3(t){let e=new WeakMap;return(r,...n)=>{let o=e.get(r);if(o!==void 0)return o;let i=t(r,...n);return e.set(r,i),i}}var J8,Z8,p$,Yme,ii,V8,$s,Y8,d$,Zme,hu=U(()=>{J8=BigInt(0),Z8=BigInt(1);p$=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Yme=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));ii={_0:48,_9:57,A:65,F:70,a:97,f:102};V8=t=>typeof t=="bigint"&&J8<=t;$s=t=>(Z8<<BigInt(t))-Z8,Y8=t=>new Uint8Array(t),d$=t=>Uint8Array.from(t);Zme={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||du(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)}});function Ye(t,e){let r=t%e;return r>=fr?r:e+r}function Ur(t,e,r){let n=t;for(;e-- >fr;)n*=n,n%=r;return n}function p1(t,e){if(t===fr)throw new Error("invert: expected non-zero number");if(e<=fr)throw new Error("invert: expected positive modulus, got "+e);let r=Ye(t,e),n=e,o=fr,i=Xt,a=Xt,s=fr;for(;r!==fr;){let f=n/r,u=n%r,d=o-a*f,m=i-s*f;n=r,r=u,o=a,i=s,a=d,s=m}if(n!==Xt)throw new Error("invert: does not exist");return Ye(o,e)}function x$(t,e){let r=(t.ORDER+Xt)/y$,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw new Error("Cannot find square root");return n}function Xme(t,e){let r=(t.ORDER-g$)/v$,n=t.mul(e,Ns),o=t.pow(n,r),i=t.mul(e,o),a=t.mul(t.mul(i,Ns),o),s=t.mul(i,t.sub(a,t.ONE));if(!t.eql(t.sqr(s),e))throw new Error("Cannot find square root");return s}function Qme(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-Xt,r=0;for(;e%Ns===fr;)e/=Ns,r++;let n=Ns,o=Jl(t);for(;b$(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return x$;let i=o.pow(n,e),a=(e+Xt)/Ns;return function(c,f){if(c.is0(f))return f;if(b$(c,f)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,i),m=c.pow(f,e),b=c.pow(f,a);for(;!c.eql(m,c.ONE);){if(c.is0(m))return c.ZERO;let w=1,T=c.sqr(m);for(;!c.eql(T,c.ONE);)if(w++,T=c.sqr(T),w===u)throw new Error("Cannot find square root");let P=Xt<<BigInt(u-w-1),R=c.pow(d,P);u=w,d=c.sqr(R),m=c.mul(m,d),b=c.mul(b,R)}return b}}function ebe(t){return t%y$===Jme?x$:t%v$===g$?Xme:Qme(t)}function h1(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=tbe.reduce((n,o)=>(n[o]="function",n),e);return ci(t,r)}function rbe(t,e,r){if(r<fr)throw new Error("invalid exponent, negatives unsupported");if(r===fr)return t.ONE;if(r===Xt)return e;let n=t.ONE,o=e;for(;r>fr;)r&Xt&&(n=t.mul(n,o)),o=t.sqr(o),r>>=Xt;return n}function mu(t,e,r=!1){let n=new Array(e.length).fill(r?t.ZERO:void 0),o=e.reduce((a,s,c)=>t.is0(s)?a:(n[c]=a,t.mul(a,s)),t.ONE),i=t.inv(o);return e.reduceRight((a,s,c)=>t.is0(s)?a:(n[c]=t.mul(a,n[c]),t.mul(a,s)),i),n}function b$(t,e){let r=(t.ORDER-Xt)/Ns,n=t.pow(e,r),o=t.eql(n,t.ONE),i=t.eql(n,t.ZERO),a=t.eql(n,t.neg(t.ONE));if(!o&&!i&&!a)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function t3(t,e){e!==void 0&&qa(e);let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Jl(t,e,r=!1,n={}){if(t<=fr)throw new Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:o,nByteLength:i}=t3(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a,s=Object.freeze({ORDER:t,isLE:r,BITS:o,BYTES:i,MASK:$s(o),ZERO:fr,ONE:Xt,create:c=>Ye(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return fr<=c&&c<t},is0:c=>c===fr,isOdd:c=>(c&Xt)===Xt,neg:c=>Ye(-c,t),eql:(c,f)=>c===f,sqr:c=>Ye(c*c,t),add:(c,f)=>Ye(c+f,t),sub:(c,f)=>Ye(c-f,t),mul:(c,f)=>Ye(c*f,t),pow:(c,f)=>rbe(s,c,f),div:(c,f)=>Ye(c*p1(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>p1(c,t),sqrt:n.sqrt||(c=>(a||(a=ebe(t)),a(s,c))),toBytes:c=>r?Q8(c,i):So(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+c.length);return r?X8(c):Er(c)},invertBatch:c=>mu(s,c),cmov:(c,f,u)=>u?f:c});return Object.freeze(s)}function w$(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function r3(t){let e=w$(t);return e+Math.ceil(e/2)}function E$(t,e,r=!1){let n=t.length,o=w$(e),i=r3(e);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);let a=r?X8(t):Er(t),s=Ye(a,e-Xt)+Xt;return r?Q8(s,o):So(s,o)}var fr,Xt,Ns,Jme,y$,g$,v$,tbe,Xl=U(()=>{Vn();hu();fr=BigInt(0),Xt=BigInt(1),Ns=BigInt(2),Jme=BigInt(3),y$=BigInt(4),g$=BigInt(5),v$=BigInt(8);tbe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function n3(t,e){let r=e.negate();return t?r:e}function I$(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function o3(t,e){I$(t,e);let r=Math.ceil(e/t)+1,n=2**(t-1),o=2**t,i=$s(t),a=BigInt(t);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:a}}function S$(t,e,r){let{windowSize:n,mask:o,maxNumber:i,shiftBy:a}=r,s=Number(t&o),c=t>>a;s>n&&(s-=i,c+=s3);let f=e*n,u=f+Math.abs(s)-1,d=s===0,m=s<0,b=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:m,isNegF:b,offsetF:f}}function nbe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function obe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}function a3(t){return T$.get(t)||1}function _$(t,e){return{constTimeNegate:n3,hasPrecomputes(r){return a3(r)!==1},unsafeLadder(r,n,o=t.ZERO){let i=r;for(;n>A$;)n&s3&&(o=o.add(i)),i=i.double(),n>>=s3;return o},precomputeWindow(r,n){let{windows:o,windowSize:i}=o3(n,e),a=[],s=r,c=s;for(let f=0;f<o;f++){c=s,a.push(c);for(let u=1;u<i;u++)c=c.add(s),a.push(c);s=c.double()}return a},wNAF(r,n,o){let i=t.ZERO,a=t.BASE,s=o3(r,e);for(let c=0;c<s.windows;c++){let{nextN:f,offset:u,isZero:d,isNeg:m,isNegF:b,offsetF:w}=S$(o,c,s);o=f,d?a=a.add(n3(b,n[w])):i=i.add(n3(m,n[u]))}return{p:i,f:a}},wNAFUnsafe(r,n,o,i=t.ZERO){let a=o3(r,e);for(let s=0;s<a.windows&&o!==A$;s++){let{nextN:c,offset:f,isZero:u,isNeg:d}=S$(o,s,a);if(o=c,!u){let m=n[f];i=i.add(d?m.negate():m)}}return i},getPrecomputes(r,n,o){let i=i3.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&i3.set(n,o(i))),i},wNAFCached(r,n,o){let i=a3(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){let a=a3(r);return a===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(a,this.getPrecomputes(a,r,o),n,i)},setWindowSize(r,n){I$(n,e),T$.set(r,n),i3.delete(r)}}}function B$(t,e,r,n){nbe(r,t),obe(n,e);let o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");let a=t.ZERO,s=h$(BigInt(o)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let f=$s(c),u=new Array(Number(f)+1).fill(a),d=Math.floor((e.BITS-1)/c)*c,m=a;for(let b=d;b>=0;b-=c){u.fill(a);for(let T=0;T<i;T++){let P=n[T],R=Number(P>>BigInt(b)&f);u[R]=u[R].add(r[T])}let w=a;for(let T=u.length-1,P=a;T>0;T--)P=P.add(u[T]),w=w.add(P);if(m=m.add(w),b!==0)for(let T=0;T<c;T++)m=m.double()}return m}function c3(t){return h1(t.Fp),ci(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...t3(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var A$,s3,i3,T$,R$=U(()=>{Xl();hu();A$=BigInt(0),s3=BigInt(1);i3=new WeakMap,T$=new WeakMap});function P$(t){t.lowS!==void 0&&lu("lowS",t.lowS),t.prehash!==void 0&&lu("prehash",t.prehash)}function ibe(t){let e=c3(t);ci(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:o}=e;if(r){if(!n.eql(o,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}function f3(t,e){return pu(So(t,e))}function abe(t){let e=ibe(t),{Fp:r}=e,n=Jl(e.n,e.nBitLength),o=e.toBytes||((_,O,$)=>{let B=O.toAffine();return cr(Uint8Array.from([4]),r.toBytes(B.x),r.toBytes(B.y))}),i=e.fromBytes||(_=>{let O=_.subarray(1),$=r.fromBytes(O.subarray(0,r.BYTES)),B=r.fromBytes(O.subarray(r.BYTES,2*r.BYTES));return{x:$,y:B}});function a(_){let{a:O,b:$}=e,B=r.sqr(_),N=r.mul(B,_);return r.add(r.add(N,r.mul(_,O)),$)}function s(_,O){let $=r.sqr(O),B=a(_);return r.eql($,B)}if(!s(e.Gx,e.Gy))throw new Error("bad curve params: generator point");let c=r.mul(r.pow(e.a,Ql),d3),f=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(c,f)))throw new Error("bad curve params: a or b");function u(_){return Ms(_,ve,e.n)}function d(_){let{allowedPrivateKeyLengths:O,nByteLength:$,wrapPrivateKey:B,n:N}=e;if(O&&typeof _!="bigint"){if(du(_)&&(_=pu(_)),typeof _!="string"||!O.includes(_.length))throw new Error("invalid private key");_=_.padStart($*2,"0")}let M;try{M=typeof _=="bigint"?_:Er(xt("private key",_,$))}catch{throw new Error("invalid private key, expected hex or "+$+" bytes, got "+typeof _)}return B&&(M=Ye(M,N)),si("private key",M,ve,N),M}function m(_){if(!(_ instanceof T))throw new Error("ProjectivePoint expected")}let b=e3((_,O)=>{let{px:$,py:B,pz:N}=_;if(r.eql(N,r.ONE))return{x:$,y:B};let M=_.is0();O==null&&(O=M?r.ONE:r.inv(N));let F=r.mul($,O),v=r.mul(B,O),l=r.mul(N,O);if(M)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw new Error("invZ was invalid");return{x:F,y:v}}),w=e3(_=>{if(_.is0()){if(e.allowInfinityPoint&&!r.is0(_.py))return;throw new Error("bad point: ZERO")}let{x:O,y:$}=_.toAffine();if(!r.isValid(O)||!r.isValid($))throw new Error("bad point: x or y not FE");if(!s(O,$))throw new Error("bad point: equation left != right");if(!_.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class T{constructor(O,$,B){if(O==null||!r.isValid(O))throw new Error("x required");if($==null||!r.isValid($)||r.is0($))throw new Error("y required");if(B==null||!r.isValid(B))throw new Error("z required");this.px=O,this.py=$,this.pz=B,Object.freeze(this)}static fromAffine(O){let{x:$,y:B}=O||{};if(!O||!r.isValid($)||!r.isValid(B))throw new Error("invalid affine point");if(O instanceof T)throw new Error("projective point not allowed");let N=M=>r.eql(M,r.ZERO);return N($)&&N(B)?T.ZERO:new T($,B,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(O){let $=mu(r,O.map(B=>B.pz));return O.map((B,N)=>B.toAffine($[N])).map(T.fromAffine)}static fromHex(O){let $=T.fromAffine(i(xt("pointHex",O)));return $.assertValidity(),$}static fromPrivateKey(O){return T.BASE.multiply(d(O))}static msm(O,$){return B$(T,n,O,$)}_setWindowSize(O){k.setWindowSize(this,O)}assertValidity(){w(this)}hasEvenY(){let{y:O}=this.toAffine();if(r.isOdd)return!r.isOdd(O);throw new Error("Field doesn't support isOdd")}equals(O){m(O);let{px:$,py:B,pz:N}=this,{px:M,py:F,pz:v}=O,l=r.eql(r.mul($,v),r.mul(M,N)),h=r.eql(r.mul(B,v),r.mul(F,N));return l&&h}negate(){return new T(this.px,r.neg(this.py),this.pz)}double(){let{a:O,b:$}=e,B=r.mul($,Ql),{px:N,py:M,pz:F}=this,v=r.ZERO,l=r.ZERO,h=r.ZERO,y=r.mul(N,N),g=r.mul(M,M),x=r.mul(F,F),E=r.mul(N,M);return E=r.add(E,E),h=r.mul(N,F),h=r.add(h,h),v=r.mul(O,h),l=r.mul(B,x),l=r.add(v,l),v=r.sub(g,l),l=r.add(g,l),l=r.mul(v,l),v=r.mul(E,v),h=r.mul(B,h),x=r.mul(O,x),E=r.sub(y,x),E=r.mul(O,E),E=r.add(E,h),h=r.add(y,y),y=r.add(h,y),y=r.add(y,x),y=r.mul(y,E),l=r.add(l,y),x=r.mul(M,F),x=r.add(x,x),y=r.mul(x,E),v=r.sub(v,y),h=r.mul(x,g),h=r.add(h,h),h=r.add(h,h),new T(v,l,h)}add(O){m(O);let{px:$,py:B,pz:N}=this,{px:M,py:F,pz:v}=O,l=r.ZERO,h=r.ZERO,y=r.ZERO,g=e.a,x=r.mul(e.b,Ql),E=r.mul($,M),S=r.mul(B,F),A=r.mul(N,v),p=r.add($,B),I=r.add(M,F);p=r.mul(p,I),I=r.add(E,S),p=r.sub(p,I),I=r.add($,N);let C=r.add(M,v);return I=r.mul(I,C),C=r.add(E,A),I=r.sub(I,C),C=r.add(B,N),l=r.add(F,v),C=r.mul(C,l),l=r.add(S,A),C=r.sub(C,l),y=r.mul(g,I),l=r.mul(x,A),y=r.add(l,y),l=r.sub(S,y),y=r.add(S,y),h=r.mul(l,y),S=r.add(E,E),S=r.add(S,E),A=r.mul(g,A),I=r.mul(x,I),S=r.add(S,A),A=r.sub(E,A),A=r.mul(g,A),I=r.add(I,A),E=r.mul(S,I),h=r.add(h,E),E=r.mul(C,I),l=r.mul(p,l),l=r.sub(l,E),E=r.mul(p,S),y=r.mul(C,y),y=r.add(y,E),new T(l,h,y)}subtract(O){return this.add(O.negate())}is0(){return this.equals(T.ZERO)}wNAF(O){return k.wNAFCached(this,O,T.normalizeZ)}multiplyUnsafe(O){let{endo:$,n:B}=e;si("scalar",O,Fn,B);let N=T.ZERO;if(O===Fn)return N;if(this.is0()||O===ve)return this;if(!$||k.hasPrecomputes(this))return k.wNAFCachedUnsafe(this,O,T.normalizeZ);let{k1neg:M,k1:F,k2neg:v,k2:l}=$.splitScalar(O),h=N,y=N,g=this;for(;F>Fn||l>Fn;)F&ve&&(h=h.add(g)),l&ve&&(y=y.add(g)),g=g.double(),F>>=ve,l>>=ve;return M&&(h=h.negate()),v&&(y=y.negate()),y=new T(r.mul(y.px,$.beta),y.py,y.pz),h.add(y)}multiply(O){let{endo:$,n:B}=e;si("scalar",O,ve,B);let N,M;if($){let{k1neg:F,k1:v,k2neg:l,k2:h}=$.splitScalar(O),{p:y,f:g}=this.wNAF(v),{p:x,f:E}=this.wNAF(h);y=k.constTimeNegate(F,y),x=k.constTimeNegate(l,x),x=new T(r.mul(x.px,$.beta),x.py,x.pz),N=y.add(x),M=g.add(E)}else{let{p:F,f:v}=this.wNAF(O);N=F,M=v}return T.normalizeZ([N,M])[0]}multiplyAndAddUnsafe(O,$,B){let N=T.BASE,M=(v,l)=>l===Fn||l===ve||!v.equals(N)?v.multiplyUnsafe(l):v.multiply(l),F=M(this,$).add(M(O,B));return F.is0()?void 0:F}toAffine(O){return b(this,O)}isTorsionFree(){let{h:O,isTorsionFree:$}=e;if(O===ve)return!0;if($)return $(T,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:O,clearCofactor:$}=e;return O===ve?this:$?$(T,this):this.multiplyUnsafe(e.h)}toRawBytes(O=!0){return lu("isCompressed",O),this.assertValidity(),o(T,this,O)}toHex(O=!0){return lu("isCompressed",O),pu(this.toRawBytes(O))}}T.BASE=new T(e.Gx,e.Gy,r.ONE),T.ZERO=new T(r.ZERO,r.ONE,r.ZERO);let{endo:P,nBitLength:R}=e,k=_$(T,P?Math.ceil(R/2):R);return{CURVE:e,ProjectivePoint:T,normPrivateKeyToScalar:d,weierstrassEquation:a,isWithinCurveOrder:u}}function sbe(t){let e=c3(t);return ci(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function C$(t){let e=sbe(t),{Fp:r,n,nByteLength:o,nBitLength:i}=e,a=r.BYTES+1,s=2*r.BYTES+1;function c(x){return Ye(x,n)}function f(x){return p1(x,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:m,isWithinCurveOrder:b}=abe({...e,toBytes(x,E,S){let A=E.toAffine(),p=r.toBytes(A.x),I=cr;return lu("isCompressed",S),S?I(Uint8Array.from([E.hasEvenY()?2:3]),p):I(Uint8Array.from([4]),p,r.toBytes(A.y))},fromBytes(x){let E=x.length,S=x[0],A=x.subarray(1);if(E===a&&(S===2||S===3)){let p=Er(A);if(!Ms(p,ve,r.ORDER))throw new Error("Point is not on curve");let I=m(p),C;try{C=r.sqrt(I)}catch(D){let z=D instanceof Error?": "+D.message:"";throw new Error("Point is not on curve"+z)}let L=(C&ve)===ve;return(S&1)===1!==L&&(C=r.neg(C)),{x:p,y:C}}else if(E===s&&S===4){let p=r.fromBytes(A.subarray(0,r.BYTES)),I=r.fromBytes(A.subarray(r.BYTES,2*r.BYTES));return{x:p,y:I}}else{let p=a,I=s;throw new Error("invalid Point, expected length of "+p+", or uncompressed "+I+", got "+E)}}});function w(x){let E=n>>ve;return x>E}function T(x){return w(x)?c(-x):x}let P=(x,E,S)=>Er(x.slice(E,S));class R{constructor(E,S,A){si("r",E,ve,n),si("s",S,ve,n),this.r=E,this.s=S,A!=null&&(this.recovery=A),Object.freeze(this)}static fromCompact(E){let S=o;return E=xt("compactSignature",E,S*2),new R(P(E,0,S),P(E,S,2*S))}static fromDER(E){let{r:S,s:A}=fi.toSig(xt("DER",E));return new R(S,A)}assertValidity(){}addRecoveryBit(E){return new R(this.r,this.s,E)}recoverPublicKey(E){let{r:S,s:A,recovery:p}=this,I=N(xt("msgHash",E));if(p==null||![0,1,2,3].includes(p))throw new Error("recovery id invalid");let C=p===2||p===3?S+e.n:S;if(C>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let L=(p&1)===0?"02":"03",j=u.fromHex(L+f3(C,r.BYTES)),D=f(C),z=c(-I*D),W=c(A*D),G=u.BASE.multiplyAndAddUnsafe(j,z,W);if(!G)throw new Error("point at infinify");return G.assertValidity(),G}hasHighS(){return w(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Zl(this.toDERHex())}toDERHex(){return fi.hexFromSig(this)}toCompactRawBytes(){return Zl(this.toCompactHex())}toCompactHex(){let E=o;return f3(this.r,E)+f3(this.s,E)}}let k={isValidPrivateKey(x){try{return d(x),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let x=r3(e.n);return E$(e.randomBytes(x),e.n)},precompute(x=8,E=u.BASE){return E._setWindowSize(x),E.multiply(BigInt(3)),E}};function _(x,E=!0){return u.fromPrivateKey(x).toRawBytes(E)}function O(x){if(typeof x=="bigint")return!1;if(x instanceof u)return!0;let S=xt("key",x).length,A=r.BYTES,p=A+1,I=2*A+1;if(!(e.allowedPrivateKeyLengths||o===p))return S===p||S===I}function $(x,E,S=!0){if(O(x)===!0)throw new Error("first arg must be private key");if(O(E)===!1)throw new Error("second arg must be public key");return u.fromHex(E).multiply(d(x)).toRawBytes(S)}let B=e.bits2int||function(x){if(x.length>8192)throw new Error("input is too large");let E=Er(x),S=x.length*8-i;return S>0?E>>BigInt(S):E},N=e.bits2int_modN||function(x){return c(B(x))},M=$s(i);function F(x){return si("num < 2^"+i,x,Fn,M),So(x,o)}function v(x,E,S=l){if(["recovered","canonical"].some(Y=>Y in S))throw new Error("sign() legacy options not supported");let{hash:A,randomBytes:p}=e,{lowS:I,prehash:C,extraEntropy:L}=S;I==null&&(I=!0),x=xt("msgHash",x),P$(S),C&&(x=xt("prehashed msgHash",A(x)));let j=N(x),D=d(E),z=[F(D),F(j)];if(L!=null&&L!==!1){let Y=L===!0?p(r.BYTES):L;z.push(xt("extraEntropy",Y))}let W=cr(...z),G=j;function K(Y){let X=B(Y);if(!b(X))return;let Z=f(X),J=u.BASE.multiply(X).toAffine(),ie=c(J.x);if(ie===Fn)return;let te=c(Z*c(G+ie*D));if(te===Fn)return;let Q=(J.x===ie?0:2)|Number(J.y&ve),be=te;return I&&w(te)&&(be=T(te),Q^=1),new R(ie,be,Q)}return{seed:W,k2sig:K}}let l={lowS:e.lowS,prehash:!1},h={lowS:e.lowS,prehash:!1};function y(x,E,S=l){let{seed:A,k2sig:p}=v(x,E,S),I=e;return m$(I.hash.outputLen,I.nByteLength,I.hmac)(A,p)}u.BASE._setWindowSize(8);function g(x,E,S,A=h){let p=x;E=xt("msgHash",E),S=xt("publicKey",S);let{lowS:I,prehash:C,format:L}=A;if(P$(A),"strict"in A)throw new Error("options.strict was renamed to lowS");if(L!==void 0&&L!=="compact"&&L!=="der")throw new Error("format must be compact or der");let j=typeof p=="string"||du(p),D=!j&&!L&&typeof p=="object"&&p!==null&&typeof p.r=="bigint"&&typeof p.s=="bigint";if(!j&&!D)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let z,W;try{if(D&&(z=new R(p.r,p.s)),j){try{L!=="compact"&&(z=R.fromDER(p))}catch(Q){if(!(Q instanceof fi.Err))throw Q}!z&&L!=="der"&&(z=R.fromCompact(p))}W=u.fromHex(S)}catch{return!1}if(!z||I&&z.hasHighS())return!1;C&&(E=e.hash(E));let{r:G,s:K}=z,Y=N(E),X=f(K),Z=c(Y*X),J=c(G*X),ie=u.BASE.multiplyAndAddUnsafe(W,Z,J)?.toAffine();return ie?c(ie.x)===G:!1}return{CURVE:e,getPublicKey:_,getSharedSecret:$,sign:y,verify:g,ProjectivePoint:u,Signature:R,utils:k}}function cbe(t,e){let r=t.ORDER,n=Fn;for(let w=r-ve;w%ga===Fn;w/=ga)n+=ve;let o=n,i=ga<<o-ve-ve,a=i*ga,s=(r-ve)/a,c=(s-ve)/ga,f=a-ve,u=i,d=t.pow(e,s),m=t.pow(e,(s+ve)/ga),b=(w,T)=>{let P=d,R=t.pow(T,f),k=t.sqr(R);k=t.mul(k,T);let _=t.mul(w,k);_=t.pow(_,c),_=t.mul(_,R),R=t.mul(_,T),k=t.mul(_,w);let O=t.mul(k,R);_=t.pow(O,u);let $=t.eql(_,t.ONE);R=t.mul(k,m),_=t.mul(O,P),k=t.cmov(R,k,$),O=t.cmov(_,O,$);for(let B=o;B>ve;B--){let N=B-ga;N=ga<<N-ve;let M=t.pow(O,N),F=t.eql(M,t.ONE);R=t.mul(k,P),P=t.mul(P,P),M=t.mul(O,P),k=t.cmov(R,k,F),O=t.cmov(M,O,F)}return{isValid:$,value:k}};if(t.ORDER%d3===Ql){let w=(t.ORDER-Ql)/d3,T=t.sqrt(t.neg(e));b=(P,R)=>{let k=t.sqr(R),_=t.mul(P,R);k=t.mul(k,_);let O=t.pow(k,w);O=t.mul(O,_);let $=t.mul(O,T),B=t.mul(t.sqr(O),R),N=t.eql(B,P),M=t.cmov($,O,N);return{isValid:N,value:M}}}return b}function O$(t,e){if(h1(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=cbe(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let o,i,a,s,c,f,u,d;o=t.sqr(n),o=t.mul(o,e.Z),i=t.sqr(o),i=t.add(i,o),a=t.add(i,t.ONE),a=t.mul(a,e.B),s=t.cmov(e.Z,t.neg(i),!t.eql(i,t.ZERO)),s=t.mul(s,e.A),i=t.sqr(a),f=t.sqr(s),c=t.mul(f,e.A),i=t.add(i,c),i=t.mul(i,a),f=t.mul(f,s),c=t.mul(f,e.B),i=t.add(i,c),u=t.mul(o,a);let{isValid:m,value:b}=r(i,f);d=t.mul(o,n),d=t.mul(d,b),u=t.cmov(u,a,m),d=t.cmov(d,b,m);let w=t.isOdd(n)===t.isOdd(d);d=t.cmov(t.neg(d),d,w);let T=mu(t,[s],!0)[0];return u=t.mul(u,T),{x:u,y:d}}}var u3,fi,Fn,ve,ga,Ql,d3,l3=U(()=>{R$();Xl();hu();u3=class extends Error{constructor(e=""){super(e)}},fi={Err:u3,_tlv:{encode:(t,e)=>{let{Err:r}=fi;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");let n=e.length/2,o=Yl(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let i=n>127?Yl(o.length/2|128):"";return Yl(t)+i+o+e},decode(t,e){let{Err:r}=fi,n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let o=e[n++],i=!!(o&128),a=0;if(!i)a=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let f=e.subarray(n,n+c);if(f.length!==c)throw new r("tlv.decode: length bytes not complete");if(f[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of f)a=a<<8|u;if(n+=c,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=e.subarray(n,n+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+a)}}},_int:{encode(t){let{Err:e}=fi;if(t<Fn)throw new e("integer: negative integers are not allowed");let r=Yl(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=fi;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Er(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=fi,o=xt("signature",t),{v:i,l:a}=n.decode(48,o);if(a.length)throw new e("invalid signature: left bytes after parsing");let{v:s,l:c}=n.decode(2,i),{v:f,l:u}=n.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(s),s:r.decode(f)}},hexFromSig(t){let{_tlv:e,_int:r}=fi,n=e.encode(2,r.encode(t.r)),o=e.encode(2,r.encode(t.s)),i=n+o;return e.encode(48,i)}};Fn=BigInt(0),ve=BigInt(1),ga=BigInt(2),Ql=BigInt(3),d3=BigInt(4)});function fbe(t){return{hash:t,hmac:(e,...r)=>G8(t,e,g9(...r)),randomBytes:Ri}}function k$(t,e){let r=n=>C$({...t,...fbe(n)});return{...r(e),create:r}}var M$=U(()=>{f$();Vn();l3();});function va(t,e){if(e0(t),e0(e),t<0||t>=1<<8*e)throw new Error("invalid I2OSP input: "+t);let r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=t&255,t>>>=8;return new Uint8Array(r)}function dbe(t,e){let r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function e0(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function lbe(t,e,r,n){ai(t),ai(e),e0(r),e.length>255&&(e=n(cr(l1("H2C-OVERSIZE-DST-"),e)));let{outputLen:o,blockLen:i}=n,a=Math.ceil(r/o);if(r>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");let s=cr(e,va(e.length,1)),c=va(0,i),f=va(r,2),u=new Array(a),d=n(cr(c,t,f,va(0,1),s));u[0]=n(cr(d,va(1,1),s));for(let b=1;b<=a;b++){let w=[dbe(d,u[b-1]),va(b+1,1),s];u[b]=n(cr(...w))}return cr(...u).slice(0,r)}function pbe(t,e,r,n,o){if(ai(t),ai(e),e0(r),e.length>255){let i=Math.ceil(2*n/8);e=o.create({dkLen:i}).update(l1("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(t).update(va(r,2)).update(e).update(va(e.length,1)).digest()}function $$(t,e,r){ci(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:o,m:i,hash:a,expand:s,DST:c}=r;ai(t),e0(e);let f=typeof c=="string"?l1(c):c,u=n.toString(2).length,d=Math.ceil((u+o)/8),m=e*i*d,b;if(s==="xmd")b=lbe(t,f,m,a);else if(s==="xof")b=pbe(t,f,m,o,a);else if(s==="_internal_pass")b=t;else throw new Error('expand must be "xmd" or "xof"');let w=new Array(e);for(let T=0;T<e;T++){let P=new Array(i);for(let R=0;R<i;R++){let k=d*(R+T*i),_=b.subarray(k,k+d);P[R]=Ye(ube(_),n)}w[T]=P}return w}function N$(t,e){let r=e.map(n=>Array.from(n).reverse());return(n,o)=>{let[i,a,s,c]=r.map(d=>d.reduce((m,b)=>t.add(t.mul(m,n),b))),[f,u]=mu(t,[a,c],!0);return n=t.mul(i,f),o=t.mul(o,t.mul(s,u)),{x:n,y:o}}}function F$(t,e,r){if(typeof e!="function")throw new Error("mapToCurve() must be defined");function n(i){return t.fromAffine(e(i))}function o(i){let a=i.clearCofactor();return a.equals(t.ZERO)?t.ZERO:(a.assertValidity(),a)}return{defaults:r,hashToCurve(i,a){let s=$$(i,2,{...r,DST:r.DST,...a}),c=n(s[0]),f=n(s[1]);return o(c.add(f))},encodeToCurve(i,a){let s=$$(i,1,{...r,DST:r.encodeDST,...a});return o(n(s[0]))},mapToCurve(i){if(!Array.isArray(i))throw new Error("expected array of bigints");for(let a of i)if(typeof a!="bigint")throw new Error("expected array of bigints");return o(n(i))}}}var ube,L$=U(()=>{Xl();hu();ube=Er});var W$={};hE(W$,{encodeToCurve:()=>wbe,hashToCurve:()=>xbe,schnorr:()=>ybe,secp256k1:()=>o0,secp256k1_hasher:()=>v3});function D$(t){let e=n0,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,d=Ur(u,r,e)*u%e,m=Ur(d,r,e)*u%e,b=Ur(m,b1,e)*f%e,w=Ur(b,o,e)*b%e,T=Ur(w,i,e)*w%e,P=Ur(T,s,e)*T%e,R=Ur(P,c,e)*P%e,k=Ur(R,s,e)*T%e,_=Ur(k,r,e)*u%e,O=Ur(_,a,e)*w%e,$=Ur(O,n,e)*f%e,B=Ur($,b1,e);if(!xa.eql(xa.sqr(B),t))throw new Error("Cannot find square root");return B}function y1(t,...e){let r=j$[t];if(r===void 0){let n=ks(Uint8Array.from(t,o=>o.charCodeAt(0)));r=cr(n,n),j$[t]=r}return ks(cr(r,...e))}function m3(t){let e=o0.utils.normPrivateKeyToScalar(t),r=g3.fromPrivateKey(e);return{scalar:r.hasEvenY()?e:r0(-e),bytes:y3(r)}}function z$(t){si("x",t,t0,n0);let e=p3(t*t),r=p3(e*t+BigInt(7)),n=D$(r);n%b1!==b3&&(n=p3(-n));let o=new g3(t,n,t0);return o.assertValidity(),o}function q$(...t){return r0(bu(y1("BIP0340/challenge",...t)))}function mbe(t){return m3(t).bytes}function bbe(t,e,r=Ri(32)){let n=xt("message",t),{bytes:o,scalar:i}=m3(e),a=xt("auxRand",r,32),s=h3(i^bu(y1("BIP0340/aux",a))),c=y1("BIP0340/nonce",s,o,n),f=r0(bu(c));if(f===b3)throw new Error("sign failed: k is zero");let{bytes:u,scalar:d}=m3(f),m=q$(u,o,n),b=new Uint8Array(64);if(b.set(u,0),b.set(h3(r0(d+m*i)),32),!H$(b,n,o))throw new Error("sign: Invalid signature produced");return b}function H$(t,e,r){let n=xt("signature",t,64),o=xt("message",e),i=xt("publicKey",r,32);try{let a=z$(bu(i)),s=bu(n.subarray(0,32));if(!Ms(s,t0,n0))return!1;let c=bu(n.subarray(32,64));if(!Ms(c,t0,m1))return!1;let f=q$(h3(s),y3(a),o),u=hbe(a,c,r0(-f));return!(!u||!u.hasEvenY()||u.toAffine().x!==s)}catch{return!1}}var n0,m1,b3,t0,b1,U$,xa,o0,j$,y3,h3,p3,r0,g3,hbe,bu,ybe,gbe,vbe,v3,xbe,wbe,K$=U(()=>{K8();Vn();M$();L$();Xl();hu();l3();n0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),m1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),b3=BigInt(0),t0=BigInt(1),b1=BigInt(2),U$=(t,e)=>(t+e/b1)/e;xa=Jl(n0,void 0,void 0,{sqrt:D$}),o0=k$({a:b3,b:BigInt(7),Fp:xa,n:m1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=m1,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-t0*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,a=BigInt("0x100000000000000000000000000000000"),s=U$(i*t,e),c=U$(-n*t,e),f=Ye(t-s*r-c*o,e),u=Ye(-s*n-c*i,e),d=f>a,m=u>a;if(d&&(f=e-f),m&&(u=e-u),f>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:f,k2neg:m,k2:u}}}},ks),j$={};y3=t=>t.toRawBytes(!0).slice(1),h3=t=>So(t,32),p3=t=>Ye(t,n0),r0=t=>Ye(t,m1),g3=o0.ProjectivePoint,hbe=(t,e,r)=>g3.BASE.multiplyAndAddUnsafe(t,e,r);bu=Er;ybe={getPublicKey:mbe,sign:bbe,verify:H$,utils:{randomPrivateKey:o0.utils.randomPrivateKey,lift_x:z$,pointToBytes:y3,numberToBytesBE:So,bytesToNumberBE:Er,taggedHash:y1,mod:Ye}},gbe=N$(xa,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(e=>BigInt(e)))),vbe=O$(xa,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:xa.create(BigInt("-11"))}),v3=F$(o0.ProjectivePoint,t=>{let{x:e,y:r}=vbe(xa.create(t[0]));return gbe(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:xa.ORDER,m:1,k:128,expand:"xmd",hash:ks}),xbe=v3.hashToCurve,wbe=v3.encodeToCurve});async function V$({hash:t,signature:e}){let r=Ut(t)?t:Vt(t),{secp256k1:n}=await Promise.resolve().then(()=>(K$(),W$));return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){let{r:f,s:u,v:d,yParity:m}=e,b=Number(m??d),w=G$(b);return new n.Signature(qe(f),qe(u)).addRecoveryBit(w)}let a=Ut(e)?e:Vt(e);if(ue(a)!==65)throw new Error("invalid signature length");let s=gt(`0x${a.slice(130)}`),c=G$(s);return n.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function G$(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}var Y$=U(()=>{Jo();On();ar();pe()});async function Z$({hash:t,signature:e}){return o$(await V$({hash:t,signature:e}))}var J$=U(()=>{i$();Y$()});function Ln(t,e="hex"){let r=X$(t),n=$f(new Uint8Array(r.length));return r.encode(n),e==="hex"?Ce(n.bytes):n.bytes}function X$(t){return Array.isArray(t)?Ebe(t.map(e=>X$(e))):Abe(t)}function Ebe(t){let e=t.reduce((o,i)=>o+i.length,0),r=Q$(e);return{length:e<=55?1+e:1+r+e,encode(o){e<=55?o.pushByte(192+e):(o.pushByte(247+r),r===1?o.pushUint8(e):r===2?o.pushUint16(e):r===3?o.pushUint24(e):o.pushUint32(e));for(let{encode:i}of t)i(o)}}}function Abe(t){let e=typeof t=="string"?sr(t):t,r=Q$(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(o){e.length===1&&e[0]<128?o.pushBytes(e):e.length<=55?(o.pushByte(128+e.length),o.pushBytes(e)):(o.pushByte(183+r),r===1?o.pushUint8(e.length):r===2?o.pushUint16(e.length):r===3?o.pushUint24(e.length):o.pushUint32(e.length),o.pushBytes(e))}}}function Q$(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new q("Length is too large.")}var g1=U(()=>{se();jb();Qr();pe()});function eN(t){let{chainId:e,nonce:r,to:n}=t,o=t.contractAddress??t.address,i=Mn(Fe(["0x05",Ln([e?V(e):"0x",o,r?V(r):"0x"])]));return n==="bytes"?sr(i):i}var tN=U(()=>{tn();Qr();pe();g1();Rf()});async function yu(t){let{authorization:e,signature:r}=t;return Z$({hash:eN(e),signature:r??e})}var v1=U(()=>{J$();tN()});var x1,rN=U(()=>{Kb();Lf();se();wr();x1=class extends q{constructor(e,{account:r,docsPath:n,chain:o,data:i,gas:a,gasPrice:s,maxFeePerGas:c,maxPriorityFeePerGas:f,nonce:u,to:d,value:m}){let b=Ps({from:r?.address,to:d,value:typeof m<"u"&&`${Ff(m)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:a,gasPrice:typeof s<"u"&&`${At(s)} gwei`,maxFeePerGas:typeof c<"u"&&`${At(c)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${At(f)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",b].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}});var ui,nn,gu,vu,xu,wu,Eu,Au,Su,Iu,Io,To,Fs=U(()=>{Lf();se();ui=class extends q{constructor({cause:e,message:r}={}){let n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}};Object.defineProperty(ui,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ui,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});nn=class extends q{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${At(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}};Object.defineProperty(nn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});gu=class extends q{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${At(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}};Object.defineProperty(gu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});vu=class extends q{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}};Object.defineProperty(vu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});xu=class extends q{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
38
+ `),{cause:e,name:"NonceTooLowError"})}};Object.defineProperty(xu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});wu=class extends q{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}};Object.defineProperty(wu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Eu=class extends q{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
39
+ `),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(Eu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});Au=class extends q{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(Au,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});Su=class extends q{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(Su,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});Iu=class extends q{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(Iu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Io=class extends q{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${At(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${At(n)} gwei`:""}).`].join(`
40
+ `),{cause:e,name:"TipAboveFeeCapError"})}};Object.defineProperty(Io,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});To=class extends q{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}});function Tu(t,e){let r=(t.details||"").toLowerCase(),n=t instanceof q?t.walk(o=>o?.code===ui.code):t;return n instanceof q?new ui({cause:t,message:n.details}):ui.nodeMessage.test(r)?new ui({cause:t,message:t.details}):nn.nodeMessage.test(r)?new nn({cause:t,maxFeePerGas:e?.maxFeePerGas}):gu.nodeMessage.test(r)?new gu({cause:t,maxFeePerGas:e?.maxFeePerGas}):vu.nodeMessage.test(r)?new vu({cause:t,nonce:e?.nonce}):xu.nodeMessage.test(r)?new xu({cause:t,nonce:e?.nonce}):wu.nodeMessage.test(r)?new wu({cause:t,nonce:e?.nonce}):Eu.nodeMessage.test(r)?new Eu({cause:t}):Au.nodeMessage.test(r)?new Au({cause:t,gas:e?.gas}):Su.nodeMessage.test(r)?new Su({cause:t,gas:e?.gas}):Iu.nodeMessage.test(r)?new Iu({cause:t}):Io.nodeMessage.test(r)?new Io({cause:t,maxFeePerGas:e?.maxFeePerGas,maxPriorityFeePerGas:e?.maxPriorityFeePerGas}):new To({cause:t})}var w1=U(()=>{se();Fs()});function nN(t,{docsPath:e,...r}){let n=(()=>{let o=Tu(t,r);return o instanceof To?t:o})();return new x1(n,{docsPath:e,...r})}var oN=U(()=>{rN();Fs();w1()});function _o(t,{format:e}){if(!e)return{};let r={};function n(i){let a=Object.keys(i);for(let s of a)s in t&&(r[s]=t[s]),i[s]&&typeof i[s]=="object"&&!Array.isArray(i[s])&&n(i[s])}let o=e(t||{});return n(o),r}var _u=U(()=>{});function Bu(t,e){return({exclude:r,format:n})=>({exclude:r,format:(o,i)=>{let a=e(o,i);if(r)for(let s of r)delete a[s];return{...a,...n(o,i)}},type:t})}var E1=U(()=>{});function on(t,e){let r={};return typeof t.authorizationList<"u"&&(r.authorizationList=Ibe(t.authorizationList)),typeof t.accessList<"u"&&(r.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(r.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?r.blobs=t.blobs.map(n=>Ce(n)):r.blobs=t.blobs),typeof t.data<"u"&&(r.data=t.data),t.account&&(r.from=t.account.address),typeof t.from<"u"&&(r.from=t.from),typeof t.gas<"u"&&(r.gas=V(t.gas)),typeof t.gasPrice<"u"&&(r.gasPrice=V(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=V(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(r.maxFeePerGas=V(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=V(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(r.nonce=V(t.nonce)),typeof t.to<"u"&&(r.to=t.to),typeof t.type<"u"&&(r.type=Sbe[t.type]),typeof t.value<"u"&&(r.value=V(t.value)),r}function Ibe(t){return t.map(e=>({address:e.address,r:e.r?V(BigInt(e.r)):e.r,s:e.s?V(BigInt(e.s)):e.s,chainId:V(e.chainId),nonce:V(e.nonce),...typeof e.yParity<"u"?{yParity:V(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:V(e.v)}:{}}))}var Sbe,Ls=U(()=>{pe();Sbe={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"}});function iN(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new Ll({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new Ll({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function Tbe(t){let{balance:e,nonce:r,state:n,stateDiff:o,code:i}=t,a={};if(i!==void 0&&(a.code=i),e!==void 0&&(a.balance=V(e)),r!==void 0&&(a.nonce=V(r)),n!==void 0&&(a.state=iN(n)),o!==void 0){if(a.state)throw new Vb;a.stateDiff=iN(o)}return a}function A1(t){if(!t)return;let e={};for(let{address:r,...n}of t){if(!de(r,{strict:!1}))throw new Te({address:r});if(e[r])throw new Gb({address:r});e[r]=Tbe(n)}return e}var x3=U(()=>{go();_b();W8();en();pe()});var e9e,t9e,r9e,n9e,o9e,i9e,a9e,s9e,c9e,f9e,u9e,d9e,l9e,p9e,h9e,m9e,b9e,y9e,g9e,v9e,x9e,w9e,E9e,A9e,S9e,I9e,T9e,_9e,B9e,R9e,P9e,C9e,O9e,k9e,M9e,$9e,N9e,F9e,L9e,U9e,j9e,D9e,z9e,q9e,H9e,W9e,K9e,G9e,V9e,Y9e,Z9e,J9e,X9e,Q9e,eAe,tAe,rAe,nAe,oAe,iAe,aAe,sAe,cAe,fAe,uAe,dAe,lAe,pAe,hAe,mAe,bAe,yAe,gAe,vAe,xAe,wAe,EAe,AAe,SAe,IAe,TAe,_Ae,BAe,RAe,PAe,CAe,OAe,kAe,MAe,$Ae,NAe,FAe,LAe,UAe,jAe,Ru,w3=U(()=>{e9e=2n**(8n-1n)-1n,t9e=2n**(16n-1n)-1n,r9e=2n**(24n-1n)-1n,n9e=2n**(32n-1n)-1n,o9e=2n**(40n-1n)-1n,i9e=2n**(48n-1n)-1n,a9e=2n**(56n-1n)-1n,s9e=2n**(64n-1n)-1n,c9e=2n**(72n-1n)-1n,f9e=2n**(80n-1n)-1n,u9e=2n**(88n-1n)-1n,d9e=2n**(96n-1n)-1n,l9e=2n**(104n-1n)-1n,p9e=2n**(112n-1n)-1n,h9e=2n**(120n-1n)-1n,m9e=2n**(128n-1n)-1n,b9e=2n**(136n-1n)-1n,y9e=2n**(144n-1n)-1n,g9e=2n**(152n-1n)-1n,v9e=2n**(160n-1n)-1n,x9e=2n**(168n-1n)-1n,w9e=2n**(176n-1n)-1n,E9e=2n**(184n-1n)-1n,A9e=2n**(192n-1n)-1n,S9e=2n**(200n-1n)-1n,I9e=2n**(208n-1n)-1n,T9e=2n**(216n-1n)-1n,_9e=2n**(224n-1n)-1n,B9e=2n**(232n-1n)-1n,R9e=2n**(240n-1n)-1n,P9e=2n**(248n-1n)-1n,C9e=2n**(256n-1n)-1n,O9e=-(2n**(8n-1n)),k9e=-(2n**(16n-1n)),M9e=-(2n**(24n-1n)),$9e=-(2n**(32n-1n)),N9e=-(2n**(40n-1n)),F9e=-(2n**(48n-1n)),L9e=-(2n**(56n-1n)),U9e=-(2n**(64n-1n)),j9e=-(2n**(72n-1n)),D9e=-(2n**(80n-1n)),z9e=-(2n**(88n-1n)),q9e=-(2n**(96n-1n)),H9e=-(2n**(104n-1n)),W9e=-(2n**(112n-1n)),K9e=-(2n**(120n-1n)),G9e=-(2n**(128n-1n)),V9e=-(2n**(136n-1n)),Y9e=-(2n**(144n-1n)),Z9e=-(2n**(152n-1n)),J9e=-(2n**(160n-1n)),X9e=-(2n**(168n-1n)),Q9e=-(2n**(176n-1n)),eAe=-(2n**(184n-1n)),tAe=-(2n**(192n-1n)),rAe=-(2n**(200n-1n)),nAe=-(2n**(208n-1n)),oAe=-(2n**(216n-1n)),iAe=-(2n**(224n-1n)),aAe=-(2n**(232n-1n)),sAe=-(2n**(240n-1n)),cAe=-(2n**(248n-1n)),fAe=-(2n**(256n-1n)),uAe=2n**8n-1n,dAe=2n**16n-1n,lAe=2n**24n-1n,pAe=2n**32n-1n,hAe=2n**40n-1n,mAe=2n**48n-1n,bAe=2n**56n-1n,yAe=2n**64n-1n,gAe=2n**72n-1n,vAe=2n**80n-1n,xAe=2n**88n-1n,wAe=2n**96n-1n,EAe=2n**104n-1n,AAe=2n**112n-1n,SAe=2n**120n-1n,IAe=2n**128n-1n,TAe=2n**136n-1n,_Ae=2n**144n-1n,BAe=2n**152n-1n,RAe=2n**160n-1n,PAe=2n**168n-1n,CAe=2n**176n-1n,OAe=2n**184n-1n,kAe=2n**192n-1n,MAe=2n**200n-1n,$Ae=2n**208n-1n,NAe=2n**216n-1n,FAe=2n**224n-1n,LAe=2n**232n-1n,UAe=2n**240n-1n,jAe=2n**248n-1n,Ru=2n**256n-1n});function Ar(t){let{account:e,maxFeePerGas:r,maxPriorityFeePerGas:n,to:o}=t,i=e?oe(e):void 0;if(i&&!de(i.address))throw new Te({address:i.address});if(o&&!de(o))throw new Te({address:o});if(r&&r>Ru)throw new nn({maxFeePerGas:r});if(n&&r&&n>r)throw new Io({maxFeePerGas:r,maxPriorityFeePerGas:n})}var wa=U(()=>{vt();w3();go();Fs();en()});var Pu,Ea,S1,i0=U(()=>{Lf();se();Pu=class extends q{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}},Ea=class extends q{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}},S1=class extends q{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${At(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}});var Cu,E3=U(()=>{se();Cu=class extends q{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}});function di(t,e){let r={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,...t.blockTimestamp!=null&&{blockTimestamp:BigInt(t.blockTimestamp)},chainId:t.chainId?gt(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?gt(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?A3[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(r.authorizationList=_be(t.authorizationList)),r.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}function _be(t){return t.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}var A3,aN,Ou=U(()=>{ar();E1();A3={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};aN=Bu("transaction",di)});function S3(t,e){let r=(t.transactions??[]).map(n=>typeof n=="string"?n:di(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:r,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}var sN,I3=U(()=>{E1();Ou();sN=Bu("block",S3)});async function Un(t,{blockHash:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest",includeTransactions:o}={}){let i=o??!1,a=r!==void 0?V(r):void 0,s=null;if(e?s=await t.request({method:"eth_getBlockByHash",params:[e,i]},{dedupe:!0}):s=await t.request({method:"eth_getBlockByNumber",params:[a||n,i]},{dedupe:!!a}),!s)throw new Cu({blockHash:e,blockNumber:r});return(t.chain?.formatters?.block?.format||S3)(s,"getBlock")}var ku=U(()=>{E3();pe();I3()});async function I1(t){let e=await t.request({method:"eth_gasPrice"});return BigInt(e)}var T3=U(()=>{});async function cN(t,e){let{block:r,chain:n=t.chain,request:o}=e||{};try{let i=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof i=="function"){let s=r||await re(t,Un,"getBlock")({}),c=await i({block:s,client:t,request:o});if(c===null)throw new Error;return c}if(typeof i<"u")return i;let a=await t.request({method:"eth_maxPriorityFeePerGas"});return qe(a)}catch{let[i,a]=await Promise.all([r?Promise.resolve(r):re(t,Un,"getBlock")({}),re(t,I1,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new Ea;let s=a-i.baseFeePerGas;return s<0n?0n:s}}var fN=U(()=>{i0();ar();Kt();ku();T3()});async function _3(t,e){let{block:r,chain:n=t.chain,request:o,type:i="eip1559"}=e||{},a=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:o}):n?.fees?.baseFeeMultiplier??1.2)();if(a<1)throw new Pu;let c=10**(a.toString().split(".")[1]?.length??0),f=m=>m*BigInt(Math.round(a*c))/BigInt(c),u=r||await re(t,Un,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){let m=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:f,request:o,type:i});if(m!==null)return m}if(i==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Ea;let m=typeof o?.maxPriorityFeePerGas=="bigint"?o.maxPriorityFeePerGas:await cN(t,{block:u,chain:n,request:o}),b=f(u.baseFeePerGas);return{maxFeePerGas:o?.maxFeePerGas??b+m,maxPriorityFeePerGas:m}}return{gasPrice:o?.gasPrice??f(await re(t,I1,"getGasPrice")({}))}}var uN=U(()=>{i0();Kt();fN();ku();T3()});function a0(t){let{blockHash:e,blockNumber:r,blockTag:n,requireCanonical:o}=t;if(o!==void 0&&!e)throw new q("`requireCanonical` can only be provided when `blockHash` is set.");return e?o?{blockHash:e,requireCanonical:o}:{blockHash:e}:typeof r=="bigint"?V(r):n??"latest"}var B3=U(()=>{se();pe()});async function T1(t,{address:e,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:i}){let a=a0({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:i}),s=await t.request({method:"eth_getTransactionCount",params:[e,a]},{dedupe:typeof n=="bigint"||r!==void 0});return gt(s)}var R3=U(()=>{B3();ar()});function Mu(t){let{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(i=>sr(i)):t.blobs,o=[];for(let i of n)o.push(Uint8Array.from(e.blobToKzgCommitment(i)));return r==="bytes"?o:o.map(i=>Ce(i))}var _1=U(()=>{Qr();pe()});function $u(t){let{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(a=>sr(a)):t.blobs,o=typeof t.commitments[0]=="string"?t.commitments.map(a=>sr(a)):t.commitments,i=[];for(let a=0;a<n.length;a++){let s=n[a],c=o[a];i.push(Uint8Array.from(e.computeBlobKzgProof(s,c)))}return r==="bytes"?i:i.map(a=>Ce(a))}var B1=U(()=>{Qr();pe()});var dN,lN=U(()=>{K8();dN=ks});function pN(t,e){let r=e||"hex",n=dN(Ut(t,{strict:!1})?ua(t):t);return r==="bytes"?n:Vt(n)}var hN=U(()=>{lN();Jo();Qr();pe()});function mN(t){let{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),o=pN(e,"bytes");return o.set([r],0),n==="bytes"?o:Ce(o)}var bN=U(()=>{pe();hN()});function R1(t){let{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),o=[];for(let i of e)o.push(mN({commitment:i,to:n,version:r}));return o}var P3=U(()=>{bN()});var P1,Nu,C1,O1,C3=U(()=>{se();P1=class extends q{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}},Nu=class extends q{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}},C1=class extends q{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}},O1=class extends q{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${1}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}});function yN(t){let e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?sr(t.data):t.data,n=ue(r);if(!n)throw new Nu;if(n>761855)throw new P1({maxSize:761855,size:n});let o=[],i=!0,a=0;for(;i;){let s=$f(new Uint8Array(131072)),c=0;for(;c<4096;){let f=r.slice(a,a+31);if(s.pushByte(0),s.pushBytes(f),f.length<31){s.pushByte(128),i=!1;break}c++,a+=31}o.push(s)}return e==="bytes"?o.map(s=>s.bytes):o.map(s=>Ce(s.bytes))}var gN=U(()=>{C3();jb();On();Qr();pe()});function k1(t){let{data:e,kzg:r,to:n}=t,o=t.blobs??yN({data:e,to:n}),i=t.commitments??Mu({blobs:o,kzg:r,to:n}),a=t.proofs??$u({blobs:o,commitments:i,kzg:r,to:n}),s=[];for(let c=0;c<o.length;c++)s.push({blob:o[c],commitment:i[c],proof:a[c]});return s}var O3=U(()=>{_1();B1();gN()});function M1(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new Zb({transaction:t})}var k3=U(()=>{wr()});function Aa(t,{docsPath:e,...r}){let n=(()=>{let o=Tu(t,r);return o instanceof To?t:o})();return new Xb(n,{docsPath:e,...r})}var s0=U(()=>{Fs();wr();w1()});async function Sr(t){let e=await t.request({method:"eth_chainId"},{dedupe:!0});return gt(e)}var Sa=U(()=>{ar()});async function $1(t,e){let{account:r=t.account,accessList:n,authorizationList:o,chain:i=t.chain,blobVersionedHashes:a,blobs:s,data:c,gas:f,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:m,maxPriorityFeePerGas:b,nonce:w,nonceManager:T,to:P,type:R,value:k,..._}=e,O=await(async()=>{if(!r||!T||typeof w<"u")return w;let M=oe(r),F=i?i.id:await re(t,Sr,"getChainId")({});return await T.consume({address:M.address,chainId:F,client:t})})();Ar(e);let $=i?.formatters?.transactionRequest?.format,N=($||on)({..._o(_,{format:$}),account:r?oe(r):void 0,accessList:n,authorizationList:o,blobs:s,blobVersionedHashes:a,data:c,gas:f,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:m,maxPriorityFeePerGas:b,nonce:O,to:P,type:R,value:k},"fillTransaction");try{let M=await t.request({method:"eth_fillTransaction",params:[N]}),v=(i?.formatters?.transaction?.format||di)(M.tx);delete v.blockHash,delete v.blockNumber,delete v.r,delete v.s,delete v.transactionIndex,delete v.v,delete v.yParity,v.data=v.input;let l=typeof v.feePayerSignature<"u"&&v.feePayerSignature!==null;if(l&&typeof O<"u"&&v.nonce!==O)throw new Uf({filledNonce:v.nonce,requestedNonce:O});if(!l){v.gas&&(v.gas=e.gas??v.gas),v.gasPrice&&(v.gasPrice=e.gasPrice??v.gasPrice),v.maxFeePerBlobGas&&(v.maxFeePerBlobGas=e.maxFeePerBlobGas??v.maxFeePerBlobGas),v.maxFeePerGas&&(v.maxFeePerGas=e.maxFeePerGas??v.maxFeePerGas),v.maxPriorityFeePerGas&&(v.maxPriorityFeePerGas=e.maxPriorityFeePerGas??v.maxPriorityFeePerGas),typeof v.nonce<"u"&&(v.nonce=e.nonce??v.nonce);let h=await(async()=>{if(typeof i?.fees?.baseFeeMultiplier=="function"){let E=await re(t,Un,"getBlock")({});return i.fees.baseFeeMultiplier({block:E,client:t,request:e})}return i?.fees?.baseFeeMultiplier??1.2})();if(h<1)throw new Pu;let g=10**(h.toString().split(".")[1]?.length??0),x=E=>E*BigInt(Math.round(h*g))/BigInt(g);v.maxFeePerGas&&!e.maxFeePerGas&&(v.maxFeePerGas=x(v.maxFeePerGas)),v.gasPrice&&!e.gasPrice&&(v.gasPrice=x(v.gasPrice))}return{raw:M.raw,transaction:{from:N.from,...v},...M.capabilities?{capabilities:M.capabilities}:{}}}catch(M){throw Aa(M,{...e,chain:t.chain})}}var M3=U(()=>{vt();i0();wr();s0();_u();Ou();Ls();Kt();wa();ku();Sa()});async function Ia(t,e){let r=e;r.account??=t.account,r.parameters??=c0;let{account:n,chain:o=t.chain,nonceManager:i,parameters:a}=r,s=(()=>{if(typeof o?.prepareTransactionRequest=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o?.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})(),c;async function f(){return c||(typeof r.chainId<"u"?r.chainId:o?o.id:(c=await re(t,Sr,"getChainId")({}),c))}let u=n&&oe(n),d=r.nonce;if(s?.fn&&s.runAt?.includes("beforeFillTransaction")){r=await s.fn({...r,chain:o},{client:t,phase:"beforeFillTransaction"}),d??=r.nonce;let O=r.account??r.from;u=O?oe(O):void 0}if(a.includes("nonce")&&typeof d>"u"&&u&&i){let O=await f();d=await i.consume({address:u.address,chainId:O,client:t})}let b=((a.includes("blobVersionedHashes")||a.includes("sidecars"))&&r.kzg&&r.blobs?!1:a.length>0&&"feePayer"in r&&r.feePayer&&!("feePayerSignature"in r&&r.feePayerSignature)?!0:$3.get(t.uid)===!1||!["fees","gas"].some($=>a.includes($))?!1:!!(a.includes("chainId")&&typeof r.chainId!="number"||a.includes("nonce")&&typeof d!="number"||a.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||a.includes("gas")&&typeof r.gas!="bigint"))?await re(t,$1,"fillTransaction")({...r,nonce:d}).then(O=>{let{chainId:$,from:B,gas:N,gasPrice:M,nonce:F,maxFeePerBlobGas:v,maxFeePerGas:l,maxPriorityFeePerGas:h,type:y,...g}=O.transaction,x="feeToken"in g?g.feeToken:void 0,E="feePayerSignature"in g&&g.feePayerSignature!==null&&typeof g.feePayerSignature<"u",S=typeof x<"u"&&x!==null&&(!("feeToken"in r)||E);return $3.set(t.uid,!0),{...r,...B?{from:B}:{},...y&&!r.type?{type:y}:{},...typeof $<"u"?{chainId:$}:{},...typeof N<"u"?{gas:N}:{},...typeof M<"u"?{gasPrice:M}:{},...typeof F<"u"?{nonce:F}:{},...typeof v<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerBlobGas:v}:{},...typeof l<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerGas:l}:{},...typeof h<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxPriorityFeePerGas:h}:{},..."nonceKey"in g&&typeof g.nonceKey<"u"?{nonceKey:g.nonceKey}:{},..."validBefore"in g&&g.validBefore!==null&&typeof g.validBefore<"u"?{validBefore:g.validBefore}:{},..."validAfter"in g&&g.validAfter!==null&&typeof g.validAfter<"u"?{validAfter:g.validAfter}:{},..."keyAuthorization"in g&&typeof g.keyAuthorization<"u"&&g.keyAuthorization!==null&&!("keyAuthorization"in r)?{keyAuthorization:g.keyAuthorization}:{},..."feePayerSignature"in g&&typeof g.feePayerSignature<"u"&&g.feePayerSignature!==null?{feePayerSignature:g.feePayerSignature}:{},...S?{feeToken:x}:{},...O.capabilities?{_capabilities:O.capabilities}:{}}}).catch(O=>{let $=O;if($.name!=="TransactionExecutionError")return r;if($.walk?.(F=>F instanceof Uf)||$.walk?.(F=>F.name==="ExecutionRevertedError"))throw O;return $.walk?.(F=>{let v=F;return v.name==="MethodNotFoundRpcError"||v.name==="MethodNotSupportedRpcError"||v.message?.includes("eth_fillTransaction is not available")})&&$3.set(t.uid,!1),r}):r;d??=b.nonce,r={...b,...u?{from:u?.address}:{},...typeof d<"u"?{nonce:d}:{}};let{blobs:w,gas:T,kzg:P,type:R}=r;s?.fn&&s.runAt?.includes("beforeFillParameters")&&(r=await s.fn({...r,chain:o},{client:t,phase:"beforeFillParameters"}));let k;async function _(){return k||(k=await re(t,Un,"getBlock")({blockTag:"latest"}),k)}if(a.includes("nonce")&&typeof d>"u"&&u&&!i&&(r.nonce=await re(t,T1,"getTransactionCount")({address:u.address,blockTag:"pending"})),(a.includes("blobVersionedHashes")||a.includes("sidecars"))&&w&&P){let O=Mu({blobs:w,kzg:P});if(a.includes("blobVersionedHashes")){let $=R1({commitments:O,to:"hex"});r.blobVersionedHashes=$}if(a.includes("sidecars")){let $=$u({blobs:w,commitments:O,kzg:P}),B=k1({blobs:w,commitments:O,proofs:$,to:"hex"});r.sidecars=B}}if(a.includes("chainId")&&(r.chainId=await f()),(a.includes("fees")||a.includes("type"))&&typeof R>"u")try{r.type=M1(r)}catch{let O=vN.get(t.uid);typeof O>"u"&&(O=typeof(await _())?.baseFeePerGas=="bigint",vN.set(t.uid,O)),r.type=O?"eip1559":"legacy"}if(a.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){let O=await _(),{maxFeePerGas:$,maxPriorityFeePerGas:B}=await _3(t,{block:O,chain:o,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<B)throw new S1({maxPriorityFeePerGas:B});r.maxPriorityFeePerGas=B,r.maxFeePerGas=$}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new Ea;if(typeof r.gasPrice>"u"){let O=await _(),{gasPrice:$}=await _3(t,{block:O,chain:o,request:r,type:"legacy"});r.gasPrice=$}}return a.includes("gas")&&typeof T>"u"&&(r.gas=await re(t,N1,"estimateGas")({...r,account:u,prepare:u?.type==="local"?[]:["blobVersionedHashes"]})),s?.fn&&s.runAt?.includes("afterFillParameters")&&(r=await s.fn({...r,chain:o},{client:t,phase:"afterFillParameters"})),Ar(r),delete r.parameters,r}var c0,vN,$3,f0=U(()=>{vt();uN();N3();ku();R3();i0();wr();_1();B1();P3();O3();Kt();Ts();wa();k3();M3();Sa();c0=["blobVersionedHashes","chainId","fees","gas","nonce","type"],vN=new Map,$3=new xr(128)});async function N1(t,e){let{account:r=t.account,prepare:n=!0}=e,o=r?oe(r):void 0,i=(()=>{if(Array.isArray(n))return n;if(o?.type!=="local")return["blobVersionedHashes"]})();try{let a=await(async()=>{if(e.to)return e.to;if(e.authorizationList&&e.authorizationList.length>0)return await yu({authorization:e.authorizationList[0]}).catch(()=>{throw new q("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:s,authorizationList:c,blobs:f,blobVersionedHashes:u,blockNumber:d,blockTag:m,data:b,gas:w,gasPrice:T,maxFeePerBlobGas:P,maxFeePerGas:R,maxPriorityFeePerGas:k,nonce:_,value:O,stateOverride:$,...B}=n?await Ia(t,{...e,parameters:i,to:a}):e;if(w&&e.gas!==w)return w;let M=(typeof d=="bigint"?V(d):void 0)||m,F=A1($);Ar(e);let v=t.chain?.formatters?.transactionRequest?.format,h=(v||on)({..._o(B,{format:v}),account:o,accessList:s,authorizationList:c,blobs:f,blobVersionedHashes:u,data:b,gasPrice:T,maxFeePerBlobGas:P,maxFeePerGas:R,maxPriorityFeePerGas:k,nonce:_,to:a,value:O},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:F?[h,M??t.experimental_blockTag??"latest",F]:M?[h,M]:[h]}))}catch(a){throw nN(a,{...e,account:o,chain:t.chain})}}var N3=U(()=>{vt();se();v1();pe();oN();_u();Ls();x3();wa();f0()});async function F1(t,e){let{abi:r,address:n,args:o,functionName:i,dataSuffix:a=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,...s}=e,c=Lr({abi:r,args:o,functionName:i});try{return await re(t,N1,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:n,...s})}catch(f){let u=s.account?oe(s.account):void 0;throw uu(f,{abi:r,address:n,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:u?.address})}}var F3=U(()=>{vt();Bs();c1();Kt();N3()});function Ir(t,e){if(!de(t,{strict:!1}))throw new Te({address:t});if(!de(e,{strict:!1}))throw new Te({address:e});return t.toLowerCase()===e.toLowerCase()}var Us=U(()=>{go();en()});function L1(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}var L3=U(()=>{});function U3(t){let{abi:e,data:r,strict:n,topics:o}=t,i=n??!0,[a,...s]=o;if(!a)throw new vb({docsPath:xN});let c=e.find(R=>R.type==="event"&&a===Pf(Lt(R)));if(!(c&&"name"in c)||c.type!=="event")throw new xb(a,{docsPath:xN});let{name:f,inputs:u}=c,d=u?.some(R=>!("name"in R&&R.name)),m=d?[]:{},b=u.map((R,k)=>[R,k]).filter(([R])=>"indexed"in R&&R.indexed),w=[];for(let R=0;R<b.length;R++){let[k,_]=b[R],O=s[R];if(!O){if(i)throw new Sb({abiItem:c,param:k});w.push([k,_]);continue}m[d?_:k.name||_]=Pbe({param:k,value:O})}let T=u.filter(R=>!("indexed"in R&&R.indexed)),P=i?T:[...w.map(([R])=>R),...T];if(P.length>0){if(r&&r!=="0x")try{let R=ti(P,r);if(R){let k=0;if(!i)for(let[_,O]of w)m[d?O:_.name||O]=R[k++];if(d)for(let _=0;_<u.length;_++)m[_]===void 0&&k<R.length&&(m[_]=R[k++]);else for(let _=0;_<T.length;_++)m[T[_].name]=R[k++]}}catch(R){if(i)throw R instanceof If||R instanceof Mf?new $l({abiItem:c,data:r,params:P,size:ue(r)}):R}else if(i)throw new $l({abiItem:c,data:"0x",params:P,size:0})}return{eventName:f,args:Object.values(m).length>0?m:void 0}}function Pbe({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(ti([t],e)||[])[0]}var xN,wN=U(()=>{Gt();j8();On();Mb();Kl();aa();xN="/docs/contract/decodeEventLog"});function U1(t){let{abi:e,args:r,logs:n,strict:o=!0}=t,i=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})(),a=e.filter(s=>s.type==="event").map(s=>({abi:s,selector:Pf(s)}));return n.map(s=>{let c=typeof s.blockNumber=="string"?L1(s):s,f=a.filter(m=>c.topics[0]===m.selector);if(f.length===0)return null;let u,d;for(let m of f)try{u=U3({...c,abi:[m.abi],strict:!0}),d=m;break}catch{}if(!u&&!o){d=f[0];try{u=U3({data:c.data,topics:c.topics,abi:[d.abi],strict:!1})}catch{let m=d.abi.inputs?.some(b=>!("name"in b&&b.name));return{...c,args:m?[]:{},eventName:d.abi.name}}}return!u||!d||i&&!i.includes(u.eventName)||!Cbe({args:u.args,inputs:d.abi.inputs,matchArgs:r})?null:{...u,...c}}).filter(Boolean)}function Cbe(t){let{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function o(i,a,s){try{return i.type==="address"?Ir(a,s):i.type==="string"?Mn(Dl(a))===s:i.type==="bytes"?Mn(ua(a))===s:a===s}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((i,a)=>{if(i==null)return!0;let s=r[a];return s?(Array.isArray(i)?i:[i]).some(f=>o(s,f,e[a])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([i,a])=>{if(a==null)return!0;let s=r.find(f=>f.name===i);return s?(Array.isArray(a)?a:[a]).some(f=>o(s,f,e[i])):!1}):!1}var j3=U(()=>{Us();Qr();L3();Rf();Mb();wN()});function j1(t){let{abi:e,args:r,functionName:n,data:o}=t,i=e[0];if(n){let s=wo({abi:e,args:r,name:n});if(!s)throw new kn(n,{docsPath:D3});i=s}if(i.type!=="function")throw new kn(void 0,{docsPath:D3});if(!i.outputs)throw new _f(i.name,{docsPath:D3});let a=ti(i.outputs,o);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}var D3,z3=U(()=>{Gt();Kl();kf();D3="/docs/contract/decodeFunctionResult"});var EN,AN=U(()=>{EN="0.1.1"});function SN(){return EN}var IN=U(()=>{AN()});function TN(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?TN(t.cause,e):e?null:t}var Ta,_N=U(()=>{IN();Ta=class t extends Error{static setStaticOptions(e){t.prototype.docsOrigin=e.docsOrigin,t.prototype.showVersion=e.showVersion,t.prototype.version=e.version}constructor(e,r={}){let n=(()=>{if(r.cause instanceof t){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),o=r.cause instanceof t&&r.cause.docsPath||r.docsPath,i=r.docsOrigin??t.prototype.docsOrigin,a=`${i}${o??""}`,s=!!(r.version??t.prototype.showVersion),c=r.version??t.prototype.version,f=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||o||s?["",n?`Details: ${n}`:void 0,o?`See: ${a}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(`
41
+ `);super(f,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=r.cause,this.details=n,this.docs=a,this.docsOrigin=i,this.docsPath=o,this.shortMessage=e,this.showVersion=s,this.version=c}walk(e){return TN(this,e)}};Object.defineProperty(Ta,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${SN()}`}});Ta.setStaticOptions(Ta.defaultStaticOptions)});function BN(t,e={}){let{dir:r,size:n=32}=e;if(n===0)return t;let o=t.replace("0x","");if(o.length>n*2)throw new D1({size:Math.ceil(o.length/2),targetSize:n,type:"Hex"});return`0x${o[r==="right"?"padEnd":"padStart"](n*2,"0")}`}var RN=U(()=>{z1()});function jn(t,e={}){let{signed:r,size:n}=e,o=BigInt(t),i;n?r?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof i=="bigint"&&r?-i-1n:0;if(i&&o>i||o<a){let f=typeof t=="bigint"?"n":"";throw new H3({max:i?`${i}${f}`:void 0,min:`${a}${f}`,signed:r,size:n,value:`${t}${f}`})}let c=`0x${(r&&o<0?BigInt.asUintN(n*8,BigInt(o)):o).toString(16)}`;return n?Mbe(c,n):c}function Mbe(t,e){return BN(t,{dir:"left",size:e})}var H3,D1,z1=U(()=>{_N();RN();H3=class extends Ta{constructor({max:e,min:r,signed:n,size:o,value:i}){super(`Number \`${i}\` is not in safe${o?` ${o*8}-bit`:""}${n?" signed":" unsigned"} integer range ${e?`(\`${r}\` to \`${e}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},D1=class extends Ta{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}});function PN(t){return{address:t.address,amount:jn(t.amount),index:jn(t.index),validatorIndex:jn(t.validatorIndex)}}var CN=U(()=>{z1()});function ON(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:jn(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:jn(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:jn(t.gasLimit)},...typeof t.number=="bigint"&&{number:jn(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:jn(t.prevRandao)},...typeof t.time=="bigint"&&{time:jn(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(PN)}}}var kN=U(()=>{z1();CN()});var W3,q1,MN,HIe,WIe,js,u0=U(()=>{W3=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],q1=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],MN=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],HIe=[...MN,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],WIe=[...MN,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],js=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]});var $N,NN=U(()=>{$N="0x82ad56cb"});var FN,LN,UN,jN=U(()=>{FN="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",LN="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",UN="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"});var Ds,H1,W1,d0,zs,l0=U(()=>{se();Ds=class extends q{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}},H1=class extends q{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} \u2013 ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} \u2013 ${e.name}`],name:"ChainMismatchError"})}},W1=class extends q{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
42
+ `),{name:"ChainNotFoundError"})}},d0=class extends q{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}},zs=class extends q{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});function p0(t){let{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;let o=e.find(a=>"type"in a&&a.type==="constructor");if(!o)throw new hb({docsPath:K3});if(!("inputs"in o))throw new kl({docsPath:K3});if(!o.inputs||o.inputs.length===0)throw new kl({docsPath:K3});let i=vo(o.inputs,r);return Fe([n,i])}var K3,G3=U(()=>{Gt();tn();_s();K3="/docs/contract/encodeDeployData"});function DN({blockNumber:t,chain:e,contract:r}){let n=e?.contracts?.[r];if(!n)throw new Ds({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new Ds({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}var zN=U(()=>{l0()});function qN(t,{docsPath:e,...r}){let n=(()=>{let o=Tu(t,r);return o instanceof To?t:o})();return new e1(n,{docsPath:e,...r})}var HN=U(()=>{i1();Fs();w1()});function Fu(){let t=()=>{},e=()=>{};return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var K1=U(()=>{});function WN({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:o}){let i=async()=>{let u=c();a();let d=u.map(({args:m})=>m);d.length!==0&&t(d).then(m=>{o&&Array.isArray(m)&&m.sort(o);for(let b=0;b<u.length;b++){let{resolve:w}=u[b];w?.([m[b],m])}}).catch(m=>{for(let b=0;b<u.length;b++){let{reject:w}=u[b];w?.(m)}})},a=()=>V3.delete(e),s=()=>c().map(({args:u})=>u),c=()=>V3.get(e)||[],f=u=>V3.set(e,[...c(),u]);return{flush:a,async schedule(u){let{promise:d,resolve:m,reject:b}=Fu();return r?.([...s(),u])&&i(),c().length>0?(f({args:u,resolve:m,reject:b}),d):(f({args:u,resolve:m,reject:b}),setTimeout(i,n),d)}}}var V3,KN=U(()=>{K1();V3=new Map});var G1,V1,Y1,GN=U(()=>{Nn();se();ri();G1=class extends q{constructor({callbackSelector:e,cause:r,data:n,extraData:o,sender:i,urls:a}){super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],r.metaMessages?.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(s=>` ${zf(s)}`)],` Sender: ${i}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}},V1=class extends q{constructor({result:e,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${zf(r)}`,`Response: ${He(e)}`],name:"OffchainLookupResponseMalformedError"})}},Y1=class extends q{constructor({sender:e,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}});function VN(t){let{abi:e,data:r}=t,n=rn(r,0,4),o=e.find(i=>i.type==="function"&&n===xo(Lt(i)));if(!o)throw new wb(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?ti(o.inputs,rn(r,4)):void 0}}var YN=U(()=>{Gt();da();Of();Kl();aa()});function Z3(t){let{abi:e,errorName:r,args:n}=t,o=e[0];if(r){let c=wo({abi:e,args:n,name:r});if(!c)throw new Ml(r,{docsPath:Y3});o=c}if(o.type!=="error")throw new Ml(void 0,{docsPath:Y3});let i=Lt(o),a=xo(i),s="0x";if(n&&n.length>0){if(!o.inputs)throw new gb(o.name,{docsPath:Y3});s=vo(o.inputs,n)}return Fe([a,s])}var Y3,ZN=U(()=>{Gt();tn();Of();_s();aa();kf();Y3="/docs/contract/encodeErrorResult"});function JN(t){let{abi:e,functionName:r,result:n}=t,o=e[0];if(r){let a=wo({abi:e,name:r});if(!a)throw new kn(r,{docsPath:J3});o=a}if(o.type!=="function")throw new kn(void 0,{docsPath:J3});if(!o.outputs)throw new _f(o.name,{docsPath:J3});let i=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new Bf(n)})();return vo(o.outputs,i)}var J3,XN=U(()=>{Gt();_s();kf();J3="/docs/contract/encodeFunctionResult"});async function Q3(t){let{data:e,ccipRequest:r}=t,{args:[n]}=VN({abi:q1,data:e}),o=[],i=[];return await Promise.all(n.map(async(a,s)=>{try{i[s]=a.urls.includes(X3)?await Q3({data:a.data,ccipRequest:r}):await r(a),o[s]=!1}catch(c){o[s]=!0,i[s]=Fbe(c)}})),JN({abi:q1,functionName:"query",result:[o,i]})}function Fbe(t){return t.name==="HttpRequestError"&&t.status?Z3({abi:q1,errorName:"HttpError",args:[t.status,t.shortMessage]}):Z3({abi:[Fb],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}var X3,QN=U(()=>{u0();Lb();YN();ZN();XN();X3="x-batch-gateway:true"});var rF={};hE(rF,{ccipRequest:()=>tF,offchainLookup:()=>Ube,offchainLookupAbiItem:()=>eF,offchainLookupSignature:()=>Lbe});async function Ube(t,{blockNumber:e,blockTag:r,data:n,requestOptions:o,to:i}){let{args:a}=Db({data:n,abi:[eF]}),[s,c,f,u,d]=a,{ccipRead:m}=t,b=m&&typeof m?.request=="function"?m.request:tF;try{if(!Ir(i,s))throw new Y1({sender:s,to:i});let w=c.includes(X3)?await Q3({data:f,ccipRequest:P=>b({...P,requestOptions:o})}):await b({data:f,requestOptions:o,sender:s,urls:c}),{data:T}=await Z1(t,{blockNumber:e,blockTag:r,data:$n([u,vo([{type:"bytes"},{type:"bytes"}],[w,d])]),requestOptions:o,to:i});return T}catch(w){throw o?.signal?.aborted?Yt(o.signal):Ao(w)?w:new G1({callbackSelector:u,cause:w,data:n,extraData:d,sender:s,urls:c})}}async function tF({data:t,requestOptions:e,sender:r,urls:n}){let o=new Error("An unknown error occurred.");for(let i=0;i<n.length;i++){if(e?.signal?.aborted)throw Yt(e.signal);let a=n[i],s=a.includes("{data}")?"GET":"POST",c=s==="POST"?{data:t,sender:r}:void 0,f=s==="POST"?{"Content-Type":"application/json"}:{};try{let u=await fetch(a.replace("{sender}",r.toLowerCase()).replace("{data}",t),{body:JSON.stringify(c),headers:f,method:s,...e?.signal?{signal:e.signal}:{}}),d;if(u.headers.get("Content-Type")?.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){o=new la({body:c,details:d?.error?He(d.error):u.statusText,headers:u.headers,status:u.status,url:a});continue}if(!Ut(d)){o=new V1({result:d,url:a});continue}return d}catch(u){if(e?.signal?.aborted)throw Yt(e.signal);if(Ao(u))throw u;o=new la({body:c,details:u.message,url:a})}}throw o}var Lbe,eF,nF=U(()=>{e4();GN();Vl();ri();z8();_s();Us();tn();Jo();QN();Nn();Lbe="0x556f1830",eF={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function Z1(t,e){let{account:r=t.account,authorizationList:n,batch:o=!!t.batch?.multicall,blockHash:i,blockNumber:a,blockTag:s=t.experimental_blockTag??"latest",requireCanonical:c,accessList:f,blobs:u,blockOverrides:d,code:m,data:b,factory:w,factoryData:T,gas:P,gasPrice:R,maxFeePerBlobGas:k,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:$,requestOptions:B,to:N,value:M,stateOverride:F,...v}=e,l=r?oe(r):void 0;if(m&&(w||T))throw new q("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&N)throw new q("Cannot provide both `code` & `to` as parameters.");let h=m&&b,y=w&&T&&N&&b,g=h||y,x=h?aF({code:m,data:b}):y?Wbe({data:b,factory:w,factoryData:T,to:N}):b;try{Ar(e);let E=a0({blockHash:i,blockNumber:a,blockTag:s,requireCanonical:c}),S=d?ON(d):void 0,A=A1(F),p=t.chain?.formatters?.transactionRequest?.format,C=(p||on)({..._o(v,{format:p}),accessList:f,account:l,authorizationList:n,blobs:u,data:x,gas:P,gasPrice:R,maxFeePerBlobGas:k,maxFeePerGas:_,maxPriorityFeePerGas:O,nonce:$,to:g?void 0:N,value:M},"call");if(o&&jbe({request:C})&&!S&&i===void 0)try{let{deployless:D=!1}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},z=iF(t,{blockNumber:a,deployless:D});if(!z||!Hbe(A,z))return await qbe(t,{...C,blockHash:i,blockNumber:a,blockTag:s,multicallAddress:z,requestOptions:B,requireCanonical:c,rpcStateOverride:A})}catch(D){if(!(D instanceof d0)&&!(D instanceof Ds))throw D}let L=(()=>{let D=[C,E];return A&&S?[...D,A,S]:A?[...D,A]:S?[...D,{},S]:D})(),j=await t.request({method:"eth_call",params:L},B);return j==="0x"?{data:void 0}:{data:j}}catch(E){if(B?.signal?.aborted)throw Yt(B.signal);if(Ao(E))throw E;let S=Kbe(E),{offchainLookup:A,offchainLookupSignature:p}=await Promise.resolve().then(()=>(nF(),rF));if(t.ccipRead!==!1&&S?.slice(0,10)===p&&N)return{data:await A(t,{data:S,requestOptions:B,to:N})};throw g&&S?.slice(0,10)==="0x101bb98d"?new o1({factory:w}):qN(E,{...e,account:l,chain:t.chain})}}function jbe({request:t}){let{data:e,to:r,...n}=t;return!(!e||e.startsWith($N)||!r||Object.values(n).filter(o=>typeof o<"u").length>0)}function zbe(t){if(!t)return"default";let e=oF.get(t);if(e!==void 0)return e;let r=Dbe++;return oF.set(t,r),r}async function qbe(t,e){let{batchSize:r=1024,deployless:n=!1,wait:o=0}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},{blockHash:i,blockNumber:a,blockTag:s=t.experimental_blockTag??"latest",requireCanonical:c,data:f,multicallAddress:u,requestOptions:d,rpcStateOverride:m,to:b}=e,w=u!==void 0?u:iF(t,{blockNumber:a,deployless:n}),T=a0({blockHash:i,blockNumber:a,blockTag:s,requireCanonical:c}),P=typeof T=="string"?T:JSON.stringify(T),R=m?`.${JSON.stringify(m)}`:"",{schedule:k}=WN({id:`${t.uid}.${P}.${zbe(d)}${R}`,wait:o,shouldSplitBatch($){return $.reduce((N,{data:M})=>N+(M.length-2),0)>r*2},fn:async $=>{let B=$.map(v=>({allowFailure:!0,callData:v.data,target:v.to})),N=Lr({abi:W3,args:[B],functionName:"aggregate3"}),M={...w===null?{data:aF({code:UN,data:N})}:{to:w,data:N}},F=await t.request({method:"eth_call",params:m?[M,T,m]:[M,T]},d);return j1({abi:W3,args:[B],functionName:"aggregate3",data:F||"0x"})}}),[{returnData:_,success:O}]=await k({data:f,to:b});if(!O)throw new qf({data:_});return _==="0x"?{data:void 0}:{data:_}}function iF(t,e){let{blockNumber:r,deployless:n}=e;if(n)return null;if(t.chain)return DN({blockNumber:r,chain:t.chain,contract:"multicall3"});throw new d0}function Hbe(t,e){return t?Object.keys(t).some(r=>Ir(r,e)):!1}function aF(t){let{code:e,data:r}=t;return p0({abi:lb(["constructor(bytes, bytes)"]),bytecode:FN,args:[e,r]})}function Wbe(t){let{data:e,factory:r,factoryData:n,to:o}=t;return p0({abi:lb(["constructor(address, bytes, address, bytes)"]),bytecode:LN,args:[o,e,r,n]})}function Kbe(t){if(!(t instanceof q))return;let e=t.walk();return typeof e?.data=="object"?e.data?.data:e.data}var Dbe,oF,e4=U(()=>{T8();kN();vt();u0();NN();jN();se();l0();i1();ri();z3();G3();Bs();Us();B3();zN();HN();_u();Ls();KN();x3();wa();Dbe=0,oF=new WeakMap});async function J1(t,e){let{abi:r,address:n,args:o,functionName:i,dataSuffix:a=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,...s}=e,c=s.account?oe(s.account):t.account,f=Lr({abi:r,args:o,functionName:i});try{let{data:u}=await re(t,Z1,"call")({batch:!1,data:`${f}${a?a.replace("0x",""):""}`,to:n,...s,account:c}),d=j1({abi:r,args:o,functionName:i,data:u||"0x"}),m=r.filter(b=>"name"in b&&b.name===e.functionName);return{result:d,request:{abi:m,address:n,args:o,dataSuffix:a,functionName:i,...s,account:c}}}catch(u){throw uu(u,{abi:r,address:n,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:c?.address})}}var t4=U(()=>{vt();z3();Bs();c1();Kt();e4()});function qs(t,e,r){let n=++Gbe,o=()=>X1.get(t)||[],i=()=>{let d=o().filter(m=>m.id!==n);if(d.length===0){X1.delete(t),r4.delete(t);return}X1.set(t,d)},a=()=>{let u=o();if(!u.some(m=>m.id===n))return;let d=r4.get(t);if(u.length===1&&d){let m=d();m instanceof Promise&&m.catch(()=>{})}i()},s=o();if(X1.set(t,[...s,{id:n,fns:e}]),s&&s.length>0)return a;let c={};for(let u in e)c[u]=((...d)=>{let m=o();if(m.length!==0)for(let b of m)b.fns[u]?.(...d)});let f=r(c);return typeof f=="function"&&r4.set(t,f),a}var X1,r4,Gbe,Q1=U(()=>{X1=new Map,r4=new Map,Gbe=0});async function h0(t,{signal:e}={}){return new Promise((r,n)=>{if(e?.aborted){n(Yt(e));return}let o=()=>e?.removeEventListener("abort",a),i=setTimeout(()=>{o(),r()},t),a=()=>{clearTimeout(i),o(),n(Yt(e))};e?.addEventListener("abort",a,{once:!0})})}var n4=U(()=>{ri()});function ey(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let o=!0,i=()=>o=!1;return(async()=>{let s;e&&(s=await t({unpoll:i}));let c=await r?.(s)??n;await h0(c);let f=async()=>{o&&(await t({unpoll:i}),await h0(n),f())};f()})(),i}var o4=U(()=>{n4()});function sF(t){let e=(o,i)=>({clear:()=>i.delete(o),get:()=>i.get(o),set:a=>i.set(o,a)}),r=e(t,Vbe),n=e(t,Ybe);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function cF(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){let n=sF(e),o=n.response.get();if(o&&r>0&&Date.now()-o.created.getTime()<r)return o.data;let i=n.promise.get();i||(i=t(),n.promise.set(i));try{let a=await i;return n.response.set({created:new Date,data:a}),a}finally{n.promise.clear()}}var Vbe,Ybe,fF=U(()=>{Vbe=new Map,Ybe=new Map});async function uF(t,{cacheTime:e=t.cacheTime}={}){let r=await cF(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Zbe(t.uid),cacheTime:e});return BigInt(r)}var Zbe,dF=U(()=>{fF();Zbe=t=>`blockNumber.${t}`});var Ot,an,li=U(()=>{se();Ot=class extends q{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
43
+ `),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}},an=class extends q{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}});function Lu({chain:t,currentChainId:e}){if(!t)throw new W1;if(e!==t.id)throw new H1({chain:t,currentChainId:e})}var ty=U(()=>{l0()});async function ry(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}var i4=U(()=>{});async function _a(t,e){let{account:r=t.account,assertChainId:n=!0,chain:o=t.chain,accessList:i,authorizationList:a,blobs:s,data:c,dataSuffix:f=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:T,type:P,value:R,...k}=e;if(typeof r>"u")throw new Ot({docsPath:"/docs/actions/wallet/sendTransaction"});let _=r?oe(r):null,O;try{Ar(e);let $=await(async()=>{if(e.to)return e.to;if(e.to!==null&&a&&a.length>0)return await yu({authorization:a[0]}).catch(()=>{throw new q("`to` is required. Could not infer from `authorizationList`.")})})();if(_?.type==="json-rpc"||_===null){let B;o!==null&&(B=await re(t,Sr,"getChainId")({}),n&&Lu({currentChainId:B,chain:o}));let N=t.chain?.formatters?.transactionRequest?.format,F=(N||on)({..._o(k,{format:N}),accessList:i,account:_,authorizationList:a,blobs:s,chainId:B,data:f?$n([c??"0x",f]):c,gas:u,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:T,to:$,type:P,value:R},"sendTransaction"),v=a4.get(t.uid),l=v?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:l,params:[F]},{retryCount:0})}catch(h){if(v===!1)throw h;let y=h;if(y.name==="InvalidInputRpcError"||y.name==="InvalidParamsRpcError"||y.name==="MethodNotFoundRpcError"||y.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[F]},{retryCount:0}).then(g=>(a4.set(t.uid,!0),g)).catch(g=>{let x=g;throw x.name==="MethodNotFoundRpcError"||x.name==="MethodNotSupportedRpcError"?(a4.set(t.uid,!1),y):x});throw y}}if(_?.type==="local"){let B=(()=>{if(!_.nonceManager||typeof T<"u")return _.nonceManager;let h=_.nonceManager;return{consume(y){return O={address:y.address,chainId:y.chainId},h.consume(y)},get(y){return h.get(y)},increment(y){return h.increment(y)},reset(y){return h.reset(y)}}})(),N=await re(t,Ia,"prepareTransactionRequest")({account:_,accessList:i,authorizationList:a,blobs:s,chain:o,data:f?$n([c??"0x",f]):c,gas:u,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:T,nonceManager:B,parameters:[...c0,"sidecars"],type:P,value:R,...k,to:$}),M=o?.serializers?.transaction,F=await _.signTransaction(N,{serializer:M}),v=(o??t.chain)?.serializers?.transactionEnvelope,l=v?await v({serializedTransaction:F,transaction:N}):F;return await re(t,ry,"sendRawTransaction")({serializedTransaction:l})}throw _?.type==="smart"?new an({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new an({docsPath:"/docs/actions/wallet/sendTransaction",type:_?.type})}catch($){throw $ instanceof an?$:(O&&_?.nonceManager?.reset(O),Aa($,{...e,account:_,chain:e.chain||void 0}))}}var a4,m0=U(()=>{vt();li();se();v1();ty();tn();s0();_u();Ls();Kt();Ts();wa();Sa();f0();i4();a4=new xr(128)});async function Dn(t,e){return Dn.internal(t,_a,"sendTransaction",e)}var b0=U(()=>{vt();li();Bs();c1();Kt();m0();(function(t){async function e(r,n,o,i){let{abi:a,account:s=r.account,address:c,args:f,functionName:u,...d}=i;if(typeof s>"u")throw new Ot({docsPath:"/docs/contract/writeContract"});let m=s?oe(s):null,b=Lr({abi:a,args:f,functionName:u});try{return await re(r,n,o)({data:b,to:c,account:m,...d})}catch(w){throw uu(w,{abi:a,address:c,args:f,docsPath:"/docs/contract/writeContract",functionName:u,sender:m?.address})}}t.internal=e})(Dn||(Dn={}))});function Hs(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0,signal:o}={}){return new Promise((i,a)=>{let s=()=>a(Yt(o));o?.addEventListener("abort",s,{once:!0});let c=async({count:f=0}={})=>{if(o?.aborted){a(Yt(o));return}let u=async({error:d})=>{let m=typeof e=="function"?e({count:f,error:d}):e;if(m)try{await h0(m,{signal:o})}catch(b){a(b);return}return c({count:f+1})};try{let d=await t();i(d)}catch(d){if(o?.aborted){a(Yt(o));return}if(Ao(d)){a(d);return}if(f<r&&await n({count:f,error:d}))return u({error:d});a(d)}};c().catch(a).finally(()=>o?.removeEventListener("abort",s))})}var oy=U(()=>{ri();n4()});function y0(t,e){let r={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(n=>L1(n)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?gt(t.transactionIndex):null,status:t.status?s4[t.status]:null,type:t.type?A3[t.type]||t.type:null};return t.blobGasPrice&&(r.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(r.blobGasUsed=BigInt(t.blobGasUsed)),r}var s4,lF,g0=U(()=>{ar();E1();L3();Ou();s4={"0x0":"reverted","0x1":"success"};lF=Bu("transactionReceipt",y0)});function vF(t){let{authorizationList:e}=t;if(e)for(let r of e){let{chainId:n}=r,o=r.address;if(!de(o))throw new Te({address:o});if(n<0)throw new zs({chainId:n})}dy(t)}function xF(t){let{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new Nu;for(let r of e){let n=ue(r),o=gt(rn(r,0,1));if(n!==32)throw new C1({hash:r,size:n});if(o!==1)throw new O1({hash:r,version:o})}}dy(t)}function dy(t){let{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:o}=t;if(e<=0)throw new zs({chainId:e});if(o&&!de(o))throw new Te({address:o});if(n&&n>Ru)throw new nn({maxFeePerGas:n});if(r&&n&&r>n)throw new Io({maxFeePerGas:n,maxPriorityFeePerGas:r})}function wF(t){let{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=t;if(e<=0)throw new zs({chainId:e});if(i&&!de(i))throw new Te({address:i});if(r||o)throw new q("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>Ru)throw new nn({maxFeePerGas:n})}function EF(t){let{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:i}=t;if(i&&!de(i))throw new Te({address:i});if(typeof e<"u"&&e<=0)throw new zs({chainId:e});if(r||o)throw new q("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>Ru)throw new nn({maxFeePerGas:n})}var AF=U(()=>{w3();go();se();C3();l0();Fs();en();On();da();ar()});function x0(t){if(!t||t.length===0)return[];let e=[];for(let r=0;r<t.length;r++){let{address:n,storageKeys:o}=t[r];for(let i=0;i<o.length;i++)if(o[i].length-2!==64)throw new Jb({storageKey:o[i]});if(!de(n,{strict:!1}))throw new Te({address:n});e.push([n,o])}return e}var SF=U(()=>{go();wr();en()});function IF(t,e){let r=M1(t);return r==="eip1559"?t1e(t,e):r==="eip2930"?r1e(t,e):r==="eip4844"?e1e(t,e):r==="eip7702"?Qbe(t,e):n1e(t,e)}function Qbe(t,e){let{authorizationList:r,chainId:n,gas:o,nonce:i,to:a,value:s,maxFeePerGas:c,maxPriorityFeePerGas:f,accessList:u,data:d}=t;vF(t);let m=x0(u),b=TF(r);return Fe(["0x04",Ln([V(n),i?V(i):"0x",f?V(f):"0x",c?V(c):"0x",o?V(o):"0x",a??"0x",s?V(s):"0x",d??"0x",m,b,...Uu(t,e)])])}function e1e(t,e){let{chainId:r,gas:n,nonce:o,to:i,value:a,maxFeePerBlobGas:s,maxFeePerGas:c,maxPriorityFeePerGas:f,accessList:u,data:d}=t;xF(t);let m=t.blobVersionedHashes,b=t.sidecars;if(t.blobs&&(typeof m>"u"||typeof b>"u")){let _=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(B=>Ce(B)),O=t.kzg,$=Mu({blobs:_,kzg:O});if(typeof m>"u"&&(m=R1({commitments:$})),typeof b>"u"){let B=$u({blobs:_,commitments:$,kzg:O});b=k1({blobs:_,commitments:$,proofs:B})}}let w=x0(u),T=[V(r),o?V(o):"0x",f?V(f):"0x",c?V(c):"0x",n?V(n):"0x",i??"0x",a?V(a):"0x",d??"0x",w,s?V(s):"0x",m??[],...Uu(t,e)],P=[],R=[],k=[];if(b)for(let _=0;_<b.length;_++){let{blob:O,commitment:$,proof:B}=b[_];P.push(O),R.push($),k.push(B)}return Fe(["0x03",b?Ln([T,P,R,k]):Ln(T)])}function t1e(t,e){let{chainId:r,gas:n,nonce:o,to:i,value:a,maxFeePerGas:s,maxPriorityFeePerGas:c,accessList:f,data:u}=t;dy(t);let d=x0(f),m=[V(r),o?V(o):"0x",c?V(c):"0x",s?V(s):"0x",n?V(n):"0x",i??"0x",a?V(a):"0x",u??"0x",d,...Uu(t,e)];return Fe(["0x02",Ln(m)])}function r1e(t,e){let{chainId:r,gas:n,data:o,nonce:i,to:a,value:s,accessList:c,gasPrice:f}=t;wF(t);let u=x0(c),d=[V(r),i?V(i):"0x",f?V(f):"0x",n?V(n):"0x",a??"0x",s?V(s):"0x",o??"0x",u,...Uu(t,e)];return Fe(["0x01",Ln(d)])}function n1e(t,e){let{chainId:r=0,gas:n,data:o,nonce:i,to:a,value:s,gasPrice:c}=t;EF(t);let f=[i?V(i):"0x",c?V(c):"0x",n?V(n):"0x",a??"0x",s?V(s):"0x",o??"0x"];if(e){let u=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+e.v-27n);let b=27n+(e.v===27n?0n:1n);if(e.v!==b)throw new Yb({v:e.v});return b})(),d=yo(e.r),m=yo(e.s);f=[...f,V(u),d==="0x00"?"0x":d,m==="0x00"?"0x":m]}else r>0&&(f=[...f,V(r),"0x","0x"]);return Ln(f)}function Uu(t,e){let r=e??t,{v:n,yParity:o}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof o>"u")return[];let i=yo(r.r),a=yo(r.s);return[typeof o=="number"?o?V(1):"0x":n===0n?"0x":n===1n?V(1):n===27n?"0x":V(1),i==="0x00"?"0x":i,a==="0x00"?"0x":a]}var d4=U(()=>{wr();_F();_1();B1();P3();O3();tn();Cb();pe();g1();AF();k3();SF()});function TF(t){if(!t||t.length===0)return[];let e=[];for(let r of t){let{chainId:n,nonce:o,...i}=r,a=r.address;e.push([n?Vt(n):"0x",a,o?Vt(o):"0x",...Uu({},i)])}return e}var _F=U(()=>{pe();d4()});function BF(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(ly.get(r))return ly.get(r);let n=t().finally(()=>ly.delete(r));return ly.set(r,n),n}var ly,RF=U(()=>{Ts();ly=new xr(8192)});function PF(t,e={}){return async(r,n={})=>{let{dedupe:o=!1,methods:i,retryDelay:a=150,retryCount:s=3,signal:c,uid:f}={...e,...n},{method:u}=r;if(i?.exclude?.includes(u))throw new ha(new Error("method not supported"),{method:u});if(i?.include&&!i.include.includes(u))throw new ha(new Error("method not supported"),{method:u});if(c?.aborted)throw Yt(c);let d=o?i1e(`${f}.${He(r)}`):void 0;return BF(()=>Hs(async()=>{try{return await t(r,c?{signal:c}:void 0)}catch(m){if(c?.aborted)throw Yt(c);if(Ao(m))throw m;let b=m;switch(b.code){case Wf.code:throw new Wf(b);case Kf.code:throw new Kf(b);case Gf.code:throw new Gf(b,{method:r.method});case Vf.code:throw new Vf(b);case ni.code:throw new ni(b);case pa.code:throw new pa(b);case Yf.code:throw new Yf(b);case Zf.code:throw new Zf(b);case Jf.code:throw new Jf(b);case ha.code:throw new ha(b,{method:r.method});case Cs.code:throw new Cs(b);case Xf.code:throw new Xf(b);case Os.code:throw new Os(b);case Qf.code:throw new Qf(b);case eu.code:throw new eu(b);case tu.code:throw new tu(b);case ru.code:throw new ru(b);case nu.code:throw new nu(b);case ma.code:throw new ma(b);case ou.code:throw new ou(b);case iu.code:throw new iu(b);case au.code:throw new au(b);case su.code:throw new su(b);case cu.code:throw new cu(b);case ba.code:throw new ba(b);case 5e3:throw new Os(b);case fu.code:throw new fu(b);default:throw m instanceof q?m:new a1(b)}}},{delay:({count:m,error:b})=>{if(b&&b instanceof la){let w=b?.headers?.get("Retry-After");if(w?.match(/\d/))return Number.parseInt(w,10)*1e3}return~~(1<<m)*a},retryCount:s,signal:c,shouldRetry:({error:m})=>o1e(m)}),{enabled:o,id:d})}}function o1e(t){return Ao(t)?!1:"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Cs.code||t.code===ni.code||t.code===429||t.code===-32007:t instanceof la&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function i1e(t,e=0){let r=3735928559^e,n=1103547991^e;for(let o=0;o<t.length;o++){let i=t.charCodeAt(o);r=Math.imul(r^i,2654435761),n=Math.imul(n^i,1597334677)}return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),(4294967296*(2097151&n)+(r>>>0)).toString(36)}var CF=U(()=>{se();Vl();s1();ri();RF();oy();Nn()});function l4(t){let e={formatters:void 0,fees:void 0,serializers:void 0,...t};function r(n){return o=>{let i=typeof o=="function"?o(n):o,a={...n,...i};return Object.assign(a,{extend:r(a)})}}return Object.assign(e,{extend:r(e)})}var OF=U(()=>{});var py,hy,my,by,kF=U(()=>{Nn();se();py=class extends q{constructor({domain:e}){super(`Invalid domain "${He(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}},hy=class extends q{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}},my=class extends q{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}},by=class extends q{constructor({type:e}){let r=e.replace(/^(u?int)/,"$&256");super(`Type "${e}" is not a valid EIP-712 type.`,{metaMessages:[`Use "${r}" instead.`],name:"InvalidTypedDataTypeError"})}}});function MF(t){let{domain:e,message:r,primaryType:n,types:o}=t,i=(c,f)=>{let u={...f};for(let d of c){let{name:m,type:b}=d;b==="address"&&(u[m]=u[m].toLowerCase())}return u},a=o.EIP712Domain?e?i(o.EIP712Domain,e):{}:{},s=(()=>{if(n!=="EIP712Domain")return i(o[n],r)})();return He({domain:a,message:s,primaryType:n,types:o})}function $F(t){let{domain:e,message:r,primaryType:n,types:o}=t,i=(a,s)=>{for(let c of a){let{name:f,type:u}=c,d=s[f],m=u.replace(/(\[[0-9]*\])+$/,"");if(m==="int"||m==="uint")throw new by({type:u});let b=u.match(Nb);if(b&&(typeof d=="number"||typeof d=="bigint")){let[P,R,k]=b;V(d,{signed:R==="int",size:Number.parseInt(k,10)/8})}if(u==="address"&&typeof d=="string"&&!de(d))throw new Te({address:d});let w=u.match(UM);if(w){let[P,R]=w;if(R&&ue(d)!==Number.parseInt(R,10))throw new Ab({expectedSize:Number.parseInt(R,10),givenSize:ue(d)})}let T=o[u];T&&(a1e(u),i(T,d))}};if(o.EIP712Domain&&e){if(typeof e!="object")throw new py({domain:e});i(o.EIP712Domain,e)}if(n!=="EIP712Domain")if(o[n])i(o[n],r);else throw new hy({primaryType:n,types:o})}function NF({domain:t}){return[typeof t?.name=="string"&&{name:"name",type:"string"},typeof t?.version=="string"&&{name:"version",type:"string"},(typeof t?.chainId=="number"||typeof t?.chainId=="bigint")&&{name:"chainId",type:"uint256"},t?.verifyingContract&&{name:"verifyingContract",type:"address"},t?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function a1e(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new my({type:t})}var FF=U(()=>{Gt();go();kF();en();On();pe();$8();Nn()});function yy(t,e){return Hb(t,e)}var p4=U(()=>{Gl()});function LF(t,e){return e$(t,e)}var UF=U(()=>{Gl()});var jF=U(()=>{Bs()});async function DF(t,{blockHash:e,blockNumber:r,blockTag:n,hash:o,index:i,sender:a,nonce:s}){let c=n||"latest",f=r!==void 0?V(r):void 0,u=null;if(o?u=await t.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):e?u=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,V(i)]},{dedupe:!0}):(f||c)&&typeof i=="number"?u=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[f||c,V(i)]},{dedupe:!!f}):a&&typeof s=="number"&&(u=await t.request({method:"eth_getTransactionBySenderAndNonce",params:[a,V(s)]},{dedupe:!0})),!u)throw new jf({blockHash:e,blockNumber:r,blockTag:c,hash:o,index:i});return(t.chain?.formatters?.transaction?.format||di)(u,"getTransaction")}var zF=U(()=>{wr();pe();Ou()});async function gy(t,{hash:e}){let r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new Df({hash:e});return(t.chain?.formatters?.transactionReceipt?.format||y0)(r,"getTransactionReceipt")}var qF=U(()=>{wr();g0()});function HF(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:o,poll:i,pollingInterval:a=t.pollingInterval}){let s=typeof i<"u"?i:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].config.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),c;return s?(()=>{let d=He(["watchBlockNumber",t.uid,e,r,a]);return qs(d,{onBlockNumber:n,onError:o},m=>ey(async()=>{try{let b=await re(t,uF,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(b===c)return;if(b-c>1&&r)for(let w=c+1n;w<b;w++)m.onBlockNumber(w,c),c=w}(c===void 0||b>c)&&(m.onBlockNumber(b,c),c=b)}catch(b){m.onError?.(b)}},{emitOnBegin:e,interval:a}))})():(()=>{let d=He(["watchBlockNumber",t.uid,e,r]);return qs(d,{onBlockNumber:n,onError:o},m=>{let b=!0,w=()=>b=!1;return(async()=>{try{let T=(()=>{if(t.transport.type==="fallback"){let R=t.transport.transports.find(k=>k.config.type==="webSocket"||k.config.type==="ipc");return R?R.value:t.transport}return t.transport})(),{unsubscribe:P}=await T.subscribe({params:["newHeads"],onData(R){if(!b)return;let k=qe(R.result?.number);m.onBlockNumber(k,c),c=k},onError(R){m.onError?.(R)}});w=P,b||w()}catch(T){o?.(T)}})(),()=>w()})})()}var WF=U(()=>{ar();Kt();Q1();o4();Nn();dF()});async function KF(t,e){let{checkReplacement:r=t.chain?.supportsTransactionReplacementDetection??!0,confirmations:n=1,hash:o,onReplaced:i,retryCount:a=6,retryDelay:s=({count:B})=>~~(1<<B)*200,timeout:c=18e4}=e,f=B=>t.chain?.transactionReplacement?.getKey?.(B)??String(B.nonce),u=e.pollingInterval?e.pollingInterval:t.chain?.experimental_preconfirmationTime?t.chain.experimental_preconfirmationTime:t.pollingInterval,d=He(["waitForTransactionReceipt",t.uid,o,{checkReplacement:r,confirmations:n,pollingInterval:u,retryCount:a,timeout:c}]),m,b,w,T=!1,P,R,{promise:k,resolve:_,reject:O}=Fu(),$=c?setTimeout(()=>{R?.(),P?.(),O(new Qb({hash:o}))},c):void 0;return P=qs(d,{onReplaced:i,resolve:_,reject:O},async B=>{if(w=await re(t,gy,"getTransactionReceipt")({hash:o}).catch(()=>{}),w&&n<=1){clearTimeout($),B.resolve(w),P?.();return}R=re(t,HF,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(N){let M=v=>{clearTimeout($),R?.(),v(),P?.()},F=N;if(!T)try{if(w){if(n>1&&(!w.blockNumber||F-w.blockNumber+1n<n))return;M(()=>B.resolve(w));return}if(r&&!m&&(T=!0,await Hs(async()=>{m=await re(t,DF,"getTransaction")({hash:o}),m.blockNumber&&(F=m.blockNumber)},{delay:s,retryCount:a}),T=!1),w=await re(t,gy,"getTransactionReceipt")({hash:o}),n>1&&(!w.blockNumber||F-w.blockNumber+1n<n))return;M(()=>B.resolve(w))}catch(v){if(v instanceof jf||v instanceof Df){if(!m){T=!1;return}if(m.blockNumber){T=!1;return}try{b=m,T=!0;let l=await Hs(()=>re(t,Un,"getBlock")({blockNumber:F,includeTransactions:!0}),{delay:s,retryCount:a,shouldRetry:({error:x})=>x instanceof Cu});T=!1;let h=f(b),y=l.transactions.find(x=>Ir(x.from,b.from)&&x.hash!==b.hash&&f(x)===h);if(!y||(w=await re(t,gy,"getTransactionReceipt")({hash:y.hash}),n>1&&(!w.blockNumber||F-w.blockNumber+1n<n)))return;let g=t.chain?.transactionReplacement?.getReason?.({replaced:b,replacement:y})??s1e(b,y);M(()=>{B.onReplaced?.({reason:g,replacedTransaction:b,transaction:y,transactionReceipt:w}),B.resolve(w)})}catch(l){M(()=>B.reject(l))}}else M(()=>B.reject(v))}}})}),k}function s1e(t,e){return(e.to&&t.to?Ir(e.to,t.to):e.to===t.to)&&e.value===t.value&&e.input===t.input?"repriced":e.from===e.to&&e.value===0n?"cancelled":"replaced"}var GF=U(()=>{E3();wr();Us();Kt();Q1();K1();oy();Nn();ku();zF();qF();WF()});function vy(t,e){if(typeof t=="bigint")return t;let r=t.decimals??e;return LF(t.formatted,c1e(r))}function c1e(t){if(t===void 0)throw new Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return t}function xy(t,e){return typeof t=="bigint"?e:t.decimals??e}function Ba(t,e){let{decimals:r,token:n}=e,o=f1e(t,n);if(o)return{address:o.address,decimals:r??o.decimals};if(de(n,{strict:!1}))return{address:n,decimals:r??d1e(t,n)};throw new Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function f1e(t,e){let r=t.tokens,n=t.chain?.id;if(!r||n===void 0)return;let o=u1e(r,e);if(o)return h4(o,n);if(de(e,{strict:!1}))for(let i of r){let a=h4(i,n);if(a&&Ir(a.address,e))return a}}function h4(t,e){let r=t.addresses[e];if(r)return{address:r,currency:t.currency,decimals:t.decimals,name:t.name,popular:t.popular,symbol:t.symbol}}function u1e(t,e){let r=e.toLowerCase();for(let n of t)if(n.symbol?.toLowerCase()===r)return n}function d1e(t,e){let r=t.tokens,n=t.chain?.id;if(r&&n!==void 0)for(let o of r){let i=h4(o,n);if(i&&Ir(i.address,e))return i.decimals}}function ju(t){let{account:e,chain:r,gas:n,maxFeePerGas:o,maxPriorityFeePerGas:i,nonce:a}=t;return{account:e,chain:r,gas:n,maxFeePerGas:o,maxPriorityFeePerGas:i,nonce:a}}function wy(t){return{...t,data:Lr(t),to:t.address}}var w0=U(()=>{en();Us();jF();UF()});async function Ey(t,{serializedTransaction:e,throwOnReceiptRevert:r,timeout:n}){let o=await t.request({method:"eth_sendRawTransactionSync",params:n?[e,n]:[e]},{retryCount:0}),a=(t.chain?.formatters?.transactionReceipt?.format||y0)(o);if(a.status==="reverted"&&r)throw new Rs({receipt:a});return a}var m4=U(()=>{wr();g0()});async function Ay(t,e){let{account:r=t.account,assertChainId:n=!0,chain:o=t.chain,accessList:i,authorizationList:a,blobs:s,data:c,dataSuffix:f=typeof t.dataSuffix=="string"?t.dataSuffix:t.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:T,pollingInterval:P,throwOnReceiptRevert:R,type:k,value:_,...O}=e,$=e.timeout??Math.max((o?.blockTime??0)*3,5e3);if(typeof r>"u")throw new Ot({docsPath:"/docs/actions/wallet/sendTransactionSync"});let B=r?oe(r):null,N;try{Ar(e);let M=await(async()=>{if(e.to)return e.to;if(e.to!==null&&a&&a.length>0)return await yu({authorization:a[0]}).catch(()=>{throw new q("`to` is required. Could not infer from `authorizationList`.")})})();if(B?.type==="json-rpc"||B===null){let F;o!==null&&(F=await re(t,Sr,"getChainId")({}),n&&Lu({currentChainId:F,chain:o}));let v=t.chain?.formatters?.transactionRequest?.format,h=(v||on)({..._o(O,{format:v}),accessList:i,account:B,authorizationList:a,blobs:s,chainId:F,data:f?$n([c??"0x",f]):c,gas:u,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:T,to:M,type:k,value:_},"sendTransaction"),y=b4.get(t.uid),g=y?"wallet_sendTransaction":"eth_sendTransaction",x=await(async()=>{try{return await t.request({method:g,params:[h]},{retryCount:0})}catch(S){if(y===!1)throw S;let A=S;if(A.name==="InvalidInputRpcError"||A.name==="InvalidParamsRpcError"||A.name==="MethodNotFoundRpcError"||A.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[h]},{retryCount:0}).then(p=>(b4.set(t.uid,!0),p)).catch(p=>{let I=p;throw I.name==="MethodNotFoundRpcError"||I.name==="MethodNotSupportedRpcError"?(b4.set(t.uid,!1),A):I});throw A}})(),E=await re(t,KF,"waitForTransactionReceipt")({checkReplacement:!1,hash:x,pollingInterval:P,timeout:$});if(R&&E.status==="reverted")throw new Rs({receipt:E});return E}if(B?.type==="local"){let F=(()=>{if(!B.nonceManager||typeof T<"u")return B.nonceManager;let x=B.nonceManager;return{consume(E){return N={address:E.address,chainId:E.chainId},x.consume(E)},get(E){return x.get(E)},increment(E){return x.increment(E)},reset(E){return x.reset(E)}}})(),v=await re(t,Ia,"prepareTransactionRequest")({account:B,accessList:i,authorizationList:a,blobs:s,chain:o,data:f?$n([c??"0x",f]):c,gas:u,gasPrice:d,maxFeePerBlobGas:m,maxFeePerGas:b,maxPriorityFeePerGas:w,nonce:T,nonceManager:F,parameters:[...c0,"sidecars"],type:k,value:_,...O,to:M}),l=o?.serializers?.transaction,h=await B.signTransaction(v,{serializer:l}),y=(o??t.chain)?.serializers?.transactionEnvelope,g=y?await y({serializedTransaction:h,transaction:v}):h;return await re(t,Ey,"sendRawTransactionSync")({serializedTransaction:g,throwOnReceiptRevert:R,timeout:e.timeout})}throw B?.type==="smart"?new an({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new an({docsPath:"/docs/actions/wallet/sendTransactionSync",type:B?.type})}catch(M){throw M instanceof an?M:(N&&!(M instanceof Rs)&&B?.nonceManager?.reset(N),Aa(M,{...e,account:B,chain:e.chain||void 0}))}}var b4,y4=U(()=>{vt();li();se();wr();v1();ty();tn();s0();_u();Ls();Kt();Ts();wa();Sa();GF();f0();m4();b4=new xr(128)});async function Du(t,e){return Dn.internal(t,Ay,"sendTransactionSync",e)}var Sy=U(()=>{y4();b0()});async function Tg(t,e,r,n){let o=t;for(let i=0;i<e;i++){let a=await n();if(a)return a;await FU(o),o*=r}return null}function FU(t){return new Promise(e=>setTimeout(e,t))}var Co=class{constructor(e){if(Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(r=>{this[r]=e[r]})}};var Xs=class extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}};var It=class extends Error{type;context;constructor(e,r,n){super(e),this.type=r||"UntypedError",this.context=n}},j0=class{transactionHash;constructor(e){this.transactionHash=e}};var AE=cn(mE(),1);xE();var BE=cn(Qu(),1),kg=30000000000000n,VU={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:`Signer "{{account_id}}" doesn't have access key with the given public_key {{public_key}}`,NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}} doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"},EE=VU,xi=24,Wye=10n**BigInt(xi),SE=[],YU=10n;for(let t=0,e=5n;t<xi;t++,e=e*YU)SE[t]=e;function ZU(t,e=xi){let r=BigInt(t);if(e!==xi){let i=xi-e-1;i>0&&(r+=SE[i])}t=r.toString();let n=t.substring(0,t.length-xi)||"0",o=t.substring(t.length-xi).padStart(xi,"0").substring(0,e);return JU(`${XU(n)}.${o}`)}function JU(t){return t.replace(/\.?0*$/,"")}function XU(t){let e=/(-?\d+)(\d{3})/;for(;e.test(t);)t=t.replace(e,"$1,$2");return t}function kt(t){if(typeof t=="string"){let e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));t=new Uint8Array(e)}return Cg.encode(t)}function Br(t){return Cg.decode(t)}var QU={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}},ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_receiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}},ej={formatNear:()=>(t,e)=>ZU(e(t))},D0=class extends It{},tj=class extends D0{transaction_outcome};function z0(t){let e={},r=IE(t,QU.schema,e,""),n=new D0(q0(r,e),r);return Object.assign(n,e),n}function Mg(t){let e=z0(t.status.Failure),r=new tj;return Object.assign(r,e),r.type=e.type,r.message=e.message,r.transaction_outcome=t.transaction_outcome,r}function q0(t,e){return typeof EE[t]=="string"?AE.default.render(EE[t],{...e,...ej}):JSON.stringify(e)}function IE(t,e,r,n){let o,i,a;for(let s in e){if(rj(t[s]))return t[s];if(Og(t[s]))o=t[s],i=e[s],a=s;else if(Og(t.kind)&&Og(t.kind[s]))o=t.kind[s],i=e[s],a=s;else continue}if(o&&i){for(let s of Object.keys(i.props))r[s]=o[s];return IE(o,e,r,a)}else return r.kind=t,n}function H0(t,e){switch(!0){case/^account .*? does not exist while viewing$/.test(t):return"AccountDoesNotExist";case/^Account .*? doesn't exist$/.test(t):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(t):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(t):return"CodeDoesNotExist";case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(t):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(t):return"MethodNotFound";case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(t):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(t):return"InvalidNonce";default:return e}}function Og(t){return Object.prototype.toString.call(t)==="[object Object]"}function rj(t){return Object.prototype.toString.call(t)==="[object String]"}var nj=class{constructor(t){this.logLevels=t}isLevelEnabled=t=>this.logLevels.includes(t);print(t,e,...r){switch(t){case"error":case"fatal":return console.error(e,...r);case"warn":return console.warn(e,...r);case"log":return console.log(e,...r);case"debug":case"verbose":return console.debug(e,...r)}}verbose(t,...e){this.isLevelEnabled("verbose")&&this.print("verbose",t,...e)}debug(t,...e){this.isLevelEnabled("debug")&&this.print("debug",t,...e)}log(t,...e){this.isLevelEnabled("log")&&this.print("log",t,...e)}warn(t,...e){this.isLevelEnabled("warn")&&this.print("warn",t,...e)}error(t,...e){this.isLevelEnabled("error")&&this.print("error",t,...e)}fatal(t,...e){this.isLevelEnabled("fatal")&&this.print("fatal",t,...e)}},oj=["verbose","debug","log","warn","error","fatal"],ij=new nj(oj),wi=class{static instanceRef=ij;static overrideLogger=t=>{this.instanceRef=t};static error(t,...e){this.instanceRef?.error(t,...e)}static log(t,...e){this.instanceRef?.log(t,...e)}static warn(t,...e){this.instanceRef?.warn(t,...e)}static debug(t,...e){this.instanceRef?.debug?.(t,...e)}static verbose(t,...e){this.instanceRef?.verbose?.(t,...e)}static fatal(t,...e){this.instanceRef?.fatal?.(t,...e)}};function TE({contractId:t,outcome:e}){let r=[e.transaction_outcome,...e.receipts_outcome].reduce((n,o)=>{let i=typeof o.outcome.status=="object"&&typeof o.outcome.status.Failure=="object";return o.outcome.logs.length||i?n.concat({receiptIds:o.outcome.receipt_ids,logs:o.outcome.logs,failure:typeof o.outcome.status=="object"&&o.outcome.status.Failure!==void 0?z0(o.outcome.status.Failure):null}):n},[]);for(let n of r)wi.log(`Receipt${n.receiptIds.length>1?"s":""}: ${n.receiptIds.join(", ")}`),$g({contractId:t,logs:n.logs,prefix:" "}),n.failure&&wi.warn(` Failure [${t}]: ${n.failure}`)}function $g({contractId:t,logs:e,prefix:r=""}){for(let n of e)wi.log(`${r}Log [${t}]: ${n}`)}function _E(t){if(typeof t.status=="object"&&typeof t.status.SuccessValue=="string"){let e=Buffer.from(t.status.SuccessValue,"base64").toString();try{return JSON.parse(e)}catch{return e}}return null}function RE(t,e){return t<e?-1:t>e?1:0}function Ng(t,e,r,n){return n&&n<49?aj(t,e):(r||((0,BE.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),sj(t,e,r))}function aj(t,e){let r=t.map(s=>BigInt(s.stake)).sort(RE),n=BigInt(e),o=r.reduce((s,c)=>s+c);if(o<n)throw new Error("Stakes are below seats");let i=1n,a=o+1n;for(;i!==a-1n;){let s=(i+a)/2n,c=!1,f=0n;for(let u=0;u<r.length;++u)if(f=f+r[u]/s,f>=n){i=s,c=!0;break}c||(a=s)}return i}function sj(t,e,r){if(r.length!=2)throw Error("minimumStakeRatio should have 2 elements");let n=t.map(i=>BigInt(i.stake)).sort(RE),o=n.reduce((i,a)=>i+a);return t.length<e?o*BigInt(r[0])/BigInt(r[1]):n[0]+1n}var W0=class{allowance;receiverId;methodNames;constructor({allowance:e,receiverId:r,methodNames:n}){this.allowance=e,this.receiverId=r,this.methodNames=n}},K0=class{},ed=class extends Co{enum;functionCall;fullAccess;constructor(e){super(e);for(let[r,n]of Object.entries(e||{}))this[r]=n,this.enum=r}},td=class{nonce;permission;constructor({nonce:e,permission:r}){this.nonce=e,this.permission=r}},G0=class{},V0=class{code;constructor({code:e}){this.code=e}},Y0=class{methodName;args;gas;deposit;constructor({methodName:e,args:r,gas:n,deposit:o}){this.methodName=e,this.args=r,this.gas=n,this.deposit=o}},Ei=class extends Co{enum;CodeHash;AccountId;constructor(e){super(e);for(let[r,n]of Object.entries(e||{}))this[r]=n,this.enum=r}},Ai=class extends Co{enum;CodeHash;AccountId;constructor(e){super(e);for(let[r,n]of Object.entries(e||{}))this[r]=n,this.enum=r}},Z0=class{code;deployMode;constructor({code:e,deployMode:r}){this.code=e,this.deployMode=r}},J0=class{contractIdentifier;constructor({contractIdentifier:e}){this.contractIdentifier=e}},X0=class{deposit;constructor({deposit:e}){this.deposit=e}},Q0=class{stake;publicKey;constructor({stake:e,publicKey:r}){this.stake=e,this.publicKey=r}},ep=class{publicKey;accessKey;constructor({publicKey:e,accessKey:r}){this.publicKey=e,this.accessKey=r}},tp=class{publicKey;constructor({publicKey:e}){this.publicKey=e}},rp=class{beneficiaryId;constructor({beneficiaryId:e}){this.beneficiaryId=e}},Qs=class{delegateAction;signature;constructor({delegateAction:e,signature:r}){this.delegateAction=e,this.signature=r}},dr=class extends Co{enum;createAccount;deployContract;functionCall;transfer;stake;addKey;deleteKey;deleteAccount;signedDelegate;deployGlobalContract;useGlobalContract;constructor(e){super(e);for(let[r,n]of Object.entries(e||{}))this[r]=n,this.enum=r}};function cj(){return new td({nonce:0n,permission:new ed({fullAccess:new K0})})}function fj(t,e,r){return new td({nonce:0n,permission:new ed({functionCall:new W0({receiverId:t,allowance:r,methodNames:e})})})}function uj(){return new dr({createAccount:new G0})}function dj(t){return new dr({deployContract:new V0({code:t})})}function Fg(t){return t.byteLength!==void 0&&t.byteLength===t.length?t:Buffer.from(JSON.stringify(t))}function lj(t,e,r=0n,n=0n,o=Fg){return new dr({functionCall:new Y0({methodName:t,args:o(e),gas:r,deposit:n})})}function pj(t=0n){return new dr({transfer:new X0({deposit:t})})}function hj(t=0n,e){return new dr({stake:new Q0({stake:t,publicKey:e})})}function mj(t,e){return new dr({addKey:new ep({publicKey:t,accessKey:e})})}function bj(t){return new dr({deleteKey:new tp({publicKey:t})})}function yj(t){return new dr({deleteAccount:new rp({beneficiaryId:t})})}function gj({delegateAction:t,signature:e}){return new dr({signedDelegate:new Qs({delegateAction:t,signature:e})})}function vj(t,e){return new dr({deployGlobalContract:new Z0({code:t,deployMode:e})})}function xj(t){return new dr({useGlobalContract:new J0({contractIdentifier:t})})}var np={addKey:mj,createAccount:uj,deleteAccount:yj,deleteKey:bj,deployContract:dj,fullAccessKey:cj,functionCall:lj,functionCallAccessKey:fj,signedDelegate:gj,stake:hj,transfer:pj,deployGlobalContract:vj,useGlobalContract:xj};var ec=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"];var PE=(function(){function t(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return t.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(this.buffer_size*2,this.buffer_size+e);var r=new ArrayBuffer(this.buffer_size);new Uint8Array(r).set(new Uint8Array(this.buffer)),this.buffer=r,this.view=new DataView(r)}},t.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},t.prototype.store_value=function(e,r){var n=r.substring(1),o=parseInt(n)/8;this.resize_if_necessary(o);var i=r[0]==="f"?"setFloat".concat(n):r[0]==="i"?"setInt".concat(n):"setUint".concat(n);this.view[i](this.offset,e,!0),this.offset+=o},t.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},t})();var CE=(function(){function t(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return t.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},t.prototype.consume_value=function(e){var r=e.substring(1),n=parseInt(r)/8;this.assert_enough_buffer(n);var o=e[0]==="f"?"getFloat".concat(r):e[0]==="i"?"getInt".concat(r):"getUint".concat(r),i=this.view[o](this.offset,!0);return this.offset+=n,i},t.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var r=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,r},t})();var wj=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();function ME(t){return Array.isArray(t)||!!t&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&(t.length===0||t.length>0&&t.length-1 in t)}function Ua(t,e,r){if(typeof t!==e)throw new Error("Expected ".concat(e," not ").concat(typeof t,"(").concat(t,") at ").concat(r.join(".")))}function $E(t,e){var r=["number","string","bigint","boolean"].includes(typeof t),n=typeof t=="object"&&t!==null&&"toString"in t;if(!r&&!n)throw new Error("Expected bigint, number, boolean or string not ".concat(typeof t,"(").concat(t,") at ").concat(e.join(".")))}function Lg(t,e,r){if(t!==e)throw new Error("Array length ".concat(t," does not match schema length ").concat(e," at ").concat(r.join(".")))}function NE(t,e){if(typeof t!="object"||t===null)throw new Error("Expected object not ".concat(typeof t,"(").concat(t,") at ").concat(e.join(".")))}var OE=ec.concat(["bool","string"]),kE=["option","enum","array","set","map","struct"],tc=(function(t){wj(e,t);function e(r,n){var o="Invalid schema: ".concat(JSON.stringify(r)," expected ").concat(n);return t.call(this,o)||this}return e})(Error);function Hn(t){if(!(typeof t=="string"&&OE.includes(t))){if(t&&typeof t=="object"){var e=Object.keys(t);if(e.length===1&&kE.includes(e[0])){var r=e[0];if(r==="option")return Hn(t[r]);if(r==="enum")return Ej(t[r]);if(r==="array")return Aj(t[r]);if(r==="set")return Hn(t[r]);if(r==="map")return Sj(t[r]);if(r==="struct")return Ij(t[r])}}throw new tc(t,kE.join(", ")+" or "+OE.join(", "))}}function Ej(t){if(!Array.isArray(t))throw new tc(t,"Array");for(var e=0,r=t;e<r.length;e++){var n=r[e];if(typeof n!="object"||!("struct"in n))throw new Error('Missing "struct" key in enum schema');if(typeof n.struct!="object"||Object.keys(n.struct).length!==1)throw new Error('The "struct" in each enum must have a single key');Hn({struct:n.struct})}}function Aj(t){if(typeof t!="object")throw new tc(t,"{ type, len? }");if(t.len&&typeof t.len!="number")throw new Error("Invalid schema: ".concat(t));if("type"in t)return Hn(t.type);throw new tc(t,"{ type, len? }")}function Sj(t){if(typeof t=="object"&&"key"in t&&"value"in t)Hn(t.key),Hn(t.value);else throw new tc(t,"{ key, value }")}function Ij(t){if(typeof t!="object")throw new tc(t,"object");for(var e in t)Hn(t[e])}var LE=(function(){function t(e){this.encoded=new PE,this.fieldPath=["value"],this.checkTypes=e}return t.prototype.encode=function(e,r){return this.encode_value(e,r),this.encoded.get_used_buffer()},t.prototype.encode_value=function(e,r){if(typeof r=="string"){if(ec.includes(r))return this.encode_integer(e,r);if(r==="string")return this.encode_string(e);if(r==="bool")return this.encode_boolean(e)}if(typeof r=="object"){if("option"in r)return this.encode_option(e,r);if("enum"in r)return this.encode_enum(e,r);if("array"in r)return this.encode_array(e,r);if("set"in r)return this.encode_set(e,r);if("map"in r)return this.encode_map(e,r);if("struct"in r)return this.encode_struct(e,r)}},t.prototype.encode_integer=function(e,r){var n=parseInt(r.substring(1));n<=32||r=="f64"?(this.checkTypes&&Ua(e,"number",this.fieldPath),this.encoded.store_value(e,r)):(this.checkTypes&&$E(e,this.fieldPath),this.encode_bigint(BigInt(e),n))},t.prototype.encode_bigint=function(e,r){for(var n=r/8,o=new Uint8Array(n),i=0;i<n;i++)o[i]=Number(e&BigInt(255)),e=e>>BigInt(8);this.encoded.store_bytes(new Uint8Array(o))},t.prototype.encode_string=function(e){this.checkTypes&&Ua(e,"string",this.fieldPath);var r=e;this.encoded.store_value(r.length,"u32");for(var n=0;n<r.length;n++)this.encoded.store_value(r.charCodeAt(n),"u8")},t.prototype.encode_boolean=function(e){this.checkTypes&&Ua(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},t.prototype.encode_option=function(e,r){e==null?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,r.option))},t.prototype.encode_enum=function(e,r){this.checkTypes&&NE(e,this.fieldPath);for(var n=Object.keys(e)[0],o=0;o<r.enum.length;o++){var i=r.enum[o];if(n===Object.keys(i.struct)[0])return this.encoded.store_value(o,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(n,") not found in enum schema: ").concat(JSON.stringify(r)," at ").concat(this.fieldPath.join(".")))},t.prototype.encode_array=function(e,r){if(ME(e))return this.encode_arraylike(e,r);if(e instanceof ArrayBuffer)return this.encode_buffer(e,r);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},t.prototype.encode_arraylike=function(e,r){r.array.len?Lg(e.length,r.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var n=0;n<e.length;n++)this.encode_value(e[n],r.array.type)},t.prototype.encode_buffer=function(e,r){r.array.len?Lg(e.byteLength,r.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},t.prototype.encode_set=function(e,r){this.checkTypes&&Ua(e,"object",this.fieldPath);var n=e instanceof Set,o=n?Array.from(e.values()):Object.values(e);this.encoded.store_value(o.length,"u32");for(var i=0,a=o;i<a.length;i++){var s=a[i];this.encode_value(s,r.set)}},t.prototype.encode_map=function(e,r){this.checkTypes&&Ua(e,"object",this.fieldPath);var n=e instanceof Map,o=n?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(o.length,"u32");for(var i=0,a=o;i<a.length;i++){var s=a[i];this.encode_value(s,r.map.key),this.encode_value(n?e.get(s):e[s],r.map.value)}},t.prototype.encode_struct=function(e,r){this.checkTypes&&Ua(e,"object",this.fieldPath);for(var n=0,o=Object.keys(r.struct);n<o.length;n++){var i=o[n];this.fieldPath.push(i),this.encode_value(e[i],r.struct[i]),this.fieldPath.pop()}},t})();var UE=(function(){function t(e){this.buffer=new CE(e)}return t.prototype.decode=function(e){return this.decode_value(e)},t.prototype.decode_value=function(e){if(typeof e=="string"){if(ec.includes(e))return this.decode_integer(e);if(e==="string")return this.decode_string();if(e==="bool")return this.decode_boolean()}if(typeof e=="object"){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw new Error("Unsupported type: ".concat(e))},t.prototype.decode_integer=function(e){var r=parseInt(e.substring(1));return r<=32||e=="f64"?this.buffer.consume_value(e):this.decode_bigint(r,e.startsWith("i"))},t.prototype.decode_bigint=function(e,r){r===void 0&&(r=!1);var n=e/8,o=new Uint8Array(this.buffer.consume_bytes(n)),i=o.reduceRight(function(a,s){return a+s.toString(16).padStart(2,"0")},"");return r&&o[n-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},t.prototype.decode_string=function(){var e=this.decode_integer("u32"),r=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,r)},t.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},t.prototype.decode_option=function(e){var r=this.buffer.consume_value("u8");if(r===1)return this.decode_value(e.option);if(r!==0)throw new Error("Invalid option ".concat(r));return null},t.prototype.decode_enum=function(e){var r,n=this.buffer.consume_value("u8");if(n>e.enum.length)throw new Error("Enum option ".concat(n," is not available"));var o=e.enum[n].struct,i=Object.keys(o)[0];return r={},r[i]=this.decode_value(o[i]),r},t.prototype.decode_array=function(e){for(var r=[],n=e.array.len?e.array.len:this.decode_integer("u32"),o=0;o<n;++o)r.push(this.decode_value(e.array.type));return r},t.prototype.decode_set=function(e){for(var r=this.decode_integer("u32"),n=new Set,o=0;o<r;++o)n.add(this.decode_value(e.set));return n},t.prototype.decode_map=function(e){for(var r=this.decode_integer("u32"),n=new Map,o=0;o<r;++o){var i=this.decode_value(e.map.key),a=this.decode_value(e.map.value);n.set(i,a)}return n},t.prototype.decode_struct=function(e){var r={};for(var n in e.struct)r[n]=this.decode_value(e.struct[n]);return r},t})();function op(t,e,r){r===void 0&&(r=!0),r&&Hn(t);var n=new LE(r);return n.encode(e,t)}function Ug(t,e,r){r===void 0&&(r=!0),r&&Hn(t);var n=new UE(e);return n.decode(t)}var Tj=Math.pow(2,30),_j={MetaTransactions:366},jg=class{prefix;constructor({prefix:e}){this.prefix=e}},Dg=class extends jg{constructor(e){super({prefix:Tj+e})}},ip=class extends Dg{constructor(){super(_j.MetaTransactions)}};function jE(t){return new Uint8Array([...op(Si.DelegateActionPrefix,new ip),...op(Si.DelegateAction,t)])}function rc(t){let e="signature"in t?Si.SignedTransaction:Si.Transaction;return op(e,t)}function Bj(t){return new rd(Ug(Si.Transaction,t))}function Rj(t){return new nd(Ug(Si.SignedTransaction,t))}var rd=class{signerId;publicKey;nonce;receiverId;actions;blockHash;constructor({signerId:e,publicKey:r,nonce:n,receiverId:o,actions:i,blockHash:a}){this.signerId=e,this.publicKey=r,this.nonce=n,this.receiverId=o,this.actions=i,this.blockHash=a}encode(){return rc(this)}static decode(e){return Bj(e)}},nd=class{transaction;signature;constructor({transaction:e,signature:r}){this.transaction=e,this.signature=r}encode(){return rc(this)}static decode(e){return Rj(e)}},Si=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};GlobalContractDeployMode={enum:[{struct:{CodeHash:{struct:{}}}},{struct:{AccountId:{struct:{}}}}]};GlobalContractIdentifier={enum:[{struct:{CodeHash:{array:{type:"u8",len:32}}}},{struct:{AccountId:"string"}}]};DeployGlobalContract={struct:{code:{array:{type:"u8"}},deployMode:this.GlobalContractDeployMode}};UseGlobalContract={struct:{contractIdentifier:this.GlobalContractIdentifier}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:"string"}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}};function od(t,e,r,n,o,i){let a=typeof n=="bigint"?n:BigInt(n);return new rd({signerId:t,publicKey:e,nonce:a,receiverId:r,actions:o,blockHash:i})}var{addKey:Pj,createAccount:Cj,deleteAccount:Oj,deleteKey:kj,deployContract:Mj,functionCall:$j,stake:Nj,transfer:Fj,deployGlobalContract:Lj,useGlobalContract:Uj}=np,zg=class{senderId;receiverId;actions;nonce;maxBlockHeight;publicKey;constructor({senderId:e,receiverId:r,actions:n,nonce:o,maxBlockHeight:i,publicKey:a}){this.senderId=e,this.receiverId=r,this.actions=n,this.nonce=o,this.maxBlockHeight=i,this.publicKey=a}};function qg({actions:t,maxBlockHeight:e,nonce:r,publicKey:n,receiverId:o,senderId:i}){return new zg({senderId:i,receiverId:o,actions:t.map(a=>{if(!a.type&&!a.params)return a;switch(a.type){case"AddKey":{let{publicKey:s,accessKey:c}=a.params;return Pj(s,c)}case"CreateAccount":return Cj(a.params.createAccount);case"DeleteAccount":return Oj(a.params.deleteAccount);case"DeleteKey":return kj(a.params.publicKey);case"DeployContract":return Mj(a.params.code);case"FunctionCall":{let{methodName:s,args:c,gas:f,deposit:u}=a.params;return $j(s,c,f,u)}case"Stake":return Nj(a.params.stake,a.params.publicKey);case"Transfer":{let{deposit:s}=a.params;return Fj(s)}case"DeployGlobalContract":{let{code:s,deployMode:c}=a.params,f=c instanceof Ei?c:new Ei(c);return Lj(s,f)}case"UseGlobalContract":{let{identifier:s}=a.params,c=s instanceof Ai?s:new Ai(s);return Uj(c)}}throw new Error("Unrecognized action")}),nonce:r,maxBlockHeight:e,publicKey:n})}var Se=(t=>(t[t.ED25519=0]="ED25519",t[t.SECP256K1=1]="SECP256K1",t))(Se||{}),Wn={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64};var Ii=class{};function jj(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Hg(t,...e){if(!jj(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Wg(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function DE(t,e){Hg(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var ja=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function sp(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function fn(t,e){return t<<32-e|t>>>e}function zE(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Kg(t){return typeof t=="string"&&(t=zE(t)),Hg(t),t}var ap=class{clone(){return this._cloneInto()}};function cp(t){let e=n=>t().update(Kg(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function qE(t=32){if(ja&&typeof ja.getRandomValues=="function")return ja.getRandomValues(new Uint8Array(t));if(ja&&typeof ja.randomBytes=="function")return ja.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function Dj(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),c=n?4:0,f=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+f,s,n)}function HE(t,e,r){return t&e^~t&r}function WE(t,e,r){return t&e^t&r^e&r}var nc=class extends ap{constructor(e,r,n,o){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=sp(this.buffer)}update(e){Wg(this);let{view:r,buffer:n,blockLen:o}=this;e=Kg(e);let i=e.length;for(let a=0;a<i;){let s=Math.min(o-this.pos,i-a);if(s===o){let c=sp(e);for(;o<=i-a;a+=o)this.process(c,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Wg(this),DE(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let d=a;d<o;d++)r[d]=0;Dj(n,o-8,BigInt(this.length*8),i),this.process(n,0);let s=sp(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=c/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)s.setUint32(4*d,u[d],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:a,pos:s}=this;return e.length=o,e.pos=s,e.finished=i,e.destroyed=a,o%r&&e.buffer.set(n),e}};var fp=BigInt(4294967295),Gg=BigInt(32);function KE(t,e=!1){return e?{h:Number(t&fp),l:Number(t>>Gg&fp)}:{h:Number(t>>Gg&fp)|0,l:Number(t&fp)|0}}function zj(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){let{h:i,l:a}=KE(t[o],e);[r[o],n[o]]=[i,a]}return[r,n]}var qj=(t,e)=>BigInt(t>>>0)<<Gg|BigInt(e>>>0),Hj=(t,e,r)=>t>>>r,Wj=(t,e,r)=>t<<32-r|e>>>r,Kj=(t,e,r)=>t>>>r|e<<32-r,Gj=(t,e,r)=>t<<32-r|e>>>r,Vj=(t,e,r)=>t<<64-r|e>>>r-32,Yj=(t,e,r)=>t>>>r-32|e<<64-r,Zj=(t,e)=>e,Jj=(t,e)=>t,Xj=(t,e,r)=>t<<r|e>>>32-r,Qj=(t,e,r)=>e<<r|t>>>32-r,eD=(t,e,r)=>e<<r-32|t>>>64-r,tD=(t,e,r)=>t<<r-32|e>>>64-r;function rD(t,e,r,n){let o=(e>>>0)+(n>>>0);return{h:t+r+(o/2**32|0)|0,l:o|0}}var nD=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),oD=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,iD=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),aD=(t,e,r,n,o)=>e+r+n+o+(t/2**32|0)|0,sD=(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0),cD=(t,e,r,n,o,i)=>e+r+n+o+i+(t/2**32|0)|0;var fD={fromBig:KE,split:zj,toBig:qj,shrSH:Hj,shrSL:Wj,rotrSH:Kj,rotrSL:Gj,rotrBH:Vj,rotrBL:Yj,rotr32H:Zj,rotr32L:Jj,rotlSH:Xj,rotlSL:Qj,rotlBH:eD,rotlBL:tD,add:rD,add3L:nD,add3H:oD,add4L:iD,add4H:aD,add5H:cD,add5L:sD},ne=fD;var[uD,dD]=ne.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Ti=new Uint32Array(80),_i=new Uint32Array(80),Vg=class extends nc{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:o,Ch:i,Cl:a,Dh:s,Dl:c,Eh:f,El:u,Fh:d,Fl:m,Gh:b,Gl:w,Hh:T,Hl:P}=this;return[e,r,n,o,i,a,s,c,f,u,d,m,b,w,T,P]}set(e,r,n,o,i,a,s,c,f,u,d,m,b,w,T,P){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=a|0,this.Dh=s|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=d|0,this.Fl=m|0,this.Gh=b|0,this.Gl=w|0,this.Hh=T|0,this.Hl=P|0}process(e,r){for(let _=0;_<16;_++,r+=4)Ti[_]=e.getUint32(r),_i[_]=e.getUint32(r+=4);for(let _=16;_<80;_++){let O=Ti[_-15]|0,$=_i[_-15]|0,B=ne.rotrSH(O,$,1)^ne.rotrSH(O,$,8)^ne.shrSH(O,$,7),N=ne.rotrSL(O,$,1)^ne.rotrSL(O,$,8)^ne.shrSL(O,$,7),M=Ti[_-2]|0,F=_i[_-2]|0,v=ne.rotrSH(M,F,19)^ne.rotrBH(M,F,61)^ne.shrSH(M,F,6),l=ne.rotrSL(M,F,19)^ne.rotrBL(M,F,61)^ne.shrSL(M,F,6),h=ne.add4L(N,l,_i[_-7],_i[_-16]),y=ne.add4H(h,B,v,Ti[_-7],Ti[_-16]);Ti[_]=y|0,_i[_]=h|0}let{Ah:n,Al:o,Bh:i,Bl:a,Ch:s,Cl:c,Dh:f,Dl:u,Eh:d,El:m,Fh:b,Fl:w,Gh:T,Gl:P,Hh:R,Hl:k}=this;for(let _=0;_<80;_++){let O=ne.rotrSH(d,m,14)^ne.rotrSH(d,m,18)^ne.rotrBH(d,m,41),$=ne.rotrSL(d,m,14)^ne.rotrSL(d,m,18)^ne.rotrBL(d,m,41),B=d&b^~d&T,N=m&w^~m&P,M=ne.add5L(k,$,N,dD[_],_i[_]),F=ne.add5H(M,R,O,B,uD[_],Ti[_]),v=M|0,l=ne.rotrSH(n,o,28)^ne.rotrBH(n,o,34)^ne.rotrBH(n,o,39),h=ne.rotrSL(n,o,28)^ne.rotrBL(n,o,34)^ne.rotrBL(n,o,39),y=n&i^n&s^i&s,g=o&a^o&c^a&c;R=T|0,k=P|0,T=b|0,P=w|0,b=d|0,w=m|0,{h:d,l:m}=ne.add(f|0,u|0,F|0,v|0),f=s|0,u=c|0,s=i|0,c=a|0,i=n|0,a=o|0;let x=ne.add3L(v,h,g);n=ne.add3H(x,F,l,y),o=x|0}({h:n,l:o}=ne.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:a}=ne.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:s,l:c}=ne.add(this.Ch|0,this.Cl|0,s|0,c|0),{h:f,l:u}=ne.add(this.Dh|0,this.Dl|0,f|0,u|0),{h:d,l:m}=ne.add(this.Eh|0,this.El|0,d|0,m|0),{h:b,l:w}=ne.add(this.Fh|0,this.Fl|0,b|0,w|0),{h:T,l:P}=ne.add(this.Gh|0,this.Gl|0,T|0,P|0),{h:R,l:k}=ne.add(this.Hh|0,this.Hl|0,R|0,k|0),this.set(n,o,i,a,s,c,f,u,d,m,b,w,T,P,R,k)}roundClean(){Ti.fill(0),_i.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var GE=cp(()=>new Vg);var Zg=BigInt(0),YE=BigInt(1),lD=BigInt(2);function Jg(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Xg(t){if(!Jg(t))throw new Error("Uint8Array expected")}function up(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}var pD=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function dp(t){Xg(t);let e="";for(let r=0;r<t.length;r++)e+=pD[t[r]];return e}function ZE(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?Zg:BigInt("0x"+t)}var Oo={_0:48,_9:57,A:65,F:70,a:97,f:102};function VE(t){if(t>=Oo._0&&t<=Oo._9)return t-Oo._0;if(t>=Oo.A&&t<=Oo.F)return t-(Oo.A-10);if(t>=Oo.a&&t<=Oo.f)return t-(Oo.a-10)}function JE(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let a=VE(t.charCodeAt(i)),s=VE(t.charCodeAt(i+1));if(a===void 0||s===void 0){let c=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=a*16+s}return n}function XE(t){return ZE(dp(t))}function oc(t){return Xg(t),ZE(dp(Uint8Array.from(t).reverse()))}function Qg(t,e){return JE(t.toString(16).padStart(e*2,"0"))}function id(t,e){return Qg(t,e).reverse()}function un(t,e,r){let n;if(typeof e=="string")try{n=JE(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else if(Jg(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(t+" of length "+r+" expected, got "+o);return n}function ev(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];Xg(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}var Yg=t=>typeof t=="bigint"&&Zg<=t;function hD(t,e,r){return Yg(t)&&Yg(e)&&Yg(r)&&e<=t&&t<r}function ic(t,e,r,n){if(!hD(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function QE(t){let e;for(e=0;t>Zg;t>>=YE,e+=1);return e}var e9=t=>(lD<<BigInt(t-1))-YE;var mD={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Jg(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function ac(t,e,r={}){let n=(o,i,a)=>{let s=mD[i];if(typeof s!="function")throw new Error("invalid validator function");let c=t[o];if(!(a&&c===void 0)&&!s(c,t))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+c)};for(let[o,i]of Object.entries(e))n(o,i,!1);for(let[o,i]of Object.entries(r))n(o,i,!0);return t}function tv(t){let e=new WeakMap;return(r,...n)=>{let o=e.get(r);if(o!==void 0)return o;let i=t(r,...n);return e.set(r,i),i}}var wt=BigInt(0),De=BigInt(1),Da=BigInt(2),yD=BigInt(3),rv=BigInt(4),t9=BigInt(5),r9=BigInt(8),gD=BigInt(9),vD=BigInt(16);function We(t,e){let r=t%e;return r>=wt?r:e+r}function xD(t,e,r){if(e<wt)throw new Error("invalid exponent, negatives unsupported");if(r<=wt)throw new Error("invalid modulus");if(r===De)return wt;let n=De;for(;e>wt;)e&De&&(n=n*t%r),t=t*t%r,e>>=De;return n}function dn(t,e,r){let n=t;for(;e-- >wt;)n*=n,n%=r;return n}function n9(t,e){if(t===wt)throw new Error("invert: expected non-zero number");if(e<=wt)throw new Error("invert: expected positive modulus, got "+e);let r=We(t,e),n=e,o=wt,i=De,a=De,s=wt;for(;r!==wt;){let f=n/r,u=n%r,d=o-a*f,m=i-s*f;n=r,r=u,o=a,i=s,a=d,s=m}if(n!==De)throw new Error("invert: does not exist");return We(o,e)}function wD(t){let e=(t-De)/Da,r,n,o;for(r=t-De,n=0;r%Da===wt;r/=Da,n++);for(o=Da;o<t&&xD(o,e,t)!==t-De;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let a=(t+De)/rv;return function(c,f){let u=c.pow(f,a);if(!c.eql(c.sqr(u),f))throw new Error("Cannot find square root");return u}}let i=(r+De)/Da;return function(s,c){if(s.pow(c,e)===s.neg(s.ONE))throw new Error("Cannot find square root");let f=n,u=s.pow(s.mul(s.ONE,o),r),d=s.pow(c,i),m=s.pow(c,r);for(;!s.eql(m,s.ONE);){if(s.eql(m,s.ZERO))return s.ZERO;let b=1;for(let T=s.sqr(m);b<f&&!s.eql(T,s.ONE);b++)T=s.sqr(T);let w=s.pow(u,De<<BigInt(f-b-1));u=s.sqr(w),d=s.mul(d,w),m=s.mul(m,u),f=b}return d}}function ED(t){if(t%rv===yD){let e=(t+De)/rv;return function(n,o){let i=n.pow(o,e);if(!n.eql(n.sqr(i),o))throw new Error("Cannot find square root");return i}}if(t%r9===t9){let e=(t-t9)/r9;return function(n,o){let i=n.mul(o,Da),a=n.pow(i,e),s=n.mul(o,a),c=n.mul(n.mul(s,Da),a),f=n.mul(s,n.sub(c,n.ONE));if(!n.eql(n.sqr(f),o))throw new Error("Cannot find square root");return f}}return t%vD,wD(t)}var o9=(t,e)=>(We(t,e)&De)===De,AD=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function i9(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=AD.reduce((n,o)=>(n[o]="function",n),e);return ac(t,r)}function SD(t,e,r){if(r<wt)throw new Error("invalid exponent, negatives unsupported");if(r===wt)return t.ONE;if(r===De)return e;let n=t.ONE,o=e;for(;r>wt;)r&De&&(n=t.mul(n,o)),o=t.sqr(o),r>>=De;return n}function ID(t,e){let r=new Array(e.length),n=e.reduce((i,a,s)=>t.is0(a)?i:(r[s]=i,t.mul(i,a)),t.ONE),o=t.inv(n);return e.reduceRight((i,a,s)=>t.is0(a)?i:(r[s]=t.mul(i,r[s]),t.mul(i,a)),o),r}function nv(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function lp(t,e,r=!1,n={}){if(t<=wt)throw new Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:o,nByteLength:i}=nv(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a,s=Object.freeze({ORDER:t,isLE:r,BITS:o,BYTES:i,MASK:e9(o),ZERO:wt,ONE:De,create:c=>We(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return wt<=c&&c<t},is0:c=>c===wt,isOdd:c=>(c&De)===De,neg:c=>We(-c,t),eql:(c,f)=>c===f,sqr:c=>We(c*c,t),add:(c,f)=>We(c+f,t),sub:(c,f)=>We(c-f,t),mul:(c,f)=>We(c*f,t),pow:(c,f)=>SD(s,c,f),div:(c,f)=>We(c*n9(f,t),t),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>n9(c,t),sqrt:n.sqrt||(c=>(a||(a=ED(t)),a(s,c))),invertBatch:c=>ID(s,c),cmov:(c,f,u)=>u?f:c,toBytes:c=>r?id(c,i):Qg(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+c.length);return r?oc(c):XE(c)}});return Object.freeze(s)}var a9=BigInt(0),pp=BigInt(1);function ov(t,e){let r=e.negate();return t?r:e}function s9(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function iv(t,e){s9(t,e);let r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function TD(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function _D(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}var av=new WeakMap,c9=new WeakMap;function sv(t){return c9.get(t)||1}function f9(t,e){return{constTimeNegate:ov,hasPrecomputes(r){return sv(r)!==1},unsafeLadder(r,n,o=t.ZERO){let i=r;for(;n>a9;)n&pp&&(o=o.add(i)),i=i.double(),n>>=pp;return o},precomputeWindow(r,n){let{windows:o,windowSize:i}=iv(n,e),a=[],s=r,c=s;for(let f=0;f<o;f++){c=s,a.push(c);for(let u=1;u<i;u++)c=c.add(s),a.push(c);s=c.double()}return a},wNAF(r,n,o){let{windows:i,windowSize:a}=iv(r,e),s=t.ZERO,c=t.BASE,f=BigInt(2**r-1),u=2**r,d=BigInt(r);for(let m=0;m<i;m++){let b=m*a,w=Number(o&f);o>>=d,w>a&&(w-=u,o+=pp);let T=b,P=b+Math.abs(w)-1,R=m%2!==0,k=w<0;w===0?c=c.add(ov(R,n[T])):s=s.add(ov(k,n[P]))}return{p:s,f:c}},wNAFUnsafe(r,n,o,i=t.ZERO){let{windows:a,windowSize:s}=iv(r,e),c=BigInt(2**r-1),f=2**r,u=BigInt(r);for(let d=0;d<a;d++){let m=d*s;if(o===a9)break;let b=Number(o&c);if(o>>=u,b>s&&(b-=f,o+=pp),b===0)continue;let w=n[m+Math.abs(b)-1];b<0&&(w=w.negate()),i=i.add(w)}return i},getPrecomputes(r,n,o){let i=av.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&av.set(n,o(i))),i},wNAFCached(r,n,o){let i=sv(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){let a=sv(r);return a===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(a,this.getPrecomputes(a,r,o),n,i)},setWindowSize(r,n){s9(n,e),c9.set(r,n),av.delete(r)}}}function u9(t,e,r,n){if(TD(r,t),_D(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let o=t.ZERO,i=QE(BigInt(r.length)),a=i>12?i-3:i>4?i-2:i?2:1,s=(1<<a)-1,c=new Array(s+1).fill(o),f=Math.floor((e.BITS-1)/a)*a,u=o;for(let d=f;d>=0;d-=a){c.fill(o);for(let b=0;b<n.length;b++){let w=n[b],T=Number(w>>BigInt(d)&BigInt(s));c[T]=c[T].add(r[b])}let m=o;for(let b=c.length-1,w=o;b>0;b--)w=w.add(c[b]),m=m.add(w);if(u=u.add(m),d!==0)for(let b=0;b<a;b++)u=u.double()}return u}function d9(t){return i9(t.Fp),ac(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nv(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var ln=BigInt(0),lr=BigInt(1),hp=BigInt(2),BD=BigInt(8),RD={zip215:!0};function PD(t){let e=d9(t);return ac(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function l9(t){let e=PD(t),{Fp:r,n,prehash:o,hash:i,randomBytes:a,nByteLength:s,h:c}=e,f=hp<<BigInt(s*8)-lr,u=r.create,d=lp(e.n,e.nBitLength),m=e.uvRatio||((E,S)=>{try{return{isValid:!0,value:r.sqrt(E*r.inv(S))}}catch{return{isValid:!1,value:ln}}}),b=e.adjustScalarBytes||(E=>E),w=e.domain||((E,S,A)=>{if(up("phflag",A),S.length||A)throw new Error("Contexts/pre-hash are not supported");return E});function T(E,S){ic("coordinate "+E,S,ln,f)}function P(E){if(!(E instanceof _))throw new Error("ExtendedPoint expected")}let R=tv((E,S)=>{let{ex:A,ey:p,ez:I}=E,C=E.is0();S==null&&(S=C?BD:r.inv(I));let L=u(A*S),j=u(p*S),D=u(I*S);if(C)return{x:ln,y:lr};if(D!==lr)throw new Error("invZ was invalid");return{x:L,y:j}}),k=tv(E=>{let{a:S,d:A}=e;if(E.is0())throw new Error("bad point: ZERO");let{ex:p,ey:I,ez:C,et:L}=E,j=u(p*p),D=u(I*I),z=u(C*C),W=u(z*z),G=u(j*S),K=u(z*u(G+D)),Y=u(W+u(A*u(j*D)));if(K!==Y)throw new Error("bad point: equation left != right (1)");let X=u(p*I),Z=u(C*L);if(X!==Z)throw new Error("bad point: equation left != right (2)");return!0});class _{constructor(S,A,p,I){this.ex=S,this.ey=A,this.ez=p,this.et=I,T("x",S),T("y",A),T("z",p),T("t",I),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(S){if(S instanceof _)throw new Error("extended point not allowed");let{x:A,y:p}=S||{};return T("x",A),T("y",p),new _(A,p,lr,u(A*p))}static normalizeZ(S){let A=r.invertBatch(S.map(p=>p.ez));return S.map((p,I)=>p.toAffine(A[I])).map(_.fromAffine)}static msm(S,A){return u9(_,d,S,A)}_setWindowSize(S){B.setWindowSize(this,S)}assertValidity(){k(this)}equals(S){P(S);let{ex:A,ey:p,ez:I}=this,{ex:C,ey:L,ez:j}=S,D=u(A*j),z=u(C*I),W=u(p*j),G=u(L*I);return D===z&&W===G}is0(){return this.equals(_.ZERO)}negate(){return new _(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:S}=e,{ex:A,ey:p,ez:I}=this,C=u(A*A),L=u(p*p),j=u(hp*u(I*I)),D=u(S*C),z=A+p,W=u(u(z*z)-C-L),G=D+L,K=G-j,Y=D-L,X=u(W*K),Z=u(G*Y),J=u(W*Y),ie=u(K*G);return new _(X,Z,ie,J)}add(S){P(S);let{a:A,d:p}=e,{ex:I,ey:C,ez:L,et:j}=this,{ex:D,ey:z,ez:W,et:G}=S;if(A===BigInt(-1)){let Be=u((C-I)*(z+D)),Re=u((C+I)*(z-D)),vi=u(Re-Be);if(vi===ln)return this.double();let ke=u(L*hp*G),Me=u(j*hp*W),Xu=Me+ke,$e=Re+Be,Ne=Me-ke,L0=u(Xu*vi),Ue=u($e*Ne),je=u(Xu*Ne),U0=u(vi*$e);return new _(L0,Ue,U0,je)}let K=u(I*D),Y=u(C*z),X=u(j*p*G),Z=u(L*W),J=u((I+C)*(D+z)-K-Y),ie=Z-X,te=Z+X,Q=u(Y-A*K),be=u(J*ie),Ae=u(te*Q),_e=u(J*Q),qn=u(ie*te);return new _(be,Ae,qn,_e)}subtract(S){return this.add(S.negate())}wNAF(S){return B.wNAFCached(this,S,_.normalizeZ)}multiply(S){let A=S;ic("scalar",A,lr,n);let{p,f:I}=this.wNAF(A);return _.normalizeZ([p,I])[0]}multiplyUnsafe(S,A=_.ZERO){let p=S;return ic("scalar",p,ln,n),p===ln?$:this.is0()||p===lr?this:B.wNAFCachedUnsafe(this,p,_.normalizeZ,A)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return B.unsafeLadder(this,n).is0()}toAffine(S){return R(this,S)}clearCofactor(){let{h:S}=e;return S===lr?this:this.multiplyUnsafe(S)}static fromHex(S,A=!1){let{d:p,a:I}=e,C=r.BYTES;S=un("pointHex",S,C),up("zip215",A);let L=S.slice(),j=S[C-1];L[C-1]=j&-129;let D=oc(L),z=A?f:r.ORDER;ic("pointHex.y",D,ln,z);let W=u(D*D),G=u(W-lr),K=u(p*W-I),{isValid:Y,value:X}=m(G,K);if(!Y)throw new Error("Point.fromHex: invalid y coordinate");let Z=(X&lr)===lr,J=(j&128)!==0;if(!A&&X===ln&&J)throw new Error("Point.fromHex: x=0 and x_0=1");return J!==Z&&(X=u(-X)),_.fromAffine({x:X,y:D})}static fromPrivateKey(S){return F(S).point}toRawBytes(){let{x:S,y:A}=this.toAffine(),p=id(A,r.BYTES);return p[p.length-1]|=S&lr?128:0,p}toHex(){return dp(this.toRawBytes())}}_.BASE=new _(e.Gx,e.Gy,lr,u(e.Gx*e.Gy)),_.ZERO=new _(ln,lr,lr,ln);let{BASE:O,ZERO:$}=_,B=f9(_,s*8);function N(E){return We(E,n)}function M(E){return N(oc(E))}function F(E){let S=r.BYTES;E=un("private key",E,S);let A=un("hashed private key",i(E),2*S),p=b(A.slice(0,S)),I=A.slice(S,2*S),C=M(p),L=O.multiply(C),j=L.toRawBytes();return{head:p,prefix:I,scalar:C,point:L,pointBytes:j}}function v(E){return F(E).pointBytes}function l(E=new Uint8Array,...S){let A=ev(...S);return M(i(w(A,un("context",E),!!o)))}function h(E,S,A={}){E=un("message",E),o&&(E=o(E));let{prefix:p,scalar:I,pointBytes:C}=F(S),L=l(A.context,p,E),j=O.multiply(L).toRawBytes(),D=l(A.context,j,C,E),z=N(L+D*I);ic("signature.s",z,ln,n);let W=ev(j,id(z,r.BYTES));return un("result",W,r.BYTES*2)}let y=RD;function g(E,S,A,p=y){let{context:I,zip215:C}=p,L=r.BYTES;E=un("signature",E,2*L),S=un("message",S),A=un("publicKey",A,L),C!==void 0&&up("zip215",C),o&&(S=o(S));let j=oc(E.slice(L,2*L)),D,z,W;try{D=_.fromHex(A,C),z=_.fromHex(E.slice(0,L),C),W=O.multiplyUnsafe(j)}catch{return!1}if(!C&&D.isSmallOrder())return!1;let G=l(I,z.toRawBytes(),D.toRawBytes(),S);return z.add(D.multiplyUnsafe(G)).subtract(W).clearCofactor().equals(_.ZERO)}return O._setWindowSize(8),{CURVE:e,getPublicKey:v,sign:h,verify:g,ExtendedPoint:_,utils:{getExtendedPublicKey:F,randomPrivateKey:()=>a(r.BYTES),precompute(E=8,S=_.BASE){return S._setWindowSize(E),S.multiply(BigInt(3)),S}}}}var cv=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),p9=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Qge=BigInt(0),CD=BigInt(1),h9=BigInt(2),eve=BigInt(3),OD=BigInt(5),kD=BigInt(8);function MD(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=cv,s=t*t%i*t%i,c=dn(s,h9,i)*s%i,f=dn(c,CD,i)*t%i,u=dn(f,OD,i)*f%i,d=dn(u,e,i)*u%i,m=dn(d,r,i)*d%i,b=dn(m,n,i)*m%i,w=dn(b,o,i)*b%i,T=dn(w,o,i)*b%i,P=dn(T,e,i)*u%i;return{pow_p_5_8:dn(P,h9,i)*t%i,b2:s}}function $D(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function ND(t,e){let r=cv,n=We(e*e*e,r),o=We(n*n*e,r),i=MD(t*o).pow_p_5_8,a=We(t*n*i,r),s=We(e*a*a,r),c=a,f=We(a*p9,r),u=s===t,d=s===We(-t,r),m=s===We(-t*p9,r);return u&&(a=c),(d||m)&&(a=f),o9(a,r)&&(a=We(-a,r)),{isValid:u||d,value:a}}var FD=lp(cv,void 0,!0),LD={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:FD,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:kD,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:GE,randomBytes:qE,adjustScalarBytes:$D,uvRatio:ND},sc=l9(LD);Vn();var QA=cn(Nv(),1);function qq(t){switch(t){case Se.ED25519:return"ed25519";case Se.SECP256K1:return"secp256k1";default:throw new Error(`Unknown key type ${t}`)}}function Hq(t){switch(t.toLowerCase()){case"ed25519":return Se.ED25519;case"secp256k1":return Se.SECP256K1;default:throw new Error(`Unknown key type ${t}`)}}function Wq(t){switch(t){case Se.ED25519:return"ed25519Key";case Se.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${t}`)}}var Fv=class{constructor(e){if(Object.keys(e).length!==1)throw new Error("Enum can only take single value");Object.keys(e).map(r=>{this[r]=e[r]})}},Dt=class t extends Fv{enum;ed25519Key;secp256k1Key;constructor(e){let r=Wq(e.keyType);super({[r]:e}),this[r]=e,this.enum=r}static from(e){return typeof e=="string"?t.fromString(e):e}static fromString(e){let r=e.split(":"),n,o;if(r.length===1)n=r[0];else if(r.length===2)n=r[1],o=Hq(r[0]);else throw new Error("Invalid encoded key format, must be <curve>:<encoded key>");let i=Br(n);o||(o=i.length===Wn.SECP256k1_PUBLIC_KEY?Se.SECP256K1:Se.ED25519);let a=o===Se.ED25519?Wn.ED25519_PUBLIC_KEY:Wn.SECP256k1_PUBLIC_KEY;if(i.length!==a)throw new Error(`Invalid public key size (${i.length}), must be ${a}`);return new t({keyType:o,data:i})}toString(){let e=kt(this.data);return`${qq(this.keyType)}:${e}`}verify(e,r){let n=this.keyType,o=this.data;switch(n){case Se.ED25519:return sc.verify(r,e,o);case Se.SECP256K1:return QA.default.ecdsaVerify(r.subarray(0,64),e,new Uint8Array([4,...o]));default:throw new Error(`Unknown key type: ${n}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}};var ld=class t extends Ii{publicKey;secretKey;extendedSecretKey;constructor(e){super();let r=Br(e),n=new Uint8Array(r.slice(0,Wn.SECRET_KEY)),o=sc.getPublicKey(new Uint8Array(n));this.publicKey=new Dt({keyType:Se.ED25519,data:o}),this.secretKey=kt(n),this.extendedSecretKey=e}static fromRandom(){let e=Ri(Wn.SECRET_KEY),r=sc.getPublicKey(new Uint8Array(e)),n=new Uint8Array([...e,...r]);return new t(kt(n))}sign(e){return{signature:sc.sign(e,Br(this.secretKey)),publicKey:this.publicKey}}verify(e,r){return this.publicKey.verify(e,r)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}};Vn();var Mp=cn(Nv(),1);var pd=class t extends Ii{publicKey;secretKey;extendedSecretKey;constructor(e){super();let r=Br(e),n=new Uint8Array(r.slice(0,Wn.SECRET_KEY)),o=Mp.default.publicKeyCreate(new Uint8Array(n),!1),i=o.subarray(1,o.length);this.publicKey=new Dt({keyType:Se.SECP256K1,data:i}),this.secretKey=kt(n),this.extendedSecretKey=e}static fromRandom(){let e=Ri(Wn.SECRET_KEY),r=Mp.default.publicKeyCreate(new Uint8Array(e),!1),n=r.subarray(1,r.length),o=new Uint8Array([...e,...n]);return new t(kt(o))}sign(e){let{signature:r,recid:n}=Mp.default.ecdsaSign(e,Br(this.secretKey));return{signature:new Uint8Array([...r,n]),publicKey:this.publicKey}}verify(e,r){return this.publicKey.verify(e,r)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}};var mr=class extends Ii{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return ld.fromRandom();case"SECP256K1":return pd.fromRandom();default:throw new Error(`Unknown curve ${e}`)}}static fromString(e){let r=e.split(":");if(r.length===2)switch(r[0].toUpperCase()){case"ED25519":return new ld(r[1]);case"SECP256K1":return new pd(r[1]);default:throw new Error(`Unknown curve: ${r[0]}`)}else throw new Error("Invalid encoded key format, must be <curve>:<encoded key>")}};function Kq(t){switch(t){case Se.ED25519:return"ed25519Signature";case Se.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${t}`)}}var hd=class extends Co{enum;ed25519Signature;secp256k1Signature;constructor(e){let r=Kq(e.keyType);super({[r]:e}),this[r]=e,this.enum=r}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}};var c7=cn(s7(),1),gH=1.5,f7=10,vH=0;function u7(t=f7,e=gH,r=vH){return{numOfAttempts:t,timeMultiple:e,startingDelay:r,retry:n=>!!([503,500,408].includes(n.cause)||n.toString().includes("FetchError")||n.toString().includes("Failed to fetch"))}}var es=class extends Error{cause;constructor(e,r){super(e,r),r.cause&&(this.cause=r.cause)}};async function d7(t,e,r,n){let o=await(0,c7.backOff)(async()=>{let i=await fetch(t,{method:"POST",body:JSON.stringify(e),headers:{...r,"Content-Type":"application/json"}}),{ok:a,status:s}=i;if(s===500)throw new es("Internal server error",{cause:s});if(s===408)throw new es("Timeout error",{cause:s});if(s===400)throw new es("Request validation error",{cause:s});if(s===503)throw new es(`${t} unavailable`,{cause:s});if(!a)throw new es(await i.text(),{cause:s});return i},n);if(!o)throw new It(`Exceeded ${f7} attempts for ${t}.`,"RetriesExceeded");return await o.json()}var xH=12,wH=500,EH=1.5,AH=123,Uo="optimistic",oo=class{connection;options;networkId;constructor(e,r){this.connection=e||{url:""};let n={retries:xH,wait:wH,backoff:EH};this.options=Object.assign({},n,r),this.networkId=void 0}async getNetworkId(){if(this.networkId)return this.networkId;let{chain_id:e}=await this.viewNodeStatus();return this.networkId=e,this.networkId}async getCurrentEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:r}=await this.experimental_protocolConfig({finality:Uo}),{current_validators:n}=await this.viewValidators();return Ng(n,300,e,r)}async getNextEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:r}=await this.experimental_protocolConfig({finality:Uo}),{next_validators:n}=await this.viewValidators();return Ng(n,300,e,r)}async viewAccessKey(e,r,n={finality:Uo}){let o=await this.query({...n,request_type:"view_access_key",account_id:e,public_key:r.toString()});return{...o,nonce:BigInt(o.nonce)}}async viewAccessKeyList(e,r={finality:Uo}){return this.query({...r,request_type:"view_access_key_list",account_id:e})}async viewAccount(e,r={finality:Uo}){let n=await this.query({...r,request_type:"view_account",account_id:e});return{...n,amount:BigInt(n.amount),locked:BigInt(n.locked)}}async viewContractCode(e,r={finality:Uo}){let n=await this.query({...r,request_type:"view_code",account_id:e});return{...n,code:new Uint8Array(Buffer.from(n.code_base64,"base64"))}}async viewContractState(e,r,n={finality:Uo}){let o=Buffer.from(r||"").toString("base64");return this.query({...n,request_type:"view_state",account_id:e,prefix_base64:o})}async callFunction(e,r,n,o={finality:Uo}){let{result:i}=await this.callFunctionRaw(e,r,n,o);if(i.length===0)return;let a=Buffer.from(i).toString();try{return JSON.parse(a)}catch{return a}}async callFunctionRaw(e,r,n,o={finality:Uo}){let a=(ArrayBuffer.isView(n)?Buffer.from(n):Buffer.from(JSON.stringify(n))).toString("base64");return await this.query({...o,request_type:"call_function",account_id:e,method_name:r,args_base64:a})}async viewBlock(e){let{finality:r}=e,{blockId:n}=e;return this.sendJsonRpc("block",{block_id:n,finality:r})}async viewChunk(e){return this.sendJsonRpc("chunk",[e])}async viewGasPrice(e){return this.sendJsonRpc("gas_price",[e||null])}async viewNodeStatus(){return this.sendJsonRpc("status",[])}async viewValidators(e){return this.sendJsonRpc("validators",[e||null])}async viewValidatorsV2(e){if(e===null)return this.sendJsonRpc("validators",[null]);if(typeof e=="object"&&"blockId"in e)return this.sendJsonRpc("validators",{block_id:e.blockId});if(typeof e=="object"&&"epochId"in e)return this.sendJsonRpc("validators",{epoch_id:e.epochId});throw new Error("Invalid parameters for validatorsV2")}async viewTransactionStatus(e,r,n){let o=typeof e=="string"?e:kt(e);return this.sendJsonRpc("tx",{tx_hash:o,sender_account_id:r,wait_until:n})}async viewTransactionStatusWithReceipts(e,r,n){let o=typeof e=="string"?e:kt(e);return this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:o,sender_account_id:r,wait_until:n})}async viewTransactionReceipt(e){return this.sendJsonRpc("EXPERIMENTAL_receipt",{receipt_id:e})}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,r){let n=rc(e);return this.sendJsonRpc("send_tx",{signed_tx_base64:Buffer.from(n).toString("base64"),wait_until:r})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,r,n="EXECUTED_OPTIMISTIC"){return typeof e=="string"?this.txStatusString(e,r,n):this.txStatusUint8Array(e,r,n)}async txStatusUint8Array(e,r,n){return this.sendJsonRpc("tx",{tx_hash:kt(e),sender_account_id:r,wait_until:n})}async txStatusString(e,r,n){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:r,wait_until:n})}async txStatusReceipts(e,r,n="EXECUTED_OPTIMISTIC"){return typeof e=="string"?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:r,wait_until:n}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:kt(e),sender_account_id:r,wait_until:n})}async query(...e){let r;if(e.length===1){let{block_id:n,blockId:o,...i}=e[0];r=await this.sendJsonRpc("query",{...i,block_id:n||o})}else{let[n,o]=e;r=await this.sendJsonRpc("query",[n,o])}if(r&&r.error)throw new It(`Querying failed: ${r.error}.
44
+ ${JSON.stringify(r,null,2)}`,H0(r.error,r.error.name));return r}async block(e){let{finality:r}=e,{blockId:n}=e;return this.sendJsonRpc("block",{block_id:n,finality:r})}async blockChanges(e){let{finality:r}=e,{blockId:n}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:n,finality:r})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:r,...n}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...n,block_id:r})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,r){let{finality:n}=r,{blockId:o}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:o,finality:n})}async singleAccessKeyChanges(e,r){let{finality:n}=r,{blockId:o}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:o,finality:n})}async accountChanges(e,r){let{finality:n}=r,{blockId:o}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:o,finality:n})}async contractStateChanges(e,r,n=""){let{finality:o}=r,{blockId:i}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:n,block_id:i,finality:o})}async contractCodeChanges(e,r){let{finality:n}=r,{blockId:o}=r;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:o,finality:n})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,r){let n={method:e,params:r,id:AH++,jsonrpc:"2.0"},o=await d7(this.connection.url,n,this.connection.headers||{},u7(this.options.retries,this.options.backoff,this.options.wait));if(o.error){if(typeof o.error.data=="object")throw typeof o.error.data.error_message=="string"&&typeof o.error.data.error_type=="string"?new It(o.error.data.error_message,o.error.data.error_type):z0(o.error.data);{let a=`[${o.error.code}] ${o.error.message}: ${o.error.data}`,s=H0(o.error.data,"");throw s?new It(q0(s,r),s):new It(a,o.error.name)}}else if(typeof o.result?.error=="string"){let a=H0(o.result.error,"");if(a)throw new D0(q0(a,r),a)}let{result:i}=o;if(typeof i>"u")throw new It(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return i}};var ts=class{providers;currentProviderIndex;constructor(e){if(e.length===0)throw new Error("At least one provider must be specified");this.providers=e,this.currentProviderIndex=0}switchToNextProvider(){this.providers.length!==1&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,wi.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){let e=this.providers[this.currentProviderIndex];if(!e)throw new Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return e}async withBackoff(e){for(let r=0;r<this.providers.length;r++)try{let n=await e(this.currentProvider);if(typeof n>"u")continue;return n}catch(n){console.error(n),this.switchToNextProvider()}throw new It(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(e=>e.status())}async getNetworkId(){return this.withBackoff(e=>e.getNetworkId())}async getCurrentEpochSeatPrice(){return this.withBackoff(e=>e.getCurrentEpochSeatPrice())}async getNextEpochSeatPrice(){return this.withBackoff(e=>e.getNextEpochSeatPrice())}async viewAccessKey(e,r,n){return this.withBackoff(o=>o.viewAccessKey(e,r,n))}async viewAccessKeyList(e,r){return this.withBackoff(n=>n.viewAccessKeyList(e,r))}async viewAccount(e,r){return this.withBackoff(n=>n.viewAccount(e,r))}async viewContractCode(e,r){return this.withBackoff(n=>n.viewContractCode(e,r))}async viewContractState(e,r,n){return this.withBackoff(o=>o.viewContractState(e,r,n))}async callFunction(e,r,n,o){return this.withBackoff(i=>i.callFunction(e,r,n,o))}async callFunctionRaw(e,r,n,o){return this.withBackoff(i=>i.callFunctionRaw(e,r,n,o))}async viewBlock(e){return this.withBackoff(r=>r.viewBlock(e))}async viewChunk(e){return this.withBackoff(r=>r.viewChunk(e))}async viewGasPrice(e){return this.withBackoff(r=>r.viewGasPrice(e))}async viewNodeStatus(){return this.withBackoff(e=>e.viewNodeStatus())}async viewValidators(e){return this.withBackoff(r=>r.viewValidators(e))}async viewValidatorsV2(e){return this.withBackoff(r=>r.viewValidatorsV2(e))}async viewTransactionStatus(e,r,n){return this.withBackoff(o=>o.viewTransactionStatus(e,r,n))}async viewTransactionStatusWithReceipts(e,r,n){return this.withBackoff(o=>o.viewTransactionStatusWithReceipts(e,r,n))}async viewTransactionReceipt(e){return this.withBackoff(r=>r.viewTransactionReceipt(e))}async sendTransactionUntil(e,r){return this.withBackoff(n=>n.sendTransactionUntil(e,r))}async sendTransaction(e){return this.withBackoff(r=>r.sendTransaction(e))}async sendTransactionAsync(e){return this.withBackoff(r=>r.sendTransactionAsync(e))}async txStatus(e,r,n){return this.withBackoff(o=>o.txStatus(e,r,n))}async txStatusReceipts(e,r,n){return this.withBackoff(o=>o.txStatusReceipts(e,r,n))}async query(e,r){return r?this.withBackoff(n=>n.query(e,r)):this.withBackoff(n=>n.query(e))}async block(e){return this.withBackoff(r=>r.block(e))}async blockChanges(e){return this.withBackoff(r=>r.blockChanges(e))}async chunk(e){return this.withBackoff(r=>r.chunk(e))}async validators(e){return this.withBackoff(r=>r.validators(e))}async experimental_protocolConfig(e){return this.withBackoff(r=>r.experimental_protocolConfig(e))}async lightClientProof(e){return this.withBackoff(r=>r.lightClientProof(e))}async nextLightClientBlock(e){return this.withBackoff(r=>r.nextLightClientBlock(e))}async accessKeyChanges(e,r){return this.withBackoff(n=>n.accessKeyChanges(e,r))}async singleAccessKeyChanges(e,r){return this.withBackoff(n=>n.singleAccessKeyChanges(e,r))}async accountChanges(e,r){return this.withBackoff(n=>n.accountChanges(e,r))}async contractStateChanges(e,r,n=""){return this.withBackoff(o=>o.contractStateChanges(e,r,n))}async contractCodeChanges(e,r){return this.withBackoff(n=>n.contractCodeChanges(e,r))}async gasPrice(e){return this.withBackoff(r=>r.gasPrice(e))}};var OT=cn(E7(),1);var Gv=function(t,e){return Gv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Gv(t,e)};function io(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Gv(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function yd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wc(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function Ec(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function br(t){return typeof t=="function"}function Lp(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Up=Lp(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
45
+ `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
46
+ `):"",this.name="UnsubscriptionError",this.errors=r}});function gd(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Ac=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=yd(a),c=s.next();!c.done;c=s.next()){var f=c.value;f.remove(this)}}catch(T){e={error:T}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}else a.remove(this);var u=this.initialTeardown;if(br(u))try{u()}catch(T){i=T instanceof Up?T.errors:[T]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var m=yd(d),b=m.next();!b.done;b=m.next()){var w=b.value;try{A7(w)}catch(T){i=i??[],T instanceof Up?i=Ec(Ec([],wc(i)),wc(T.errors)):i.push(T)}}}catch(T){n={error:T}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}}if(i)throw new Up(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)A7(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}},t.prototype._hasParent=function(e){var r=this._parentage;return r===e||Array.isArray(r)&&r.includes(e)},t.prototype._addParent=function(e){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e},t.prototype._removeParent=function(e){var r=this._parentage;r===e?this._parentage=null:Array.isArray(r)&&gd(r,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&gd(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})();var Vv=Ac.EMPTY;function jp(t){return t instanceof Ac||t&&"closed"in t&&br(t.remove)&&br(t.add)&&br(t.unsubscribe)}function A7(t){br(t)?t():t.unsubscribe()}var xn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Sc={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Sc.delegate;return o?.setTimeout?o.setTimeout.apply(o,Ec([t,e],wc(r))):setTimeout.apply(void 0,Ec([t,e],wc(r)))},clearTimeout:function(t){var e=Sc.delegate;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function S7(t){Sc.setTimeout(function(){var e=xn.onUnhandledError;if(e)e(t);else throw t})}function Yv(){}var I7=(function(){return Zv("C",void 0,void 0)})();function T7(t){return Zv("E",void 0,t)}function _7(t){return Zv("N",t,void 0)}function Zv(t,e,r){return{kind:t,value:e,error:r}}var rs=null;function Ic(t){if(xn.useDeprecatedSynchronousErrorHandling){var e=!rs;if(e&&(rs={errorThrown:!1,error:null}),t(),e){var r=rs,n=r.errorThrown,o=r.error;if(rs=null,n)throw o}}else t()}function B7(t){xn.useDeprecatedSynchronousErrorHandling&&rs&&(rs.errorThrown=!0,rs.error=t)}var vd=(function(t){io(e,t);function e(r){var n=t.call(this)||this;return n.isStopped=!1,r?(n.destination=r,jp(r)&&r.add(n)):n.destination=kH,n}return e.create=function(r,n,o){return new zp(r,n,o)},e.prototype.next=function(r){this.isStopped?Xv(_7(r),this):this._next(r)},e.prototype.error=function(r){this.isStopped?Xv(T7(r),this):(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped?Xv(I7,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Ac);var PH=Function.prototype.bind;function Jv(t,e){return PH.call(t,e)}var CH=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var r=this.partialObserver;if(r.next)try{r.next(e)}catch(n){Dp(n)}},t.prototype.error=function(e){var r=this.partialObserver;if(r.error)try{r.error(e)}catch(n){Dp(n)}else Dp(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(r){Dp(r)}},t})(),zp=(function(t){io(e,t);function e(r,n,o){var i=t.call(this)||this,a;if(br(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&xn.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&Jv(r.next,s),error:r.error&&Jv(r.error,s),complete:r.complete&&Jv(r.complete,s)}):a=r}return i.destination=new CH(a),i}return e})(vd);function Dp(t){xn.useDeprecatedSynchronousErrorHandling?B7(t):S7(t)}function OH(t){throw t}function Xv(t,e){var r=xn.onStoppedNotification;r&&Sc.setTimeout(function(){return r(t,e)})}var kH={closed:!0,next:Yv,error:OH,complete:Yv};var R7=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function P7(t){return t}function C7(t){return t.length===0?P7:t.length===1?t[0]:function(r){return t.reduce(function(n,o){return o(n)},r)}}var Qv=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var o=this,i=$H(e)?e:new zp(e,r,n);return Ic(function(){var a=o,s=a.operator,c=a.source;i.add(s?s.call(i,c):c?o._subscribe(i):o._trySubscribe(i))}),i},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){e.error(r)}},t.prototype.forEach=function(e,r){var n=this;return r=O7(r),new r(function(o,i){var a=new zp({next:function(s){try{e(s)}catch(c){i(c),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},t.prototype._subscribe=function(e){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(e)},t.prototype[R7]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return C7(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=O7(e),new e(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},t.create=function(e){return new t(e)},t})();function O7(t){var e;return(e=t??xn.Promise)!==null&&e!==void 0?e:Promise}function MH(t){return t&&br(t.next)&&br(t.error)&&br(t.complete)}function $H(t){return t&&t instanceof vd||MH(t)&&jp(t)}function NH(t){return br(t?.lift)}function k7(t){return function(e){if(NH(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function M7(t,e,r,n,o){return new FH(t,e,r,n,o)}var FH=(function(t){io(e,t);function e(r,n,o,i,a,s){var c=t.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(f){try{n(f)}catch(u){r.error(u)}}:t.prototype._next,c._error=i?function(f){try{i(f)}catch(u){r.error(u)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=o?function(){try{o()}catch(f){r.error(f)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},e})(vd);var $7=Lp(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var Tc=(function(t){io(e,t);function e(){var r=t.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype.lift=function(r){var n=new N7(this,this);return n.operator=r,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new $7},e.prototype.next=function(r){var n=this;Ic(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=yd(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(f){o={error:f}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},e.prototype.error=function(r){var n=this;Ic(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},e.prototype.complete=function(){var r=this;Ic(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(r){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},e.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Vv:(this.currentObservers=null,s.push(r),new Ac(function(){n.currentObservers=null,gd(s,r)}))},e.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},e.prototype.asObservable=function(){var r=new Qv;return r.source=this,r},e.create=function(r,n){return new N7(r,n)},e})(Qv);var N7=(function(t){io(e,t);function e(r,n){var o=t.call(this)||this;return o.destination=r,o.source=n,o}return e.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},e.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},e.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},e.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Vv},e})(Tc);var e2=(function(t){io(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e})(Tc);function F7(t,e,r,n,o){return function(i,a){var s=r,c=e,f=0;i.subscribe(M7(a,function(u){var d=f++;c=s?t(c,u,d):(s=!0,u),n&&a.next(c)},o&&(function(){s&&a.next(c),a.complete()})))}}function t2(t,e){return k7(F7(t,e,arguments.length>=2,!0))}var LH=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ui=new Uint32Array(64),r2=class extends nc{constructor(){super(64,32,8,!1),this.A=Li[0]|0,this.B=Li[1]|0,this.C=Li[2]|0,this.D=Li[3]|0,this.E=Li[4]|0,this.F=Li[5]|0,this.G=Li[6]|0,this.H=Li[7]|0}get(){let{A:e,B:r,C:n,D:o,E:i,F:a,G:s,H:c}=this;return[e,r,n,o,i,a,s,c]}set(e,r,n,o,i,a,s,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)Ui[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){let m=Ui[d-15],b=Ui[d-2],w=fn(m,7)^fn(m,18)^m>>>3,T=fn(b,17)^fn(b,19)^b>>>10;Ui[d]=T+Ui[d-7]+w+Ui[d-16]|0}let{A:n,B:o,C:i,D:a,E:s,F:c,G:f,H:u}=this;for(let d=0;d<64;d++){let m=fn(s,6)^fn(s,11)^fn(s,25),b=u+m+HE(s,c,f)+LH[d]+Ui[d]|0,T=(fn(n,2)^fn(n,13)^fn(n,22))+WE(n,o,i)|0;u=f,f=c,c=s,s=a+b|0,a=i,i=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,o,i,a,s,c,f,u)}roundClean(){Ui.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var L7=cp(()=>new r2);var qp=class{};var ns=class extends qp{keys;constructor(){super(),this.keys={}}async setKey(e,r,n){this.keys[`${r}:${e}`]=n.toString()}async getKey(e,r){let n=this.keys[`${r}:${e}`];return n?mr.fromString(n):null}async removeKey(e,r){delete this.keys[`${r}:${e}`]}async clear(){this.keys={}}async getNetworks(){let e=new Set;return Object.keys(this.keys).forEach(r=>{let n=r.split(":");e.add(n[1])}),Array.from(e.values())}async getAccounts(e){let r=new Array;return Object.keys(this.keys).forEach(n=>{let o=n.split(":");o[o.length-1]===e&&r.push(o.slice(0,o.length-1).join(":"))}),r}toString(){return"InMemoryKeyStore"}};var os=class t{keyStore;constructor(e){this.keyStore=e}static async fromKeyPair(e,r,n){let o=new ns;return await o.setKey(e,r,n),new t(o)}async createKey(e,r,n){let o=n===Se.SECP256K1?mr.fromRandom("secp256k1"):mr.fromRandom("ed25519");return await this.keyStore.setKey(r,e,o),o.getPublicKey()}async getPublicKey(e,r){let n=await this.keyStore.getKey(r,e);return n===null?null:n.getPublicKey()}async signMessage(e,r,n){let o=new Uint8Array(L7(e));if(!r)throw new Error("InMemorySigner requires provided account id");let i=await this.keyStore.getKey(n,r);if(i===null)throw new Error(`Key for ${r} not found in ${n}`);return i.sign(o)}toString(){return`InMemorySigner(${this.keyStore})`}};var _c=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"];var U7=(function(){function t(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return t.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(this.buffer_size*2,this.buffer_size+e);var r=new ArrayBuffer(this.buffer_size);new Uint8Array(r).set(new Uint8Array(this.buffer)),this.buffer=r,this.view=new DataView(r)}},t.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},t.prototype.store_value=function(e,r){var n=r.substring(1),o=parseInt(n)/8;this.resize_if_necessary(o);var i=r[0]==="f"?"setFloat".concat(n):r[0]==="i"?"setInt".concat(n):"setUint".concat(n);this.view[i](this.offset,e,!0),this.offset+=o},t.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},t})();var j7=(function(){function t(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return t.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Error in schema, the buffer is smaller than expected")},t.prototype.consume_value=function(e){var r=e.substring(1),n=parseInt(r)/8;this.assert_enough_buffer(n);var o=e[0]==="f"?"getFloat".concat(r):e[0]==="i"?"getInt".concat(r):"getUint".concat(r),i=this.view[o](this.offset,!0);return this.offset+=n,i},t.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var r=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,r},t})();var UH=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();function q7(t){return Array.isArray(t)||!!t&&typeof t=="object"&&"length"in t&&typeof t.length=="number"&&(t.length===0||t.length>0&&t.length-1 in t)}function is(t,e,r){if(typeof t!==e)throw new Error("Expected ".concat(e," not ").concat(typeof t,"(").concat(t,") at ").concat(r.join(".")))}function H7(t,e){var r=["number","string","bigint","boolean"].includes(typeof t),n=typeof t=="object"&&t!==null&&"toString"in t;if(!r&&!n)throw new Error("Expected bigint, number, boolean or string not ".concat(typeof t,"(").concat(t,") at ").concat(e.join(".")))}function n2(t,e,r){if(t!==e)throw new Error("Array length ".concat(t," does not match schema length ").concat(e," at ").concat(r.join(".")))}function W7(t,e){if(typeof t!="object"||t===null)throw new Error("Expected object not ".concat(typeof t,"(").concat(t,") at ").concat(e.join(".")))}var D7=_c.concat(["bool","string"]),z7=["option","enum","array","set","map","struct"],Bc=(function(t){UH(e,t);function e(r,n){var o="Invalid schema: ".concat(JSON.stringify(r)," expected ").concat(n);return t.call(this,o)||this}return e})(Error);function jo(t){if(!(typeof t=="string"&&D7.includes(t))){if(t&&typeof t=="object"){var e=Object.keys(t);if(e.length===1&&z7.includes(e[0])){var r=e[0];if(r==="option")return jo(t[r]);if(r==="enum")return jH(t[r]);if(r==="array")return DH(t[r]);if(r==="set")return jo(t[r]);if(r==="map")return zH(t[r]);if(r==="struct")return qH(t[r])}}throw new Bc(t,z7.join(", ")+" or "+D7.join(", "))}}function jH(t){if(!Array.isArray(t))throw new Bc(t,"Array");for(var e=0,r=t;e<r.length;e++){var n=r[e];if(typeof n!="object"||!("struct"in n))throw new Error('Missing "struct" key in enum schema');if(typeof n.struct!="object"||Object.keys(n.struct).length!==1)throw new Error('The "struct" in each enum must have a single key');jo({struct:n.struct})}}function DH(t){if(typeof t!="object")throw new Bc(t,"{ type, len? }");if(t.len&&typeof t.len!="number")throw new Error("Invalid schema: ".concat(t));if("type"in t)return jo(t.type);throw new Bc(t,"{ type, len? }")}function zH(t){if(typeof t=="object"&&"key"in t&&"value"in t)jo(t.key),jo(t.value);else throw new Bc(t,"{ key, value }")}function qH(t){if(typeof t!="object")throw new Bc(t,"object");for(var e in t)jo(t[e])}var G7=(function(){function t(e){this.encoded=new U7,this.fieldPath=["value"],this.checkTypes=e}return t.prototype.encode=function(e,r){return this.encode_value(e,r),this.encoded.get_used_buffer()},t.prototype.encode_value=function(e,r){if(typeof r=="string"){if(_c.includes(r))return this.encode_integer(e,r);if(r==="string")return this.encode_string(e);if(r==="bool")return this.encode_boolean(e)}if(typeof r=="object"){if("option"in r)return this.encode_option(e,r);if("enum"in r)return this.encode_enum(e,r);if("array"in r)return this.encode_array(e,r);if("set"in r)return this.encode_set(e,r);if("map"in r)return this.encode_map(e,r);if("struct"in r)return this.encode_struct(e,r)}},t.prototype.encode_integer=function(e,r){var n=parseInt(r.substring(1));n<=32||r=="f64"?(this.checkTypes&&is(e,"number",this.fieldPath),this.encoded.store_value(e,r)):(this.checkTypes&&H7(e,this.fieldPath),this.encode_bigint(BigInt(e),n))},t.prototype.encode_bigint=function(e,r){for(var n=r/8,o=new Uint8Array(n),i=0;i<n;i++)o[i]=Number(e&BigInt(255)),e=e>>BigInt(8);this.encoded.store_bytes(new Uint8Array(o))},t.prototype.encode_string=function(e){this.checkTypes&&is(e,"string",this.fieldPath);for(var r=e,n=[],o=0;o<r.length;o++){var i=r.charCodeAt(o);i<128?n.push(i):i<2048?n.push(192|i>>6,128|i&63):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|i&63):(o++,i=65536+((i&1023)<<10|r.charCodeAt(o)&1023),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}this.encoded.store_value(n.length,"u32"),this.encoded.store_bytes(new Uint8Array(n))},t.prototype.encode_boolean=function(e){this.checkTypes&&is(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},t.prototype.encode_option=function(e,r){e==null?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,r.option))},t.prototype.encode_enum=function(e,r){this.checkTypes&&W7(e,this.fieldPath);for(var n=Object.keys(e)[0],o=0;o<r.enum.length;o++){var i=r.enum[o];if(n===Object.keys(i.struct)[0])return this.encoded.store_value(o,"u8"),this.encode_struct(e,i)}throw new Error("Enum key (".concat(n,") not found in enum schema: ").concat(JSON.stringify(r)," at ").concat(this.fieldPath.join(".")))},t.prototype.encode_array=function(e,r){if(q7(e))return this.encode_arraylike(e,r);if(e instanceof ArrayBuffer)return this.encode_buffer(e,r);throw new Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},t.prototype.encode_arraylike=function(e,r){r.array.len?n2(e.length,r.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var n=0;n<e.length;n++)this.encode_value(e[n],r.array.type)},t.prototype.encode_buffer=function(e,r){r.array.len?n2(e.byteLength,r.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},t.prototype.encode_set=function(e,r){this.checkTypes&&is(e,"object",this.fieldPath);var n=e instanceof Set,o=n?Array.from(e.values()):Object.values(e);this.encoded.store_value(o.length,"u32");for(var i=0,a=o;i<a.length;i++){var s=a[i];this.encode_value(s,r.set)}},t.prototype.encode_map=function(e,r){this.checkTypes&&is(e,"object",this.fieldPath);var n=e instanceof Map,o=n?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(o.length,"u32");for(var i=0,a=o;i<a.length;i++){var s=a[i];this.encode_value(s,r.map.key),this.encode_value(n?e.get(s):e[s],r.map.value)}},t.prototype.encode_struct=function(e,r){this.checkTypes&&is(e,"object",this.fieldPath);for(var n=0,o=Object.keys(r.struct);n<o.length;n++){var i=o[n];this.fieldPath.push(i),this.encode_value(e[i],r.struct[i]),this.fieldPath.pop()}},t})();var HH=(function(){function t(e){this.buffer=new j7(e)}return t.prototype.decode=function(e){return this.decode_value(e)},t.prototype.decode_value=function(e){if(typeof e=="string"){if(_c.includes(e))return this.decode_integer(e);if(e==="string")return this.decode_string();if(e==="bool")return this.decode_boolean()}if(typeof e=="object"){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw new Error("Unsupported type: ".concat(e))},t.prototype.decode_integer=function(e){var r=parseInt(e.substring(1));return r<=32||e=="f64"?this.buffer.consume_value(e):this.decode_bigint(r,e.startsWith("i"))},t.prototype.decode_bigint=function(e,r){r===void 0&&(r=!1);var n=e/8,o=new Uint8Array(this.buffer.consume_bytes(n)),i=o.reduceRight(function(a,s){return a+s.toString(16).padStart(2,"0")},"");return r&&o[n-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},t.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),r=new Uint8Array(this.buffer.consume_bytes(e)),n=[],o=0;o<e;++o){var i=r[o];if(i<128)n.push(i);else if(i<224)n.push((i&31)<<6|r[++o]&63);else if(i<240)n.push((i&15)<<12|(r[++o]&63)<<6|r[++o]&63);else{var a=(i&7)<<18|(r[++o]&63)<<12|(r[++o]&63)<<6|r[++o]&63;n.push(a)}}return String.fromCodePoint.apply(String,n)},t.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},t.prototype.decode_option=function(e){var r=this.buffer.consume_value("u8");if(r===1)return this.decode_value(e.option);if(r!==0)throw new Error("Invalid option ".concat(r));return null},t.prototype.decode_enum=function(e){var r,n=this.buffer.consume_value("u8");if(n>e.enum.length)throw new Error("Enum option ".concat(n," is not available"));var o=e.enum[n].struct,i=Object.keys(o)[0];return r={},r[i]=this.decode_value(o[i]),r},t.prototype.decode_array=function(e){for(var r=[],n=e.array.len?e.array.len:this.decode_integer("u32"),o=0;o<n;++o)r.push(this.decode_value(e.array.type));return r},t.prototype.decode_set=function(e){for(var r=this.decode_integer("u32"),n=new Set,o=0;o<r;++o)n.add(this.decode_value(e.set));return n},t.prototype.decode_map=function(e){for(var r=this.decode_integer("u32"),n=new Map,o=0;o<r;++o){var i=this.decode_value(e.map.key),a=this.decode_value(e.map.value);n.set(i,a)}return n},t.prototype.decode_struct=function(e){var r={};for(var n in e.struct)r[n]=this.decode_value(e.struct[n]);return r},t})();function Rc(t,e,r){r===void 0&&(r=!0),r&&jo(t);var n=new G7(r);return n.encode(e,t)}var KH=cn(V7(),1);function Pe(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{f(n.next(u))}catch(d){a(d)}}function c(u){try{f(n.throw(u))}catch(d){a(d)}}function f(u){u.done?i(u.value):o(u.value).then(s,c)}f((n=n.apply(t,e||[])).next())})}var Q2=class{constructor(e){this.provider=new ts(this.urlsToProviders(e))}query(e,r){return typeof e=="string"&&r!==void 0?this.provider.query(e,r):this.provider.query(e)}viewAccessKey({accountId:e,publicKey:r}){return this.query({request_type:"view_access_key",finality:"final",account_id:e,public_key:r})}block(e){return this.provider.block(e)}sendTransaction(e){return this.provider.sendTransaction(e)}urlsToProviders(e){return e&&e.length>0?e.map(r=>new oo({url:r})):[]}},Y7=":",ds=class{constructor(e,r){this.storage=e,this.namespace=Array.isArray(r)?r.join(Y7):r}resolveKey(e){return[this.namespace,e].join(Y7)}getItem(e){return this.storage.getItem(this.resolveKey(e)).then(r=>typeof r=="string"?JSON.parse(r):null)}setItem(e,r){return this.storage.setItem(this.resolveKey(e),JSON.stringify(r))}removeItem(e){return this.storage.removeItem(this.resolveKey(e))}},Wp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xd=function(t){return t&&t.Math===Math&&t},le=xd(typeof globalThis=="object"&&globalThis)||xd(typeof window=="object"&&window)||xd(typeof self=="object"&&self)||xd(typeof Wp=="object"&&Wp)||xd(typeof Wp=="object"&&Wp)||(function(){return this})()||globalThis,Bh={},ge=function(t){try{return!!t()}catch{return!0}},GH=ge,tr=!GH(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),VH=ge,Rh=!VH(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),YH=Rh,Kp=Function.prototype.call,Nt=YH?Kp.bind(Kp):function(){return Kp.apply(Kp,arguments)},jx={},kT={}.propertyIsEnumerable,MT=Object.getOwnPropertyDescriptor,ZH=MT&&!kT.call({1:2},1);jx.f=ZH?function(e){var r=MT(this,e);return!!r&&r.enumerable}:kT;var Ph=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},$T=Rh,NT=Function.prototype,ex=NT.call,JH=$T&&NT.bind.bind(ex,ex),Ke=$T?JH:function(t){return function(){return ex.apply(t,arguments)}},FT=Ke,XH=FT({}.toString),QH=FT("".slice),Wc=function(t){return QH(XH(t),8,-1)},eW=Ke,tW=ge,rW=Wc,o2=Object,nW=eW("".split),Ch=tW(function(){return!o2("z").propertyIsEnumerable(0)})?function(t){return rW(t)==="String"?nW(t,""):o2(t)}:o2,Oh=function(t){return t==null},oW=Oh,iW=TypeError,jd=function(t){if(oW(t))throw new iW("Can't call method on "+t);return t},aW=Ch,sW=jd,Dd=function(t){return aW(sW(t))},i2=typeof document=="object"&&document.all,Ge=typeof i2>"u"&&i2!==void 0?function(t){return typeof t=="function"||t===i2}:function(t){return typeof t=="function"},cW=Ge,zt=function(t){return typeof t=="object"?t!==null:cW(t)},a2=le,fW=Ge,uW=function(t){return fW(t)?t:void 0},ps=function(t,e){return arguments.length<2?uW(a2[t]):a2[t]&&a2[t][e]},dW=Ke,Kc=dW({}.isPrototypeOf),lW=le,Z7=lW.navigator,J7=Z7&&Z7.userAgent,Gi=J7?String(J7):"",LT=le,s2=Gi,X7=LT.process,Q7=LT.Deno,eS=X7&&X7.versions||Q7&&Q7.version,tS=eS&&eS.v8,An,bh;tS&&(An=tS.split("."),bh=An[0]>0&&An[0]<4?1:+(An[0]+An[1]));!bh&&s2&&(An=s2.match(/Edge\/(\d+)/),(!An||An[1]>=74)&&(An=s2.match(/Chrome\/(\d+)/),An&&(bh=+An[1])));var zd=bh,rS=zd,pW=ge,hW=le,mW=hW.String,UT=!!Object.getOwnPropertySymbols&&!pW(function(){var t=Symbol("symbol detection");return!mW(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rS&&rS<41}),bW=UT,jT=bW&&!Symbol.sham&&typeof Symbol.iterator=="symbol",yW=ps,gW=Ge,vW=Kc,xW=jT,wW=Object,Dx=xW?function(t){return typeof t=="symbol"}:function(t){var e=yW("Symbol");return gW(e)&&vW(e.prototype,wW(t))},EW=String,Gc=function(t){try{return EW(t)}catch{return"Object"}},AW=Ge,SW=Gc,IW=TypeError,In=function(t){if(AW(t))return t;throw new IW(SW(t)+" is not a function")},TW=In,_W=Oh,zx=function(t,e){var r=t[e];return _W(r)?void 0:TW(r)},c2=Nt,f2=Ge,u2=zt,BW=TypeError,RW=function(t,e){var r,n;if(e==="string"&&f2(r=t.toString)&&!u2(n=c2(r,t))||f2(r=t.valueOf)&&!u2(n=c2(r,t))||e!=="string"&&f2(r=t.toString)&&!u2(n=c2(r,t)))return n;throw new BW("Can't convert object to primitive value")},kh={exports:{}},nS=le,PW=Object.defineProperty,qx=function(t,e){try{PW(nS,t,{value:e,configurable:!0,writable:!0})}catch{nS[t]=e}return e},CW=le,OW=qx,oS="__core-js_shared__",iS=kh.exports=CW[oS]||OW(oS,{});(iS.versions||(iS.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var aS=kh.exports,Hx=function(t,e){return aS[t]||(aS[t]=e||{})},kW=jd,MW=Object,Wo=function(t){return MW(kW(t))},$W=Ke,NW=Wo,FW=$W({}.hasOwnProperty),Or=Object.hasOwn||function(e,r){return FW(NW(e),r)},LW=Ke,UW=0,jW=Math.random(),DW=LW(1 .toString),Wx=function(t){return"Symbol("+(t===void 0?"":t)+")_"+DW(++UW+jW,36)},zW=le,qW=Hx,sS=Or,HW=Wx,WW=UT,KW=jT,Mc=zW.Symbol,d2=qW("wks"),GW=KW?Mc.for||Mc:Mc&&Mc.withoutSetter||HW,Rt=function(t){return sS(d2,t)||(d2[t]=WW&&sS(Mc,t)?Mc[t]:GW("Symbol."+t)),d2[t]},VW=Nt,cS=zt,fS=Dx,YW=zx,ZW=RW,JW=Rt,XW=TypeError,QW=JW("toPrimitive"),DT=function(t,e){if(!cS(t)||fS(t))return t;var r=YW(t,QW),n;if(r){if(e===void 0&&(e="default"),n=VW(r,t,e),!cS(n)||fS(n))return n;throw new XW("Can't convert object to primitive value")}return e===void 0&&(e="number"),ZW(t,e)},eK=DT,tK=Dx,Kx=function(t){var e=eK(t,"string");return tK(e)?e:e+""},rK=le,uS=zt,tx=rK.document,nK=uS(tx)&&uS(tx.createElement),Mh=function(t){return nK?tx.createElement(t):{}},oK=tr,iK=ge,aK=Mh,zT=!oK&&!iK(function(){return Object.defineProperty(aK("div"),"a",{get:function(){return 7}}).a!==7}),sK=tr,cK=Nt,fK=jx,uK=Ph,dK=Dd,lK=Kx,pK=Or,hK=zT,dS=Object.getOwnPropertyDescriptor;Bh.f=sK?dS:function(e,r){if(e=dK(e),r=lK(r),hK)try{return dS(e,r)}catch{}if(pK(e,r))return uK(!cK(fK.f,e,r),e[r])};var fo={},mK=tr,bK=ge,qT=mK&&bK(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),yK=zt,gK=String,vK=TypeError,Hr=function(t){if(yK(t))return t;throw new vK(gK(t)+" is not an object")},xK=tr,wK=zT,EK=qT,Gp=Hr,lS=Kx,AK=TypeError,l2=Object.defineProperty,SK=Object.getOwnPropertyDescriptor,p2="enumerable",h2="configurable",m2="writable";fo.f=xK?EK?function(e,r,n){if(Gp(e),r=lS(r),Gp(n),typeof e=="function"&&r==="prototype"&&"value"in n&&m2 in n&&!n[m2]){var o=SK(e,r);o&&o[m2]&&(e[r]=n.value,n={configurable:h2 in n?n[h2]:o[h2],enumerable:p2 in n?n[p2]:o[p2],writable:!1})}return l2(e,r,n)}:l2:function(e,r,n){if(Gp(e),r=lS(r),Gp(n),wK)try{return l2(e,r,n)}catch{}if("get"in n||"set"in n)throw new AK("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var IK=tr,TK=fo,_K=Ph,hs=IK?function(t,e,r){return TK.f(t,e,_K(1,r))}:function(t,e,r){return t[e]=r,t},Gx={exports:{}},rx=tr,BK=Or,HT=Function.prototype,RK=rx&&Object.getOwnPropertyDescriptor,Vx=BK(HT,"name"),PK=Vx&&(function(){}).name==="something",CK=Vx&&(!rx||rx&&RK(HT,"name").configurable),qd={EXISTS:Vx,PROPER:PK,CONFIGURABLE:CK},OK=Ke,kK=Ge,nx=kh.exports,MK=OK(Function.toString);kK(nx.inspectSource)||(nx.inspectSource=function(t){return MK(t)});var Yx=nx.inspectSource,$K=le,NK=Ge,pS=$K.WeakMap,FK=NK(pS)&&/native code/.test(String(pS)),LK=Hx,UK=Wx,hS=LK("keys"),Zx=function(t){return hS[t]||(hS[t]=UK(t))},Jx={},jK=FK,WT=le,DK=zt,zK=hs,b2=Or,y2=kh.exports,qK=Zx,HK=Jx,mS="Object already initialized",ox=WT.TypeError,WK=WT.WeakMap,yh,Fd,gh,KK=function(t){return gh(t)?Fd(t):yh(t,{})},GK=function(t){return function(e){var r;if(!DK(e)||(r=Fd(e)).type!==t)throw new ox("Incompatible receiver, "+t+" required");return r}};jK||y2.state?(wn=y2.state||(y2.state=new WK),wn.get=wn.get,wn.has=wn.has,wn.set=wn.set,yh=function(t,e){if(wn.has(t))throw new ox(mS);return e.facade=t,wn.set(t,e),e},Fd=function(t){return wn.get(t)||{}},gh=function(t){return wn.has(t)}):(as=qK("state"),HK[as]=!0,yh=function(t,e){if(b2(t,as))throw new ox(mS);return e.facade=t,zK(t,as,e),e},Fd=function(t){return b2(t,as)?t[as]:{}},gh=function(t){return b2(t,as)});var wn,as,ms={set:yh,get:Fd,has:gh,enforce:KK,getterFor:GK},Xx=Ke,VK=ge,YK=Ge,Vp=Or,ix=tr,ZK=qd.CONFIGURABLE,JK=Yx,KT=ms,XK=KT.enforce,QK=KT.get,bS=String,dh=Object.defineProperty,eG=Xx("".slice),tG=Xx("".replace),rG=Xx([].join),nG=ix&&!VK(function(){return dh(function(){},"length",{value:8}).length!==8}),oG=String(String).split("String"),iG=Gx.exports=function(t,e,r){eG(bS(e),0,7)==="Symbol("&&(e="["+tG(bS(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Vp(t,"name")||ZK&&t.name!==e)&&(ix?dh(t,"name",{value:e,configurable:!0}):t.name=e),nG&&r&&Vp(r,"arity")&&t.length!==r.arity&&dh(t,"length",{value:r.arity});try{r&&Vp(r,"constructor")&&r.constructor?ix&&dh(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=XK(t);return Vp(n,"source")||(n.source=rG(oG,typeof e=="string"?e:"")),t};Function.prototype.toString=iG(function(){return YK(this)&&QK(this).source||JK(this)},"toString");var aG=Ge,sG=fo,cG=Gx.exports,fG=qx,Vi=function(t,e,r,n){n||(n={});var o=n.enumerable,i=n.name!==void 0?n.name:e;if(aG(r)&&cG(r,i,n),n.global)o?t[e]=r:fG(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch{}o?t[e]=r:sG.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Qx={},uG=Math.ceil,dG=Math.floor,lG=Math.trunc||function(e){var r=+e;return(r>0?dG:uG)(r)},pG=lG,Hd=function(t){var e=+t;return e!==e||e===0?0:pG(e)},hG=Hd,mG=Math.max,bG=Math.min,e6=function(t,e){var r=hG(t);return r<0?mG(r+e,0):bG(r,e)},yG=Hd,gG=Math.min,Wd=function(t){var e=yG(t);return e>0?gG(e,9007199254740991):0},vG=Wd,Ko=function(t){return vG(t.length)},xG=Dd,wG=e6,EG=Ko,yS=function(t){return function(e,r,n){var o=xG(e),i=EG(o);if(i===0)return!t&&-1;var a=wG(n,i),s;if(t&&r!==r){for(;i>a;)if(s=o[a++],s!==s)return!0}else for(;i>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},GT={includes:yS(!0),indexOf:yS(!1)},AG=Ke,g2=Or,SG=Dd,IG=GT.indexOf,TG=Jx,gS=AG([].push),VT=function(t,e){var r=SG(t),n=0,o=[],i;for(i in r)!g2(TG,i)&&g2(r,i)&&gS(o,i);for(;e.length>n;)g2(r,i=e[n++])&&(~IG(o,i)||gS(o,i));return o},t6=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_G=VT,BG=t6,RG=BG.concat("length","prototype");Qx.f=Object.getOwnPropertyNames||function(e){return _G(e,RG)};var r6={};r6.f=Object.getOwnPropertySymbols;var PG=ps,CG=Ke,OG=Qx,kG=r6,MG=Hr,$G=CG([].concat),NG=PG("Reflect","ownKeys")||function(e){var r=OG.f(MG(e)),n=kG.f;return n?$G(r,n(e)):r},vS=Or,FG=NG,LG=Bh,UG=fo,YT=function(t,e,r){for(var n=FG(e),o=UG.f,i=LG.f,a=0;a<n.length;a++){var s=n[a];!vS(t,s)&&!(r&&vS(r,s))&&o(t,s,i(e,s))}},jG=ge,DG=Ge,zG=/#|\.prototype\./,Kd=function(t,e){var r=HG[qG(t)];return r===KG?!0:r===WG?!1:DG(e)?jG(e):!!e},qG=Kd.normalize=function(t){return String(t).replace(zG,".").toLowerCase()},HG=Kd.data={},WG=Kd.NATIVE="N",KG=Kd.POLYFILL="P",ZT=Kd,Yp=le,GG=Bh.f,VG=hs,YG=Vi,ZG=qx,JG=YT,XG=ZT,Ft=function(t,e){var r=t.target,n=t.global,o=t.stat,i,a,s,c,f,u;if(n?a=Yp:o?a=Yp[r]||ZG(r,{}):a=Yp[r]&&Yp[r].prototype,a)for(s in e){if(f=e[s],t.dontCallGetSet?(u=GG(a,s),c=u&&u.value):c=a[s],i=XG(n?s:r+(o?".":"#")+s,t.forced),!i&&c!==void 0){if(typeof f==typeof c)continue;JG(f,c)}(t.sham||c&&c.sham)&&VG(f,"sham",!0),YG(a,s,f,t)}},wd=le,QG=Gi,eV=Wc,Zp=function(t){return QG.slice(0,t.length)===t},JT=(function(){return Zp("Bun/")?"BUN":Zp("Cloudflare-Workers")?"CLOUDFLARE":Zp("Deno/")?"DENO":Zp("Node.js/")?"NODE":wd.Bun&&typeof Bun.version=="string"?"BUN":wd.Deno&&typeof Deno.version=="object"?"DENO":eV(wd.process)==="process"?"NODE":wd.window&&wd.document?"BROWSER":"REST"})(),tV=JT,$h=tV==="NODE",rV=Ke,nV=In,oV=function(t,e,r){try{return rV(nV(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},iV=zt,aV=function(t){return iV(t)||t===null},sV=aV,cV=String,fV=TypeError,uV=function(t){if(sV(t))return t;throw new fV("Can't set "+cV(t)+" as a prototype")},dV=oV,lV=zt,pV=jd,hV=uV,Vc=Object.setPrototypeOf||("__proto__"in{}?(function(){var t=!1,e={},r;try{r=dV(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(o,i){return pV(o),hV(i),lV(o)&&(t?r(o,i):o.__proto__=i),o}})():void 0),mV=fo.f,bV=Or,yV=Rt,xS=yV("toStringTag"),Gd=function(t,e,r){t&&!r&&(t=t.prototype),t&&!bV(t,xS)&&mV(t,xS,{configurable:!0,value:e})},wS=Gx.exports,gV=fo,Nh=function(t,e,r){return r.get&&wS(r.get,e,{getter:!0}),r.set&&wS(r.set,e,{setter:!0}),gV.f(t,e,r)},vV=ps,xV=Nh,wV=Rt,EV=tr,ES=wV("species"),n6=function(t){var e=vV(t);EV&&e&&!e[ES]&&xV(e,ES,{configurable:!0,get:function(){return this}})},AV=Kc,SV=TypeError,o6=function(t,e){if(AV(e,t))return t;throw new SV("Incorrect invocation")},IV=Rt,TV=IV("toStringTag"),XT={};XT[TV]="z";var _V=String(XT)==="[object z]",BV=_V,RV=Ge,lh=Wc,PV=Rt,CV=PV("toStringTag"),OV=Object,kV=lh((function(){return arguments})())==="Arguments",MV=function(t,e){try{return t[e]}catch{}},bs=BV?lh:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=MV(e=OV(t),CV))=="string"?r:kV?lh(e):(n=lh(e))==="Object"&&RV(e.callee)?"Arguments":n},$V=Ke,NV=ge,QT=Ge,FV=bs,LV=ps,UV=Yx,e_=function(){},t_=LV("Reflect","construct"),i6=/^\s*(?:class|function)\b/,jV=$V(i6.exec),DV=!i6.test(e_),Ed=function(e){if(!QT(e))return!1;try{return t_(e_,[],e),!0}catch{return!1}},r_=function(e){if(!QT(e))return!1;switch(FV(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return DV||!!jV(i6,UV(e))}catch{return!0}};r_.sham=!0;var n_=!t_||NV(function(){var t;return Ed(Ed.call)||!Ed(Object)||!Ed(function(){t=!0})||t})?r_:Ed,zV=n_,qV=Gc,HV=TypeError,o_=function(t){if(zV(t))return t;throw new HV(qV(t)+" is not a constructor")},AS=Hr,WV=o_,KV=Oh,GV=Rt,VV=GV("species"),YV=function(t,e){var r=AS(t).constructor,n;return r===void 0||KV(n=AS(r)[VV])?e:WV(n)},ZV=Rh,i_=Function.prototype,SS=i_.apply,IS=i_.call,a_=typeof Reflect=="object"&&Reflect.apply||(ZV?IS.bind(SS):function(){return IS.apply(SS,arguments)}),JV=Wc,XV=Ke,a6=function(t){if(JV(t)==="Function")return XV(t)},TS=a6,QV=In,eY=Rh,tY=TS(TS.bind),Vd=function(t,e){return QV(t),e===void 0?t:eY?tY(t,e):function(){return t.apply(e,arguments)}},rY=ps,s_=rY("document","documentElement"),nY=Ke,Fh=nY([].slice),oY=TypeError,iY=function(t,e){if(t<e)throw new oY("Not enough arguments");return t},aY=Gi,c_=/(?:ipad|iphone|ipod).*applewebkit/i.test(aY),Cr=le,sY=a_,cY=Vd,_S=Ge,fY=Or,f_=ge,BS=s_,uY=Fh,RS=Mh,dY=iY,lY=c_,pY=$h,ax=Cr.setImmediate,sx=Cr.clearImmediate,hY=Cr.process,v2=Cr.Dispatch,mY=Cr.Function,PS=Cr.MessageChannel,bY=Cr.String,x2=0,kd={},CS="onreadystatechange",Ld,ss,w2,E2;f_(function(){Ld=Cr.location});var s6=function(t){if(fY(kd,t)){var e=kd[t];delete kd[t],e()}},A2=function(t){return function(){s6(t)}},OS=function(t){s6(t.data)},kS=function(t){Cr.postMessage(bY(t),Ld.protocol+"//"+Ld.host)};(!ax||!sx)&&(ax=function(e){dY(arguments.length,1);var r=_S(e)?e:mY(e),n=uY(arguments,1);return kd[++x2]=function(){sY(r,void 0,n)},ss(x2),x2},sx=function(e){delete kd[e]},pY?ss=function(t){hY.nextTick(A2(t))}:v2&&v2.now?ss=function(t){v2.now(A2(t))}:PS&&!lY?(w2=new PS,E2=w2.port2,w2.port1.onmessage=OS,ss=cY(E2.postMessage,E2)):Cr.addEventListener&&_S(Cr.postMessage)&&!Cr.importScripts&&Ld&&Ld.protocol!=="file:"&&!f_(kS)?(ss=kS,Cr.addEventListener("message",OS,!1)):CS in RS("script")?ss=function(t){BS.appendChild(RS("script"))[CS]=function(){BS.removeChild(this),s6(t)}}:ss=function(t){setTimeout(A2(t),0)});var u_={set:ax,clear:sx},MS=le,yY=tr,gY=Object.getOwnPropertyDescriptor,vY=function(t){if(!yY)return MS[t];var e=gY(MS,t);return e&&e.value},d_=function(){this.head=null,this.tail=null};d_.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t){var e=this.head=t.next;return e===null&&(this.tail=null),t.item}}};var l_=d_,xY=Gi,wY=/ipad|iphone|ipod/i.test(xY)&&typeof Pebble<"u",EY=Gi,AY=/web0s(?!.*chrome)/i.test(EY),zc=le,SY=vY,$S=Vd,S2=u_.set,IY=l_,TY=c_,_Y=wY,BY=AY,I2=$h,NS=zc.MutationObserver||zc.WebKitMutationObserver,FS=zc.document,LS=zc.process,Jp=zc.Promise,cx=SY("queueMicrotask"),Pc,T2,_2,Xp,US;cx||(Ad=new IY,Sd=function(){var t,e;for(I2&&(t=LS.domain)&&t.exit();e=Ad.get();)try{e()}catch(r){throw Ad.head&&Pc(),r}t&&t.enter()},!TY&&!I2&&!BY&&NS&&FS?(T2=!0,_2=FS.createTextNode(""),new NS(Sd).observe(_2,{characterData:!0}),Pc=function(){_2.data=T2=!T2}):!_Y&&Jp&&Jp.resolve?(Xp=Jp.resolve(void 0),Xp.constructor=Jp,US=$S(Xp.then,Xp),Pc=function(){US(Sd)}):I2?Pc=function(){LS.nextTick(Sd)}:(S2=$S(S2,zc),Pc=function(){S2(Sd)}),cx=function(t){Ad.head||Pc(),Ad.add(t)});var Ad,Sd,RY=cx,PY=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}},c6=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}},CY=le,Lh=CY.Promise,OY=le,Md=Lh,kY=Ge,MY=ZT,$Y=Yx,NY=Rt,jS=JT,B2=zd;Md&&Md.prototype;var FY=NY("species"),fx=!1,p_=kY(OY.PromiseRejectionEvent),LY=MY("Promise",function(){var t=$Y(Md),e=t!==String(Md);if(!e&&B2===66)return!0;if(!B2||B2<51||!/native code/.test(t)){var r=new Md(function(i){i(1)}),n=function(i){i(function(){},function(){})},o=r.constructor={};if(o[FY]=n,fx=r.then(function(){})instanceof n,!fx)return!0}return!e&&(jS==="BROWSER"||jS==="DENO")&&!p_}),Yd={CONSTRUCTOR:LY,REJECTION_EVENT:p_,SUBCLASSING:fx},Yc={},DS=In,UY=TypeError,jY=function(t){var e,r;this.promise=new t(function(n,o){if(e!==void 0||r!==void 0)throw new UY("Bad Promise constructor");e=n,r=o}),this.resolve=DS(e),this.reject=DS(r)};Yc.f=function(t){return new jY(t)};var DY=Ft,vh=$h,Wi=le,qc=Nt,zS=Vi,qS=Vc,zY=Gd,qY=n6,HY=In,ph=Ge,WY=zt,KY=o6,GY=YV,h_=u_.set,f6=RY,VY=PY,YY=c6,ZY=l_,m_=ms,xh=Lh,u6=Yd,b_=Yc,Uh="Promise",y_=u6.CONSTRUCTOR,JY=u6.REJECTION_EVENT,XY=u6.SUBCLASSING,R2=m_.getterFor(Uh),QY=m_.set,kc=xh&&xh.prototype,us=xh,Qp=kc,g_=Wi.TypeError,ux=Wi.document,d6=Wi.process,dx=b_.f,eZ=dx,tZ=!!(ux&&ux.createEvent&&Wi.dispatchEvent),v_="unhandledrejection",rZ="rejectionhandled",HS=0,x_=1,nZ=2,l6=1,w_=2,eh,WS,oZ,KS,E_=function(t){var e;return WY(t)&&ph(e=t.then)?e:!1},A_=function(t,e){var r=e.value,n=e.state===x_,o=n?t.ok:t.fail,i=t.resolve,a=t.reject,s=t.domain,c,f,u;try{o?(n||(e.rejection===w_&&aZ(e),e.rejection=l6),o===!0?c=r:(s&&s.enter(),c=o(r),s&&(s.exit(),u=!0)),c===t.promise?a(new g_("Promise-chain cycle")):(f=E_(c))?qc(f,c,i,a):i(c)):a(r)}catch(d){s&&!u&&s.exit(),a(d)}},S_=function(t,e){t.notified||(t.notified=!0,f6(function(){for(var r=t.reactions,n;n=r.get();)A_(n,t);t.notified=!1,e&&!t.rejection&&iZ(t)}))},I_=function(t,e,r){var n,o;tZ?(n=ux.createEvent("Event"),n.promise=e,n.reason=r,n.initEvent(t,!1,!0),Wi.dispatchEvent(n)):n={promise:e,reason:r},!JY&&(o=Wi["on"+t])?o(n):t===v_&&VY("Unhandled promise rejection",r)},iZ=function(t){qc(h_,Wi,function(){var e=t.facade,r=t.value,n=GS(t),o;if(n&&(o=YY(function(){vh?d6.emit("unhandledRejection",r,e):I_(v_,e,r)}),t.rejection=vh||GS(t)?w_:l6,o.error))throw o.value})},GS=function(t){return t.rejection!==l6&&!t.parent},aZ=function(t){qc(h_,Wi,function(){var e=t.facade;vh?d6.emit("rejectionHandled",e):I_(rZ,e,t.value)})},$c=function(t,e,r){return function(n){t(e,n,r)}},Fc=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=nZ,S_(t,!0))},lx=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new g_("Promise can't be resolved itself");var n=E_(e);n?f6(function(){var o={done:!1};try{qc(n,e,$c(lx,o,t),$c(Fc,o,t))}catch(i){Fc(o,i,t)}}):(t.value=e,t.state=x_,S_(t,!1))}catch(o){Fc({done:!1},o,t)}}};if(y_&&(us=function(e){KY(this,Qp),HY(e),qc(eh,this);var r=R2(this);try{e($c(lx,r),$c(Fc,r))}catch(n){Fc(r,n)}},Qp=us.prototype,eh=function(e){QY(this,{type:Uh,done:!1,notified:!1,parent:!1,reactions:new ZY,rejection:!1,state:HS,value:null})},eh.prototype=zS(Qp,"then",function(e,r){var n=R2(this),o=dx(GY(this,us));return n.parent=!0,o.ok=ph(e)?e:!0,o.fail=ph(r)&&r,o.domain=vh?d6.domain:void 0,n.state===HS?n.reactions.add(o):f6(function(){A_(o,n)}),o.promise}),WS=function(){var t=new eh,e=R2(t);this.promise=t,this.resolve=$c(lx,e),this.reject=$c(Fc,e)},b_.f=dx=function(t){return t===us||t===oZ?new WS(t):eZ(t)},ph(xh)&&kc!==Object.prototype)){KS=kc.then,XY||zS(kc,"then",function(e,r){var n=this;return new us(function(o,i){qc(KS,n,o,i)}).then(e,r)},{unsafe:!0});try{delete kc.constructor}catch{}qS&&qS(kc,Qp)}DY({global:!0,constructor:!0,wrap:!0,forced:y_},{Promise:us});zY(us,Uh,!1);qY(Uh);var Zd={},sZ=Rt,cZ=Zd,fZ=sZ("iterator"),uZ=Array.prototype,T_=function(t){return t!==void 0&&(cZ.Array===t||uZ[fZ]===t)},dZ=bs,VS=zx,lZ=Oh,pZ=Zd,hZ=Rt,mZ=hZ("iterator"),p6=function(t){if(!lZ(t))return VS(t,mZ)||VS(t,"@@iterator")||pZ[dZ(t)]},bZ=Nt,yZ=In,gZ=Hr,vZ=Gc,xZ=p6,wZ=TypeError,__=function(t,e){var r=arguments.length<2?xZ(t):e;if(yZ(r))return gZ(bZ(r,t));throw new wZ(vZ(t)+" is not iterable")},EZ=Nt,YS=Hr,AZ=zx,SZ=function(t,e,r){var n,o;YS(t);try{if(n=AZ(t,"return"),!n){if(e==="throw")throw r;return r}n=EZ(n,t)}catch(i){o=!0,n=i}if(e==="throw")throw r;if(o)throw n;return YS(n),r},IZ=Vd,TZ=Nt,_Z=Hr,BZ=Gc,RZ=T_,PZ=Ko,ZS=Kc,CZ=__,OZ=p6,JS=SZ,kZ=TypeError,hh=function(t,e){this.stopped=t,this.result=e},XS=hh.prototype,B_=function(t,e,r){var n=r&&r.that,o=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),a=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),c=IZ(e,n),f,u,d,m,b,w,T,P=function(k){return f&&JS(f,"normal",k),new hh(!0,k)},R=function(k){return o?(_Z(k),s?c(k[0],k[1],P):c(k[0],k[1])):s?c(k,P):c(k)};if(i)f=t.iterator;else if(a)f=t;else{if(u=OZ(t),!u)throw new kZ(BZ(t)+" is not iterable");if(RZ(u)){for(d=0,m=PZ(t);m>d;d++)if(b=R(t[d]),b&&ZS(XS,b))return b;return new hh(!1)}f=CZ(t,u)}for(w=i?t.next:f.next;!(T=TZ(w,f)).done;){try{b=R(T.value)}catch(k){JS(f,"throw",k)}if(typeof b=="object"&&b&&ZS(XS,b))return b}return new hh(!1)},MZ=Rt,R_=MZ("iterator"),P_=!1;try{QS=0,P2={next:function(){return{done:!!QS++}},return:function(){P_=!0}},P2[R_]=function(){return this},Array.from(P2,function(){throw 2})}catch{}var QS,P2,C_=function(t,e){try{if(!e&&!P_)return!1}catch{return!1}var r=!1;try{var n={};n[R_]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},$Z=Lh,NZ=C_,FZ=Yd.CONSTRUCTOR,O_=FZ||!NZ(function(t){$Z.all(t).then(void 0,function(){})}),LZ=Ft,UZ=Nt,jZ=In,DZ=Yc,zZ=c6,qZ=B_,HZ=O_;LZ({target:"Promise",stat:!0,forced:HZ},{all:function(e){var r=this,n=DZ.f(r),o=n.resolve,i=n.reject,a=zZ(function(){var s=jZ(r.resolve),c=[],f=0,u=1;qZ(e,function(d){var m=f++,b=!1;u++,UZ(s,r,d).then(function(w){b||(b=!0,c[m]=w,--u||o(c))},i)}),--u||o(c)});return a.error&&i(a.value),n.promise}});var WZ=Ft,KZ=Yd.CONSTRUCTOR,px=Lh,GZ=ps,VZ=Ge,YZ=Vi,eI=px&&px.prototype;WZ({target:"Promise",proto:!0,forced:KZ,real:!0},{catch:function(t){return this.then(void 0,t)}});VZ(px)&&(C2=GZ("Promise").prototype.catch,eI.catch!==C2&&YZ(eI,"catch",C2,{unsafe:!0}));var C2,ZZ=Ft,JZ=Nt,XZ=In,QZ=Yc,eJ=c6,tJ=B_,rJ=O_;ZZ({target:"Promise",stat:!0,forced:rJ},{race:function(e){var r=this,n=QZ.f(r),o=n.reject,i=eJ(function(){var a=XZ(r.resolve);tJ(e,function(s){JZ(a,r,s).then(n.resolve,o)})});return i.error&&o(i.value),n.promise}});var nJ=Ft,oJ=Yc,iJ=Yd.CONSTRUCTOR;nJ({target:"Promise",stat:!0,forced:iJ},{reject:function(e){var r=oJ.f(this),n=r.reject;return n(e),r.promise}});var aJ=Hr,sJ=zt,cJ=Yc,fJ=function(t,e){if(aJ(t),sJ(e)&&e.constructor===t)return e;var r=cJ.f(t),n=r.resolve;return n(e),r.promise},uJ=Ft,dJ=ps,lJ=Yd.CONSTRUCTOR,pJ=fJ;dJ("Promise");uJ({target:"Promise",stat:!0,forced:lJ},{resolve:function(e){return pJ(this,e)}});var hx=class{getItem(e){return typeof localStorage>"u"?Promise.resolve(null):new Promise(r=>{let n=localStorage.getItem(e);r(n)})}setItem(e,r){return typeof localStorage>"u"?Promise.resolve():new Promise(n=>{localStorage.setItem(e,r),n()})}removeItem(e){return typeof localStorage>"u"?Promise.resolve():new Promise(r=>{localStorage.removeItem(e),r()})}},k_={},hJ=VT,mJ=t6,M_=Object.keys||function(e){return hJ(e,mJ)},bJ=tr,yJ=qT,gJ=fo,vJ=Hr,xJ=Dd,wJ=M_;k_.f=bJ&&!yJ?Object.defineProperties:function(e,r){vJ(e);for(var n=xJ(r),o=wJ(r),i=o.length,a=0,s;i>a;)gJ.f(e,s=o[a++],n[s]);return e};var EJ=Hr,AJ=k_,tI=t6,SJ=Jx,IJ=s_,TJ=Mh,_J=Zx,rI=">",nI="<",mx="prototype",bx="script",$_=_J("IE_PROTO"),O2=function(){},N_=function(t){return nI+bx+rI+t+nI+"/"+bx+rI},oI=function(t){t.write(N_("")),t.close();var e=t.parentWindow.Object;return t=null,e},BJ=function(){var t=TJ("iframe"),e="java"+bx+":",r;return t.style.display="none",IJ.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(N_("document.F=Object")),r.close(),r.F},th,mh=function(){try{th=new ActiveXObject("htmlfile")}catch{}mh=typeof document<"u"?document.domain&&th?oI(th):BJ():oI(th);for(var t=tI.length;t--;)delete mh[mx][tI[t]];return mh()};SJ[$_]=!0;var jh=Object.create||function(e,r){var n;return e!==null?(O2[mx]=EJ(e),n=new O2,O2[mx]=null,n[$_]=e):n=mh(),r===void 0?n:AJ.f(n,r)},RJ=Rt,PJ=jh,CJ=fo.f,yx=RJ("unscopables"),gx=Array.prototype;gx[yx]===void 0&&CJ(gx,yx,{configurable:!0,value:PJ(null)});var F_=function(t){gx[yx][t]=!0},OJ=ge,kJ=!OJ(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),MJ=Or,$J=Ge,NJ=Wo,FJ=Zx,LJ=kJ,iI=FJ("IE_PROTO"),vx=Object,UJ=vx.prototype,Dh=LJ?vx.getPrototypeOf:function(t){var e=NJ(t);if(MJ(e,iI))return e[iI];var r=e.constructor;return $J(r)&&e instanceof r?r.prototype:e instanceof vx?UJ:null},jJ=ge,DJ=Ge,zJ=zt,aI=Dh,qJ=Vi,HJ=Rt,xx=HJ("iterator"),L_=!1,ls,k2,M2;[].keys&&(M2=[].keys(),"next"in M2?(k2=aI(aI(M2)),k2!==Object.prototype&&(ls=k2)):L_=!0);var WJ=!zJ(ls)||jJ(function(){var t={};return ls[xx].call(t)!==t});WJ&&(ls={});DJ(ls[xx])||qJ(ls,xx,function(){return this});var U_={IteratorPrototype:ls,BUGGY_SAFARI_ITERATORS:L_},KJ=U_.IteratorPrototype,GJ=jh,VJ=Ph,YJ=Gd,ZJ=Zd,JJ=function(){return this},XJ=function(t,e,r,n){var o=e+" Iterator";return t.prototype=GJ(KJ,{next:VJ(+!n,r)}),YJ(t,o,!1),ZJ[o]=JJ,t},QJ=Ft,eX=Nt,j_=qd,tX=Ge,rX=XJ,sI=Dh,cI=Vc,nX=Gd,oX=hs,$2=Vi,iX=Rt,aX=Zd,D_=U_,sX=j_.PROPER,cX=j_.CONFIGURABLE,fI=D_.IteratorPrototype,rh=D_.BUGGY_SAFARI_ITERATORS,Id=iX("iterator"),uI="keys",Td="values",dI="entries",fX=function(){return this},uX=function(t,e,r,n,o,i,a){rX(r,e,n);var s=function(R){if(R===o&&m)return m;if(!rh&&R&&R in u)return u[R];switch(R){case uI:return function(){return new r(this,R)};case Td:return function(){return new r(this,R)};case dI:return function(){return new r(this,R)}}return function(){return new r(this)}},c=e+" Iterator",f=!1,u=t.prototype,d=u[Id]||u["@@iterator"]||o&&u[o],m=!rh&&d||s(o),b=e==="Array"&&u.entries||d,w,T,P;if(b&&(w=sI(b.call(new t)),w!==Object.prototype&&w.next&&(sI(w)!==fI&&(cI?cI(w,fI):tX(w[Id])||$2(w,Id,fX)),nX(w,c,!0))),sX&&o===Td&&d&&d.name!==Td&&(cX?oX(u,"name",Td):(f=!0,m=function(){return eX(d,this)})),o)if(T={values:s(Td),keys:i?m:s(uI),entries:s(dI)},a)for(P in T)(rh||f||!(P in u))&&$2(u,P,T[P]);else QJ({target:e,proto:!0,forced:rh||f},T);return u[Id]!==m&&$2(u,Id,m,{name:o}),aX[e]=m,T},dX=function(t,e){return{value:t,done:e}},lX=Dd,h6=F_,lI=Zd,z_=ms,pX=fo.f,hX=uX,nh=dX,mX=tr,q_="Array Iterator",bX=z_.set,yX=z_.getterFor(q_),gX=hX(Array,"Array",function(t,e){bX(this,{type:q_,target:lX(t),index:0,kind:e})},function(){var t=yX(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,nh(void 0,!0);switch(t.kind){case"keys":return nh(r,!1);case"values":return nh(e[r],!1)}return nh([r,e[r]],!1)},"values"),pI=lI.Arguments=lI.Array;h6("keys");h6("values");h6("entries");if(mX&&pI.name!=="values")try{pX(pI,"name",{value:"values"})}catch{}var vX={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},xX=Mh,N2=xX("span").classList,hI=N2&&N2.constructor&&N2.constructor.prototype,wX=hI===Object.prototype?void 0:hI,mI=le,H_=vX,EX=wX,Cd=gX,bI=hs,AX=Gd,SX=Rt,F2=SX("iterator"),L2=Cd.values,W_=function(t,e){if(t){if(t[F2]!==L2)try{bI(t,F2,L2)}catch{t[F2]=L2}if(AX(t,e,!0),H_[e]){for(var r in Cd)if(t[r]!==Cd[r])try{bI(t,r,Cd[r])}catch{t[r]=Cd[r]}}}};for(oh in H_)W_(mI[oh]&&mI[oh].prototype,oh);var oh;W_(EX,"DOMTokenList");var Hc=class t{constructor(e){this.namespace=e}emit(e,...r){if(t.debug){if(this.namespace&&e!=="error"){console[e](this.namespace,...r);return}console[e](...r)}}log(...e){this.emit("log",...e)}info(...e){this.emit("info",...e)}warn(...e){this.emit("warn",...e)}error(...e){this.emit("error",...e)}};Hc.debug=!1;var ao=new Hc,IX=Ft,TX=GT.includes,_X=ge,BX=F_,RX=_X(function(){return!Array(1).includes()});IX({target:"Array",proto:!0,forced:RX},{includes:function(e){return TX(this,e,arguments.length>1?arguments[1]:void 0)}});BX("includes");var yI=tr,PX=Ke,CX=Nt,OX=ge,U2=M_,kX=r6,MX=jx,$X=Wo,NX=Ch,Cc=Object.assign,gI=Object.defineProperty,FX=PX([].concat),LX=!Cc||OX(function(){if(yI&&Cc({b:1},Cc(gI({},"a",{enumerable:!0,get:function(){gI(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(o){e[o]=o}),Cc({},t)[r]!==7||U2(Cc({},e)).join("")!==n})?function(e,r){for(var n=$X(e),o=arguments.length,i=1,a=kX.f,s=MX.f;o>i;)for(var c=NX(arguments[i++]),f=a?FX(U2(c),a(c)):U2(c),u=f.length,d=0,m;u>d;)m=f[d++],(!yI||CX(s,c,m))&&(n[m]=c[m]);return n}:Cc,UX=Ft,vI=LX;UX({target:"Object",stat:!0,arity:2,forced:Object.assign!==vI},{assign:vI});var jX=zt,DX=Wc,zX=Rt,qX=zX("match"),HX=function(t){var e;return jX(t)&&((e=t[qX])!==void 0?!!e:DX(t)==="RegExp")},WX=HX,KX=TypeError,GX=function(t){if(WX(t))throw new KX("The method doesn't accept regular expressions");return t},VX=bs,YX=String,Jd=function(t){if(VX(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return YX(t)},ZX=Rt,JX=ZX("match"),XX=function(t){var e=/./;try{"/./"[t](e)}catch{try{return e[JX]=!1,"/./"[t](e)}catch{}}return!1},QX=Ft,eQ=Ke,tQ=GX,rQ=jd,xI=Jd,nQ=XX,oQ=eQ("".indexOf);QX({target:"String",proto:!0,forced:!nQ("includes")},{includes:function(e){return!!~oQ(xI(rQ(this)),xI(tQ(e)),arguments.length>1?arguments[1]:void 0)}});var K_=`
47
+ \v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`,iQ=Ke,aQ=jd,sQ=Jd,wx=K_,wI=iQ("".replace),cQ=RegExp("^["+wx+"]+"),fQ=RegExp("(^|[^"+wx+"])["+wx+"]+$"),j2=function(t){return function(e){var r=sQ(aQ(e));return t&1&&(r=wI(r,cQ,"")),t&2&&(r=wI(r,fQ,"$1")),r}},uQ={start:j2(1),end:j2(2),trim:j2(3)},dQ=qd.PROPER,lQ=ge,EI=K_,AI="\u200B\x85\u180E",pQ=function(t){return lQ(function(){return!!EI[t]()||AI[t]()!==AI||dQ&&EI[t].name!==t})},hQ=Ft,mQ=uQ.trim,bQ=pQ;hQ({target:"String",proto:!0,forced:bQ("trim")},{trim:function(){return mQ(this)}});var wh=class{constructor(){this.emitter=new OT.EventEmitter}on(e,r){return this.emitter.on(e,r),{remove:()=>this.emitter.off(e,r)}}off(e,r){this.emitter.off(e,r)}emit(e,r){this.emitter.emit(e,r)}},Od="near-wallet-selector",$d="recentlySignedInWallets",Ex="rememberRecentWallets",zo={ENABLED:"enabled",DISABLED:"disabled"},SI="contract",D2="contract:pending",II="selectedWalletId",z2="selectedWalletId:pending",Ax=class{constructor({factories:e,storage:r,options:n,store:o,emitter:i,provider:a}){this.factories=e,this.storage=r,this.options=n,this.store=o,this.emitter=i,this.provider=a,this.modules=[],this.instances={}}validateWallet(e){return Pe(this,void 0,void 0,function*(){let r=[],n=yield this.getWallet(e);return n&&(r=yield n.getAccounts().catch(o=>(ao.log(`Failed to validate ${n.id} during setup`),ao.error(o),[]))),r})}resolveStorageState(){return Pe(this,void 0,void 0,function*(){let e=new ds(this.storage,Od),r=yield e.getItem(z2),n=yield e.getItem(D2),o=yield e.getItem(Ex);if(r&&n){let f=yield this.validateWallet(r);if(yield e.removeItem(z2),yield e.removeItem(D2),f.length){let{selectedWalletId:u}=this.store.getState(),d=yield this.getWallet(u);d&&r!==u&&(yield d.signOut().catch(b=>{ao.log("Failed to sign out existing wallet"),ao.error(b)}));let m=[];return o===zo.ENABLED&&(m=yield this.setWalletAsRecentlySignedIn(r)),{accounts:f,contract:n,selectedWalletId:r,recentlySignedInWallets:m,rememberRecentWallets:o||zo.ENABLED}}}let{contract:i,selectedWalletId:a}=this.store.getState(),s=yield this.validateWallet(a),c=yield e.getItem($d);return s.length?{accounts:s,contract:i,selectedWalletId:a,recentlySignedInWallets:c||[],rememberRecentWallets:o||zo.ENABLED}:{accounts:[],contract:null,selectedWalletId:null,recentlySignedInWallets:c||[],rememberRecentWallets:o||zo.ENABLED}})}setWalletAsRecentlySignedIn(e){return Pe(this,void 0,void 0,function*(){let r=new ds(this.storage,Od),n=yield r.getItem($d);return n||(n=[]),n.includes(e)||(n.unshift(e),n=n.slice(0,5),yield r.setItem($d,n)),n})}signOutWallet(e){return Pe(this,void 0,void 0,function*(){let r=yield this.getWallet(e);yield r.signOut().catch(n=>{ao.log(`Failed to sign out ${r.id}`),ao.error(n),this.onWalletSignedOut(r.id)})})}onWalletSignedIn(e,{accounts:r,contractId:n,methodNames:o}){return Pe(this,void 0,void 0,function*(){n=n||"";let{selectedWalletId:i,rememberRecentWallets:a}=this.store.getState(),s=new ds(this.storage,Od),c={contractId:n,methodNames:o};if(!r.length){this.getModule(e).type==="browser"&&(yield s.setItem(z2,e),yield s.setItem(D2,c));return}i&&i!==e&&(yield this.signOutWallet(i));let f=[];a===zo.ENABLED&&(f=yield this.setWalletAsRecentlySignedIn(e)),this.store.dispatch({type:"WALLET_CONNECTED",payload:{walletId:e,contract:c,accounts:r,recentlySignedInWallets:f,rememberRecentWallets:a}}),this.emitter.emit("signedIn",{walletId:e,contractId:n,methodNames:o,accounts:r})})}onWalletSignedOut(e){this.store.dispatch({type:"WALLET_DISCONNECTED",payload:{walletId:e}}),this.emitter.emit("signedOut",{walletId:e})}setupWalletEmitter(e){let r=new wh;return r.on("signedOut",()=>{this.onWalletSignedOut(e.id)}),r.on("signedIn",n=>{this.onWalletSignedIn(e.id,n)}),r.on("accountsChanged",({accounts:n})=>Pe(this,void 0,void 0,function*(){if(this.emitter.emit("accountsChanged",{walletId:e.id,accounts:n}),!n.length)return this.signOutWallet(e.id);this.store.dispatch({type:"ACCOUNTS_CHANGED",payload:{walletId:e.id,accounts:n}})})),r.on("networkChanged",({networkId:n})=>{this.emitter.emit("networkChanged",{walletId:e.id,networkId:n})}),r.on("uriChanged",({uri:n})=>{this.emitter.emit("uriChanged",{walletId:e.id,uri:n})}),r}validateSignMessageParams({message:e,nonce:r,recipient:n}){if(!e||e.trim()==="")throw new Error("Invalid message. It must be a non-empty string.");if(!Buffer.isBuffer(r)||r.length!==32)throw new Error("Invalid nonce. It must be a Buffer with a length of 32 bytes.");if(!n||n.trim()==="")throw new Error("Invalid recipient. It must be a non-empty string.")}decorateWallet(e){let r=e.signIn,n=e.signOut,o=e.signMessage,i=e.createSignedTransaction,a=e.getPublicKey,s=e.signNep413Message,c=e.signTransaction,f=e.signDelegateAction;return e.signIn=u=>Pe(this,void 0,void 0,function*(){let d=yield r(Object.assign(Object.assign({},this.options.createAccessKeyFor),u)),{contractId:m,methodNames:b=[]}=u;return yield this.onWalletSignedIn(e.id,{accounts:d,contractId:m||"",methodNames:b}),d}),e.signOut=()=>Pe(this,void 0,void 0,function*(){yield n(),this.onWalletSignedOut(e.id)}),e.signMessage=u=>Pe(this,void 0,void 0,function*(){if(o===void 0)throw Error(`The signMessage method is not supported by ${e.metadata.name}`);return this.validateSignMessageParams(u),yield o(u)}),e.createSignedTransaction=(u,d)=>Pe(this,void 0,void 0,function*(){if(i===void 0)throw Error(`The createSignedTransaction method is not supported by ${e.metadata.name}`);return yield i(u,d)}),e.getPublicKey=u=>Pe(this,void 0,void 0,function*(){if(a===void 0)throw Error(`The getPublicKey method is not supported by ${e.metadata.name}`);return typeof u>"u"?yield a():yield a(u)}),e.signNep413Message=(...u)=>Pe(this,void 0,void 0,function*(){if(s===void 0)throw Error(`The signNep413Message method is not supported by ${e.metadata.name}`);return yield s(...u)}),e.signTransaction=(...u)=>Pe(this,void 0,void 0,function*(){if(c===void 0)throw Error(`The signTransaction method is not supported by ${e.metadata.name}`);return yield c(...u)}),e.signDelegateAction=(...u)=>Pe(this,void 0,void 0,function*(){if(f===void 0)throw Error(`The signDelegateAction method is not supported by ${e.metadata.name}`);return yield f(...u)}),e}setupInstance(e){return Pe(this,void 0,void 0,function*(){let r=this.instances[e.id];if(r)return r;if(!e.metadata.available){let o=e.type==="injected"?"not installed":"not available";throw Error(`${e.metadata.name} is ${o}`)}let n=Object.assign({id:e.id,type:e.type,metadata:e.metadata},yield e.init({id:e.id,type:e.type,metadata:e.metadata,options:this.options,store:this.store.toReadOnly(),provider:this.provider,emitter:this.setupWalletEmitter(e),logger:new Hc(e.id),storage:new ds(this.storage,[Od,e.id])}));return r=this.decorateWallet(n),this.instances[e.id]=r,r})}getModule(e){return this.modules.find(r=>r.id===e)}getWallet(e){return Pe(this,void 0,void 0,function*(){let r=this.getModule(e);if(!r)return null;let{selectedWalletId:n}=this.store.getState();return!r.metadata.available&&n?(this.onWalletSignedOut(n),null):yield r.wallet()})}setupModule(e,r){if(!e)return;let n={id:e.id,type:e.type,metadata:e.metadata,listIndex:r,wallet:()=>this.setupInstance(e)};return n.type==="instant-link"&&this.setupInstantLinkWallet(n),n}setupWalletModules(){return Pe(this,void 0,void 0,function*(){let r=(yield Promise.all(this.factories.map((n,o)=>n({options:this.options}).then(i=>this.setupModule(i,o)).catch(i=>{ao.log("Failed to setup module"),ao.error(i)})))).filter(n=>n!==void 0);this.modules=r,this.store.dispatch({type:"ADD_WALLET_MODULES",payload:{modules:r}})})}setupStorage(){return Pe(this,void 0,void 0,function*(){let{accounts:e,contract:r,selectedWalletId:n,recentlySignedInWallets:o,rememberRecentWallets:i}=yield this.resolveStorageState();this.store.dispatch({type:"SETUP",payload:{accounts:e,contract:r,selectedWalletId:n,recentlySignedInWallets:o,rememberRecentWallets:i}})})}setupInstantLinkWallet(e){return Pe(this,void 0,void 0,function*(){if(e.type!=="instant-link")return;let r=yield e.wallet();if(r.metadata.runOnStartup)try{yield r.signIn({contractId:r.getContractId()})}catch(n){ao.error("Failed to sign in to wallet. "+r.metadata.name+n)}})}},G_=(t,e)=>{switch(t){case"mainnet":return{networkId:t,nodeUrl:e?.[0]||"https://free.rpc.fastnear.com",helperUrl:"https://helper.mainnet.near.org",explorerUrl:"https://nearblocks.io",indexerUrl:"https://api.fastnear.com/v0"};case"testnet":return{networkId:t,nodeUrl:e?.[0]||"https://test.rpc.fastnear.com",helperUrl:"https://helper.testnet.near.org",explorerUrl:"https://testnet.nearblocks.io",indexerUrl:"https://test.api.fastnear.com/v0"};default:throw Error(`Failed to find config for: '${t}'`)}},yQ=t=>typeof t=="string"?G_(t):t,gQ=t=>({options:{languageCode:t.languageCode||void 0,network:yQ(t.network),debug:t.debug||!1,optimizeWalletOrder:t.optimizeWalletOrder!==!1,randomizeWalletOrder:t.randomizeWalletOrder||!1,relayerUrl:t.relayerUrl||void 0,createAccessKeyFor:t.createAccessKeyFor?typeof t.createAccessKeyFor=="string"?{contractId:t.createAccessKeyFor,methodNames:[]}:{contractId:t.createAccessKeyFor.contractId,methodNames:t.createAccessKeyFor.methodNames}:void 0},storage:t.storage||new hx}),TI=Gc,vQ=TypeError,xQ=function(t,e){if(!delete t[e])throw new vQ("Cannot delete property "+TI(e)+" of "+TI(t))},_I=Fh,wQ=Math.floor,Sx=function(t,e){var r=t.length;if(r<8)for(var n=1,o,i;n<r;){for(i=n,o=t[n];i&&e(t[i-1],o)>0;)t[i]=t[--i];i!==n++&&(t[i]=o)}else for(var a=wQ(r/2),s=Sx(_I(t,0,a),e),c=Sx(_I(t,a),e),f=s.length,u=c.length,d=0,m=0;d<f||m<u;)t[d+m]=d<f&&m<u?e(s[d],c[m])<=0?s[d++]:c[m++]:d<f?s[d++]:c[m++];return t},V_=Sx,EQ=ge,Y_=function(t,e){var r=[][t];return!!r&&EQ(function(){r.call(null,e||function(){return 1},1)})},AQ=Gi,BI=AQ.match(/firefox\/(\d+)/i),Z_=!!BI&&+BI[1],SQ=Gi,J_=/MSIE|Trident/.test(SQ),IQ=Gi,RI=IQ.match(/AppleWebKit\/(\d+)\./),X_=!!RI&&+RI[1],TQ=Ft,Q_=Ke,_Q=In,BQ=Wo,PI=Ko,RQ=xQ,CI=Jd,m6=ge,PQ=V_,CQ=Y_,OI=Z_,OQ=J_,kI=zd,MI=X_,qi=[],$I=Q_(qi.sort),kQ=Q_(qi.push),MQ=m6(function(){qi.sort(void 0)}),$Q=m6(function(){qi.sort(null)}),NQ=CQ("sort"),eB=!m6(function(){if(kI)return kI<70;if(!(OI&&OI>3)){if(OQ)return!0;if(MI)return MI<603;var t="",e,r,n,o;for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)qi.push({k:r+o,v:n})}for(qi.sort(function(i,a){return a.v-i.v}),o=0;o<qi.length;o++)r=qi[o].k.charAt(0),t.charAt(t.length-1)!==r&&(t+=r);return t!=="DGBEFHACIJK"}}),FQ=MQ||!$Q||!NQ||!eB,LQ=function(t){return function(e,r){return r===void 0?-1:e===void 0?1:t!==void 0?+t(e,r)||0:CI(e)>CI(r)?1:-1}};TQ({target:"Array",proto:!0,forced:FQ},{sort:function(e){e!==void 0&&_Q(e);var r=BQ(this);if(eB)return e===void 0?$I(r):$I(r,e);var n=[],o=PI(r),i,a;for(a=0;a<o;a++)a in r&&kQ(n,r[a]);for(PQ(n,LQ(e)),i=PI(n),a=0;a<i;)r[a]=n[a++];for(;a<o;)RQ(r,a++);return r}});var UQ=(t,e)=>{switch(ao.log("Store Action",e),e.type){case"SETUP":{let{accounts:r,contract:n,selectedWalletId:o,recentlySignedInWallets:i,rememberRecentWallets:a}=e.payload,s=r.map((c,f)=>Object.assign(Object.assign({},c),{active:f===0}));return Object.assign(Object.assign({},t),{accounts:s,contract:n,selectedWalletId:o,recentlySignedInWallets:i,rememberRecentWallets:a})}case"ADD_WALLET_MODULE":{let{module:r}=e.payload,n=[...t.modules,r];return n=n.sort((o,i)=>o.listIndex-i.listIndex),Object.assign(Object.assign({},t),{modules:n})}case"ADD_WALLET_MODULES":{let{modules:r}=e.payload,n=[...t.modules,...r];return n=n.sort((o,i)=>o.listIndex-i.listIndex),Object.assign(Object.assign({},t),{modules:n})}case"WALLET_CONNECTED":{let{walletId:r,contract:n,accounts:o,recentlySignedInWallets:i}=e.payload;if(!o.length)return t;let a=t.accounts.findIndex(c=>c.active),s=o.map((c,f)=>Object.assign(Object.assign({},c),{active:f===(a>-1?a:0)}));return Object.assign(Object.assign({},t),{contract:n,accounts:s,selectedWalletId:r,recentlySignedInWallets:i})}case"WALLET_DISCONNECTED":{let{walletId:r}=e.payload;return r!==t.selectedWalletId?t:Object.assign(Object.assign({},t),{contract:null,accounts:[],selectedWalletId:null})}case"ACCOUNTS_CHANGED":{let{walletId:r,accounts:n}=e.payload;if(r!==t.selectedWalletId)return t;let o=t.accounts.find(s=>s.active),i=!n.some(s=>s.accountId===o?.accountId),a=n.map((s,c)=>Object.assign(Object.assign({},s),{active:i?c===0:s.accountId===o?.accountId}));return Object.assign(Object.assign({},t),{accounts:a})}case"SET_ACTIVE_ACCOUNT":{let{accountId:r}=e.payload,n=t.accounts.map(o=>Object.assign(Object.assign({},o),{active:o.accountId===r}));return Object.assign(Object.assign({},t),{accounts:n})}case"SET_REMEMBER_RECENT_WALLETS":{let{selectedWalletId:r,recentlySignedInWallets:n}=t,{rememberRecentWallets:o}=e.payload,i=o===zo.ENABLED?zo.DISABLED:zo.ENABLED,a=[...n];r&&!n.includes(r)&&a.push(r);let s=i===zo.ENABLED?a:[];return Object.assign(Object.assign({},t),{rememberRecentWallets:i,recentlySignedInWallets:s})}default:return t}},jQ=t=>Pe(void 0,void 0,void 0,function*(){let e=new ds(t,Od),r={modules:[],accounts:[],contract:yield e.getItem(SI),selectedWalletId:yield e.getItem(II),recentlySignedInWallets:(yield e.getItem($d))||[],rememberRecentWallets:(yield e.getItem(Ex))||""},n=new e2(r),o=new Tc;o.pipe(t2(UQ,r)).subscribe(n);let i=(s,c,f,u)=>Pe(void 0,void 0,void 0,function*(){if(c[u]!==s[u]){if(c[u]){yield e.setItem(f,c[u]);return}yield e.removeItem(f)}}),a=n.getValue();return n.subscribe(s=>{i(a,s,II,"selectedWalletId"),i(a,s,SI,"contract"),i(a,s,$d,"recentlySignedInWallets"),i(a,s,Ex,"rememberRecentWallets"),a=s}),{observable:n,getState:()=>n.getValue(),dispatch:s=>o.next(s),toReadOnly:()=>({getState:()=>n.getValue(),observable:n.asObservable()})}}),q2=null,NI=(t,e,r,n)=>({options:t,store:e.toReadOnly(),wallet:o=>Pe(void 0,void 0,void 0,function*(){let{selectedWalletId:i}=e.getState(),a=yield r.getWallet(o||i);if(!a)throw o?new Error("Invalid wallet id"):new Error("No wallet selected");return a}),setActiveAccount:o=>{let{accounts:i}=e.getState();if(!i.some(a=>a.accountId===o))throw new Error("Invalid account id");e.dispatch({type:"SET_ACTIVE_ACCOUNT",payload:{accountId:o}})},setRememberRecentWallets:()=>{let{rememberRecentWallets:o}=e.getState();e.dispatch({type:"SET_REMEMBER_RECENT_WALLETS",payload:{rememberRecentWallets:o}})},isSignedIn(){let{accounts:o}=e.getState();return!!o.length},on:(o,i)=>n.on(o,i),off:(o,i)=>{n.off(o,i)},subscribeOnAccountChange(o){this.store.observable.subscribe(i=>Pe(this,void 0,void 0,function*(){var a;let s=(a=i?.accounts.find(c=>c.active))===null||a===void 0?void 0:a.accountId;o(s||"")}))}}),tB=t=>Pe(void 0,void 0,void 0,function*(){let{options:e,storage:r}=gQ(t);Hc.debug=e.debug;let n=new wh,o=yield jQ(r),i=G_(e.network.networkId,t.fallbackRpcUrls),a=t.fallbackRpcUrls&&t.fallbackRpcUrls.length>0?t.fallbackRpcUrls:[i.nodeUrl],s=new Ax({factories:t.modules,storage:r,options:e,store:o,emitter:n,provider:new Q2(a)});return yield s.setupWalletModules(),yield s.setupStorage(),t.allowMultipleSelectors?NI(e,o,s,n):(q2||(q2=NI(e,o,s,n)),q2)});var DQ=In,zQ=Wo,qQ=Ch,HQ=Ko,FI=TypeError,LI="Reduce of empty array with no initial value",UI=function(t){return function(e,r,n,o){var i=zQ(e),a=qQ(i),s=HQ(i);if(DQ(r),s===0&&n<2)throw new FI(LI);var c=t?s-1:0,f=t?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=f;break}if(c+=f,t?c<0:s<=c)throw new FI(LI)}for(;t?c>=0:s>c;c+=f)c in a&&(o=r(o,a[c],c,i));return o}},WQ={left:UI(!1),right:UI(!0)},KQ=Ft,GQ=WQ.left,VQ=Y_,jI=zd,YQ=$h,ZQ=!YQ&&jI>79&&jI<83,JQ=ZQ||!VQ("reduce");KQ({target:"Array",proto:!0,forced:JQ},{reduce:function(e){var r=arguments.length;return GQ(this,e,r,r>1?arguments[1]:void 0)}});var XQ=Hr,rB=function(){var t=XQ(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},b6=ge,QQ=le,y6=QQ.RegExp,g6=b6(function(){var t=y6("a","y");return t.lastIndex=2,t.exec("abcd")!==null}),eee=g6||b6(function(){return!y6("a","y").sticky}),tee=g6||b6(function(){var t=y6("^r","gy");return t.lastIndex=2,t.exec("str")!==null}),ree={BROKEN_CARET:tee,MISSED_STICKY:eee,UNSUPPORTED_Y:g6},nee=ge,oee=le,iee=oee.RegExp,aee=nee(function(){var t=iee(".","s");return!(t.dotAll&&t.test(`
48
+ `)&&t.flags==="s")}),see=ge,cee=le,fee=cee.RegExp,uee=see(function(){var t=fee("(?<a>b)","g");return t.exec("b").groups.a!=="b"||"b".replace(t,"$<a>c")!=="bc"}),Nc=Nt,zh=Ke,dee=Jd,lee=rB,pee=ree,hee=Hx,mee=jh,bee=ms.get,yee=aee,gee=uee,vee=hee("native-string-replace",String.prototype.replace),Eh=RegExp.prototype.exec,Ix=Eh,xee=zh("".charAt),wee=zh("".indexOf),Eee=zh("".replace),H2=zh("".slice),Tx=(function(){var t=/a/,e=/b*/g;return Nc(Eh,t,"a"),Nc(Eh,e,"a"),t.lastIndex!==0||e.lastIndex!==0})(),nB=pee.BROKEN_CARET,_x=/()??/.exec("")[1]!==void 0,Aee=Tx||_x||nB||yee||gee;Aee&&(Ix=function(e){var r=this,n=bee(r),o=dee(e),i=n.raw,a,s,c,f,u,d,m;if(i)return i.lastIndex=r.lastIndex,a=Nc(Ix,i,o),r.lastIndex=i.lastIndex,a;var b=n.groups,w=nB&&r.sticky,T=Nc(lee,r),P=r.source,R=0,k=o;if(w&&(T=Eee(T,"y",""),wee(T,"g")===-1&&(T+="g"),k=H2(o,r.lastIndex),r.lastIndex>0&&(!r.multiline||r.multiline&&xee(o,r.lastIndex-1)!==`
49
+ `)&&(P="(?: "+P+")",k=" "+k,R++),s=new RegExp("^(?:"+P+")",T)),_x&&(s=new RegExp("^"+P+"$(?!\\s)",T)),Tx&&(c=r.lastIndex),f=Nc(Eh,w?s:r,k),w?f?(f.input=H2(f.input,R),f[0]=H2(f[0],R),f.index=r.lastIndex,r.lastIndex+=f[0].length):r.lastIndex=0:Tx&&f&&(r.lastIndex=r.global?f.index+f[0].length:c),_x&&f&&f.length>1&&Nc(vee,f[0],s,function(){for(u=1;u<arguments.length-2;u++)arguments[u]===void 0&&(f[u]=void 0)}),f&&b)for(f.groups=d=mee(null),u=0;u<b.length;u++)m=b[u],d[m[0]]=f[m[1]];return f});var See=Ix,Iee=Ft,DI=See;Iee({target:"RegExp",proto:!0,forced:/./.exec!==DI},{exec:DI});var Tee=Nt,_ee=Or,Bee=Kc,Ree=rB,zI=RegExp.prototype,Pee=function(t){var e=t.flags;return e===void 0&&!("flags"in zI)&&!_ee(t,"flags")&&Bee(zI,t)?Tee(Ree,t):e},Cee=qd.PROPER,Oee=Vi,kee=Hr,qI=Jd,Mee=ge,$ee=Pee,v6="toString",oB=RegExp.prototype,iB=oB[v6],Nee=Mee(function(){return iB.call({source:"a",flags:"b"})!=="/a/b"}),Fee=Cee&&iB.name!==v6;(Nee||Fee)&&Oee(oB,v6,function(){var e=kee(this),r=qI(e.source),n=qI($ee(e));return"/"+r+"/"+n},{unsafe:!0});var aB=typeof ArrayBuffer<"u"&&typeof DataView<"u",Lee=Vi,Uee=function(t,e,r){for(var n in e)Lee(t,n,e[n],r);return t},jee=Hd,Dee=Wd,zee=RangeError,sB=function(t){if(t===void 0)return 0;var e=jee(t),r=Dee(e);if(e!==r)throw new zee("Wrong length or index");return r},qee=Math.sign||function(e){var r=+e;return r===0||r!==r?r:r<0?-1:1},Hee=2220446049250313e-31,HI=1/Hee,Wee=function(t){return t+HI-HI},Kee=qee,Gee=Wee,Vee=Math.abs,Yee=2220446049250313e-31,Zee=function(t,e,r,n){var o=+t,i=Vee(o),a=Kee(o);if(i<n)return a*Gee(i/n/e)*n*e;var s=(1+e/Yee)*i,c=s-(s-i);return c>r||c!==c?a*(1/0):a*c},Jee=Zee,Xee=11920928955078125e-23,Qee=34028234663852886e22,ete=11754943508222875e-54,tte=Math.fround||function(e){return Jee(e,Xee,Qee,ete)},rte=Array,nte=Math.abs,Do=Math.pow,ote=Math.floor,ite=Math.log,ate=Math.LN2,ste=function(t,e,r){var n=rte(r),o=r*8-e-1,i=(1<<o)-1,a=i>>1,s=e===23?Do(2,-24)-Do(2,-77):0,c=t<0||t===0&&1/t<0?1:0,f=0,u,d,m;for(t=nte(t),t!==t||t===1/0?(d=t!==t?1:0,u=i):(u=ote(ite(t)/ate),m=Do(2,-u),t*m<1&&(u--,m*=2),u+a>=1?t+=s/m:t+=s*Do(2,1-a),t*m>=2&&(u++,m/=2),u+a>=i?(d=0,u=i):u+a>=1?(d=(t*m-1)*Do(2,e),u+=a):(d=t*Do(2,a-1)*Do(2,e),u=0));e>=8;)n[f++]=d&255,d/=256,e-=8;for(u=u<<e|d,o+=e;o>0;)n[f++]=u&255,u/=256,o-=8;return n[f-1]|=c*128,n},cte=function(t,e){var r=t.length,n=r*8-e-1,o=(1<<n)-1,i=o>>1,a=n-7,s=r-1,c=t[s--],f=c&127,u;for(c>>=7;a>0;)f=f*256+t[s--],a-=8;for(u=f&(1<<-a)-1,f>>=-a,a+=e;a>0;)u=u*256+t[s--],a-=8;if(f===0)f=1-i;else{if(f===o)return u?NaN:c?-1/0:1/0;u+=Do(2,e),f-=i}return(c?-1:1)*u*Do(2,f-e)},fte={pack:ste,unpack:cte},ute=Wo,WI=e6,dte=Ko,cB=function(e){for(var r=ute(this),n=dte(r),o=arguments.length,i=WI(o>1?arguments[1]:void 0,n),a=o>2?arguments[2]:void 0,s=a===void 0?n:WI(a,n);s>i;)r[i++]=e;return r},lte=Ge,pte=zt,KI=Vc,fB=function(t,e,r){var n,o;return KI&&lte(n=e.constructor)&&n!==r&&pte(o=n.prototype)&&o!==r.prototype&&KI(t,o),t},qh=le,x6=Ke,W2=tr,hte=aB,uB=qd,mte=hs,bte=Nh,GI=Uee,K2=ge,ih=o6,yte=Hd,gte=Wd,Ah=sB,vte=tte,dB=fte,xte=Dh,VI=Vc,wte=cB,Ete=Fh,Ate=fB,Ste=YT,lB=Gd,w6=ms,Ite=uB.PROPER,YI=uB.CONFIGURABLE,Lc="ArrayBuffer",Hh="DataView",Uc="prototype",Tte="Wrong length",pB="Wrong index",ZI=w6.getterFor(Lc),Nd=w6.getterFor(Hh),JI=w6.set,En=qh[Lc],Pr=En,Oc=Pr&&Pr[Uc],so=qh[Hh],cs=so&&so[Uc],XI=Object.prototype,_te=qh.Array,Sh=qh.RangeError,Bte=x6(wte),Rte=x6([].reverse),hB=dB.pack,QI=dB.unpack,eT=function(t){return[t&255]},tT=function(t){return[t&255,t>>8&255]},rT=function(t){return[t&255,t>>8&255,t>>16&255,t>>24&255]},nT=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Pte=function(t){return hB(vte(t),23,4)},Cte=function(t){return hB(t,52,8)},ah=function(t,e,r){bte(t[Uc],e,{configurable:!0,get:function(){return r(this)[e]}})},ji=function(t,e,r,n){var o=Nd(t),i=Ah(r),a=!!n;if(i+e>o.byteLength)throw new Sh(pB);var s=o.bytes,c=i+o.byteOffset,f=Ete(s,c,c+e);return a?f:Rte(f)},Di=function(t,e,r,n,o,i){var a=Nd(t),s=Ah(r),c=n(+o),f=!!i;if(s+e>a.byteLength)throw new Sh(pB);for(var u=a.bytes,d=s+a.byteOffset,m=0;m<e;m++)u[d+m]=c[f?m:e-m-1]};hte?(G2=Ite&&En.name!==Lc,!K2(function(){En(1)})||!K2(function(){new En(-1)})||K2(function(){return new En,new En(1.5),new En(NaN),En.length!==1||G2&&!YI})?(Pr=function(e){return ih(this,Oc),Ate(new En(Ah(e)),this,Pr)},Pr[Uc]=Oc,Oc.constructor=Pr,Ste(Pr,En)):G2&&YI&&mte(En,"name",Lc),VI&&xte(cs)!==XI&&VI(cs,XI),_d=new so(new Pr(2)),V2=x6(cs.setInt8),_d.setInt8(0,2147483648),_d.setInt8(1,2147483649),(_d.getInt8(0)||!_d.getInt8(1))&&GI(cs,{setInt8:function(e,r){V2(this,e,r<<24>>24)},setUint8:function(e,r){V2(this,e,r<<24>>24)}},{unsafe:!0})):(Pr=function(e){ih(this,Oc);var r=Ah(e);JI(this,{type:Lc,bytes:Bte(_te(r),0),byteLength:r}),W2||(this.byteLength=r,this.detached=!1)},Oc=Pr[Uc],so=function(e,r,n){ih(this,cs),ih(e,Oc);var o=ZI(e),i=o.byteLength,a=yte(r);if(a<0||a>i)throw new Sh("Wrong offset");if(n=n===void 0?i-a:gte(n),a+n>i)throw new Sh(Tte);JI(this,{type:Hh,buffer:e,byteLength:n,byteOffset:a,bytes:o.bytes}),W2||(this.buffer=e,this.byteLength=n,this.byteOffset=a)},cs=so[Uc],W2&&(ah(Pr,"byteLength",ZI),ah(so,"buffer",Nd),ah(so,"byteLength",Nd),ah(so,"byteOffset",Nd)),GI(cs,{getInt8:function(e){return ji(this,1,e)[0]<<24>>24},getUint8:function(e){return ji(this,1,e)[0]},getInt16:function(e){var r=ji(this,2,e,arguments.length>1?arguments[1]:!1);return(r[1]<<8|r[0])<<16>>16},getUint16:function(e){var r=ji(this,2,e,arguments.length>1?arguments[1]:!1);return r[1]<<8|r[0]},getInt32:function(e){return nT(ji(this,4,e,arguments.length>1?arguments[1]:!1))},getUint32:function(e){return nT(ji(this,4,e,arguments.length>1?arguments[1]:!1))>>>0},getFloat32:function(e){return QI(ji(this,4,e,arguments.length>1?arguments[1]:!1),23)},getFloat64:function(e){return QI(ji(this,8,e,arguments.length>1?arguments[1]:!1),52)},setInt8:function(e,r){Di(this,1,e,eT,r)},setUint8:function(e,r){Di(this,1,e,eT,r)},setInt16:function(e,r){Di(this,2,e,tT,r,arguments.length>2?arguments[2]:!1)},setUint16:function(e,r){Di(this,2,e,tT,r,arguments.length>2?arguments[2]:!1)},setInt32:function(e,r){Di(this,4,e,rT,r,arguments.length>2?arguments[2]:!1)},setUint32:function(e,r){Di(this,4,e,rT,r,arguments.length>2?arguments[2]:!1)},setFloat32:function(e,r){Di(this,4,e,Pte,r,arguments.length>2?arguments[2]:!1)},setFloat64:function(e,r){Di(this,8,e,Cte,r,arguments.length>2?arguments[2]:!1)}}));var G2,_d,V2;lB(Pr,Lc);lB(so,Hh);var E6={ArrayBuffer:Pr,DataView:so},Ote=Ft,kte=le,Mte=E6,$te=n6,A6="ArrayBuffer",oT=Mte[A6],Nte=kte[A6];Ote({global:!0,constructor:!0,forced:Nte!==oT},{ArrayBuffer:oT});$te(A6);var Fte=Ft,S6=a6,Lte=ge,mB=E6,iT=Hr,aT=e6,Ute=Wd,I6=mB.ArrayBuffer,Bx=mB.DataView,bB=Bx.prototype,sT=S6(I6.prototype.slice),jte=S6(bB.getUint8),Dte=S6(bB.setUint8),zte=Lte(function(){return!new I6(2).slice(1,void 0).byteLength});Fte({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:zte},{slice:function(e,r){if(sT&&r===void 0)return sT(iT(this),e);for(var n=iT(this).byteLength,o=aT(e,n),i=aT(r===void 0?n:r,n),a=new I6(Ute(i-o)),s=new Bx(this),c=new Bx(a),f=0;o<i;)Dte(c,f++,jte(s,o++));return a}});var Rx={exports:{}},qte=aB,T6=tr,er=le,yB=Ge,Wh=zt,Ki=Or,_6=bs,Hte=Gc,Wte=hs,Px=Vi,Kte=Nh,Gte=Kc,Kh=Dh,Zc=Vc,Vte=Rt,Yte=Wx,gB=ms,vB=gB.enforce,Zte=gB.get,Ih=er.Int8Array,Cx=Ih&&Ih.prototype,cT=er.Uint8ClampedArray,fT=cT&&cT.prototype,co=Ih&&Kh(Ih),Sn=Cx&&Kh(Cx),Jte=Object.prototype,B6=er.TypeError,uT=Vte("toStringTag"),Ox=Yte("TYPED_ARRAY_TAG"),Th="TypedArrayConstructor",qo=qte&&!!Zc&&_6(er.opera)!=="Opera",xB=!1,yr,Hi,jc,Ho={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},R6={BigInt64Array:8,BigUint64Array:8},Xte=function(e){if(!Wh(e))return!1;var r=_6(e);return r==="DataView"||Ki(Ho,r)||Ki(R6,r)},wB=function(t){var e=Kh(t);if(Wh(e)){var r=Zte(e);return r&&Ki(r,Th)?r[Th]:wB(e)}},EB=function(t){if(!Wh(t))return!1;var e=_6(t);return Ki(Ho,e)||Ki(R6,e)},Qte=function(t){if(EB(t))return t;throw new B6("Target is not a typed array")},ere=function(t){if(yB(t)&&(!Zc||Gte(co,t)))return t;throw new B6(Hte(t)+" is not a typed array constructor")},tre=function(t,e,r,n){if(T6){if(r)for(var o in Ho){var i=er[o];if(i&&Ki(i.prototype,t))try{delete i.prototype[t]}catch{try{i.prototype[t]=e}catch{}}}(!Sn[t]||r)&&Px(Sn,t,r?e:qo&&Cx[t]||e,n)}},rre=function(t,e,r){var n,o;if(T6){if(Zc){if(r){for(n in Ho)if(o=er[n],o&&Ki(o,t))try{delete o[t]}catch{}}if(!co[t]||r)try{return Px(co,t,r?e:qo&&co[t]||e)}catch{}else return}for(n in Ho)o=er[n],o&&(!o[t]||r)&&Px(o,t,e)}};for(yr in Ho)Hi=er[yr],jc=Hi&&Hi.prototype,jc?vB(jc)[Th]=Hi:qo=!1;for(yr in R6)Hi=er[yr],jc=Hi&&Hi.prototype,jc&&(vB(jc)[Th]=Hi);if((!qo||!yB(co)||co===Function.prototype)&&(co=function(){throw new B6("Incorrect invocation")},qo))for(yr in Ho)er[yr]&&Zc(er[yr],co);if((!qo||!Sn||Sn===Jte)&&(Sn=co.prototype,qo))for(yr in Ho)er[yr]&&Zc(er[yr].prototype,Sn);qo&&Kh(fT)!==Sn&&Zc(fT,Sn);if(T6&&!Ki(Sn,uT)){xB=!0,Kte(Sn,uT,{configurable:!0,get:function(){return Wh(this)?this[Ox]:void 0}});for(yr in Ho)er[yr]&&Wte(er[yr],Ox,yr)}var Yi={NATIVE_ARRAY_BUFFER_VIEWS:qo,TYPED_ARRAY_TAG:xB&&Ox,aTypedArray:Qte,aTypedArrayConstructor:ere,exportTypedArrayMethod:tre,exportTypedArrayStaticMethod:rre,getTypedArrayConstructor:wB,isView:Xte,isTypedArray:EB,TypedArray:co,TypedArrayPrototype:Sn},AB=le,Y2=ge,nre=C_,ore=Yi.NATIVE_ARRAY_BUFFER_VIEWS,ire=AB.ArrayBuffer,fs=AB.Int8Array,SB=!ore||!Y2(function(){fs(1)})||!Y2(function(){new fs(-1)})||!nre(function(t){new fs,new fs(null),new fs(1.5),new fs(t)},!0)||Y2(function(){return new fs(new ire(2),1,void 0).length!==1}),are=zt,sre=Math.floor,cre=Number.isInteger||function(e){return!are(e)&&isFinite(e)&&sre(e)===e},fre=Hd,ure=RangeError,dre=function(t){var e=fre(t);if(e<0)throw new ure("The argument can't be less than 0");return e},lre=dre,pre=RangeError,IB=function(t,e){var r=lre(t);if(r%e)throw new pre("Wrong offset");return r},hre=Math.round,mre=function(t){var e=hre(t);return e<0?0:e>255?255:e&255},bre=bs,yre=function(t){var e=bre(t);return e==="BigInt64Array"||e==="BigUint64Array"},gre=DT,vre=TypeError,TB=function(t){var e=gre(t,"number");if(typeof e=="number")throw new vre("Can't convert number to bigint");return BigInt(e)},xre=Vd,wre=Nt,Ere=o_,Are=Wo,Sre=Ko,Ire=__,Tre=p6,_re=T_,Bre=yre,Rre=Yi.aTypedArrayConstructor,Pre=TB,_B=function(e){var r=Ere(this),n=Are(e),o=arguments.length,i=o>1?arguments[1]:void 0,a=i!==void 0,s=Tre(n),c,f,u,d,m,b,w,T;if(s&&!_re(s))for(w=Ire(n,s),T=w.next,n=[];!(b=wre(T,w)).done;)n.push(b.value);for(a&&o>2&&(i=xre(i,arguments[2])),f=Sre(n),u=new(Rre(r))(f),d=Bre(u),c=0;f>c;c++)m=a?i(n[c],c):n[c],u[c]=d?Pre(m):+m;return u},Cre=Wc,Ore=Array.isArray||function(e){return Cre(e)==="Array"},dT=Ore,kre=n_,Mre=zt,$re=Rt,Nre=$re("species"),lT=Array,Fre=function(t){var e;return dT(t)&&(e=t.constructor,kre(e)&&(e===lT||dT(e.prototype))?e=void 0:Mre(e)&&(e=e[Nre],e===null&&(e=void 0))),e===void 0?lT:e},Lre=Fre,Ure=function(t,e){return new(Lre(t))(e===0?0:e)},jre=Vd,Dre=Ke,zre=Ch,qre=Wo,Hre=Ko,Wre=Ure,pT=Dre([].push),zi=function(t){var e=t===1,r=t===2,n=t===3,o=t===4,i=t===6,a=t===7,s=t===5||i;return function(c,f,u,d){for(var m=qre(c),b=zre(m),w=Hre(b),T=jre(f,u),P=0,R=d||Wre,k=e?R(c,w):r||a?R(c,0):void 0,_,O;w>P;P++)if((s||P in b)&&(_=b[P],O=T(_,P,m),t))if(e)k[P]=O;else if(O)switch(t){case 3:return!0;case 5:return _;case 6:return P;case 2:pT(k,_)}else switch(t){case 4:return!1;case 7:pT(k,_)}return i?-1:n||o?o:k}},Kre={forEach:zi(0),map:zi(1),filter:zi(2),some:zi(3),every:zi(4),find:zi(5),findIndex:zi(6),filterReject:zi(7)},Gre=Ko,Vre=function(t,e,r){for(var n=0,o=arguments.length>2?r:Gre(e),i=new t(o);o>n;)i[n]=e[n++];return i},hT=Ft,BB=le,mT=Nt,Yre=tr,Zre=SB,Xd=Yi,RB=E6,bT=o6,Jre=Ph,Bd=hs,Xre=cre,Qre=Wd,yT=sB,Z2=IB,ene=mre,PB=Kx,Rd=Or,tne=bs,kx=zt,rne=Dx,nne=jh,one=Kc,sh=Vc,ine=Qx.f,gT=_B,ane=Kre.forEach,sne=n6,cne=Nh,CB=fo,OB=Bh,vT=Vre,P6=ms,fne=fB,Mx=P6.get,une=P6.set,dne=P6.enforce,kB=CB.f,lne=OB.f,J2=BB.RangeError,MB=RB.ArrayBuffer,pne=MB.prototype,hne=RB.DataView,ch=Xd.NATIVE_ARRAY_BUFFER_VIEWS,xT=Xd.TYPED_ARRAY_TAG,wT=Xd.TypedArray,Pd=Xd.TypedArrayPrototype,$x=Xd.isTypedArray,fh="BYTES_PER_ELEMENT",X2="Wrong length",uh=function(t,e){cne(t,e,{configurable:!0,get:function(){return Mx(this)[e]}})},ET=function(t){var e;return one(pne,t)||(e=tne(t))==="ArrayBuffer"||e==="SharedArrayBuffer"},$B=function(t,e){return $x(t)&&!rne(e)&&e in t&&Xre(+e)&&e>=0},AT=function(e,r){return r=PB(r),$B(e,r)?Jre(2,e[r]):lne(e,r)},ST=function(e,r,n){return r=PB(r),$B(e,r)&&kx(n)&&Rd(n,"value")&&!Rd(n,"get")&&!Rd(n,"set")&&!n.configurable&&(!Rd(n,"writable")||n.writable)&&(!Rd(n,"enumerable")||n.enumerable)?(e[r]=n.value,e):kB(e,r,n)};Yre?(ch||(OB.f=AT,CB.f=ST,uh(Pd,"buffer"),uh(Pd,"byteOffset"),uh(Pd,"byteLength"),uh(Pd,"length")),hT({target:"Object",stat:!0,forced:!ch},{getOwnPropertyDescriptor:AT,defineProperty:ST}),Rx.exports=function(t,e,r){var n=t.match(/\d+/)[0]/8,o=t+(r?"Clamped":"")+"Array",i="get"+t,a="set"+t,s=BB[o],c=s,f=c&&c.prototype,u={},d=function(T,P){var R=Mx(T);return R.view[i](P*n+R.byteOffset,!0)},m=function(T,P,R){var k=Mx(T);k.view[a](P*n+k.byteOffset,r?ene(R):R,!0)},b=function(T,P){kB(T,P,{get:function(){return d(this,P)},set:function(R){return m(this,P,R)},enumerable:!0})};ch?Zre&&(c=e(function(T,P,R,k){return bT(T,f),fne((function(){return kx(P)?ET(P)?k!==void 0?new s(P,Z2(R,n),k):R!==void 0?new s(P,Z2(R,n)):new s(P):$x(P)?vT(c,P):mT(gT,c,P):new s(yT(P))})(),T,c)}),sh&&sh(c,wT),ane(ine(s),function(T){T in c||Bd(c,T,s[T])}),c.prototype=f):(c=e(function(T,P,R,k){bT(T,f);var _=0,O=0,$,B,N;if(!kx(P))N=yT(P),B=N*n,$=new MB(B);else if(ET(P)){$=P,O=Z2(R,n);var M=P.byteLength;if(k===void 0){if(M%n)throw new J2(X2);if(B=M-O,B<0)throw new J2(X2)}else if(B=Qre(k)*n,B+O>M)throw new J2(X2);N=B/n}else return $x(P)?vT(c,P):mT(gT,c,P);for(une(T,{buffer:$,byteOffset:O,byteLength:B,length:N,view:new hne($)});_<N;)b(T,_++)}),sh&&sh(c,wT),f=c.prototype=nne(Pd)),f.constructor!==c&&Bd(f,"constructor",c),dne(f).TypedArrayConstructor=c,xT&&Bd(f,xT,o);var w=c!==s;u[o]=c,hT({global:!0,constructor:!0,forced:w,sham:!ch},u),fh in c||Bd(c,fh,n),fh in f||Bd(f,fh,n),sne(o)}):Rx.exports=function(){};var mne=Rx.exports;mne("Uint8",function(t){return function(r,n,o){return t(this,r,n,o)}});var NB=Yi,bne=cB,yne=TB,gne=bs,vne=Nt,xne=Ke,wne=ge,Ene=NB.aTypedArray,Ane=NB.exportTypedArrayMethod,Sne=xne("".slice),Ine=wne(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),t!==1});Ane("fill",function(e){var r=arguments.length;Ene(this);var n=Sne(gne(this),0,3)==="Big"?yne(e):+e;return vne(bne,this,n,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)},Ine);var Tne=SB,_ne=Yi.exportTypedArrayStaticMethod,Bne=_B;_ne("from",Bne,Tne);var FB=le,LB=Nt,C6=Yi,Rne=Ko,Pne=IB,Cne=Wo,UB=ge,One=FB.RangeError,Nx=FB.Int8Array,IT=Nx&&Nx.prototype,jB=IT&&IT.set,kne=C6.aTypedArray,Mne=C6.exportTypedArrayMethod,Fx=!UB(function(){var t=new Uint8ClampedArray(2);return LB(jB,t,{length:1,0:3},1),t[1]!==3}),$ne=Fx&&C6.NATIVE_ARRAY_BUFFER_VIEWS&&UB(function(){var t=new Nx(2);return t.set(1),t.set("2",1),t[0]!==0||t[1]!==2});Mne("set",function(e){kne(this);var r=Pne(arguments.length>1?arguments[1]:void 0,1),n=Cne(e);if(Fx)return LB(jB,this,n,r);var o=this.length,i=Rne(n),a=0;if(i+r>o)throw new One("Wrong length");for(;a<i;)this[r+a]=n[a++]},!Fx||$ne);var Nne=le,Fne=a6,Lx=ge,Lne=In,Une=V_,DB=Yi,TT=Z_,jne=J_,_T=zd,BT=X_,Dne=DB.aTypedArray,zne=DB.exportTypedArrayMethod,Ud=Nne.Uint16Array,Dc=Ud&&Fne(Ud.prototype.sort),qne=!!Dc&&!(Lx(function(){Dc(new Ud(2),null)})&&Lx(function(){Dc(new Ud(2),{})})),RT=!!Dc&&!Lx(function(){if(_T)return _T<74;if(TT)return TT<67;if(jne)return!0;if(BT)return BT<602;var t=new Ud(516),e=Array(516),r,n;for(r=0;r<516;r++)n=r%4,t[r]=515-r,e[r]=r-2*n+3;for(Dc(t,function(o,i){return(o/4|0)-(i/4|0)}),r=0;r<516;r++)if(t[r]!==e[r])return!0}),Hne=function(t){return function(e,r){return t!==void 0?+t(e,r)||0:r!==r?-1:e!==e?1:e===0&&r===0?1/e>0&&1/r<0?1:-1:e>r}};zne("sort",function(e){return e!==void 0&&Lne(e),RT?Dc(this,e):Une(Dne(this),Hne(e))},!RT||qne);var Wne=le,Kne=a_,zB=Yi,Ux=ge,PT=Fh,_h=Wne.Int8Array,CT=zB.aTypedArray,Gne=zB.exportTypedArrayMethod,qB=[].toLocaleString,Vne=!!_h&&Ux(function(){qB.call(new _h(1))}),Yne=Ux(function(){return[1,2].toLocaleString()!==new _h([1,2]).toLocaleString()})||!Ux(function(){_h.prototype.toLocaleString.call([1,2])});Gne("toLocaleString",function(){return Kne(qB,Vne?PT(CT(this)):CT(this),PT(arguments))},Yne);var HB=cn(Qu(),1);function Zne(t){switch(t.type){case void 0:return t;case"JsonRpcProvider":return new oo({...t.args});case"FailoverRpcProvider":{let e=(t?.args||[]).map(r=>new oo(r));return new ts(e)}default:throw new Error(`Unknown provider type ${t.type}`)}}function Jne(t){switch(t.type){case void 0:return t;case"InMemorySigner":return new os(t.keyStore);default:throw new Error(`Unknown signer type ${t.type}`)}}var Gh=class t{networkId;provider;signer;constructor(e,r,n){(0,HB.default)("new Connection(networkId, provider, signer)")("`Connection` is no longer used anywhere, please switch to constructing `Account` without it - use `new Account(accountId, provider, signer)`"),this.networkId=e,this.provider=r,this.signer=n}getConnection(){return this}static fromConfig(e){let r=Zne(e.provider),n=Jne(e.signer);return new t(e.networkId,r,n)}};var O6=cn(Qu(),1);function Xne(t){return JSON.parse(Buffer.from(t).toString())}function Qne(t){return Buffer.from(JSON.stringify(t))}function eoe(t){if(!(t.byteLength!==void 0&&t.byteLength===t.length)&&(Array.isArray(t)||typeof t!="object"))throw new Xs}async function WB(t,e,r,n={finality:"optimistic"}){(0,O6.default)("viewState()")("It will be removed in the next major release");let{values:i}=await t.provider.query({request_type:"view_state",...n,account_id:e,prefix_base64:Buffer.from(r).toString("base64")});return i.map(({key:a,value:s})=>({key:Buffer.from(a,"base64"),value:Buffer.from(s,"base64")}))}async function KB(t,{contractId:e,methodName:r,args:n={},parse:o=Xne,stringify:i=Qne,blockQuery:a={finality:"optimistic"}}){(0,O6.default)("viewFunction()")("It will be removed in the next major release"),eoe(n);let c=i(n),f=await t.provider.query({request_type:"call_function",...a,account_id:e,method_name:r,args_base64:c.toString("base64")});return f.logs&&$g({contractId:e,logs:f.logs}),f.result&&f.result.length>0&&o(Buffer.from(f.result))}function GB(t,e,r=e){t=ooe(t);let n=t.substring(0,t.length-e)||"0",o=t.substring(t.length-e).substring(0,e).padStart(e,"0");return o=o.substring(0,r),roe(`${n}.${o}`)}function VB(t,e){t=toe(t);let r=t.split(".");if(r.length>2)throw new Error(`Cannot parse amount '${t}' as it contains more than a single dot`);let n=r[0],o=r[1]||"";if(o.length>24)throw new Error(`Cannot parse amount '${t}' as it exceeds maximum decimal precision of 24`);return noe(n+o.substring(0,e).padEnd(e,"0"))}function toe(t){return t.replace(/,/g,".").trim()}function roe(t){return t.replace(/\.?0*$/,"")}function noe(t){return t=t.replace(/^0+/,""),t===""?"0":t}function ooe(t){return BigInt(t).toString()}var k6=class{metadata;constructor(e){this.metadata=e}toUnits(e){let r=VB(e.toString(),this.metadata.decimals);return BigInt(r)}toDecimal(e,r){return GB(e,this.metadata.decimals,r)}},Vh=class extends k6{constructor(e){super(e)}async transfer({from:e,receiverId:r,amount:n}){return e.signAndSendTransaction({receiverId:r,actions:[{transfer:{deposit:n.toString()}}]})}async getBalance(e){let{balance:{available:r}}=await e.getState();return r}};var Qd=new Vh({name:"NEAR",decimals:24,symbol:"NEAR",icon:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2216%22%20fill%3D%22white%22%3E%3C%2Fcircle%3E%3Cg%20clip-path%3D%22url(%23clip0000000003)%22%3E%3Cpath%20d%3D%22M20.8422%208.84471L17.4978%2013.776C17.4501%2013.847%2017.43%2013.9328%2017.4411%2014.0174C17.4522%2014.102%2017.4938%2014.1798%2017.5582%2014.2363C17.6225%2014.2928%2017.7053%2014.3243%2017.7913%2014.3249C17.8772%2014.3254%2017.9604%2014.2951%2018.0256%2014.2395L21.3178%2011.4036C21.3371%2011.3865%2021.361%2011.3753%2021.3866%2011.3714C21.4122%2011.3675%2021.4383%2011.3711%2021.4619%2011.3818C21.4855%2011.3924%2021.5054%2011.4096%2021.5193%2011.4314C21.5331%2011.4531%2021.5403%2011.4783%2021.54%2011.504V20.3824C21.54%2020.4095%2021.5316%2020.4361%2021.5158%2020.4583C21.5001%2020.4806%2021.4779%2020.4975%2021.4522%2020.5068C21.4265%2020.516%2021.3985%2020.5172%2021.3721%2020.5102C21.3456%2020.5031%2021.322%2020.4882%2021.3044%2020.4673L11.3533%208.63726C11.1933%208.44956%2010.994%208.29873%2010.7693%208.19525C10.5446%208.09178%2010.2999%208.03815%2010.0522%208.03809H9.70444C9.2524%208.03809%208.81887%208.21642%208.49922%208.53386C8.17957%208.8513%208%209.28185%208%209.73078V22.2351C8%2022.684%208.17957%2023.1145%208.49922%2023.432C8.81887%2023.7494%209.2524%2023.9277%209.70444%2023.9277V23.9277C9.99591%2023.9278%2010.2825%2023.8537%2010.537%2023.7125C10.7914%2023.5713%2011.0051%2023.3677%2011.1578%2023.1211L14.5022%2018.1898C14.5499%2018.1188%2014.57%2018.033%2014.5589%2017.9484C14.5478%2017.8638%2014.5062%2017.7861%2014.4418%2017.7295C14.3775%2017.673%2014.2947%2017.6415%2014.2087%2017.641C14.1228%2017.6404%2014.0396%2017.6707%2013.9744%2017.7264L10.6822%2020.5622C10.6629%2020.5794%2010.639%2020.5906%2010.6134%2020.5944C10.5878%2020.5983%2010.5617%2020.5947%2010.5381%2020.5841C10.5145%2020.5734%2010.4946%2020.5562%2010.4807%2020.5345C10.4669%2020.5128%2010.4597%2020.4875%2010.46%2020.4618V11.5813C10.46%2011.5541%2010.4684%2011.5276%2010.4842%2011.5053C10.4999%2011.483%2010.5221%2011.4661%2010.5478%2011.4568C10.5735%2011.4476%2010.6015%2011.4464%2010.6279%2011.4534C10.6544%2011.4605%2010.678%2011.4755%2010.6956%2011.4963L20.6456%2023.3286C20.8056%2023.5163%2021.0049%2023.6671%2021.2296%2023.7706C21.4543%2023.874%2021.699%2023.9277%2021.9467%2023.9277H22.2944C22.5184%2023.9279%2022.7401%2023.8842%2022.947%2023.7992C23.154%2023.7142%2023.342%2023.5895%2023.5004%2023.4324C23.6588%2023.2752%2023.7844%2023.0885%2023.8702%2022.8831C23.9559%2022.6776%2024%2022.4574%2024%2022.2351V9.73078C24%209.28185%2023.8204%208.8513%2023.5008%208.53386C23.1811%208.21642%2022.7476%208.03809%2022.2956%208.03809C22.0041%208.03801%2021.7175%208.11211%2021.4631%208.25332C21.2086%208.39453%2020.9949%208.59814%2020.8422%208.84471V8.84471Z%22%20fill%3D%22black%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip00033%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22black%22%20transform%3D%22translate(8%207.9834)%22%3E%3C%2Frect%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E"});var qt=cn(Qu(),1),{addKey:el,createAccount:YB,deleteAccount:ioe,deleteKey:aoe,deployContract:ZB,deployGlobalContract:soe,fullAccessKey:Yh,functionCall:M6,functionCallAccessKey:JB,transfer:$6,useGlobalContract:coe}=np,rr="optimistic",N6="EXECUTED_OPTIMISTIC",tl=class t{accountId;provider;signer;constructor(e,r,n){this.accountId=e,this.provider=r,this.signer=n}setSigner(e){this.signer=e}getSigner(){return this.signer}async getState(){let e=await this.provider.experimental_protocolConfig({finality:rr}),r=await this.provider.viewAccount(this.accountId,{finality:rr}),n=BigInt(e.runtime_config.storage_amount_per_byte),o=BigInt(r.storage_usage)*n,i=BigInt(r.locked),a=BigInt(r.amount)+i,s=a-(i>o?i:o);return{balance:{total:a,usedOnStorage:o,locked:i,available:s},storageUsage:r.storage_usage,codeHash:r.code_hash}}async getAccessKey(e){return this.provider.viewAccessKey(this.accountId,e,{finality:rr})}async getAccessKeyList(){return this.provider.viewAccessKeyList(this.accountId,{finality:rr})}async getContractCode(){return this.provider.viewContractCode(this.accountId,{finality:rr})}async getContractState(e){return this.provider.viewContractState(this.accountId,e,{finality:rr})}async createTransaction(e,r,n){if(!n)throw new Error("Please provide a public key");let o=Dt.from(n),i=await this.getAccessKey(o),s=(await this.provider.viewBlock({finality:rr})).header.hash,c=BigInt(i.nonce)+1n;return od(this.accountId,o,e,c+1n,r,Br(s))}async createSignedTransaction(e,r){if(!this.signer)throw new Error("Please set a signer");let n=await this.createTransaction(e,r,await this.signer.getPublicKey()),[,o]=await this.signer.signTransaction(n);return o}async createMetaTransaction(e,r,n=200,o){if(!o)throw new Error("Please provide a public key");let i=Dt.from(o),a=await this.getAccessKey(i),s=BigInt(a.nonce)+1n,{header:c}=await this.provider.viewBlock({finality:rr}),f=BigInt(c.height)+BigInt(n);return qg({receiverId:e,senderId:this.accountId,actions:r,publicKey:i,nonce:s,maxBlockHeight:f})}async createSignedMetaTransaction(e,r,n=200){if(!this.signer)throw new Error("Please set a signer");let o=await this.createMetaTransaction(e,r,n,await this.signer.getPublicKey());return this.signer.signDelegateAction(o)}async signAndSendTransaction({receiverId:e,actions:r,waitUntil:n=N6,throwOnFailure:o=!0}){let i=await this.createSignedTransaction(e,r),a=await this.provider.sendTransactionUntil(i,n);if(o&&typeof a.status=="object"&&typeof a.status.Failure=="object"&&a.status.Failure!==null)throw Mg(a);return a}async signAndSendTransactions({transactions:e,waitUntil:r=N6,throwOnFailure:n=!0}){if(!this.signer)throw new Error("Please set a signer");return await Promise.all(e.map(async({receiverId:i,actions:a})=>this.signAndSendTransaction({receiverId:i,actions:a,waitUntil:r,throwOnFailure:n})))}async createAccount(e,r,n="0"){if(e.endsWith(this.accountId))return this.createSubAccount(e,r,n);let o=e.split(".");if(o.length!=2)throw new Error("newAccountId needs to be of the form <string>.<tla>");let i=o[1];return this.signAndSendTransaction({receiverId:i,actions:[M6("create_account",{new_account_id:e,new_public_key:r.toString()},BigInt("60000000000000"),BigInt(n))]})}async createSubAccount(e,r,n="0"){if(!this.signer)throw new Error("Please set a signer");let o=e.includes(".")?e:`${e}.${this.accountId}`;if(o.length>64)throw new Error("Accounts cannot exceed 64 characters");if(!o.endsWith(this.accountId))throw new Error(`New account must end up with ${this.accountId}`);let i=[YB(),$6(BigInt(n)),el(Dt.from(r),Yh())];return this.signAndSendTransaction({receiverId:o,actions:i})}async deleteAccount(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[ioe(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[ZB(e)]})}async deployGlobalContract(e,r){let n=r==="codeHash"?new Ei({CodeHash:null}):new Ei({AccountId:null});return this.signAndSendTransaction({receiverId:this.accountId,actions:[soe(e,n)]})}async useGlobalContract(e){let r="accountId"in e?new Ai({AccountId:e.accountId}):new Ai({CodeHash:typeof e.codeHash=="string"?Buffer.from(e.codeHash,"hex"):e.codeHash});return this.signAndSendTransaction({receiverId:this.accountId,actions:[coe(r)]})}async addFunctionCallAccessKey({publicKey:e,contractId:r,methodNames:n=[],allowance:o=Qd.toUnits("0.25")}){return this.signAndSendTransaction({receiverId:this.accountId,actions:[el(Dt.from(e),JB(r,n,BigInt(o)))]})}async addFullAccessKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[el(Dt.from(e),Yh())]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[aoe(Dt.from(e))]})}async callFunction(e){let r=await this.callFunctionRaw(e);return _E(r)}async callFunctionRaw({contractId:e,methodName:r,args:n={},deposit:o="0",gas:i=kg,waitUntil:a=N6}){return await this.signAndSendTransaction({receiverId:e,actions:[M6(r,n,BigInt(i),BigInt(o))],waitUntil:a})}async signNep413Message({message:e,recipient:r,nonce:n,callbackUrl:o}){if(!this.signer)throw new Error("Please set a signer");return this.signer.signNep413Message(e,this.accountId,r,n,o)}async getBalance(e=Qd){return e.getBalance(this)}async transfer({receiverId:e,amount:r,token:n=Qd}){return n.transfer({from:this,receiverId:e,amount:r})}async signedDelegate({actions:e,blockHeightTtl:r,receiverId:n}){(0,qt.default)("Account.signedDelegate()")("It will be removed in the next major release, please switch to Account.createSignedMetaTransaction()");let{header:i}=await this.provider.viewBlock({finality:rr});if(!this.signer)throw new Error("Please set a signer");let a=await this.signer.getPublicKey(),s=await this.getAccessKey(a),c=qg({actions:e,maxBlockHeight:BigInt(i.height)+BigInt(r),nonce:BigInt(s.nonce)+1n,publicKey:a,receiverId:n,senderId:this.accountId}),[,f]=await this.signer.signDelegateAction(c);return f}getConnection(){return new Gh("",this.provider,new os(new ns))}validateArgs(e){if(!(e.byteLength!==void 0&&e.byteLength===e.length)&&(Array.isArray(e)||typeof e!="object"))throw new Xs}async functionCall({contractId:e,methodName:r,args:n={},gas:o=kg,attachedDeposit:i,walletMeta:a,walletCallbackUrl:s,stringify:c}){(0,qt.default)("Account.functionCall()")("It will be removed in the next major release, please switch to Account.callFunction()"),this.validateArgs(n);let d=[r,n,o,i,c===void 0?Fg:c,!1];return this.signAndSendTransactionLegacy({receiverId:e,actions:[M6.apply(void 0,d)],walletMeta:a,walletCallbackUrl:s})}async getTransactionStatus(e){return(0,qt.default)("Account.getTransactionStatus()")("It will be removed in the next major release, please switch to Provider.viewTransactionStatus()"),this.provider.viewTransactionStatus(e,this.accountId,"EXECUTED_OPTIMISTIC")}async signTransaction(e,r,n){(0,qt.default)("Account.signTransaction()")("It will be removed in the next major release, please switch to Account.createSignedTransaction()");let i=n?.signer||this.signer;if(!i)throw new Error("Please set a signer");let a=await i.getPublicKey(),s=await this.getAccessKey(a),f=(await this.provider.viewBlock({finality:rr})).header.hash,u=BigInt(s.nonce)+1n,d=od(this.accountId,a,e,u+1n,r,Br(f));return i.signTransaction(d)}async createAndDeployContract(e,r,n,o){(0,qt.default)("Account.createAndDeployContract()")("It will be removed in the next major release");let a=Yh();return await this.signAndSendTransactionLegacy({receiverId:e,actions:[YB(),$6(o),el(Dt.from(r),a),ZB(n)]}),new t(e,this.provider)}async sendMoney(e,r){return(0,qt.default)("Account.sendMoney()")("It will be removed in the next major release, please switch to Account.transfer()"),this.signAndSendTransactionLegacy({receiverId:e,actions:[$6(r)]})}async signAndSendTransactionLegacy({receiverId:e,actions:r,returnError:n},o){(0,qt.default)("Account.signAndSendTransactionLegacy()")("It will be removed in the next major release, please switch to Account.signAndSendTransaction()");let a,s,d=await Tg(500,12,1.5,async()=>{[a,s]=await this.signTransaction(e,r,o);try{return await this.provider.sendTransaction(s)}catch(m){if(m.type==="InvalidNonce")return wi.warn(`Retrying transaction ${e}:${kt(a)} with new nonce.`),null;if(m.type==="Expired")return wi.warn(`Retrying transaction ${e}:${kt(a)} due to expired block hash`),null;throw m.context=new j0(kt(a)),m}});if(!d)throw new It("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if(TE({contractId:s.transaction.receiverId,outcome:d}),!n&&typeof d.status=="object"&&typeof d.status.Failure=="object"&&d.status.Failure!==null)throw d.status.Failure.error_message&&d.status.Failure.error_type?new It(`Transaction ${d.transaction_outcome.id} failed. ${d.status.Failure.error_message}`,d.status.Failure.error_type):Mg(d);return d}accessKeyByPublicKeyCache={};async findAccessKey(e,r){if((0,qt.default)("Account.findAccessKey()")("It will be removed in the next major release"),!this.signer)throw new Error("Please set a signer");let o=await this.signer.getPublicKey();if(!o)throw new It(`no matching key pair found in ${this.signer.constructor.name}`,"PublicKeyNotFound");let i=this.accessKeyByPublicKeyCache[o.toString()];if(i!==void 0)return{publicKey:o,accessKey:i};try{let a=await this.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:o.toString(),finality:rr}),s={...a,nonce:BigInt(a.nonce||0)};return this.accessKeyByPublicKeyCache[o.toString()]?{publicKey:o,accessKey:this.accessKeyByPublicKeyCache[o.toString()]}:(this.accessKeyByPublicKeyCache[o.toString()]=s,{publicKey:o,accessKey:s})}catch(a){if(a.type=="AccessKeyDoesNotExist")return null;throw a}}async addKey(e,r,n,o){(0,qt.default)("Account.addKey()")("It will be removed in the next major release, please switch to either Account.addFullAccessKey(), or Account.addFunctionAccessKey()"),n||(n=[]),Array.isArray(n)||(n=[n]);let a;return r?a=JB(r,n,o):a=Yh(),this.signAndSendTransactionLegacy({receiverId:this.accountId,actions:[el(Dt.from(e),a)]})}async viewFunction(e){return(0,qt.default)("Account.viewFunction()")("It will be removed in the next major release, please switch to either Provider.callFunction()"),await KB(this.getConnection(),e)}async viewState(e,r={finality:rr}){return(0,qt.default)("Account.viewState()")("It will be removed in the next major release, please switch to either Account.getContractState()"),await WB(this.getConnection(),this.accountId,e,r)}async getAccessKeys(){return(0,qt.default)("Account.getAccessKeys()")("It will be removed in the next major release, please switch to either Account.getAccessKeyList()"),(await this.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:rr}))?.keys?.map(n=>({...n,access_key:{...n.access_key,nonce:BigInt(n.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(n=>n.access_key.permission!=="FullAccess").map(n=>{let o=n.access_key.permission;return{contractId:o.FunctionCall.receiver_id,amount:o.FunctionCall.allowance,publicKey:n.public_key}})}}async state(){return(0,qt.default)("Account.state()")("It will be removed in the next major release, please switch to either Account.getState()"),this.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async getAccountBalance(){(0,qt.default)("Account.getAccountBalance()")("It will be removed in the next major release, please switch to either Account.getState()");let r=await this.provider.experimental_protocolConfig({finality:rr}),n=await this.state(),o=BigInt(r.runtime_config.storage_amount_per_byte),i=BigInt(n.storage_usage)*o,a=BigInt(n.locked),s=BigInt(n.amount)+a,c=s-(a>i?a:i);return{total:s.toString(),stateStaked:i.toString(),staked:a.toString(),available:c.toString()}}async getActiveDelegatedStakeBalance(){(0,qt.default)("Account.getActiveDelegatedStakeBalance()")("It will be removed in the next major release");let r=await this.provider.block({finality:rr}),n=r.header.hash,o=r.header.epoch_id,{current_validators:i,next_validators:a,current_proposals:s}=await this.provider.validators(o),c=new Set;[...i,...a,...s].forEach(w=>c.add(w.account_id));let f=[...c],u=f.map(w=>this.viewFunction({contractId:w,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:n}})),d=await Promise.allSettled(u);if(d.some(w=>w.status==="rejected"&&w.reason.type==="TimeoutError"))throw new Error("Failed to get delegated stake balance");let b=d.reduce((w,T,P)=>{let R=f[P];if(T.status==="fulfilled"){let k=BigInt(T.value);if(k!==0n)return{...w,stakedValidators:[...w.stakedValidators,{validatorId:R,amount:k.toString()}],total:w.total+k}}return T.status==="rejected"?{...w,failedValidators:[...w.failedValidators,{validatorId:R,error:T.reason}]}:w},{stakedValidators:[],failedValidators:[],total:0n});return{...b,total:b.total.toString()}}};var Zh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},rl=function(t){return t&&t.Math===Math&&t},Ve=rl(typeof globalThis=="object"&&globalThis)||rl(typeof window=="object"&&window)||rl(typeof self=="object"&&self)||rl(typeof Zh=="object"&&Zh)||rl(typeof Zh=="object"&&Zh)||(function(){return this})()||globalThis,x5={},Ht=function(t){try{return!!t()}catch{return!0}},foe=Ht,Wt=!foe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),uoe=Ht,km=!uoe(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),doe=km,Jh=Function.prototype.call,ir=doe?Jh.bind(Jh):function(){return Jh.apply(Jh,arguments)},w5={},dC={}.propertyIsEnumerable,lC=Object.getOwnPropertyDescriptor,loe=lC&&!dC.call({1:2},1);w5.f=loe?function(e){var r=lC(this,e);return!!r&&r.enumerable}:dC;var El=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},pC=km,hC=Function.prototype,zw=hC.call,poe=pC&&hC.bind.bind(zw,zw),bt=pC?poe:function(t){return function(){return zw.apply(t,arguments)}},mC=bt,hoe=mC({}.toString),moe=mC("".slice),Al=function(t){return moe(hoe(t),8,-1)},boe=bt,yoe=Ht,goe=Al,F6=Object,voe=boe("".split),bC=yoe(function(){return!F6("z").propertyIsEnumerable(0)})?function(t){return goe(t)==="String"?voe(t,""):F6(t)}:F6,Mm=function(t){return t==null},xoe=Mm,woe=TypeError,Sl=function(t){if(xoe(t))throw new woe("Can't call method on "+t);return t},Eoe=bC,Aoe=Sl,Il=function(t){return Eoe(Aoe(t))},L6=typeof document=="object"&&document.all,yt=typeof L6>"u"&&L6!==void 0?function(t){return typeof t=="function"||t===L6}:function(t){return typeof t=="function"},Soe=yt,Zr=function(t){return typeof t=="object"?t!==null:Soe(t)},U6=Ve,Ioe=yt,Toe=function(t){return Ioe(t)?t:void 0},ra=function(t,e){return arguments.length<2?Toe(U6[t]):U6[t]&&U6[t][e]},_oe=bt,$m=_oe({}.isPrototypeOf),Boe=Ve,XB=Boe.navigator,QB=XB&&XB.userAgent,Tl=QB?String(QB):"",yC=Ve,j6=Tl,eR=yC.process,tR=yC.Deno,rR=eR&&eR.versions||tR&&tR.version,nR=rR&&rR.v8,Bn,Am;nR&&(Bn=nR.split("."),Am=Bn[0]>0&&Bn[0]<4?1:+(Bn[0]+Bn[1]));!Am&&j6&&(Bn=j6.match(/Edge\/(\d+)/),(!Bn||Bn[1]>=74)&&(Bn=j6.match(/Chrome\/(\d+)/),Bn&&(Am=+Bn[1])));var gC=Am,oR=gC,Roe=Ht,Poe=Ve,Coe=Poe.String,vC=!!Object.getOwnPropertySymbols&&!Roe(function(){var t=Symbol("symbol detection");return!Coe(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&oR&&oR<41}),Ooe=vC,xC=Ooe&&!Symbol.sham&&typeof Symbol.iterator=="symbol",koe=ra,Moe=yt,$oe=$m,Noe=xC,Foe=Object,wC=Noe?function(t){return typeof t=="symbol"}:function(t){var e=koe("Symbol");return Moe(e)&&$oe(e.prototype,Foe(t))},Loe=String,Nm=function(t){try{return Loe(t)}catch{return"Object"}},Uoe=yt,joe=Nm,Doe=TypeError,na=function(t){if(Uoe(t))return t;throw new Doe(joe(t)+" is not a function")},zoe=na,qoe=Mm,E5=function(t,e){var r=t[e];return qoe(r)?void 0:zoe(r)},D6=ir,z6=yt,q6=Zr,Hoe=TypeError,Woe=function(t,e){var r,n;if(e==="string"&&z6(r=t.toString)&&!q6(n=D6(r,t))||z6(r=t.valueOf)&&!q6(n=D6(r,t))||e!=="string"&&z6(r=t.toString)&&!q6(n=D6(r,t)))return n;throw new Hoe("Can't convert object to primitive value")},Fm={exports:{}},Koe=!1,iR=Ve,Goe=Object.defineProperty,A5=function(t,e){try{Goe(iR,t,{value:e,configurable:!0,writable:!0})}catch{iR[t]=e}return e},Voe=Ve,Yoe=A5,aR="__core-js_shared__",sR=Fm.exports=Voe[aR]||Yoe(aR,{});(sR.versions||(sR.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var cR=Fm.exports,EC=function(t,e){return cR[t]||(cR[t]=e||{})},Zoe=Sl,Joe=Object,Lm=function(t){return Joe(Zoe(t))},Xoe=bt,Qoe=Lm,eie=Xoe({}.hasOwnProperty),Mr=Object.hasOwn||function(e,r){return eie(Qoe(e),r)},tie=bt,rie=0,nie=Math.random(),oie=tie(1 .toString),AC=function(t){return"Symbol("+(t===void 0?"":t)+")_"+oie(++rie+nie,36)},iie=Ve,aie=EC,fR=Mr,sie=AC,cie=vC,fie=xC,of=iie.Symbol,H6=aie("wks"),uie=fie?of.for||of:of&&of.withoutSetter||sie,Pt=function(t){return fR(H6,t)||(H6[t]=cie&&fR(of,t)?of[t]:uie("Symbol."+t)),H6[t]},die=ir,uR=Zr,dR=wC,lie=E5,pie=Woe,hie=Pt,mie=TypeError,bie=hie("toPrimitive"),yie=function(t,e){if(!uR(t)||dR(t))return t;var r=lie(t,bie),n;if(r){if(e===void 0&&(e="default"),n=die(r,t,e),!uR(n)||dR(n))return n;throw new mie("Can't convert object to primitive value")}return e===void 0&&(e="number"),pie(t,e)},gie=yie,vie=wC,SC=function(t){var e=gie(t,"string");return vie(e)?e:e+""},xie=Ve,lR=Zr,qw=xie.document,wie=lR(qw)&&lR(qw.createElement),Um=function(t){return wie?qw.createElement(t):{}},Eie=Wt,Aie=Ht,Sie=Um,IC=!Eie&&!Aie(function(){return Object.defineProperty(Sie("div"),"a",{get:function(){return 7}}).a!==7}),Iie=Wt,Tie=ir,_ie=w5,Bie=El,Rie=Il,Pie=SC,Cie=Mr,Oie=IC,pR=Object.getOwnPropertyDescriptor;x5.f=Iie?pR:function(e,r){if(e=Rie(e),r=Pie(r),Oie)try{return pR(e,r)}catch{}if(Cie(e,r))return Bie(!Tie(_ie.f,e,r),e[r])};var po={},kie=Wt,Mie=Ht,TC=kie&&Mie(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),$ie=Zr,Nie=String,Fie=TypeError,$r=function(t){if($ie(t))return t;throw new Fie(Nie(t)+" is not an object")},Lie=Wt,Uie=IC,jie=TC,Xh=$r,hR=SC,Die=TypeError,W6=Object.defineProperty,zie=Object.getOwnPropertyDescriptor,K6="enumerable",G6="configurable",V6="writable";po.f=Lie?jie?function(e,r,n){if(Xh(e),r=hR(r),Xh(n),typeof e=="function"&&r==="prototype"&&"value"in n&&V6 in n&&!n[V6]){var o=zie(e,r);o&&o[V6]&&(e[r]=n.value,n={configurable:G6 in n?n[G6]:o[G6],enumerable:K6 in n?n[K6]:o[K6],writable:!1})}return W6(e,r,n)}:W6:function(e,r,n){if(Xh(e),r=hR(r),Xh(n),Uie)try{return W6(e,r,n)}catch{}if("get"in n||"set"in n)throw new Die("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var qie=Wt,Hie=po,Wie=El,jm=qie?function(t,e,r){return Hie.f(t,e,Wie(1,r))}:function(t,e,r){return t[e]=r,t},S5={exports:{}},Hw=Wt,Kie=Mr,_C=Function.prototype,Gie=Hw&&Object.getOwnPropertyDescriptor,I5=Kie(_C,"name"),Vie=I5&&(function(){}).name==="something",Yie=I5&&(!Hw||Hw&&Gie(_C,"name").configurable),T5={EXISTS:I5,PROPER:Vie,CONFIGURABLE:Yie},Zie=bt,Jie=yt,Ww=Fm.exports,Xie=Zie(Function.toString);Jie(Ww.inspectSource)||(Ww.inspectSource=function(t){return Xie(t)});var _5=Ww.inspectSource,Qie=Ve,eae=yt,mR=Qie.WeakMap,tae=eae(mR)&&/native code/.test(String(mR)),rae=EC,nae=AC,bR=rae("keys"),B5=function(t){return bR[t]||(bR[t]=nae(t))},R5={},oae=tae,BC=Ve,iae=Zr,aae=jm,Y6=Mr,Z6=Fm.exports,sae=B5,cae=R5,yR="Object already initialized",Kw=BC.TypeError,fae=BC.WeakMap,Sm,xl,Im,uae=function(t){return Im(t)?xl(t):Sm(t,{})},dae=function(t){return function(e){var r;if(!iae(e)||(r=xl(e)).type!==t)throw new Kw("Incompatible receiver, "+t+" required");return r}};oae||Z6.state?(Tn=Z6.state||(Z6.state=new fae),Tn.get=Tn.get,Tn.has=Tn.has,Tn.set=Tn.set,Sm=function(t,e){if(Tn.has(t))throw new Kw(yR);return e.facade=t,Tn.set(t,e),e},xl=function(t){return Tn.get(t)||{}},Im=function(t){return Tn.has(t)}):(ys=sae("state"),cae[ys]=!0,Sm=function(t,e){if(Y6(t,ys))throw new Kw(yR);return e.facade=t,aae(t,ys,e),e},xl=function(t){return Y6(t,ys)?t[ys]:{}},Im=function(t){return Y6(t,ys)});var Tn,ys,pf={set:Sm,get:xl,has:Im,enforce:uae,getterFor:dae},P5=bt,lae=Ht,pae=yt,Qh=Mr,Gw=Wt,hae=T5.CONFIGURABLE,mae=_5,RC=pf,bae=RC.enforce,yae=RC.get,gR=String,bm=Object.defineProperty,gae=P5("".slice),vae=P5("".replace),xae=P5([].join),wae=Gw&&!lae(function(){return bm(function(){},"length",{value:8}).length!==8}),Eae=String(String).split("String"),Aae=S5.exports=function(t,e,r){gae(gR(e),0,7)==="Symbol("&&(e="["+vae(gR(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Qh(t,"name")||hae&&t.name!==e)&&(Gw?bm(t,"name",{value:e,configurable:!0}):t.name=e),wae&&r&&Qh(r,"arity")&&t.length!==r.arity&&bm(t,"length",{value:r.arity});try{r&&Qh(r,"constructor")&&r.constructor?Gw&&bm(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=bae(t);return Qh(n,"source")||(n.source=xae(Eae,typeof e=="string"?e:"")),t};Function.prototype.toString=Aae(function(){return pae(this)&&yae(this).source||mae(this)},"toString");var Sae=yt,Iae=po,Tae=S5.exports,_ae=A5,Yo=function(t,e,r,n){n||(n={});var o=n.enumerable,i=n.name!==void 0?n.name:e;if(Sae(r)&&Tae(r,i,n),n.global)o?t[e]=r:_ae(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch{}o?t[e]=r:Iae.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},PC={},Bae=Math.ceil,Rae=Math.floor,Pae=Math.trunc||function(e){var r=+e;return(r>0?Rae:Bae)(r)},Cae=Pae,C5=function(t){var e=+t;return e!==e||e===0?0:Cae(e)},Oae=C5,kae=Math.max,Mae=Math.min,CC=function(t,e){var r=Oae(t);return r<0?kae(r+e,0):Mae(r,e)},$ae=C5,Nae=Math.min,Fae=function(t){var e=$ae(t);return e>0?Nae(e,9007199254740991):0},Lae=Fae,O5=function(t){return Lae(t.length)},Uae=Il,jae=CC,Dae=O5,vR=function(t){return function(e,r,n){var o=Uae(e),i=Dae(o);if(i===0)return!t&&-1;var a=jae(n,i),s;if(t&&r!==r){for(;i>a;)if(s=o[a++],s!==s)return!0}else for(;i>a;a++)if((t||a in o)&&o[a]===r)return t||a||0;return!t&&-1}},OC={includes:vR(!0),indexOf:vR(!1)},zae=bt,J6=Mr,qae=Il,Hae=OC.indexOf,Wae=R5,xR=zae([].push),kC=function(t,e){var r=qae(t),n=0,o=[],i;for(i in r)!J6(Wae,i)&&J6(r,i)&&xR(o,i);for(;e.length>n;)J6(r,i=e[n++])&&(~Hae(o,i)||xR(o,i));return o},k5=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Kae=kC,Gae=k5,Vae=Gae.concat("length","prototype");PC.f=Object.getOwnPropertyNames||function(e){return Kae(e,Vae)};var M5={};M5.f=Object.getOwnPropertySymbols;var Yae=ra,Zae=bt,Jae=PC,Xae=M5,Qae=$r,ese=Zae([].concat),tse=Yae("Reflect","ownKeys")||function(e){var r=Jae.f(Qae(e)),n=Xae.f;return n?ese(r,n(e)):r},wR=Mr,rse=tse,nse=x5,ose=po,ise=function(t,e,r){for(var n=rse(e),o=ose.f,i=nse.f,a=0;a<n.length;a++){var s=n[a];!wR(t,s)&&!(r&&wR(r,s))&&o(t,s,i(e,s))}},ase=Ht,sse=yt,cse=/#|\.prototype\./,_l=function(t,e){var r=use[fse(t)];return r===lse?!0:r===dse?!1:sse(e)?ase(e):!!e},fse=_l.normalize=function(t){return String(t).replace(cse,".").toLowerCase()},use=_l.data={},dse=_l.NATIVE="N",lse=_l.POLYFILL="P",MC=_l,em=Ve,pse=x5.f,hse=jm,mse=Yo,bse=A5,yse=ise,gse=MC,gr=function(t,e){var r=t.target,n=t.global,o=t.stat,i,a,s,c,f,u;if(n?a=em:o?a=em[r]||bse(r,{}):a=em[r]&&em[r].prototype,a)for(s in e){if(f=e[s],t.dontCallGetSet?(u=pse(a,s),c=u&&u.value):c=a[s],i=gse(n?s:r+(o?".":"#")+s,t.forced),!i&&c!==void 0){if(typeof f==typeof c)continue;yse(f,c)}(t.sham||c&&c.sham)&&hse(f,"sham",!0),mse(a,s,f,t)}},vse=kC,xse=k5,$C=Object.keys||function(e){return vse(e,xse)},ER=Wt,wse=bt,Ese=ir,Ase=Ht,X6=$C,Sse=M5,Ise=w5,Tse=Lm,_se=bC,Jc=Object.assign,AR=Object.defineProperty,Bse=wse([].concat),NC=!Jc||Ase(function(){if(ER&&Jc({b:1},Jc(AR({},"a",{enumerable:!0,get:function(){AR(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(o){e[o]=o}),Jc({},t)[r]!==7||X6(Jc({},e)).join("")!==n})?function(e,r){for(var n=Tse(e),o=arguments.length,i=1,a=Sse.f,s=Ise.f;o>i;)for(var c=_se(arguments[i++]),f=a?Bse(X6(c),a(c)):X6(c),u=f.length,d=0,m;u>d;)m=f[d++],(!ER||Ese(s,c,m))&&(n[m]=c[m]);return n}:Jc,Rse=gr,SR=NC;Rse({target:"Object",stat:!0,arity:2,forced:Object.assign!==SR},{assign:SR});var Pse=Pt,Cse=Pse("toStringTag"),FC={};FC[Cse]="z";var Ose=String(FC)==="[object z]",kse=Ose,Mse=yt,ym=Al,$se=Pt,Nse=$se("toStringTag"),Fse=Object,Lse=ym((function(){return arguments})())==="Arguments",Use=function(t,e){try{return t[e]}catch{}},Dm=kse?ym:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=Use(e=Fse(t),Nse))=="string"?r:Lse?ym(e):(n=ym(e))==="Object"&&Mse(e.callee)?"Arguments":n},jse=Dm,Dse=String,hf=function(t){if(jse(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Dse(t)},zse=$r,qse=function(){var t=zse(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},Hse=ir,Wse=Mr,Kse=$m,Gse=qse,IR=RegExp.prototype,Vse=function(t){var e=t.flags;return e===void 0&&!("flags"in IR)&&!Wse(t,"flags")&&Kse(IR,t)?Hse(Gse,t):e},Yse=T5.PROPER,Zse=Yo,Jse=$r,TR=hf,Xse=Ht,Qse=Vse,$5="toString",LC=RegExp.prototype,UC=LC[$5],ece=Xse(function(){return UC.call({source:"a",flags:"b"})!=="/a/b"}),tce=Yse&&UC.name!==$5;(ece||tce)&&Zse(LC,$5,function(){var e=Jse(this),r=TR(e.source),n=TR(Qse(e));return"/"+r+"/"+n},{unsafe:!0});function Ee(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{f(n.next(u))}catch(d){a(d)}}function c(u){try{f(n.throw(u))}catch(d){a(d)}}function f(u){u.done?i(u.value):o(u.value).then(s,c)}f((n=n.apply(t,e||[])).next())})}var rce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAMAAABOo35HAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD8UExURUdwTGx5rpLO8YOYx1Og0ly29X5ezR4mT0tiji4eWJ953KGn1Jxs7qB9xvfD/Us0gduu8yeh4HOq74dD647R91256eSz+j82cbvg/dSj/LuL79Wp6zCf24KN9xANGRANF59d/0W+/taa/8iN/3HL9uOn/z638Bil7l3G84TP+FHB8o5A/0i9/ZjU+47S+vq8/4Qy/S6w8O+x/5Rp/wyg7G2T/s+T/vO2/+qt/1qp/qDV/HyD/ki4+4R7/qnY/tyh/1Gx/ptU/76E/2bJ9Ld8/4t0/pxe+XvN9iOq7rB0/0i88aRk/6ps/z++/naL/mab/mGh/pVM/wub5mGd+fAEOhEAAAAgdFJOUwBEyWKA47EKJhnFluGA6l3H67Du6crdNOXs5q/I65rcQbfB9AAAIABJREFUeNrsnE9r4zoXxidOG9tNQqBvSrLKeKGF7WIz4J0WgSCuDc1s7vf/Mq/+S0d2p7Zkd7i0SsZJh3th+PGcR4+OpP748T3+4yNODofDKY2/SYxgdbhcfl4ul9M3rY9ZpZefbFwu6TeMD8dJwPp5Sb6l9eFIL5zW5TDoWrEc35wEjtOFDWPxjE2aJMkqWa3W6/WevuigPyVJ+tWngTg+HQ58PmSDQlqvt5Eax+jIBv2UY7umyL6u0JiMBK6DpETp4KqmL/ngX9hnwcEJYl8TGIV1EpzOEaNUCUBqFPwPfRX0W8GfFSPGgX255JCcTpwUByVY1WAU/FHwLxRWV3RdIYGtvhIvKqoVI0WriwoGK1CDvLi8JDouse5L8YqT08M2Op+vVFOYl54wJ+5PkppkJUkJZYlipN9RV1Ne69UXmCOT0zY6Xq+4Kip7GEYGmKZVyNF1ghj9whx//ZfltXQYTE/b8xnTUeFr1R82Lm7vwuPh6Cgz9jr+TVx8Mt+zcTgt0w6Ik310xIJVJXxdUaqgsIzH1w6tjlekxrVdpX/FSlb7zW63a+lrt3vazG8JFiqHVa2ewOQLlR70W1oX58XlhSiv7aerKz4xUvd7Rse9pWO32xxm/VfE6To64yt1KyEsgUt8ckT99GDsHUpL6oq9EaKT4+cWY5weNrvfbZtlNwqLfkpcM0o8XtFMhZlRUT7YYDLKEtmhsurQJNO6R0sEL0brk3FRWe3+ydpMDvblzpDtnvYz/SPihIYFzHRFYYE6xMazBnJWYTyrhsri4uqEfSESPX+WdcWnza7NbjemKyYpVob/Ml5Zu9vP0cmME1aBxZXDuSpdKWSGlK0qxUqteSxUphA7hLoOsednWVe8YiV4y34zTYkX9a4bhXejtbgJp8VQcVmJuDA4Gyp7d2K8TFn1oGnJWbEjqO5ywnLE5+iK8mGyEnbFlMV0dWO1GEyLmhWdA1kKrdiTG7y2duPvss3QWx1qVLVLSxZiJwRWdOQTxJXsd9qrGKvMHsznn4JocbNic6B5KWW5wlLMBmbDesjcOzN4KZLj0uKKD7tWcslcVIJgiLbi1fasSYk3p2WUJTsOdsqqHGVBw9I5q7BQcVp0XlxYXKdNa4Tlqkp8/uNNi0UrzupqawsLd8cYqqoXSkHOqu0ED5SF1AshQo1+tRyteM+F1RhGjXy0oiwZLU9txWwdKEhpTKIIjWv1pDUQHGpXW66uUGfTWi8WIk5Pd6Ao5VqNNDCGq7170WIx9IqFqq4iuXNUVyWr95RVDeYsSKqwPEvSkrgQLcXFhHW/STz8T2uqz9DKfHwrPVisMP/GSV0tZdkxvq6qgf6fzu+1hQsoC+mwRQd/Pi5kXOnmt+Jh53fH4mkG220m/gOSh0gpyuBSVVhhuNxRsbRfh+5sCH1LCqpjvNg39kHYrLiIcfEqZHwah5DzM8tbk2glbBbEVgHKqVANMxViJzvApWFd9wOWcng9FSrHQtLpaUJdgFa8euqHheExzeWptRuzMgqzgpaO8bClVVXuhoXSVT0kLCEtwUo+mG2hxwVoxetdNhYW09YkXUFQ3LIMJ1OJGPJyFoiqVVrD6K6VpSdCpS0xlqjEdD8a1hRa8fYs8DiuBUrRpSWF1e/+DbSzrCq0YpaaDjv2mJ9Wutll9w8xNWKGpLT242gl0fnDEsRDylKkqoF2Vu24FoxYcsGjypDQEa3npRVvRllWw8MXXWGPpJVE0bXvWCad2sLCfc9yZkSoqkI3suyljnQrrimOi+Q5mplWuhnp7zKqUm2lo6wQlqGqQygsteDBoAFfuWsdp1Oquu+82dBZyoKuRdhr3kqksMbSov8dja8jtZVsoyFlye6DrSwtLVxbydQA05hqW1qOZ1mrQ1GENGyxx7y0KKzbOFgNz6ajXT5xogO+2j0H4Fm2tNxeqZXgB5SF3JQFBnWtefPW2DJsVLRvR9KKk4GgpV1LSQv0HjDcwh8CpTfCQHPGWJampF1+zrw12rPElDghQXBa2PV3LFc9lrIwbCtbs2ExBMzOo9ZEqCtQUpLFmOfH59lW1emYAN+2rb1snEDrHWm56QE7uAZmQ1iInb3QkaTEgwhgiIgPNCetdNxqpzUmn4kexFhauOdbYDVtdwAr9zzb8JahyqSwCjtkS4vwwX/K82g7T38rnqgs9Rf30S5/xX9QlhO1avNyldVzeKejbKpQSosI46Jhi+Rzxa109DoajFs2ntYfpNWbEHstmrofsmQZFrD5Dk2LCJNnpkWBoXlMPh4Jq4ENG563vLTVC1qgDut+F75/5AiUIfR36er6Wy4URrp5bCsZBavpb2fcRva3+tqCMb7CTg+w6p8qfb8MkeblmpaweOZblFl5nKPRHHuW4fj+FshbeIgXPPBQgSNa8iwpnAjtIjTuToBpyaW0GvPYFlXWPYTWhDnRNJcx1rs8yrC0ZfWOO4CGA5gLkW1ZrJ2skAlBWQPl5CXctpiyfGG12ciVz0lWIjZLa6Osyj3XVtfvG5YmVViGZa11pGUREUpFepDSIjPYlqeyGtXfmpK3sNUAtGj1TmnB3p+7aWiON1jW3klJ6ToEwqKoaNp6iP8KrEa5/di8dbLnRNxrl1Z21JLLRJgd3MMzrrur7E6QeQBYpCRRMkPO8itDtbc4tmNzBgZvw3Kb8AM7PEJbmhXYMESgj0V0yDI1mHNplcdgafkbPKfF9hPHnA0cWPmArGV1acCJtt5+YQH9ynYsgvS6EDllSGnRKB/s8QEGb3Yxxs6Jg5YFtyyArApnbSjPdPcSKQLKUgbveFYe7vFB0WFKf6u3kYhB9wH2ljUrFUrroe1CI6qOGGERhFCfE/8IlVaYsqZ0bNTKB2OVIrBTifJy4cAR3HcWOhKYG0d7M+Fc0vJTlld/C86JIGrpJQ/olaqLTXVtoSqsRGpWOTC5m3DFKTFQ3LVCc7yXstp+f2vUno/JW043XsbSuhq4kDJ07hZurMJAOmBXiloZJi3fBN/CoyNsPzGdsPKxYZmzy8KvsK5F9WUok0LXIqCfbCJDrljlYpRh0krDytBaJ07RluNa8Jj3UV0if5b3pu2DpI6yYMAyjQYrMhD9CpVWHBwdVH/r9xRaIMTbTRoBar9aJWKs+H1XSqxn8JpVJ2dDiQrBKEqAsgKlFbaQhnlrdCVewTa+Vha/X89+iUMM/49EACsKc/IdwfMNBLRIkWtYufb5IGkxZbE7AtMXh9nAefnt6P1ErNfV8iYPxmd2QeKdS3txslpTXPJeU1cg5PRnUK/+BB9LVDNIi+0btu2f3Gg0vZFnbHQPomK3U0Qgra7nj26Is9s/xyOlUxRDZ9d0KLXjlealPCsnQdJK+CZrm80w2imVKLqB/HoKV9W7ooK4okJ1sxCMWUQld2QbFvArupbmrZpVgLL+xy6DZfdwUqzLNS1viWXO9Rptk1E7e1xdtAaVbSHU26oAwT03ZiWZlbQO/ZsPFNbrLbsNH7qd0gzU57fS8VmeX9SkFTj+kH+SbKNanGCTJ7E63vgjCEYsouZBRYm7OzP4kL4WhfXr9XYb3H+ePjfesmYCLd6Jv068bMPEpY/O2Cdm1E40sqrQrUTOy9/iGSxFqwlgpc9vNU9jK5HdAJ4kK3W++vkIt+w7qzmK+v0GC1Qelh44rF//3uTN6CbMuW6j89aPlHdsztH0y7rsArGqxM5q+BF3BW3lK0WLLRD9LV7Aotq6ZzJvNb7RwfS3Rs2JlBaNml7XRpLt8UiorApwykjHhtwOC4ZUKT/KR986lLAorYErdF7r63a0ttbedwOpcRHSdXCXAsYG1fIjDi/28K1DBYvTalvv4OD0t0ZpK/b/JRuMlrMJTdw8CrO7paz8JRSW0FZIx9Ta8hmprZBuCaWVy/1CGLGsuK54lcLdpbJy7zo0sLhvZd77Yg04NHJfntY2Mg1lgnrtPuDrSloS1+NzGgpLJoh7gLIm97dCGuLbI4E79o6/W7hIqVmVtAx969CG1U+nPnOizBC/F6e1itR2DhlY5pjuqO1ZUlovq3BYglbr5fONX38rpCW+juz9HOT0sGzLKqVxleLta1oQFvetW3Zv5+lBbBf+HQvUtuSBoj/VoPH4UqAqc+JnWg4sOSe2QctEfdBmwv1EP9uKOnUeC2gqH/YrSYo9/JKWC4vTus0grAnpNLAQYcJyls9lbmJDKQ2ePl7mgRWUt5yY2ixNK3k+8gPJTsCydSVQKUxSWW+PXhv5fVgib4V2A6f1t/yldRwMDU5TRvAy0aEs0cNMsGbpb8lfntE0y9JKoiM76O4IK7eDOzAshuqNKeshnQmWS6v1tq3x9xP9XYvYsKyOe8nempYsQEXMz+FF82+YVtuG2tZtcd+iyZRYW6nvKctQkuMlmUtZpr/VhvsWpbVdjla6PZZcWQ4qKCrbsdh4K70yvFbW68Cc6N+yUbm0bTit5bQVr6J8uN0ODMtW1hufDn0yPNvd+TWsLf9EqhY+7LNZ2OWTl37/2O7J6LhgAXsLgcVxvc6Yt8zvSWKLxmZJWunzsXRxldzaS9utchsVez94K+v11+uwbwVKq2kFrHY5WjRqlWYjh6jFoFw8A1BvFqvH5yBlDWnLt2Uj9qcbRqvhymr+T9vZtTaOZGG4m51O3M3AsDOEgaEDXhjsxr6JcXxh3AKLHQnFDk68/v//ZavOV51TVfKHpJRkxUl6LubhOW+dKtlO9VG0fGhFrajsxiihfqi8grPLUpphtbhV9lhH4wdN4fjA3Pr88PcPvcahXQZdgRoVserUaHEZiluGGd5P7BD0TqeyFq18xn8YrdHvf4fmXWJd1oNRg7Wj8z8P3WA9zcmsltwqO9JybQMdOD6oEu//lXRY0X6MTIEECi4dYc0F1DzfQdy8v+UJ4bnU4/FDaEGnlZglpH7sog6LaHWGRbjmuZiH/a36JqfGJbGKYDm3PuJDMSHhCdR/bRf6Q9XezuT7rpdZ8/ZK7HDHgutPToL17QNoueUhvxg5tA2zdDm4I2a7fmXIauV53XY/sQ51aMWq3OHduv8QWDOJLIXqh4703Uyfuy6LQzILec3T+TB7P7E+qxaQqmOriNcH0Bo9yEvVeB6cmbTaxcB2HVfSbBYAw2JM7bpyfwuLcImJtRwniQWX6tvQtD4/SNdOG6N6caP7djnc+PJ5gMxq706vuZ+4ZLeYVSSWgzW4W86szK6MXTdrWjt4dHk7nZg1n8/VtBhXI+xvjc/uby3JqmWmaSCxMLaGdotghbUg35UIMs0w1yned2jWfefM0p3pvGUP4qJZwoucGusCJFp+fBv0k/hGDz/0YtDs8dneKqCaDGKWZNdT4tbljrTWdbhMpkJmVT3+OiQtB2um7jnbxY0qQJ1YPcyai1y6i8j2W/t2qZYRqXEovzpYVQ3uFpo1i7YZQv3586cpQW9Wl92/XGaZ6DK5db4/LTmyIrGqcHwELc4sm+ncJESUhoL1FBqurFpP6t0F7QvCjFdwFlqsQWn5MkxWzrtMtyCgJu4yhFmm45onbpXnb1EsWxosa1WBtIaaEwFWvBZUC5uIFdLqDusYVaEqQusXvV7+TOfOk+BYNe2+XYi88mOolIeAT2/ghElwNrOoepnlWR3n84xhmQ6i9fVb3F2N064dkSmzCj8eB3Jr9CDNle7Wd7swD052P9GncBmoDMPM+DTP3/NJtmw8onKZmwi5Fw2kioqOohiGlocFbu1UtxDSPVSeOXqU4TFHLJv14FYN7xVe2i0stcixabXUNViwWJV3a4hKFLNmihdTwifCKDzpUYZHC0zahywtiK19VIDpRMiNu80rJZaj9fsAtBjWTjUMO92ua7Xw7BnwSOqYmpVu2+A6Mbzblxv3fIdly7CAMgxjiA4CYamJb5ZMfgGVXL/80sMsVqtlZmztIJZxgxUCq9LrQc0KcG38uRmgEo1ZyqbJ2aM7LMaVZpfs3cyztPCtFRmvKu5IbbqHCgRag1QiwFJTn2GlmanI6m+W+HWMaCVuHZlW3da5i1TWrFCDHtVmsxmAloMlQTWTXQWKp0kUVSHgf+kd8MfsnJj2XEfcCoTw2ktoRfvtUeMeEqsiq1wZAq1+f6uKzOJdPV2CkxSS59cPVnokXVfccdWv+HmS/iVY+2XYw4q2RTWqQoe7w7QZhhaYtTPrZQ3JcuJHH1hH/7DhdcxFl4w7/5dJa9pp2OdWg8s42yuNisXyoyctb1ayUtZJBXAmhItpdYSFlEItJlH/xIvroNcfd3/+dkevvvKvWEv3RdMaND0DmMW0Nr1oebNyLdXErnCi0RkWD7aLWJ1x64/fvn79fId/7HZZi1e1whRt91FYVRmzerpFZXi2X5jIV8bWDVZ9LAWUkMo1EtJ1Aaz7T/fOrVevVT3WVsUb7rJyjkixWQd39HILzTJNekBjrhOFqxesSK44up4ULoL16etvd/tXvPds072qkiosKqa1kcZBxPK4utNCWJNs/ck1HovesCDobXTlNm3mHhb8x86t2t7ICbcmosCy6b7hA8069KFFZsVa7VSq6yeTvmVYGrtEMNui6m1nMMv915/vKKdqulTSt5ttGdlpUGFlxDocDo933WiNHtKEujAWPc0qLau5jq9owRhgebd0uHupinQbWa8HqXUnXAcgBaxWh45uxbAmqldQeOiER68yLMsScSlk8zpdWwsyhgWViFpVyzTZk/WglKASC6rw4HF1oxVgtXQJA5tVloKq1Dmvp8fjXG1yCSxPqwpuKbVUMxol1maz4XTHqRBjyz2+dKE1ejgPCYyyhzs7wgJSZUlfkuyisrSGBVi+g6jiFWGVqEW0glgqsCCywK1OKe9gRY1CWnxcfwuB1xkWc4IncTWa3YgjNRAKFtGqlrl90ciqWCzMduAEo1NueViZOmOFBJvF1QXWCM2CzEJmx1SxOOafDCxPCzjV0GApXoXZdGepCh1X9GBYqw65hWYlrGwJmktvsxAXSEWtRGnnRtN6GVjgVpXZkpEVYdUa7oeN9srBWt2cWzmzJtqsuBi7Z9Y3gCU1SJXIlqXtRA4Wp3yyHoxQ8RZWCCsK9kDLfXcrLQ9rkYZ5kCgN+K5mMSxGFqqR7Kqj+IJLBAtzq1qmPYPdwrK9aJgHoQLJrMOtuQVmJYjgXOgiNN9MBoClHHOUyriz5+g6xrDAragOw3KwkPWNFCEtcgQVksLr6TZaZFb7KZR6Z5aDNfbv/ir5UqoqlGqsfYuq6jGBhbRyN1PNPFgYs6QAV+HwxG7LLQernU/4brHAi79O+phV+3Os1QpVidkPvKivd5cUVkRLbnpVIlZh58GDqkGsQjpXb7f18lSGhtWCSjBAmqjrortZY4+pRrESwUqFS6mVgWVpFYlaG7V8Pti8Ikj0ZXXjnAhmLfQ5YVDqqYDql1ke1jjQMry4Eo/Y53PY58yiDsJsM5gGy/buB91fHYhVGDek/Oi7AWN1khqkn6FYPc1CYgxprHDRUsi2qVlYwa1CZ9aGOyyn1SFaO4cGS+N6W51ucGv0fTGxXlnBFgttFz/vCsvfLGVa4NhYcCGyY62v3rA8rOBW6LA20jUUei3Im1hhKgyk4Pp29arawbJjop43Ot0n8rNFD1j0MVBAyrHSuPx3ZoKEamyBxbQKfTdHljgFpxUvni0qKcM3h8qN1ZX3qhWsiSq/JsKmYPpf/bsrrJI+6hftGktdcoJFRXlsNYtpFXaJYzZGD3bxvDJinUgsr9bpykqMzGqUPnSNqPkfTjrC2qcfkFyOpSxrnfiyOfFrGyykpefBTaEXz9E8uJJ+VInlI4vduoJWBGvSLK4ZA8ESZPi1DGVZcpNRtpoFtEzPYBpRnALtrowpQc4sxHX6ckUlOlgN+nQBk9arh1l7OrLAalWTXJXtZqFbUS9qbk4c1EYyLQkF1xtVIMXW++mKSiSzCFdDlwy5ZjCz8NPYWqjpyMce9gwscMvcdi4MqDiwbIPlig9JrQDW6XLKs1lGL/u0SdB1N2vvxhgeltWeQOFnO2F/AW7V58zCfqsw97z0grAt3FEsZPUORXg6gVsXaOnMaoSOMo1/1ah/1nSHxQcz4xPJ7eUznsSzs2ZRJRZF1LdT9W3OouLGwU2GDta7w3aJFpnVhPJrDJ7G/gwf/cxiu1gxOeGo4aAPfPefnHwelneL2lHdim7OspIqpHHy4/39Ii0d8E2sUfhBNAv0gIVA9qKXyMWo8M8QwMce+uMSLMotuxq02wwZrzwqYYW0PKwLtDwsB6KhSxNUEoKNqVP4TVdY2RFwuVHTQ8ZFWOBWYe7Qm3VzbpHDnTtOhG/vPNbvp3O0Rt+bhlGFcmzEpsY84cegsOzwRYiVCI8rYHm3HjniDxu7MarMsmqFxDoJqbW7nnOLYZFYGlljZsfmw8w6P66ABbSCVXb/KrCKpsFQgGTWybFar8/RElgtgkXNF3zpDOvV/c+/wtk2kl+91lfA8q+xeTQNVnTXK+MV8joRrTcQy7t1WrfT8rCm7rDEwhFCKyRZD1ivROsVTz7CU48Hjj3942vMgtx6DHtYuRoM+wzgFdegEwraBjDrtPZne245WFODa5EyW1hinc16JRpBL4WIkfkTBn7zch2sT/d/3lVKLLMzGtL9zezMYLxLuK9JrnWrW6Pv0ymgmvqvLQOLk89FH1ivTIUhAROtGP8S/+XrlbA+3VMl4vbVJocq6q5wInS03kLCr5lW9p1cDhZyimuxaTLJz5r1MUtXnsYkHMUtP16uhoW0HKeVeQVI3GCtQsC/265BxPIpn/3kCjZrinKdI7YI0HqZJVwUMEtIf3ctLKjEx41e56R3clCslXglWgGkdzrWbZUIsIDV9KJbIfS7wopNujxerof16SvQStbPqh19W0WstFlrMWvrjhwthBWAYX41TWt+NU0/WFcRen2h8+UWWOiWbbHS2xOrRKt3UYpTfutwZWgFWOQWxDxNkPkkW0y7wnrZnyUEpx9Myz/55wZYQCu8SkZe0hDFO+z5ua7hzXglgYVjkqHlYT1PY2DypSX3hzbrhVGFg8S6ySyitUn7dtW4UzNKvZUmpVk5uVJaDtYzY9K0zrLqCusl8QiBvITn8iMef90Ei93KRLtZ5mSLkONq61vTHK3R92ej1tRY1UiG6THtAYvNoZMtwrrjIlTjn9vMIlq5lbPak1G5rkgJLjdmp+02peVhAa7nJkn6WLJesO4BFvIJGW4jKgL18o87bjTLDaAVrQdDWtEsqHCZuNqiXOstDttvEayp8at5bkI3kavHHma9hHKTQE8oMSl33A4rdSvpGUJgSXvlzi2H1RaKMXWLyjCuxQSUUqyzWVJsJphSTMypo1mf7kdIK4DSeaXbqzWtCY1ZAsqPn5qWg/X8jLQI2rT5nyR+nldXs15UQOkyNJg0KT86wLK01B7y6i1e5di2fcsZvyW9ttv/83Z+PY3kWBSHpdkkZBtlHjYtQr9UlaCkliXUKGuIZClRKQ8QbQlU+f7fZe17/edel9MTXMlWMmmGHqTh1+ceHx9XB0FpASxnW7XV19uyb161TxTZBv9OEkHq2vLHFv7JejsnQ4t2ok5Ze8fKVDOfetEzjd+Ki8rL6pcR1urxMdCa/DSoGC+trC6o641RsmIbAovO3n8PiMqj0srKei8GT4tW7vuervYrlkYBlMe12uEgBm15ZcFLZ4B1b5yTw1UP8iyAlRBWwBNe6LXIfOMKoPXxYW9Y2//nY7+PhtDPn98PkhFU9lXpy7v85CfoarnUcqqJvKzfL98It8BsAKweKfvqTCpoatuYR45nMW3t9dOdOn+QLJrK7ZvVhrq7sayNMNrCBDH52SEqa/PE6Ol+0UsMX08Ea+ul5fhwVTX6uch+S5TxP6/hFhm8FQssa0+ncPUZzyCbQ60tYXBpYKq4/of53xgjLFRWR5TFokScU/NgbWOHsoMXJpCBgscAWCNDC6Koze57X7f7JOpZbbyugrLEBqdQCVGYe2xGZm+4tLyctpZ8FD2wN6+vXFhbMn3bSFRJVEOUhdr6cJEU7pQBTh9hCtnFSCnrWRqVVlZr1sTxj5+1QQW4nLaiWXzju+xBytoGUfE49Z4gBdcQWIbWB4mjENo/yAjS/TOCoroCezdjKIq2ba///e3bz87pCrVFvQscfslBwcdDYPUiQkpSICoANgjWhZtER2tF94Mstq+YtysrK41KGGKFxnV9ff2XhtWhtGqnrbAq8j2QP9sYMIY9Ub0fGsATKIvR6jUNn/EySMYQdWXsSr8abcH1WHeIy0qrphvr5VsoI2qyCcqHFRC9p43KU8KrWgx9g7Bvek2047fHzSAxrE/r7DwyWF2Z0CBUIdQv7VpFWxQaWW0Gsevq9CxaeXGvz4S15VuZ9yglbPkAGlTDYRlaRlQmv/ePU10rs+EJSxhXN7TEpoA5dNJq2zeqrc5vrP0vxMLsJObCOjx7yCpSVnUCZekEoWkZZe0/UVurz55fRbJyjmWEZUSlgRlVaZEhrSWZRKetlKgGKiusfO9pT2cj2FTVcFigLXunzH7fWwXjAssqC0htQFqgKGGYASzU1rKjq2LtaHmNLUM1mA8r7VV9XBWwak4Cy2gLItZ+7/srnq74MiiU3RQKq6y2LdzVIi3CqrZPjwsF9rY8jbKSsgJM20hWp/Asq61Pcwix/4zWwY2vGryyhN0/Y2wwBl+wy2srTlxdWBxJjljWA2AxaTV+DWxIDnWiAlwngWW0Ze/s49vBOLe7rgG2hPphrp0A14IRLITo06ptogdp9TY/g5WVSFXc1wOuxWney91M4iqxErLcDnvnYFdGWIBMGVYQTAtM823NJtE3gh1fGHE9PAmsHiSNaFv5+TulsqxvOVR7XvWtIllZUgBIuCn0w4jawry1rLl18YrLfmIgrKb/oFbVBFQng4W+FUh5Wa2ItVtZbUBROikQQu6DHX46sSZ6YFxay2GwGp4XmjgveGWdFhbSYstgcPcI6FJiAAASE0lEQVRQNIBZaWIGijP3yOJ3zuUJrM6VzXXweEttAKwmmr8tD1aoqSYM4uKEPwmG0Nq4jMWmUOAiuAFdCcQUxhA/2rXpNbGrvXeBdXVuHLNhNdtD80eiFVGWlCeEZXyLnTvTgAUrILRX2I3iI9JUAVtEKy3UVnShprrwSz0EVjKruxXQ6coP4UmVBdpiLXLQlYIO2ccrE0VVawaxcN6lGDNVJGjV4eiH9Db5sJreZpmJinECaZ0UltfWph+wbCVj94PWs4qIkGiDifV2PmRx7IysrMByYTmv2vZUZXn5LHoeWJggrFWtwrmzcr0oqqpVrfAzVxR9ajuBnU1bp/eJ/mCxyx9Db+69FFr5dEVRyZPDsrT4aWrQFZbIkBsEiiteCp2yIKQWpN86FCKWy2xYyW6hYcHKfSBPbvDBt1jZ/mjrmLAOqp6tk2URgykw1Z/6XdM1saN53hlYPqwmHkNnV02wdmlFBR/cXZ78x9AirfhAFVVlHZ0aFqyJ7Y6jcwkfsrzRFdv+kI4rX1l/RuUEFSZRympx+p9w7GgBscfQyeB2MK0sl0a9siyuVAfhZQXtc6ayFgcmkGwGvbSke9ydHtbI0lIrUrmbGVT+ZCINrGWDCKPo+61+5HLOlQVruqj6siKJoUFhyWBYAGt6clhWWyt+kANHXgJ9XbXUrLyiRG8Qd3rpJNpKKmwArMQEelQkZUmUl4F1hh9ib7QFth4OCKEYRc+yWaFVTFHCK4poS7TK561umR7GHFij74skqortcGSQlQEm5d3NGWBdXFxqWuSGBhhCJURR9MOooFGLwCpsM6hh/a5TsAYoa3T1r2jLTLbNTUDlE5a9ZuNzwLrw2jLhARq+X86wqDfxrNUzMnCuonD9Fjh6F81jFqzLBeHkHcuLSpIBNJqytMrZ5ehstADW4wZEFQ4Hv3IplyDImuiP+FFdWbB+zMLWpgp7G/2AkSNRFJFZXPOr88BC34JbioATFsi0wHJBVJiQJeKkhToT9ouifmuosi4AVt/VUVmNdJx8aLDXmUzL0wKbh+8bTijcrKVVJrCDUNGqyPstrqw8WOOblLHTnkHa5EAcS8r1mUwLaYGqrLebUewzOpRQhbctVFbc2HjHz4KFEb6i5UKvkeETKM86h4GWu5lB4bGXlY7oc1IJXm59DLT43qfOh1Vxw/Lbm/QMlrIszxNLKS17WI8nN2n9GMcSETIVBhG+OJxVW2SWWBas0XRBW74qLvuca+EQVo7WGefQ+ZaAATTDJBIxQdjaPSEx5feJqqDniR3ND3nKurzbVtGpoI+fvpIJU1jio6zm30dnpaVshSASXV+UT6nAqMUXzuxs3iJxq8tT1uWC1XxEYBVtsIhflRLm8P580gJaQrV2Z6iK/jYwlA5t6t9cA4Fx9rfb+Xh95SlLZwfaWjWVbLysnLhoHnXKktX5LN7Ran2PwDCFIot8NqjLHZbZSWT9lh/DPGXp7CCdR5HkwHVFUFla8szSsi4P37Ld8YiCHUf/IT8UeMBvx9in086ZVpc9hpPpXRXvnoOkYAL9QljapRCe5VmlBbR+qVan0h1fDnloJ5m+JTUgftIBM0YftYF5yhpdLXp6on0Mze0WF8Bay7vZOaUF+0TjW5jgRTJOaY8SCXIicHL7xIL3W5ljqB2+Cmc4TcTLSUwGwypRWmtZnnNBdLTghiIRO1PUv8M2sWDBwX+NzhgC/4bBG0mlmbAuftykMrskyyBPWGBZa7kuy7tzdQ+EljL3qhX+kEuIY7Y+9r4kP5IGF79/KxcWmJYvZWQ4wmH5ypKynoUKO7PHO1pws7vpinHLp0Xy94cXCXi+gxgwhmBatDqWdPtMAlYp0aykxEEsy/V6Pj0/LfNtKvVoJol2ovE+cRcXhIwV3lH5O/hWLqzLWWxU9JCQ0iq9sNC5jG1Nzktrgr7lTriCHSlCSdBKXvGzV8G0Ze8NzIZlkhbt2yUVVkwKJ3FtnuXaDOLsanTxf/EtkEbRMvOmdbP4w3F13G91+bDMCY+MhSXjUqaM10KYQzkfQGs0Gn3F5TFdujrB16RhZVQpz1dMWf4em1xYbA5lhAuAlfxhRLWG14chtEaX08sjaYW8hSIr4v1PwuEVKylYvzVAWaPxTcRKVgd0FeI7sCo1rTKX1uTqdn6c5QEtPIaAb3f3x9OK5G+LqA3MhgVzSJo+CwpRVSEyBFpISssLXvNojae3t0+3t8fS+qUK51voUja779KpQSSaU8heeJ44AJYO8bKJ+/aoRi5tYCDCkmvgZWh9H39Zzfe3T/o6ntaj/jYdrSMbeUFKVbelBnVpbWXD0uvhXcOPJ6SkrEpuWWYpRHWtgdZ6Ppt+7Qc4ji41q5enp5eX2+Mm0SQIE0ahaFbpLgvVJZzszG/6/yDut+p8WKMrHeJlQxJDf/ccRGWVVeIUmqt8mN9ffSFwjb/Pb180K8PreG35xKQOnYmlT1zdEPrLZPl8WBc/ZjJq26XXVhmCu9/nrO2KuMYLbP5ocenVd377+voE18vr8bR22G/tFHekHasf1CF7xzICnprWAFi4P/TZiuqqlL0toZtBMCyA9fCg4+n99yNwjUbjqZWV1hX88vQFl29dhEjeDn+wDPSoXK3fXufD0n/YMj4frDgrNolrqiszhlpb2rlmf4drNBlPjaxeYALx+fTyhUmENlCIg86+a/HgJ/xFDOHvfRC+5jJvzfJtwNt43Nw5s5L9ZZBpStplkPPS6jJGr4dxMjosqqv7+e0zyOn1+cldL1/xrfZw5dD7GwShq+f7b+N6Q2CZ6kGy4C57wd0qax1CVgRLPzUuPY3j3j5G72zGl05Uz0/P1t2f3CAeTcv0UiSR28r5byZyJ4IcbYgYAuticnMXWneuLRm1DTSUMlRw3Rle0++X4/FkMjLXZDIZj6+m9zON6vn55fnFXd6zvkgLd9M75TpRyKnh6HB3jIu1g2Bpacn+zTJS0sAQMkOIWLgYPoTnw8Prej6fGWT6mpqX2b3mdKvn75nCeqIm/3Kky0/ifmsnxIGB3P0psKpBsLRrrdlJDstYss/K03pAXERcmtfD66vOBHO87m7/197V9CaOBNGwBGEmCkJIOEKcMHK0QpbQ+GD3wVLfkfj/f2e7+rOqus0ANtFqEq82yaz2sPvy6vWrV9VG1OrPtcGqtlA9xq3efCti1SVRnn6LcFgZgjENnDrw8qNoBcUqUswCpEoQfKF/BpD0F8CKVKEVLf1DfTu3rudbUXtYRXcxBjNLqVZxOHCl8k0hyxu0d0d1iLCy3DLwCA0T/KFtMVwn83cg1l3cYvlWVbGCO/uUSx+HPqzp/N2xgcxS1MpTviF4d9cT0irUSAWsZCkMVsJ8hQJ030WoQouVF632PpVn+Rbuf7reKH5MZukDMZVgFThywNTCCi8tVE6yNECGX74EqcC3vgI9v+7QLZRv7aveCuzzYoOZpai1OjR8WcYNc5zJgkBZUktqqWXx0lhZ5QI2aVJ5yBy1Tr4K2xOqxdvRwvlWmE2fk1JvDD3ZxRnMrJc5dIimv4FqLIjAG+cOKZYsUljJcBKWZW2p5bEKAo+5RY7DO9H6VOrel2+lr9hhyl0Gg/Xy8Us2h4KOCaPD0Hc7xGVJxCwNmAh41eFAbJFsBY+FEbvHb/F8i3Gq613jGl6GEItvi0NTsAm0mxK63F2yXocB5cAKSAl7KCaYdWqxwt/rt+yQiwcQfA0Crwg6CIeDBc60cYYh2IUQY7kmOnCrRJJFkcJw+aclttSTCjGrvT2x+cT5VnrNpkfqx2AWRDUWLdoRNrglbJLdDvZYlFmWXbVxDgnNailcj+VbzKKfA6vQ6k3g2AhgvSzeVSFagMyiLUlmcPRexL5B4m4nwIUf5LSQuj+k8nG+db4i9mc8uR6FWVCIBW6g4fvBTVYbHzdwzZJMtIwjLSmzrH8P5gEz61G0XL7V4bvT1R9s1kjMgkIsDiwZtUVImRVpFrWk2DtY6yA8Wix3iAzE4/lWxUuyS1rVkZg1VydiOAllg6Y5wV/hxMEplkMMkaoMx6EXeSZaqKNmaL3d3Ccav/Vp7iCevfPq2FUxvBFRdaOABaPiLZpQSLcEQjxDiP1KKVO+oceUuk46xDRO3eNSvGNCdtH78tH+FtEwshzRVSOBNQfZKhBeZPZFAuUS5zOo16FFaMtQJJl1aoPTah9Ay+VbnX/9n4GrSvsHN3sci1latkjgwEK/okfc0VmITsOa+Cx2HBIbT587slOUL8f51vnCOFaNySzjH2B32zHLjSh46OfR4k10KYi8Y8B0qhXxqk0YiMfzra7q3ZZ3ujUeWDBzDWZUaxaqQ4nSGdwUBoUX1Gfh3tAUYU3L8JQowkH5Fr2+Eu1MjlmGGq28CdkM7gm5yXIpKZH4kjY7tBRRtOzrMMksjVZ2o251aLvvfGWSuB+dWeq3tcsLnMzwsU7BipD7d1KIdbI3JMRK2Yfb0YLOpwqJzYV2h1qviN8aOGRN7E9tnV41XNujrpCGMyU/CyOhJ3FpGwxEohJXt+9v0XyrZ4/SBPKqDKejvlsO0DJWq0li5aYU/iiUUatjoaprFjxQT4rz0rgS83s2knC+1XGnFe75jA2WQctcaYK/Ghl5Uq9WVxTLwcVki4wtyFgs5tZtl8+yK/lWdDRWY4Ol0dKGlJ6EEtt3pFgso4m8Q8JnOWaRyXQbNz43/W/xfOvaNjP4rMnLqM98sttawUo5UjoCI71OD7FSHv7PzFrduCQX51vn3rcDKrDGvkezALSkkXncQIc+Giv8NWax7rDFVovMpaMucXn7zTOSb/kbKuHlBej9LF21Gf3S0fzj11YSVkWtDmdW1BcGWmHNQvlf29sdAla7O27pxftbFdetyjFrfLBAt3JrSMNeJNOsMNyh1KJ4mWF+GzstNmltqV7t7tqCDvkW9aM8n7+MaeAjlZcS2Xgi8bKkXbRHill4wRKtOHlIlODy3ht62dTfT6zsx/LAzxcSCyr2/R5b3x1ab7kxWqV1EQVLsiQ17wnvQJvD1IEYpha2IFuzanp3rSi0rN+CzzGi40R/GVZht37SPcmP9xxEvpTR8gxay5LJmWHiLAzMYkENppVZE1lNH7jLaKav5h75J+SmlVuUtDmXNvlPqUI7el2Z7rDEK1ncOkhmSvt8ViJZpi7LbZk+eAHbvPUHADt3x+6otBzsRNiG1xH05mkXcOeLiTkUrbYXkkwqJG116lRvGKjV+jKkIk/j5Rbk6tFrW6DynXt3ML2/ad4fcpw99WUnH2+5kEVBAmW278fNQ8lNVp/Ae3lvUUiavz/+u9d+qzOvsKEpvN3jmq2ferN7nk1XW1WGDq2SRMpsN6ukDt5zq7cMww6g+bbMd4PegaDzLfPpMu4dbdU+vPPoMnvyGxbAzecNGYKVvdNV6uB9CYq0wLPFNh00ZIM/EfCoDddlb1/C5d6VpP7B+XnqjgeKK1AuvVnLh2DSrd5a8xAx69rw8GRFy9JquRuuKIvp5viphz1ddzzqt/8YAVN2dPaavTz/WUzeVtuyARfhFmeSAU3Zw6xoxBNymlNtLqm0Il8NpZX9b93M9r/trOe815+GCHVZzdbTr8DKwJWL0otWgdRd9galxGiJVAJ4EgYpEPa3yVjzvNfZWctWePa/j/+8ZvOXL3oWIPSluTTXo1oRs5KTQ8otDVXdKmEf8deeTdf6rrCWLv31c7b5KlqZX9j84321DPfAPKd6NatGTqsvATydhFDWapwKxEf4Zvbv0b5JdzbbrL+QVki6cjq5v+azBK5AMrIIkiXq8aEycE1e1xv9rF+nky+Hypw1Ci4U/PHWsExrVjzDd3CJZf4EqEwlLLJskmWJW31fVoyGXTJK30WsWXUqKiXMWj4Nqv/LA9oVtF57L5s3hHEYmRtquPQlHrvwoKklalV/Stb/ZqjMyaivptalbKRbCHGpgyDxn2hxCRrkNFLCkGrxt0NlqvFjqvGSOpZx8QxCy2+V+mtiUI3KqgOCLSA1yb4DUgSvrbYSNbpsWCYyeCCU8lOaW8Cpt+k3QsrhpW9AA2CWXLWguXJtL7IKW4MA1E5xavHdoPKGRhFspRADWkkMV+0WQ+D8g5vA6l97n35XoJCjmb7rS/Y5YMYaRGCTvpY/zb45UKQmgWQ7hRl5dj8wXaPZQr/PQeGTLfQLHn5A+Xl+np/n53nC8x/tAMljWkeBnAAAAABJRU5ErkJggg==",jC={},nce=Wt,oce=TC,ice=po,ace=$r,sce=Il,cce=$C;jC.f=nce&&!oce?Object.defineProperties:function(e,r){ace(e);for(var n=sce(r),o=cce(r),i=o.length,a=0,s;i>a;)ice.f(e,s=o[a++],n[s]);return e};var fce=ra,DC=fce("document","documentElement"),uce=$r,dce=jC,_R=k5,lce=R5,pce=DC,hce=Um,mce=B5,BR=">",RR="<",Vw="prototype",Yw="script",zC=mce("IE_PROTO"),Q6=function(){},qC=function(t){return RR+Yw+BR+t+RR+"/"+Yw+BR},PR=function(t){t.write(qC("")),t.close();var e=t.parentWindow.Object;return t=null,e},bce=function(){var t=hce("iframe"),e="java"+Yw+":",r;return t.style.display="none",pce.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(qC("document.F=Object")),r.close(),r.F},tm,gm=function(){try{tm=new ActiveXObject("htmlfile")}catch{}gm=typeof document<"u"?document.domain&&tm?PR(tm):bce():PR(tm);for(var t=_R.length;t--;)delete gm[Vw][_R[t]];return gm()};lce[zC]=!0;var N5=Object.create||function(e,r){var n;return e!==null?(Q6[Vw]=uce(e),n=new Q6,Q6[Vw]=null,n[zC]=e):n=gm(),r===void 0?n:dce.f(n,r)},yce=Pt,gce=N5,vce=po.f,Zw=yce("unscopables"),Jw=Array.prototype;Jw[Zw]===void 0&&vce(Jw,Zw,{configurable:!0,value:gce(null)});var HC=function(t){Jw[Zw][t]=!0},xce=gr,wce=OC.includes,Ece=Ht,Ace=HC,Sce=Ece(function(){return!Array(1).includes()});xce({target:"Array",proto:!0,forced:Sce},{includes:function(e){return wce(this,e,arguments.length>1?arguments[1]:void 0)}});Ace("includes");var Bl={},Ice=Ht,Tce=!Ice(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),_ce=Mr,Bce=yt,Rce=Lm,Pce=B5,Cce=Tce,CR=Pce("IE_PROTO"),Xw=Object,Oce=Xw.prototype,WC=Cce?Xw.getPrototypeOf:function(t){var e=Rce(t);if(_ce(e,CR))return e[CR];var r=e.constructor;return Bce(r)&&e instanceof r?r.prototype:e instanceof Xw?Oce:null},kce=Ht,Mce=yt,$ce=Zr,OR=WC,Nce=Yo,Fce=Pt,Qw=Fce("iterator"),KC=!1,Es,ew,tw;[].keys&&(tw=[].keys(),"next"in tw?(ew=OR(OR(tw)),ew!==Object.prototype&&(Es=ew)):KC=!0);var Lce=!$ce(Es)||kce(function(){var t={};return Es[Qw].call(t)!==t});Lce&&(Es={});Mce(Es[Qw])||Nce(Es,Qw,function(){return this});var GC={IteratorPrototype:Es,BUGGY_SAFARI_ITERATORS:KC},Uce=po.f,jce=Mr,Dce=Pt,kR=Dce("toStringTag"),mf=function(t,e,r){t&&!r&&(t=t.prototype),t&&!jce(t,kR)&&Uce(t,kR,{configurable:!0,value:e})},zce=GC.IteratorPrototype,qce=N5,Hce=El,Wce=mf,Kce=Bl,Gce=function(){return this},VC=function(t,e,r,n){var o=e+" Iterator";return t.prototype=qce(zce,{next:Hce(+!n,r)}),Wce(t,o,!1),Kce[o]=Gce,t},Vce=bt,Yce=na,Zce=function(t,e,r){try{return Vce(Yce(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},Jce=Zr,Xce=function(t){return Jce(t)||t===null},Qce=Xce,efe=String,tfe=TypeError,rfe=function(t){if(Qce(t))return t;throw new tfe("Can't set "+efe(t)+" as a prototype")},nfe=Zce,ofe=Zr,ife=Sl,afe=rfe,YC=Object.setPrototypeOf||("__proto__"in{}?(function(){var t=!1,e={},r;try{r=nfe(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(o,i){return ife(o),afe(i),ofe(o)&&(t?r(o,i):o.__proto__=i),o}})():void 0),sfe=gr,cfe=ir,ZC=T5,ffe=yt,ufe=VC,MR=WC,$R=YC,dfe=mf,lfe=jm,rw=Yo,pfe=Pt,hfe=Bl,JC=GC,mfe=ZC.PROPER,bfe=ZC.CONFIGURABLE,NR=JC.IteratorPrototype,rm=JC.BUGGY_SAFARI_ITERATORS,nl=pfe("iterator"),FR="keys",ol="values",LR="entries",yfe=function(){return this},XC=function(t,e,r,n,o,i,a){ufe(r,e,n);var s=function(R){if(R===o&&m)return m;if(!rm&&R&&R in u)return u[R];switch(R){case FR:return function(){return new r(this,R)};case ol:return function(){return new r(this,R)};case LR:return function(){return new r(this,R)}}return function(){return new r(this)}},c=e+" Iterator",f=!1,u=t.prototype,d=u[nl]||u["@@iterator"]||o&&u[o],m=!rm&&d||s(o),b=e==="Array"&&u.entries||d,w,T,P;if(b&&(w=MR(b.call(new t)),w!==Object.prototype&&w.next&&(MR(w)!==NR&&($R?$R(w,NR):ffe(w[nl])||rw(w,nl,yfe)),dfe(w,c,!0))),mfe&&o===ol&&d&&d.name!==ol&&(bfe?lfe(u,"name",ol):(f=!0,m=function(){return cfe(d,this)})),o)if(T={values:s(ol),keys:i?m:s(FR),entries:s(LR)},a)for(P in T)(rm||f||!(P in u))&&rw(u,P,T[P]);else sfe({target:e,proto:!0,forced:rm||f},T);return u[nl]!==m&&rw(u,nl,m,{name:o}),hfe[e]=m,T},F5=function(t,e){return{value:t,done:e}},gfe=Il,L5=HC,UR=Bl,QC=pf,vfe=po.f,xfe=XC,nm=F5,wfe=Wt,eO="Array Iterator",Efe=QC.set,Afe=QC.getterFor(eO),Sfe=xfe(Array,"Array",function(t,e){Efe(this,{type:eO,target:gfe(t),index:0,kind:e})},function(){var t=Afe(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,nm(void 0,!0);switch(t.kind){case"keys":return nm(r,!1);case"values":return nm(e[r],!1)}return nm([r,e[r]],!1)},"values"),jR=UR.Arguments=UR.Array;L5("keys");L5("values");L5("entries");if(wfe&&jR.name!=="values")try{vfe(jR,"name",{value:"values"})}catch{}var il=Ve,Ife=Tl,Tfe=Al,om=function(t){return Ife.slice(0,t.length)===t},tO=(function(){return om("Bun/")?"BUN":om("Cloudflare-Workers")?"CLOUDFLARE":om("Deno/")?"DENO":om("Node.js/")?"NODE":il.Bun&&typeof Bun.version=="string"?"BUN":il.Deno&&typeof Deno.version=="object"?"DENO":Tfe(il.process)==="process"?"NODE":il.window&&il.document?"BROWSER":"REST"})(),_fe=tO,U5=_fe==="NODE",DR=S5.exports,Bfe=po,j5=function(t,e,r){return r.get&&DR(r.get,e,{getter:!0}),r.set&&DR(r.set,e,{setter:!0}),Bfe.f(t,e,r)},Rfe=ra,Pfe=j5,Cfe=Pt,Ofe=Wt,zR=Cfe("species"),kfe=function(t){var e=Rfe(t);Ofe&&e&&!e[zR]&&Pfe(e,zR,{configurable:!0,get:function(){return this}})},Mfe=$m,$fe=TypeError,D5=function(t,e){if(Mfe(e,t))return t;throw new $fe("Incorrect invocation")},Nfe=bt,Ffe=Ht,rO=yt,Lfe=Dm,Ufe=ra,jfe=_5,nO=function(){},oO=Ufe("Reflect","construct"),z5=/^\s*(?:class|function)\b/,Dfe=Nfe(z5.exec),zfe=!z5.test(nO),al=function(e){if(!rO(e))return!1;try{return oO(nO,[],e),!0}catch{return!1}},iO=function(e){if(!rO(e))return!1;switch(Lfe(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return zfe||!!Dfe(z5,jfe(e))}catch{return!0}};iO.sham=!0;var aO=!oO||Ffe(function(){var t;return al(al.call)||!al(Object)||!al(function(){t=!0})||t})?iO:al,qfe=aO,Hfe=Nm,Wfe=TypeError,Kfe=function(t){if(qfe(t))return t;throw new Wfe(Hfe(t)+" is not a constructor")},qR=$r,Gfe=Kfe,Vfe=Mm,Yfe=Pt,Zfe=Yfe("species"),Jfe=function(t,e){var r=qR(t).constructor,n;return r===void 0||Vfe(n=qR(r)[Zfe])?e:Gfe(n)},Xfe=km,sO=Function.prototype,HR=sO.apply,WR=sO.call,Qfe=typeof Reflect=="object"&&Reflect.apply||(Xfe?WR.bind(HR):function(){return WR.apply(HR,arguments)}),eue=Al,tue=bt,rue=function(t){if(eue(t)==="Function")return tue(t)},KR=rue,nue=na,oue=km,iue=KR(KR.bind),bf=function(t,e){return nue(t),e===void 0?t:oue?iue(t,e):function(){return t.apply(e,arguments)}},aue=bt,q5=aue([].slice),sue=TypeError,H5=function(t,e){if(t<e)throw new sue("Not enough arguments");return t},cue=Tl,cO=/(?:ipad|iphone|ipod).*applewebkit/i.test(cue),kr=Ve,fue=Qfe,uue=bf,GR=yt,due=Mr,fO=Ht,VR=DC,lue=q5,YR=Um,pue=H5,hue=cO,mue=U5,e5=kr.setImmediate,t5=kr.clearImmediate,bue=kr.process,nw=kr.Dispatch,yue=kr.Function,ZR=kr.MessageChannel,gue=kr.String,ow=0,hl={},JR="onreadystatechange",wl,gs,iw,aw;fO(function(){wl=kr.location});var W5=function(t){if(due(hl,t)){var e=hl[t];delete hl[t],e()}},sw=function(t){return function(){W5(t)}},XR=function(t){W5(t.data)},QR=function(t){kr.postMessage(gue(t),wl.protocol+"//"+wl.host)};(!e5||!t5)&&(e5=function(e){pue(arguments.length,1);var r=GR(e)?e:yue(e),n=lue(arguments,1);return hl[++ow]=function(){fue(r,void 0,n)},gs(ow),ow},t5=function(e){delete hl[e]},mue?gs=function(t){bue.nextTick(sw(t))}:nw&&nw.now?gs=function(t){nw.now(sw(t))}:ZR&&!hue?(iw=new ZR,aw=iw.port2,iw.port1.onmessage=XR,gs=uue(aw.postMessage,aw)):kr.addEventListener&&GR(kr.postMessage)&&!kr.importScripts&&wl&&wl.protocol!=="file:"&&!fO(QR)?(gs=QR,kr.addEventListener("message",XR,!1)):JR in YR("script")?gs=function(t){VR.appendChild(YR("script"))[JR]=function(){VR.removeChild(this),W5(t)}}:gs=function(t){setTimeout(sw(t),0)});var uO={set:e5,clear:t5},eP=Ve,vue=Wt,xue=Object.getOwnPropertyDescriptor,dO=function(t){if(!vue)return eP[t];var e=xue(eP,t);return e&&e.value},lO=function(){this.head=null,this.tail=null};lO.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t){var e=this.head=t.next;return e===null&&(this.tail=null),t.item}}};var pO=lO,wue=Tl,Eue=/ipad|iphone|ipod/i.test(wue)&&typeof Pebble<"u",Aue=Tl,Sue=/web0s(?!.*chrome)/i.test(Aue),ff=Ve,Iue=dO,tP=bf,cw=uO.set,Tue=pO,_ue=cO,Bue=Eue,Rue=Sue,fw=U5,rP=ff.MutationObserver||ff.WebKitMutationObserver,nP=ff.document,oP=ff.process,im=ff.Promise,r5=Iue("queueMicrotask"),Xc,uw,dw,am,iP;r5||(sl=new Tue,cl=function(){var t,e;for(fw&&(t=oP.domain)&&t.exit();e=sl.get();)try{e()}catch(r){throw sl.head&&Xc(),r}t&&t.enter()},!_ue&&!fw&&!Rue&&rP&&nP?(uw=!0,dw=nP.createTextNode(""),new rP(cl).observe(dw,{characterData:!0}),Xc=function(){dw.data=uw=!uw}):!Bue&&im&&im.resolve?(am=im.resolve(void 0),am.constructor=im,iP=tP(am.then,am),Xc=function(){iP(cl)}):fw?Xc=function(){oP.nextTick(cl)}:(cw=tP(cw,ff),Xc=function(){cw(cl)}),r5=function(t){sl.head||Xc(),sl.add(t)});var sl,cl,Pue=r5,Cue=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}},K5=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}},Oue=Ve,zm=Oue.Promise,kue=Ve,ml=zm,Mue=yt,$ue=MC,Nue=_5,Fue=Pt,aP=tO,lw=gC;ml&&ml.prototype;var Lue=Fue("species"),n5=!1,hO=Mue(kue.PromiseRejectionEvent),Uue=$ue("Promise",function(){var t=Nue(ml),e=t!==String(ml);if(!e&&lw===66)return!0;if(!lw||lw<51||!/native code/.test(t)){var r=new ml(function(i){i(1)}),n=function(i){i(function(){},function(){})},o=r.constructor={};if(o[Lue]=n,n5=r.then(function(){})instanceof n,!n5)return!0}return!e&&(aP==="BROWSER"||aP==="DENO")&&!hO}),Rl={CONSTRUCTOR:Uue,REJECTION_EVENT:hO,SUBCLASSING:n5},yf={},sP=na,jue=TypeError,Due=function(t){var e,r;this.promise=new t(function(n,o){if(e!==void 0||r!==void 0)throw new jue("Bad Promise constructor");e=n,r=o}),this.resolve=sP(e),this.reject=sP(r)};yf.f=function(t){return new Due(t)};var zue=gr,Tm=U5,ta=Ve,uf=ir,cP=Yo,fP=YC,que=mf,Hue=kfe,Wue=na,vm=yt,Kue=Zr,Gue=D5,Vue=Jfe,mO=uO.set,G5=Pue,Yue=Cue,Zue=K5,Jue=pO,bO=pf,_m=zm,V5=Rl,yO=yf,qm="Promise",gO=V5.CONSTRUCTOR,Xue=V5.REJECTION_EVENT,Que=V5.SUBCLASSING,pw=bO.getterFor(qm),ede=bO.set,rf=_m&&_m.prototype,ws=_m,sm=rf,vO=ta.TypeError,o5=ta.document,Y5=ta.process,i5=yO.f,tde=i5,rde=!!(o5&&o5.createEvent&&ta.dispatchEvent),xO="unhandledrejection",nde="rejectionhandled",uP=0,wO=1,ode=2,Z5=1,EO=2,cm,dP,ide,lP,AO=function(t){var e;return Kue(t)&&vm(e=t.then)?e:!1},SO=function(t,e){var r=e.value,n=e.state===wO,o=n?t.ok:t.fail,i=t.resolve,a=t.reject,s=t.domain,c,f,u;try{o?(n||(e.rejection===EO&&sde(e),e.rejection=Z5),o===!0?c=r:(s&&s.enter(),c=o(r),s&&(s.exit(),u=!0)),c===t.promise?a(new vO("Promise-chain cycle")):(f=AO(c))?uf(f,c,i,a):i(c)):a(r)}catch(d){s&&!u&&s.exit(),a(d)}},IO=function(t,e){t.notified||(t.notified=!0,G5(function(){for(var r=t.reactions,n;n=r.get();)SO(n,t);t.notified=!1,e&&!t.rejection&&ade(t)}))},TO=function(t,e,r){var n,o;rde?(n=o5.createEvent("Event"),n.promise=e,n.reason=r,n.initEvent(t,!1,!0),ta.dispatchEvent(n)):n={promise:e,reason:r},!Xue&&(o=ta["on"+t])?o(n):t===xO&&Yue("Unhandled promise rejection",r)},ade=function(t){uf(mO,ta,function(){var e=t.facade,r=t.value,n=pP(t),o;if(n&&(o=Zue(function(){Tm?Y5.emit("unhandledRejection",r,e):TO(xO,e,r)}),t.rejection=Tm||pP(t)?EO:Z5,o.error))throw o.value})},pP=function(t){return t.rejection!==Z5&&!t.parent},sde=function(t){uf(mO,ta,function(){var e=t.facade;Tm?Y5.emit("rejectionHandled",e):TO(nde,e,t.value)})},af=function(t,e,r){return function(n){t(e,n,r)}},cf=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=ode,IO(t,!0))},a5=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new vO("Promise can't be resolved itself");var n=AO(e);n?G5(function(){var o={done:!1};try{uf(n,e,af(a5,o,t),af(cf,o,t))}catch(i){cf(o,i,t)}}):(t.value=e,t.state=wO,IO(t,!1))}catch(o){cf({done:!1},o,t)}}};if(gO&&(ws=function(e){Gue(this,sm),Wue(e),uf(cm,this);var r=pw(this);try{e(af(a5,r),af(cf,r))}catch(n){cf(r,n)}},sm=ws.prototype,cm=function(e){ede(this,{type:qm,done:!1,notified:!1,parent:!1,reactions:new Jue,rejection:!1,state:uP,value:null})},cm.prototype=cP(sm,"then",function(e,r){var n=pw(this),o=i5(Vue(this,ws));return n.parent=!0,o.ok=vm(e)?e:!0,o.fail=vm(r)&&r,o.domain=Tm?Y5.domain:void 0,n.state===uP?n.reactions.add(o):G5(function(){SO(o,n)}),o.promise}),dP=function(){var t=new cm,e=pw(t);this.promise=t,this.resolve=af(a5,e),this.reject=af(cf,e)},yO.f=i5=function(t){return t===ws||t===ide?new dP(t):tde(t)},vm(_m)&&rf!==Object.prototype)){lP=rf.then,Que||cP(rf,"then",function(e,r){var n=this;return new ws(function(o,i){uf(lP,n,o,i)}).then(e,r)},{unsafe:!0});try{delete rf.constructor}catch{}fP&&fP(rf,sm)}zue({global:!0,constructor:!0,wrap:!0,forced:gO},{Promise:ws});que(ws,qm,!1);Hue(qm);var cde=Pt,fde=Bl,ude=cde("iterator"),dde=Array.prototype,_O=function(t){return t!==void 0&&(fde.Array===t||dde[ude]===t)},lde=Dm,hP=E5,pde=Mm,hde=Bl,mde=Pt,bde=mde("iterator"),Hm=function(t){if(!pde(t))return hP(t,bde)||hP(t,"@@iterator")||hde[lde(t)]},yde=ir,gde=na,vde=$r,xde=Nm,wde=Hm,Ede=TypeError,J5=function(t,e){var r=arguments.length<2?wde(t):e;if(gde(r))return vde(yde(r,t));throw new Ede(xde(t)+" is not iterable")},Ade=ir,mP=$r,Sde=E5,BO=function(t,e,r){var n,o;mP(t);try{if(n=Sde(t,"return"),!n){if(e==="throw")throw r;return r}n=Ade(n,t)}catch(i){o=!0,n=i}if(e==="throw")throw r;if(o)throw n;return mP(n),r},Ide=bf,Tde=ir,_de=$r,Bde=Nm,Rde=_O,Pde=O5,bP=$m,Cde=J5,Ode=Hm,yP=BO,kde=TypeError,xm=function(t,e){this.stopped=t,this.result=e},gP=xm.prototype,RO=function(t,e,r){var n=r&&r.that,o=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),a=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),c=Ide(e,n),f,u,d,m,b,w,T,P=function(k){return f&&yP(f,"normal",k),new xm(!0,k)},R=function(k){return o?(_de(k),s?c(k[0],k[1],P):c(k[0],k[1])):s?c(k,P):c(k)};if(i)f=t.iterator;else if(a)f=t;else{if(u=Ode(t),!u)throw new kde(Bde(t)+" is not iterable");if(Rde(u)){for(d=0,m=Pde(t);m>d;d++)if(b=R(t[d]),b&&bP(gP,b))return b;return new xm(!1)}f=Cde(t,u)}for(w=i?t.next:f.next;!(T=Tde(w,f)).done;){try{b=R(T.value)}catch(k){yP(f,"throw",k)}if(typeof b=="object"&&b&&bP(gP,b))return b}return new xm(!1)},Mde=Pt,PO=Mde("iterator"),CO=!1;try{vP=0,hw={next:function(){return{done:!!vP++}},return:function(){CO=!0}},hw[PO]=function(){return this},Array.from(hw,function(){throw 2})}catch{}var vP,hw,$de=function(t,e){try{if(!e&&!CO)return!1}catch{return!1}var r=!1;try{var n={};n[PO]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},Nde=zm,Fde=$de,Lde=Rl.CONSTRUCTOR,OO=Lde||!Fde(function(t){Nde.all(t).then(void 0,function(){})}),Ude=gr,jde=ir,Dde=na,zde=yf,qde=K5,Hde=RO,Wde=OO;Ude({target:"Promise",stat:!0,forced:Wde},{all:function(e){var r=this,n=zde.f(r),o=n.resolve,i=n.reject,a=qde(function(){var s=Dde(r.resolve),c=[],f=0,u=1;Hde(e,function(d){var m=f++,b=!1;u++,jde(s,r,d).then(function(w){b||(b=!0,c[m]=w,--u||o(c))},i)}),--u||o(c)});return a.error&&i(a.value),n.promise}});var Kde=gr,Gde=Rl.CONSTRUCTOR,s5=zm,Vde=ra,Yde=yt,Zde=Yo,xP=s5&&s5.prototype;Kde({target:"Promise",proto:!0,forced:Gde,real:!0},{catch:function(t){return this.then(void 0,t)}});Yde(s5)&&(mw=Vde("Promise").prototype.catch,xP.catch!==mw&&Zde(xP,"catch",mw,{unsafe:!0}));var mw,Jde=gr,Xde=ir,Qde=na,ele=yf,tle=K5,rle=RO,nle=OO;Jde({target:"Promise",stat:!0,forced:nle},{race:function(e){var r=this,n=ele.f(r),o=n.reject,i=tle(function(){var a=Qde(r.resolve);rle(e,function(s){Xde(a,r,s).then(n.resolve,o)})});return i.error&&o(i.value),n.promise}});var ole=gr,ile=yf,ale=Rl.CONSTRUCTOR;ole({target:"Promise",stat:!0,forced:ale},{reject:function(e){var r=ile.f(this),n=r.reject;return n(e),r.promise}});var sle=$r,cle=Zr,fle=yf,ule=function(t,e){if(sle(t),cle(e)&&e.constructor===t)return e;var r=fle.f(t),n=r.resolve;return n(e),r.promise},dle=gr,lle=ra,ple=Rl.CONSTRUCTOR,hle=ule;lle("Promise");dle({target:"Promise",stat:!0,forced:ple},{resolve:function(e){return hle(this,e)}});var mle=Zr,ble=Al,yle=Pt,gle=yle("match"),vle=function(t){var e;return mle(t)&&((e=t[gle])!==void 0?!!e:ble(t)==="RegExp")},xle=vle,wle=TypeError,Ele=function(t){if(xle(t))throw new wle("The method doesn't accept regular expressions");return t},Ale=Pt,Sle=Ale("match"),Ile=function(t){var e=/./;try{"/./"[t](e)}catch{try{return e[Sle]=!1,"/./"[t](e)}catch{}}return!1},Tle=gr,_le=bt,Ble=Ele,Rle=Sl,wP=hf,Ple=Ile,Cle=_le("".indexOf);Tle({target:"String",proto:!0,forced:!Ple("includes")},{includes:function(e){return!!~Cle(wP(Rle(this)),wP(Ble(e)),arguments.length>1?arguments[1]:void 0)}});var Ole={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},kle=Um,bw=kle("span").classList,EP=bw&&bw.constructor&&bw.constructor.prototype,Mle=EP===Object.prototype?void 0:EP,AP=Ve,kO=Ole,$le=Mle,dl=Sfe,SP=jm,Nle=mf,Fle=Pt,yw=Fle("iterator"),gw=dl.values,MO=function(t,e){if(t){if(t[yw]!==gw)try{SP(t,yw,gw)}catch{t[yw]=gw}if(Nle(t,e,!0),kO[e]){for(var r in dl)if(t[r]!==dl[r])try{SP(t,r,dl[r])}catch{t[r]=dl[r]}}}};for(fm in kO)MO(AP[fm]&&AP[fm].prototype,fm);var fm;MO($le,"DOMTokenList");var X5=bt,Lle=C5,Ule=hf,jle=Sl,Dle=X5("".charAt),IP=X5("".charCodeAt),zle=X5("".slice),TP=function(t){return function(e,r){var n=Ule(jle(e)),o=Lle(r),i=n.length,a,s;return o<0||o>=i?t?"":void 0:(a=IP(n,o),a<55296||a>56319||o+1===i||(s=IP(n,o+1))<56320||s>57343?t?Dle(n,o):a:t?zle(n,o,o+2):(a-55296<<10)+(s-56320)+65536)}},$O={codeAt:TP(!1),charAt:TP(!0)},qle=$O.charAt,Hle=hf,NO=pf,Wle=XC,_P=F5,FO="String Iterator",Kle=NO.set,Gle=NO.getterFor(FO);Wle(String,"String",function(t){Kle(this,{type:FO,string:Hle(t),index:0})},function(){var e=Gle(this),r=e.string,n=e.index,o;return n>=r.length?_P(void 0,!0):(o=qle(r,n),e.index+=o.length,_P(o,!1))});var Vle=Ht,Yle=Pt,Zle=Wt,BP=Koe,Jle=Yle("iterator"),LO=!Vle(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return t.pathname="c%20d",e.forEach(function(o,i){e.delete("b"),n+=i+o}),r.delete("a",2),r.delete("b",void 0),BP&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(BP||!Zle)||!e.sort||t.href!=="https://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[Jle]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("https://a#\u0431").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Xle=$r,Qle=BO,e0e=function(t,e,r,n){try{return n?e(Xle(r)[0],r[1]):e(r)}catch(o){Qle(t,"throw",o)}},t0e=Wt,r0e=po,n0e=El,o0e=function(t,e,r){t0e?r0e.f(t,e,n0e(0,r)):t[e]=r},i0e=bf,a0e=ir,s0e=Lm,c0e=e0e,f0e=_O,u0e=aO,d0e=O5,RP=o0e,l0e=J5,p0e=Hm,PP=Array,h0e=function(e){var r=s0e(e),n=u0e(this),o=arguments.length,i=o>1?arguments[1]:void 0,a=i!==void 0;a&&(i=i0e(i,o>2?arguments[2]:void 0));var s=p0e(r),c=0,f,u,d,m,b,w;if(s&&!(this===PP&&f0e(s)))for(u=n?new this:[],m=l0e(r,s),b=m.next;!(d=a0e(b,m)).done;c++)w=a?c0e(m,i,[d.value,c],!0):d.value,RP(u,c,w);else for(f=d0e(r),u=n?new this(f):PP(f);f>c;c++)w=a?i(r[c],c):r[c],RP(u,c,w);return u.length=c,u},As=bt,vw=2147483647,bl=36,UO=1,c5=26,m0e=38,b0e=700,y0e=72,g0e=128,v0e="-",x0e=/[^\0-\u007E]/,jO=/[.\u3002\uFF0E\uFF61]/g,CP="Overflow: input needs wider integers to process",xw=bl-UO,OP=RangeError,w0e=As(jO.exec),sf=Math.floor,ww=String.fromCharCode,kP=As("".charCodeAt),DO=As([].join),Qi=As([].push),E0e=As("".replace),A0e=As("".split),S0e=As("".toLowerCase),I0e=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=kP(t,r++);if(o>=55296&&o<=56319&&r<n){var i=kP(t,r++);(i&64512)===56320?Qi(e,((o&1023)<<10)+(i&1023)+65536):(Qi(e,o),r--)}else Qi(e,o)}return e},MP=function(t){return t+22+75*(t<26)},T0e=function(t,e,r){var n=0;for(t=r?sf(t/b0e):t>>1,t+=sf(t/e);t>xw*c5>>1;)t=sf(t/xw),n+=bl;return sf(n+(xw+1)*t/(t+m0e))},_0e=function(t){var e=[];t=I0e(t);var r=t.length,n=g0e,o=0,i=y0e,a,s;for(a=0;a<t.length;a++)s=t[a],s<128&&Qi(e,ww(s));var c=e.length,f=c;for(c&&Qi(e,v0e);f<r;){var u=vw;for(a=0;a<t.length;a++)s=t[a],s>=n&&s<u&&(u=s);var d=f+1;if(u-n>sf((vw-o)/d))throw new OP(CP);for(o+=(u-n)*d,n=u,a=0;a<t.length;a++){if(s=t[a],s<n&&++o>vw)throw new OP(CP);if(s===n){for(var m=o,b=bl;;){var w=b<=i?UO:b>=i+c5?c5:b-i;if(m<w)break;var T=m-w,P=bl-w;Qi(e,ww(MP(w+T%P))),m=sf(T/P),b+=bl}Qi(e,ww(MP(m))),i=T0e(o,d,f===c),o=0,f++}}o++,n++}return DO(e,"")},B0e=function(t){var e=[],r=A0e(E0e(S0e(t),jO,"."),"."),n,o;for(n=0;n<r.length;n++)o=r[n],Qi(e,w0e(x0e,o)?"xn--"+_0e(o):o);return DO(e,".")},R0e=gr,P0e=bt,C0e=CC,O0e=RangeError,$P=String.fromCharCode,NP=String.fromCodePoint,k0e=P0e([].join),M0e=!!NP&&NP.length!==1;R0e({target:"String",stat:!0,arity:1,forced:M0e},{fromCodePoint:function(e){for(var r=[],n=arguments.length,o=0,i;n>o;){if(i=+arguments[o++],C0e(i,1114111)!==i)throw new O0e(i+" is not a valid code point");r[o]=i<65536?$P(i):$P(((i-=65536)>>10)+55296,i%1024+56320)}return k0e(r,"")}});var $0e=Yo,N0e=function(t,e,r){for(var n in e)$0e(t,n,e[n],r);return t},FP=q5,F0e=Math.floor,f5=function(t,e){var r=t.length;if(r<8)for(var n=1,o,i;n<r;){for(i=n,o=t[n];i&&e(t[i-1],o)>0;)t[i]=t[--i];i!==n++&&(t[i]=o)}else for(var a=F0e(r/2),s=f5(FP(t,0,a),e),c=f5(FP(t,a),e),f=s.length,u=c.length,d=0,m=0;d<f||m<u;)t[d+m]=d<f&&m<u?e(s[d],c[m])<=0?s[d++]:c[m++]:d<f?s[d++]:c[m++];return t},L0e=f5,u5=gr,zO=Ve,Q5=dO,U0e=ra,um=ir,Pn=bt,yl=Wt,qO=LO,HO=Yo,j0e=j5,D0e=N0e,z0e=mf,q0e=VC,e8=pf,WO=D5,Ew=yt,H0e=Mr,W0e=bf,K0e=Dm,G0e=$r,KO=Zr,or=hf,V0e=N5,LP=El,UP=J5,Y0e=Hm,dm=F5,Qc=H5,Z0e=Pt,J0e=L0e,X0e=Z0e("iterator"),gf="URLSearchParams",GO=gf+"Iterator",VO=e8.set,Vr=e8.getterFor(gf),Q0e=e8.getterFor(GO),jP=Q5("fetch"),Bm=Q5("Request"),gl=Q5("Headers"),Aw=Bm&&Bm.prototype,DP=gl&&gl.prototype,epe=zO.TypeError,tpe=zO.encodeURIComponent,rpe=String.fromCharCode,npe=U0e("String","fromCodePoint"),ope=parseInt,wm=Pn("".charAt),zP=Pn([].join),ea=Pn([].push),YO=Pn("".replace),ipe=Pn([].shift),qP=Pn([].splice),HP=Pn("".split),ZO=Pn("".slice),ape=Pn(/./.exec),spe=/\+/g,Sw="\uFFFD",cpe=/^[0-9a-f]+$/i,WP=function(t,e){var r=ZO(t,e,e+2);return ape(cpe,r)?ope(r,16):NaN},fpe=function(t){for(var e=0,r=128;r>0&&(t&r)!==0;r>>=1)e++;return e},upe=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(t[0]&31)<<6|t[1]&63;break;case 3:e=(t[0]&15)<<12|(t[1]&63)<<6|t[2]&63;break;case 4:e=(t[0]&7)<<18|(t[1]&63)<<12|(t[2]&63)<<6|t[3]&63;break}return e>1114111?null:e},KP=function(t){t=YO(t,spe," ");for(var e=t.length,r="",n=0;n<e;){var o=wm(t,n);if(o==="%"){if(wm(t,n+1)==="%"||n+3>e){r+="%",n++;continue}var i=WP(t,n+1);if(i!==i){r+=o,n++;continue}n+=2;var a=fpe(i);if(a===0)o=rpe(i);else{if(a===1||a>4){r+=Sw,n++;continue}for(var s=[i],c=1;c<a&&(n++,!(n+3>e||wm(t,n)!=="%"));){var f=WP(t,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;ea(s,f),n+=2,c++}if(s.length!==a){r+=Sw;continue}var u=upe(s);u===null?r+=Sw:o=npe(u)}}r+=o,n++}return r},dpe=/[!'()~]|%20/g,lpe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ppe=function(t){return lpe[t]},GP=function(t){return YO(tpe(t),dpe,ppe)},Iw=q0e(function(e,r){VO(this,{type:GO,target:Vr(e).entries,index:0,kind:r})},gf,function(){var e=Q0e(this),r=e.target,n=e.index++;if(!r||n>=r.length)return e.target=null,dm(void 0,!0);var o=r[n];switch(e.kind){case"keys":return dm(o.key,!1);case"values":return dm(o.value,!1)}return dm([o.key,o.value],!1)},!0),JO=function(t){this.entries=[],this.url=null,t!==void 0&&(KO(t)?this.parseObject(t):this.parseQuery(typeof t=="string"?wm(t,0)==="?"?ZO(t,1):t:or(t)))};JO.prototype={type:gf,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e=this.entries,r=Y0e(t),n,o,i,a,s,c,f;if(r)for(n=UP(t,r),o=n.next;!(i=um(o,n)).done;){if(a=UP(G0e(i.value)),s=a.next,(c=um(s,a)).done||(f=um(s,a)).done||!um(s,a).done)throw new epe("Expected sequence with length 2");ea(e,{key:or(c.value),value:or(f.value)})}else for(var u in t)H0e(t,u)&&ea(e,{key:u,value:or(t[u])})},parseQuery:function(t){if(t)for(var e=this.entries,r=HP(t,"&"),n=0,o,i;n<r.length;)o=r[n++],o.length&&(i=HP(o,"="),ea(e,{key:KP(ipe(i)),value:KP(zP(i,"="))}))},serialize:function(){for(var t=this.entries,e=[],r=0,n;r<t.length;)n=t[r++],ea(e,GP(n.key)+"="+GP(n.value));return zP(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Wm=function(){WO(this,df);var e=arguments.length>0?arguments[0]:void 0,r=VO(this,new JO(e));yl||(this.size=r.entries.length)},df=Wm.prototype;D0e(df,{append:function(e,r){var n=Vr(this);Qc(arguments.length,2),ea(n.entries,{key:or(e),value:or(r)}),yl||this.length++,n.updateURL()},delete:function(t){for(var e=Vr(this),r=Qc(arguments.length,1),n=e.entries,o=or(t),i=r<2?void 0:arguments[1],a=i===void 0?i:or(i),s=0;s<n.length;){var c=n[s];if(c.key===o&&(a===void 0||c.value===a)){if(qP(n,s,1),a!==void 0)break}else s++}yl||(this.size=n.length),e.updateURL()},get:function(e){var r=Vr(this).entries;Qc(arguments.length,1);for(var n=or(e),o=0;o<r.length;o++)if(r[o].key===n)return r[o].value;return null},getAll:function(e){var r=Vr(this).entries;Qc(arguments.length,1);for(var n=or(e),o=[],i=0;i<r.length;i++)r[i].key===n&&ea(o,r[i].value);return o},has:function(e){for(var r=Vr(this).entries,n=Qc(arguments.length,1),o=or(e),i=n<2?void 0:arguments[1],a=i===void 0?i:or(i),s=0;s<r.length;){var c=r[s++];if(c.key===o&&(a===void 0||c.value===a))return!0}return!1},set:function(e,r){var n=Vr(this);Qc(arguments.length,1);for(var o=n.entries,i=!1,a=or(e),s=or(r),c=0,f;c<o.length;c++)f=o[c],f.key===a&&(i?qP(o,c--,1):(i=!0,f.value=s));i||ea(o,{key:a,value:s}),yl||(this.size=o.length),n.updateURL()},sort:function(){var e=Vr(this);J0e(e.entries,function(r,n){return r.key>n.key?1:-1}),e.updateURL()},forEach:function(e){for(var r=Vr(this).entries,n=W0e(e,arguments.length>1?arguments[1]:void 0),o=0,i;o<r.length;)i=r[o++],n(i.value,i.key,this)},keys:function(){return new Iw(this,"keys")},values:function(){return new Iw(this,"values")},entries:function(){return new Iw(this,"entries")}},{enumerable:!0});HO(df,X0e,df.entries,{name:"entries"});HO(df,"toString",function(){return Vr(this).serialize()},{enumerable:!0});yl&&j0e(df,"size",{get:function(){return Vr(this).entries.length},configurable:!0,enumerable:!0});z0e(Wm,gf);u5({global:!0,constructor:!0,forced:!qO},{URLSearchParams:Wm});!qO&&Ew(gl)&&(VP=Pn(DP.has),YP=Pn(DP.set),Tw=function(t){if(KO(t)){var e=t.body,r;if(K0e(e)===gf)return r=t.headers?new gl(t.headers):new gl,VP(r,"content-type")||YP(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),V0e(t,{body:LP(0,or(e)),headers:LP(0,r)})}return t},Ew(jP)&&u5({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return jP(e,arguments.length>1?Tw(arguments[1]):{})}}),Ew(Bm)&&(lm=function(e){return WO(this,Aw),new Bm(e,arguments.length>1?Tw(arguments[1]):{})},Aw.constructor=lm,lm.prototype=Aw,u5({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:lm})));var VP,YP,Tw,lm,hpe={URLSearchParams:Wm,getState:Vr},mpe=gr,t8=Wt,bpe=LO,r8=Ve,ZP=bf,Jr=bt,Rm=Yo,Wr=j5,ype=D5,d5=Mr,n8=NC,ef=h0e,_n=q5,gpe=$O.codeAt,vpe=B0e,Vo=hf,xpe=mf,wpe=H5,XO=hpe,QO=pf,Epe=QO.set,Pm=QO.getterFor("URL"),Ape=XO.URLSearchParams,Spe=XO.getState,fl=r8.URL,l5=r8.TypeError,Cm=r8.parseInt,Ipe=Math.floor,JP=Math.pow,Yr=Jr("".charAt),Rn=Jr(/./.exec),ll=Jr([].join),Tpe=Jr(1 .toString),_pe=Jr([].pop),nf=Jr([].push),_w=Jr("".replace),Bpe=Jr([].shift),Rpe=Jr("".split),vl=Jr("".slice),Om=Jr("".toLowerCase),Ppe=Jr([].unshift),Cpe="Invalid authority",Bw="Invalid scheme",vs="Invalid host",XP="Invalid port",ek=/[a-z]/i,Ope=/[\d+-.a-z]/i,p5=/\d/,kpe=/^0x/i,Mpe=/^[0-7]+$/,$pe=/^\d+$/,tk=/^[\da-f]+$/i,Npe=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Fpe=/[\0\t\n\r #/:<>?@[\\\]^|]/,Lpe=/^[\u0000-\u0020]+/,Upe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,jpe=/[\t\n\r]/g,Kr,Dpe=function(t){var e=Rpe(t,"."),r,n,o,i,a,s,c;if(e.length&&e[e.length-1]===""&&e.length--,r=e.length,r>4)return t;for(n=[],o=0;o<r;o++){if(i=e[o],i==="")return t;if(a=10,i.length>1&&Yr(i,0)==="0"&&(a=Rn(kpe,i)?16:8,i=vl(i,a===8?1:2)),i==="")s=0;else{if(!Rn(a===10?$pe:a===8?Mpe:tk,i))return t;s=Cm(i,a)}nf(n,s)}for(o=0;o<r;o++)if(s=n[o],o===r-1){if(s>=JP(256,5-r))return null}else if(s>255)return null;for(c=_pe(n),o=0;o<n.length;o++)c+=n[o]*JP(256,3-o);return c},zpe=function(t){var e=[0,0,0,0,0,0,0,0],r=0,n=null,o=0,i,a,s,c,f,u,d,m=function(){return Yr(t,o)};if(m()===":"){if(Yr(t,1)!==":")return;o+=2,r++,n=r}for(;m();){if(r===8)return;if(m()===":"){if(n!==null)return;o++,r++,n=r;continue}for(i=a=0;a<4&&Rn(tk,m());)i=i*16+Cm(m(),16),o++,a++;if(m()==="."){if(a===0||(o-=a,r>6))return;for(s=0;m();){if(c=null,s>0)if(m()==="."&&s<4)o++;else return;if(!Rn(p5,m()))return;for(;Rn(p5,m());){if(f=Cm(m(),10),c===null)c=f;else{if(c===0)return;c=c*10+f}if(c>255)return;o++}e[r]=e[r]*256+c,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(m()===":"){if(o++,!m())return}else if(m())return;e[r++]=i}if(n!==null)for(u=r-n,r=7;r!==0&&u>0;)d=e[r],e[r--]=e[n+u-1],e[n+--u]=d;else if(r!==8)return;return e},qpe=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)t[i]!==0?(o>r&&(e=n,r=o),n=null,o=0):(n===null&&(n=i),++o);return o>r?n:e},ul=function(t){var e,r,n,o;if(typeof t=="number"){for(e=[],r=0;r<4;r++)Ppe(e,t%256),t=Ipe(t/256);return ll(e,".")}if(typeof t=="object"){for(e="",n=qpe(t),r=0;r<8;r++)o&&t[r]===0||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=Tpe(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},Em={},rk=n8({},Em,{" ":1,'"':1,"<":1,">":1,"`":1}),nk=n8({},rk,{"#":1,"?":1,"{":1,"}":1}),Rw=n8({},nk,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Zi=function(t,e){var r=gpe(t,0);return r>32&&r<127&&!d5(e,t)?t:encodeURIComponent(t)},pm={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pl=function(t,e){var r;return t.length===2&&Rn(ek,Yr(t,0))&&((r=Yr(t,1))===":"||!e&&r==="|")},QP=function(t){var e;return t.length>1&&pl(vl(t,0,2))&&(t.length===2||(e=Yr(t,2))==="/"||e==="\\"||e==="?"||e==="#")},Hpe=function(t){return t==="."||Om(t)==="%2e"},Wpe=function(t){return t=Om(t),t===".."||t==="%2e."||t===".%2e"||t==="%2e%2e"},Pw={},eC={},Cw={},tC={},rC={},Ow={},nC={},oC={},hm={},mm={},kw={},Mw={},$w={},Nw={},iC={},Fw={},tf={},uo={},aC={},xs={},Go={},o8=function(t,e,r){var n=Vo(t),o,i,a;if(e){if(i=this.parse(n),i)throw new l5(i);this.searchParams=null}else{if(r!==void 0&&(o=new o8(r,!0)),i=this.parse(n,null,o),i)throw new l5(i);a=Spe(new Ape),a.bindURL(this),this.searchParams=a}};o8.prototype={type:"URL",parse:function(t,e,r){var n=this,o=e||Pw,i=0,a="",s=!1,c=!1,f=!1,u,d,m,b;for(t=Vo(t),e||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,t=_w(t,Lpe,""),t=_w(t,Upe,"$1")),t=_w(t,jpe,""),u=ef(t);i<=u.length;){switch(d=u[i],o){case Pw:if(d&&Rn(ek,d))a+=Om(d),o=eC;else{if(e)return Bw;o=Cw;continue}break;case eC:if(d&&(Rn(Ope,d)||d==="+"||d==="-"||d==="."))a+=Om(d);else if(d===":"){if(e&&(n.isSpecial()!==d5(pm,a)||a==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=a,e){n.isSpecial()&&pm[n.scheme]===n.port&&(n.port=null);return}a="",n.scheme==="file"?o=Nw:n.isSpecial()&&r&&r.scheme===n.scheme?o=tC:n.isSpecial()?o=oC:u[i+1]==="/"?(o=rC,i++):(n.cannotBeABaseURL=!0,nf(n.path,""),o=aC)}else{if(e)return Bw;a="",o=Cw,i=0;continue}break;case Cw:if(!r||r.cannotBeABaseURL&&d!=="#")return Bw;if(r.cannotBeABaseURL&&d==="#"){n.scheme=r.scheme,n.path=_n(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,o=Go;break}o=r.scheme==="file"?Nw:Ow;continue;case tC:if(d==="/"&&u[i+1]==="/")o=hm,i++;else{o=Ow;continue}break;case rC:if(d==="/"){o=mm;break}else{o=uo;continue}case Ow:if(n.scheme=r.scheme,d===Kr)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=_n(r.path),n.query=r.query;else if(d==="/"||d==="\\"&&n.isSpecial())o=nC;else if(d==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=_n(r.path),n.query="",o=xs;else if(d==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=_n(r.path),n.query=r.query,n.fragment="",o=Go;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=_n(r.path),n.path.length--,o=uo;continue}break;case nC:if(n.isSpecial()&&(d==="/"||d==="\\"))o=hm;else if(d==="/")o=mm;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,o=uo;continue}break;case oC:if(o=hm,d!=="/"||Yr(a,i+1)!=="/")continue;i++;break;case hm:if(d!=="/"&&d!=="\\"){o=mm;continue}break;case mm:if(d==="@"){s&&(a="%40"+a),s=!0,m=ef(a);for(var w=0;w<m.length;w++){var T=m[w];if(T===":"&&!f){f=!0;continue}var P=Zi(T,Rw);f?n.password+=P:n.username+=P}a=""}else if(d===Kr||d==="/"||d==="?"||d==="#"||d==="\\"&&n.isSpecial()){if(s&&a==="")return Cpe;i-=ef(a).length+1,a="",o=kw}else a+=d;break;case kw:case Mw:if(e&&n.scheme==="file"){o=Fw;continue}else if(d===":"&&!c){if(a==="")return vs;if(b=n.parseHost(a),b)return b;if(a="",o=$w,e===Mw)return}else if(d===Kr||d==="/"||d==="?"||d==="#"||d==="\\"&&n.isSpecial()){if(n.isSpecial()&&a==="")return vs;if(e&&a===""&&(n.includesCredentials()||n.port!==null))return;if(b=n.parseHost(a),b)return b;if(a="",o=tf,e)return;continue}else d==="["?c=!0:d==="]"&&(c=!1),a+=d;break;case $w:if(Rn(p5,d))a+=d;else if(d===Kr||d==="/"||d==="?"||d==="#"||d==="\\"&&n.isSpecial()||e){if(a!==""){var R=Cm(a,10);if(R>65535)return XP;n.port=n.isSpecial()&&R===pm[n.scheme]?null:R,a=""}if(e)return;o=tf;continue}else return XP;break;case Nw:if(n.scheme="file",d==="/"||d==="\\")o=iC;else if(r&&r.scheme==="file")switch(d){case Kr:n.host=r.host,n.path=_n(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=_n(r.path),n.query="",o=xs;break;case"#":n.host=r.host,n.path=_n(r.path),n.query=r.query,n.fragment="",o=Go;break;default:QP(ll(_n(u,i),""))||(n.host=r.host,n.path=_n(r.path),n.shortenPath()),o=uo;continue}else{o=uo;continue}break;case iC:if(d==="/"||d==="\\"){o=Fw;break}r&&r.scheme==="file"&&!QP(ll(_n(u,i),""))&&(pl(r.path[0],!0)?nf(n.path,r.path[0]):n.host=r.host),o=uo;continue;case Fw:if(d===Kr||d==="/"||d==="\\"||d==="?"||d==="#"){if(!e&&pl(a))o=uo;else if(a===""){if(n.host="",e)return;o=tf}else{if(b=n.parseHost(a),b)return b;if(n.host==="localhost"&&(n.host=""),e)return;a="",o=tf}continue}else a+=d;break;case tf:if(n.isSpecial()){if(o=uo,d!=="/"&&d!=="\\")continue}else if(!e&&d==="?")n.query="",o=xs;else if(!e&&d==="#")n.fragment="",o=Go;else if(d!==Kr&&(o=uo,d!=="/"))continue;break;case uo:if(d===Kr||d==="/"||d==="\\"&&n.isSpecial()||!e&&(d==="?"||d==="#")){if(Wpe(a)?(n.shortenPath(),d!=="/"&&!(d==="\\"&&n.isSpecial())&&nf(n.path,"")):Hpe(a)?d!=="/"&&!(d==="\\"&&n.isSpecial())&&nf(n.path,""):(n.scheme==="file"&&!n.path.length&&pl(a)&&(n.host&&(n.host=""),a=Yr(a,0)+":"),nf(n.path,a)),a="",n.scheme==="file"&&(d===Kr||d==="?"||d==="#"))for(;n.path.length>1&&n.path[0]==="";)Bpe(n.path);d==="?"?(n.query="",o=xs):d==="#"&&(n.fragment="",o=Go)}else a+=Zi(d,nk);break;case aC:d==="?"?(n.query="",o=xs):d==="#"?(n.fragment="",o=Go):d!==Kr&&(n.path[0]+=Zi(d,Em));break;case xs:!e&&d==="#"?(n.fragment="",o=Go):d!==Kr&&(d==="'"&&n.isSpecial()?n.query+="%27":d==="#"?n.query+="%23":n.query+=Zi(d,Em));break;case Go:d!==Kr&&(n.fragment+=Zi(d,rk));break}i++}},parseHost:function(t){var e,r,n;if(Yr(t,0)==="["){if(Yr(t,t.length-1)!=="]"||(e=zpe(vl(t,1,-1)),!e))return vs;this.host=e}else if(this.isSpecial()){if(t=vpe(t),Rn(Npe,t)||(e=Dpe(t),e===null))return vs;this.host=e}else{if(Rn(Fpe,t))return vs;for(e="",r=ef(t),n=0;n<r.length;n++)e+=Zi(r[n],Em);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return d5(pm,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;e&&(this.scheme!=="file"||e!==1||!pl(t[0],!0))&&t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,s=t.query,c=t.fragment,f=e+":";return o!==null?(f+="//",t.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=ul(o),i!==null&&(f+=":"+i)):e==="file"&&(f+="//"),f+=t.cannotBeABaseURL?a[0]:a.length?"/"+ll(a,"/"):"",s!==null&&(f+="?"+s),c!==null&&(f+="#"+c),f},setHref:function(t){var e=this.parse(t);if(e)throw new l5(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if(t==="blob")try{return new lf(t.path[0]).origin}catch{return"null"}return t==="file"||!this.isSpecial()?"null":t+"://"+ul(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(Vo(t)+":",Pw)},getUsername:function(){return this.username},setUsername:function(t){var e=ef(Vo(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=Zi(e[r],Rw)}},getPassword:function(){return this.password},setPassword:function(t){var e=ef(Vo(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=Zi(e[r],Rw)}},getHost:function(){var t=this.host,e=this.port;return t===null?"":e===null?ul(t):ul(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,kw)},getHostname:function(){var t=this.host;return t===null?"":ul(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Mw)},getPort:function(){var t=this.port;return t===null?"":Vo(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(t=Vo(t),t===""?this.port=null:this.parse(t,$w))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+ll(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,tf))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){t=Vo(t),t===""?this.query=null:(Yr(t,0)==="?"&&(t=vl(t,1)),this.query="",this.parse(t,xs)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(t=Vo(t),t===""){this.fragment=null;return}Yr(t,0)==="#"&&(t=vl(t,1)),this.fragment="",this.parse(t,Go)},update:function(){this.query=this.searchParams.serialize()||null}};var lf=function(e){var r=ype(this,nr),n=wpe(arguments.length,1)>1?arguments[1]:void 0,o=Epe(r,new o8(e,!1,n));t8||(r.href=o.serialize(),r.origin=o.getOrigin(),r.protocol=o.getProtocol(),r.username=o.getUsername(),r.password=o.getPassword(),r.host=o.getHost(),r.hostname=o.getHostname(),r.port=o.getPort(),r.pathname=o.getPathname(),r.search=o.getSearch(),r.searchParams=o.getSearchParams(),r.hash=o.getHash())},nr=lf.prototype,Gr=function(t,e){return{get:function(){return Pm(this)[t]()},set:e&&function(r){return Pm(this)[e](r)},configurable:!0,enumerable:!0}};t8&&(Wr(nr,"href",Gr("serialize","setHref")),Wr(nr,"origin",Gr("getOrigin")),Wr(nr,"protocol",Gr("getProtocol","setProtocol")),Wr(nr,"username",Gr("getUsername","setUsername")),Wr(nr,"password",Gr("getPassword","setPassword")),Wr(nr,"host",Gr("getHost","setHost")),Wr(nr,"hostname",Gr("getHostname","setHostname")),Wr(nr,"port",Gr("getPort","setPort")),Wr(nr,"pathname",Gr("getPathname","setPathname")),Wr(nr,"search",Gr("getSearch","setSearch")),Wr(nr,"searchParams",Gr("getSearchParams")),Wr(nr,"hash",Gr("getHash","setHash")));Rm(nr,"toJSON",function(){return Pm(this).serialize()},{enumerable:!0});Rm(nr,"toString",function(){return Pm(this).serialize()},{enumerable:!0});fl&&(Lw=fl.createObjectURL,Uw=fl.revokeObjectURL,Lw&&Rm(lf,"createObjectURL",ZP(Lw,fl)),Uw&&Rm(lf,"revokeObjectURL",ZP(Uw,fl)));var Lw,Uw;xpe(lf,"URL");mpe({global:!0,constructor:!0,forced:!bpe,sham:!t8},{URL:lf});var Kpe=gr,Gpe=ir;Kpe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return Gpe(URL.prototype.toString,this)}});function Vpe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function ok(t,...e){if(!Vpe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function sC(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ype(t,e){ok(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function jw(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function lo(t,e){return t<<32-e|t>>>e}function Zpe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function ik(t){return typeof t=="string"&&(t=Zpe(t)),ok(t),t}var h5=class{clone(){return this._cloneInto()}};function Jpe(t){let e=n=>t().update(ik(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Xpe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),c=n?4:0,f=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+f,s,n)}function Qpe(t,e,r){return t&e^~t&r}function ehe(t,e,r){return t&e^t&r^e&r}var m5=class extends h5{constructor(e,r,n,o){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=jw(this.buffer)}update(e){sC(this);let{view:r,buffer:n,blockLen:o}=this;e=ik(e);let i=e.length;for(let a=0;a<i;){let s=Math.min(o-this.pos,i-a);if(s===o){let c=jw(e);for(;o<=i-a;a+=o)this.process(c,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){sC(this),Ype(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let d=a;d<o;d++)r[d]=0;Xpe(n,o-8,BigInt(this.length*8),i),this.process(n,0);let s=jw(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=c/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)s.setUint32(4*d,u[d],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:i,destroyed:a,pos:s}=this;return e.length=o,e.pos=s,e.finished=i,e.destroyed=a,o%r&&e.buffer.set(n),e}},the=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ji=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xi=new Uint32Array(64),b5=class extends m5{constructor(){super(64,32,8,!1),this.A=Ji[0]|0,this.B=Ji[1]|0,this.C=Ji[2]|0,this.D=Ji[3]|0,this.E=Ji[4]|0,this.F=Ji[5]|0,this.G=Ji[6]|0,this.H=Ji[7]|0}get(){let{A:e,B:r,C:n,D:o,E:i,F:a,G:s,H:c}=this;return[e,r,n,o,i,a,s,c]}set(e,r,n,o,i,a,s,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)Xi[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){let m=Xi[d-15],b=Xi[d-2],w=lo(m,7)^lo(m,18)^m>>>3,T=lo(b,17)^lo(b,19)^b>>>10;Xi[d]=T+Xi[d-7]+w+Xi[d-16]|0}let{A:n,B:o,C:i,D:a,E:s,F:c,G:f,H:u}=this;for(let d=0;d<64;d++){let m=lo(s,6)^lo(s,11)^lo(s,25),b=u+m+Qpe(s,c,f)+the[d]+Xi[d]|0,T=(lo(n,2)^lo(n,13)^lo(n,22))+ehe(n,o,i)|0;u=f,f=c,c=s,s=a+b|0,a=i,i=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,o,i,a,s,c,f,u)}roundClean(){Xi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Dw=Jpe(()=>new b5),rhe={struct:{message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}},y5=class{},g5=class t extends y5{key;constructor(e){super(),this.key=e}static fromSecretKey(e){let r=mr.fromString(e);return new t(r)}async getPublicKey(){return this.key.getPublicKey()}async signNep413Message(e,r,n,o,i){if(o.length!==32)throw new Error("Nonce must be exactly 32 bytes long");let a=this.key.getPublicKey(),c=Rc("u32",2147484061),u=Rc(rhe,{message:e,recipient:n,nonce:o,callbackUrl:i}),d=new Uint8Array(c.length+u.length);d.set(c),d.set(u,c.length);let m=new Uint8Array(Dw(d)),{signature:b}=this.key.sign(m);return{accountId:r,publicKey:a,signature:b}}async signTransaction(e){let r=this.key.getPublicKey();if(e.publicKey.toString()!==r.toString())throw new Error("The public key doesn't match the signer's key");let n=rc(e),o=new Uint8Array(Dw(n)),{signature:i}=this.key.sign(o),a=new nd({transaction:e,signature:new hd({keyType:e.publicKey.ed25519Key?Se.ED25519:Se.SECP256K1,data:i})});return[o,a]}async signDelegateAction(e){let r=this.key.getPublicKey();if(e.publicKey.toString()!==r.toString())throw new Error("The public key doesn't match the signer's key");let n=jE(e),o=new Uint8Array(Dw(n)),{signature:i}=this.key.sign(o),a=new Qs({delegateAction:e,signature:new hd({keyType:r.keyType,data:i})});return[o,a]}},cC=480,fC=640,nhe=300,v5=class{constructor(e,r){let n=localStorage.getItem("near_app_wallet_auth_key");if(n){let{accountId:i}=JSON.parse(n);localStorage.setItem("signedAccountId",i),localStorage.removeItem("near_app_wallet_auth_key");let a=localStorage.getItem(`near-api-js:keystore:${i}:${r.networkId}`);if(a){let{contractId:s,methodNames:c}=JSON.parse(localStorage.getItem("near-wallet-selector:contract")||"{}");this.functionCallKey={privateKey:a,contractId:s,methods:c||[]},localStorage.setItem("functionCallKey",JSON.stringify(this.functionCallKey)),localStorage.removeItem(`near-api-js:keystore:${i}:${r.networkId}`)}}this.walletUrl=e,this.provider=new oo({url:r.nodeUrl}),this.signedAccountId=localStorage.getItem("signedAccountId")||"";let o=localStorage.getItem("functionCallKey");this.functionCallKey=o?JSON.parse(o):null,this.network=r}getAccountId(){return this.signedAccountId}getPublicKey(){if(this.functionCallKey)return mr.fromString(this.functionCallKey.privateKey).getPublicKey()}isSignedIn(){return!!this.signedAccountId}signOut(){this.signedAccountId="",this.functionCallKey=null,localStorage.removeItem("signedAccountId"),localStorage.removeItem("functionCallKey")}requestSignIn({contractId:e,methodNames:r}){return Ee(this,void 0,void 0,function*(){let n=yield this.requestSignInUrl({contractId:e,methodNames:r});return yield this.handlePopupTransaction(n,o=>Ee(this,void 0,void 0,function*(){let i=o,{public_key:a,account_id:s}=i;if(s)return this.signedAccountId=s,localStorage.setItem("signedAccountId",s),[{accountId:s,publicKey:a||""}];throw new Error("Invalid response data from wallet")}))})}requestSignInUrl({contractId:e,methodNames:r}){return Ee(this,void 0,void 0,function*(){let n=new URL(window.location.href),o=new URL(`${this.walletUrl}/login/`);if(o.searchParams.set("success_url",n.href),o.searchParams.set("failure_url",n.href),e){o.searchParams.set("contract_id",e);let i=mr.fromRandom("ed25519");o.searchParams.set("public_key",i.getPublicKey().toString()),this.functionCallKey={privateKey:i.toString(),contractId:e,methods:r||[]},localStorage.setItem("functionCallKey",JSON.stringify(this.functionCallKey))}return r&&r.forEach(i=>{o.searchParams.append("methodNames",i)}),o.toString()})}signMessage({message:e,nonce:r,recipient:n,callbackUrl:o,state:i}){return Ee(this,void 0,void 0,function*(){let a=o||window.location.href;if(!a)throw new Error("MyNearWallet: CallbackUrl is missing");let s=new URL(this.walletUrl);return s.pathname="sign-message",s.searchParams.append("message",e),s.searchParams.append("nonce",Buffer.from(r).toString("base64")),s.searchParams.append("recipient",n),s.searchParams.append("callbackUrl",a),i&&s.searchParams.append("state",i),yield this.handlePopupTransaction(s.toString(),c=>{var f,u,d;return{accountId:((f=c?.signedRequest)===null||f===void 0?void 0:f.accountId)||"",publicKey:((u=c?.signedRequest)===null||u===void 0?void 0:u.publicKey)||"",signature:((d=c?.signedRequest)===null||d===void 0?void 0:d.signature)||""}})})}signAndSendTransactions(e){return Ee(this,void 0,void 0,function*(){let r=yield Promise.all(e.map(n=>this.completeTransaction(n)));return this.signAndSendTransactionsMNW(r)})}signAndSendTransaction({receiverId:e,actions:r}){return Ee(this,void 0,void 0,function*(){if(r.length===1&&this.storedKeyCanSign(e,r))try{return this.signUsingKeyPair({receiverId:e,actions:r})}catch(i){console.warn("Failed to sign using key pair, falling back to wallet",i)}let n=yield this.completeTransaction({receiverId:e,actions:r});return(yield this.signAndSendTransactionsMNW([n]))[0]})}completeTransaction({receiverId:e,actions:r}){return Ee(this,void 0,void 0,function*(){let n=yield this.provider.block({finality:"final"}),o=Br(n.header.hash);return od(this.signedAccountId,mr.fromRandom("ed25519").getPublicKey(),e,0,r,o)})}signAndSendTransactionsMNW(e){var r;return Ee(this,void 0,void 0,function*(){let n=this.requestSignTransactionsUrl(e),o=(r=yield this.handlePopupTransaction(n,i=>i.transactionHashes))===null||r===void 0?void 0:r.split(",");if(!o)throw new Error("No transaction hashes received");return Promise.all(o.map(i=>this.provider.txStatus(i,"unused","NONE")))})}storedKeyCanSign(e,r){return this.functionCallKey&&this.functionCallKey.contractId===e?r[0].functionCall&&r[0].functionCall.deposit===BigInt(0)&&(this.functionCallKey.methods.length===0||this.functionCallKey.methods.includes(r[0].functionCall.methodName)):!1}signUsingKeyPair({receiverId:e,actions:r}){return Ee(this,void 0,void 0,function*(){let n=mr.fromString(this.functionCallKey.privateKey),o=new g5(n);return new tl(this.signedAccountId,this.provider,o).signAndSendTransaction({receiverId:e,actions:r})})}requestSignTransactionsUrl(e){let r=new URL("sign",this.walletUrl);return r.searchParams.set("transactions",e.map(n=>Rc(Si.Transaction,n)).map(n=>Buffer.from(n).toString("base64")).join(",")),r.searchParams.set("callbackUrl",new URL(window.location.href).toString()),r.toString()}handlePopupTransaction(e,r){return Ee(this,void 0,void 0,function*(){let n=window.innerWidth||screen.width,o=window.innerHeight||screen.height,i=(n-cC)/2,a=(o-fC)/2,s=window.open(e,"MyNearWallet",`width=${cC},height=${fC},top=${a},left=${i}`);if(!s)throw new Error("Popup window blocked. Please allow popups for this site.");return new Promise((c,f)=>{let u=this.setupMessageHandler(c,f,s,r),d=setInterval(()=>{s.closed&&(window.removeEventListener("message",u),clearInterval(d),f(new Error("User closed the window")))},nhe)})})}setupMessageHandler(e,r,n,o){let i=a=>Ee(this,void 0,void 0,function*(){let s=a.data,c=new URL(a.origin),f=new URL(this.walletUrl);if(c.origin!==f.origin){console.warn("Ignoring message from different origin",c.origin);return}switch(s.status){case"success":n?.close(),e(o(s));break;case"failure":n?.close(),r(new Error(s.errorMessage||"Transaction failed"));break;default:console.warn("Unhandled message status:",s.status)}});return window.addEventListener("message",i),i}},uC=(t,e)=>{if(e)return e;switch(t.networkId){case"mainnet":return"https://app.mynearwallet.com";case"testnet":return"https://testnet.mynearwallet.com";default:throw new Error("Invalid wallet url")}},ohe=(t,e)=>Ee(void 0,void 0,void 0,function*(){return{wallet:new v5(t.walletUrl,e)}}),ihe=({metadata:t,options:e,store:r,params:n,logger:o})=>Ee(void 0,void 0,void 0,function*(){let i=yield ohe(n,e.network),a=()=>Ee(void 0,void 0,void 0,function*(){let s=i.wallet.getAccountId(),c=i.wallet.getPublicKey();return[{accountId:s,publicKey:c?c.toString():""}]});return{signIn({contractId:s,methodNames:c}){return Ee(this,void 0,void 0,function*(){return i.wallet.isSignedIn()||(yield i.wallet.requestSignIn({contractId:s,methodNames:c})),a()})},signOut(){return Ee(this,void 0,void 0,function*(){i.wallet.signOut()})},getAccounts(){return Ee(this,void 0,void 0,function*(){return a()})},verifyOwner(){return Ee(this,void 0,void 0,function*(){throw new Error(`Method not supported by ${t.name}`)})},signMessage({message:s,nonce:c,recipient:f,callbackUrl:u,state:d}){return Ee(this,void 0,void 0,function*(){return o.log("sign message",{message:s}),yield i.wallet.signMessage({message:s,nonce:c,recipient:f,callbackUrl:u,state:d})})},signAndSendTransaction({signerId:s,receiverId:c,actions:f}){return Ee(this,void 0,void 0,function*(){o.log("signAndSendTransaction",{signerId:s,receiverId:c,actions:f});let{contract:u}=r.getState();if(!i.wallet.isSignedIn()||!u)throw new Error("Wallet not signed in");let d=i.wallet.getAccountId();if(s&&d!==s)throw new Error(`Signed in as ${d}, cannot sign for ${s}`);return i.wallet.signAndSendTransaction({receiverId:c||u.contractId,actions:f})})},signAndSendTransactions({transactions:s}){return Ee(this,void 0,void 0,function*(){if(o.log("signAndSendTransactions",{transactions:s}),!i.wallet.isSignedIn())throw new Error("Wallet not signed in");return i.wallet.signAndSendTransactions(s)})},createSignedTransaction(s,c){return Ee(this,void 0,void 0,function*(){throw o.log("createSignedTransaction",{receiverId:s,actions:c}),new Error(`Method not supported by ${t.name}`)})},signTransaction(s){return Ee(this,void 0,void 0,function*(){throw o.log("signTransaction",{transaction:s}),new Error(`Method not supported by ${t.name}`)})},getPublicKey(){return Ee(this,void 0,void 0,function*(){throw o.log("getPublicKey",{}),new Error(`Method not supported by ${t.name}`)})},signNep413Message(s,c,f,u,d){return Ee(this,void 0,void 0,function*(){throw o.log("signNep413Message",{message:s,accountId:c,recipient:f,nonce:u,callbackUrl:d}),new Error(`Method not supported by ${t.name}`)})},signDelegateAction(s){return Ee(this,void 0,void 0,function*(){throw o.log("signDelegateAction",{delegateAction:s}),new Error(`Method not supported by ${t.name}`)})},buildImportAccountsUrl(){return`${n.walletUrl}/batch-import`}}});function ak({walletUrl:t,iconUrl:e=rce,deprecated:r=!1}={}){return n=>Ee(this,void 0,void 0,function*(){return{id:"my-near-wallet",type:"injected",metadata:{name:"MyNearWallet",description:"NEAR wallet to store, buy, send and stake assets for DeFi.",iconUrl:e,deprecated:r,available:!0,downloadUrl:uC(n.options.network,t)},init:o=>ihe(Object.assign(Object.assign({},o),{params:{walletUrl:uC(o.options.network,t)}}))}})}var ng=cn(_k(),1);async function Bk(t){return await t.signOut?.(),t.signIn({})}var Lhe=t=>Object.freeze(t());function Uhe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function b8(t){if(!Uhe(t))throw new TypeError("Uint8Array expected")}function Ck(t,e){if(typeof e!="string")throw new TypeError(`${t}: string expected`);return!0}var Rk=(()=>{try{let t=new TextDecoder;return t.decode(Uint8Array.of(65,48,43,127))==="A0+\x7F"?t:void 0}catch{return}})(),m8=8192;function jhe(t){let e=t.length;if(Rk!==void 0&&e>=12)return Rk.decode(t);if(e<=m8)return String.fromCharCode.apply(null,t);let r="";for(let n=0;n<e;n+=m8)r+=String.fromCharCode.apply(null,t.subarray(n,n+m8));return r}function Dhe(t,e){let r=t.length;if(r>128)throw new Error("alphabet: max 128 letters");let n=new Uint8Array(r),o=new Int8Array(128).fill(-1);for(let i=0;i<r;i++){let a=t.charCodeAt(i);if(t.codePointAt(i)!==a||a>127)throw new Error("alphabet: single-char ASCII letters only");n[i]=a,o[a]=i}if(e!==void 0)for(let i of Object.keys(e)){let a=i.charCodeAt(0),s=o[e[i].charCodeAt(0)];if(i.length!==1||a>127||s===void 0||s===-1)throw new Error(`alphabet: invalid alias ${i}`);o[a]=s}return{encode:i=>{let a=new Uint8Array(i.length);for(let s=0;s<i.length;s++){let c=i[s],f=n[c];if(f===void 0)throw new Error(`alphabet.encode: invalid digit ${c}`);a[s]=f}return jhe(a)},decode:i=>{Ck("decode",i);let a=i.length,s=new Uint8Array(a);for(let c=0;c<a;c++){let f=i.charCodeAt(c),u=f<128?o[f]:-1;if(u===-1)throw new Error(`Unknown letter "${i[c]}". Allowed: ${t}`);s[c]=u}return s}}}var zhe=656356768;var Pk=65536,qhe=2048,Hhe=4096,Whe=(t,e)=>({encode:r=>{b8(r);let n=r.length;if(n===0)return new Uint8Array(0);if(n>=Pk)throw new Error("invalid length");let o=0;for(;o<n-1&&r[o]===0;)o++;let i=Math.ceil(n/2),a=new Uint16Array(i),s=n&1;s&&(a[0]=r[0]);for(let w=s,T=s;w<n;w+=2,T++)a[T]=r[w]<<8|r[w+1];let c=[],f=0;for(;f<i;){let w=0;for(let T=f;T<i;T++){let P=w*65536+a[T],R=Math.floor(P/e);w=P-R*e,a[T]=R,R===0&&T===f&&f++}c.push(w)}let u=c.length-1,d=u*5;for(let w=c[u];d++,!(w<t);w=Math.floor(w/t));let m=new Uint8Array(o+d),b=m.length-1;for(let w=0;w<u;w++){let T=c[w];for(let P=0;P<5;P++)m[b--]=T%t,T=Math.floor(T/t)}for(let w=c[u];b>=o;w=Math.floor(w/t))m[b--]=w%t;return m},decode:r=>{b8(r);let n=r.length;if(n===0)return new Uint8Array(0);if(n>=Pk)throw new Error("invalid length");let o=0;for(;o<n-1&&r[o]===0;)o++;let i=new Uint16Array(Math.ceil(n*6/16)+1),a=0,s=0,c=n%5||5;for(;s<n;){let m=0,b=1;for(let T=s+c;s<T;s++){let P=r[s];if(P>=t)throw new Error(`invalid integer: ${P}`);m=m*t+P,b*=t}c=5;let w=m;for(let T=0;T<a;T++){let P=i[T]*b+w;w=Math.floor(P/65536),i[T]=P-w*65536}for(;w>0;w=Math.floor(w/65536))i[a++]=w%65536}let f=a===0?1:a*2-(i[a-1]<256?1:0),u=new Uint8Array(o+f),d=u.length-1;for(let m=0;m<a;m++){let b=i[m];u[d--]=b&255,d>=o&&(u[d--]=b>>8)}return u}}),Khe=(t,e)=>{let r=Dhe(e);return{encode(n){if(b8(n),n.length>qhe)throw new Error("invalid length");return r.encode(t.encode(n))},decode(n){if(Ck("baseN.decode",n),n.length>Hhe)throw new Error("invalid length");return t.decode(r.decode(n))}}},Ghe=Whe(58,zhe);var Vhe=t=>Khe(Ghe,t),y8=Lhe(()=>Vhe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"));se();se();var ny=class extends q{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}};Kt();Q1();o4();K1();oy();Nn();da();Cb();ar();g0();vt();se();s1();Bs();tn();ar();pe();s0();m0();var c4="0x5792579257925792579257925792579257925792579257925792579257925792",f4=V(0,{size:32});async function iy(t,e){let{account:r=t.account,chain:n=t.chain,experimental_fallback:o,experimental_fallbackDelay:i=32,forceAtomic:a=!1,id:s,version:c="2.0.0"}=e,f=r?oe(r):null,u=e.capabilities;t.dataSuffix&&!e.capabilities?.dataSuffix&&(typeof t.dataSuffix=="string"?u={...e.capabilities,dataSuffix:{value:t.dataSuffix,optional:!0}}:u={...e.capabilities,dataSuffix:{value:t.dataSuffix.value,...t.dataSuffix.required?{}:{optional:!0}}});let d=e.calls.map(m=>{let b=m,w=b.abi?Lr({abi:b.abi,functionName:b.functionName,args:b.args}):b.data;return{data:b.dataSuffix&&w?$n([w,b.dataSuffix]):w,to:b.to,value:b.value?V(b.value):void 0}});try{let m=await t.request({method:"wallet_sendCalls",params:[{atomicRequired:a,calls:d,capabilities:u,chainId:V(n.id),from:f?.address,id:s,version:c}]},{retryCount:0});return typeof m=="string"?{id:m}:m}catch(m){let b=m;if(o&&(b.name==="MethodNotFoundRpcError"||b.name==="MethodNotSupportedRpcError"||b.name==="UnknownRpcError"||b.details.toLowerCase()==="this request method is not supported"||b.details.toLowerCase().includes("does not exist / is not available")||b.details.toLowerCase().includes("missing or invalid. request()")||b.details.toLowerCase().includes("did not match any variant of untagged enum")||b.details.toLowerCase().includes("account upgraded to unsupported contract")||b.details.toLowerCase().includes("eip-7702 not supported")||b.details.toLowerCase().includes("unsupported wc_ method")||b.details.toLowerCase().includes("feature toggled misconfigured")||b.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(u&&Object.values(u).some(R=>!R.optional)){let R="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new ma(new q(R,{details:R}))}if(a&&d.length>1){let P="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new ba(new q(P,{details:P}))}let w=[];for(let P of d){try{let R=await _a(t,{account:f,chain:n,data:P.data,to:P.to,value:P.value?qe(P.value):void 0});w.push({status:"fulfilled",value:R})}catch(R){w.push({reason:R,status:"rejected"})}i>0&&await new Promise(R=>setTimeout(R,i))}if(w.every(P=>P.status==="rejected"))throw w[0].reason;let T=w.map(P=>P.status==="fulfilled"?P.value:f4);return{id:$n([...T,V(n.id,{size:32}),c4])}}throw Aa(m,{...e,account:f,chain:e.chain})}}async function ay(t,e){async function r(u){if(u.endsWith(c4.slice(2))){let m=yo($b(u,-64,-32)),b=$b(u,0,-64).slice(2).match(/.{1,64}/g),w=await Promise.all(b.map(P=>f4.slice(2)!==P?t.request({method:"eth_getTransactionReceipt",params:[`0x${P}`]},{dedupe:!0}):void 0)),T=w.some(P=>P===null)?100:w.every(P=>P?.status==="0x1")?200:w.every(P=>P?.status==="0x0")?500:600;return{atomic:!1,chainId:gt(m),receipts:w.filter(Boolean),status:T,version:"2.0.0"}}return t.request({method:"wallet_getCallsStatus",params:[u]})}let{atomic:n=!1,chainId:o,receipts:i,version:a="2.0.0",...s}=await r(e.id),[c,f]=(()=>{let u=s.status;return u>=100&&u<200?["pending",u]:u>=200&&u<300?["success",u]:u>=300&&u<700?["failure",u]:u==="CONFIRMED"?["success",200]:u==="PENDING"?["pending",100]:[void 0,u]})();return{...s,atomic:n,chainId:o?gt(o):void 0,receipts:i?.map(u=>({...u,blockNumber:qe(u.blockNumber),gasUsed:qe(u.gasUsed),status:s4[u.status]}))??[],statusCode:f,status:c,version:a}}var pF=new WeakMap,Jbe=0;function hF(t){let e=pF.get(t);return e===void 0&&(e=++Jbe,pF.set(t,e)),e}async function sy(t,e){let{id:r,pollingInterval:n=t.pollingInterval,status:o=({statusCode:T})=>T===200||T>=300,retryCount:i=4,retryDelay:a=({count:T})=>~~(1<<T)*200,timeout:s=6e4,throwOnFailure:c=!1}=e,f=He(["waitForCallsStatus",t.uid,r,{pollingInterval:n,retryCount:i,retryDelay:typeof e.retryDelay=="function"?["function",hF(e.retryDelay)]:e.retryDelay,status:e.status?hF(e.status):void 0,throwOnFailure:c}]),{promise:u,resolve:d,reject:m}=Fu(),b,w=qs(f,{resolve:d,reject:m},T=>{let P=ey(async()=>{let R=k=>{clearTimeout(b),P(),k(),w()};try{let k=await Hs(async()=>{let _=await re(t,ay,"getCallsStatus")({id:r});if(c&&_.status==="failure")throw new ny(_);return _},{retryCount:i,delay:a});if(!o(k))return;R(()=>T.resolve(k))}catch(k){R(()=>T.reject(k))}},{interval:n,emitOnBegin:!0});return P});return b=s?setTimeout(()=>{w(),clearTimeout(b),m(new u4({id:r}))},s):void 0,await u.finally(()=>w())}var u4=class extends q{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}};vt();var cy=256,fy;function uy(t=11){if(!fy||cy+t>256*2){fy="",cy=0;for(let e=0;e<256;e++)fy+=(256+Math.random()*256|0).toString(16).substring(1)}return fy.substring(cy,cy+++t)}function yF(t){let{batch:e,chain:r,ccipRead:n,dataSuffix:o,key:i="base",name:a="Base Client",tokens:s,type:c="base"}=t,f=t.experimental_blockTag??(typeof r?.experimental_preconfirmationTime=="number"?"pending":void 0),u=r?.blockTime??12e3,d=Math.min(Math.max(Math.floor(u/2),500),4e3),m=t.pollingInterval??d,b=t.cacheTime??m,w=t.account?oe(t.account):void 0,{config:T,request:P,value:R}=t.transport({account:w,chain:r,pollingInterval:m}),k={...T,...R},_={account:w,batch:e,cacheTime:b,ccipRead:n,chain:r,dataSuffix:o,key:i,name:a,pollingInterval:m,request:P,tokens:s,transport:k,type:c,uid:uy(),...f?{experimental_blockTag:f}:{}};return gF(_)}var mF=new WeakSet,Xbe=0;function gF(t){function e(n,o){return i=>{let a=i(n);for(let u in t)u!=="scope"&&delete a[u];let s={...n,...a};for(let u in a){let d=n[u],m=a[u];bF(d)&&bF(m)&&(s[u]={...d,...m})}let c=[...o,i],{scope:f}=s;return Object.assign(s,{extend:e(s,c),scope:typeof f=="function"&&mF.has(f)?r(c):f})}}function r(n){let o=new WeakMap,i=(a={})=>{let s=a.signal&&o.get(a.signal);if(s)return s;let c=`scope.${Xbe++}`,f=new AbortController,{signal:u}=a;u?.aborted?f.abort(u.reason):u?.addEventListener("abort",()=>f.abort(u.reason),{once:!0});let d=(b,w)=>t.request(b,{...w,signal:w?.signal??f.signal,uid:w?.uid??c}),m=n.reduce((b,w)=>b.extend(w),gF({...t,request:d,uid:c}));return u&&o.set(u,m),m};return mF.add(i),i}return Object.assign(t,{extend:e(t,[]),scope:r([])})}function bF(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function v0(t,e){let r=(n={})=>e(t,n);for(let n of["call","calls","callWithPeriod","estimateGas","prepare","prepareRecipient","predict","simulate"])if(Object.hasOwn(e,n)){let o=e[n];r[n]=(i={})=>o.length===1?o(i):o(t,i)}for(let n of["extractEvent","extractEvents"])Object.hasOwn(e,n)&&(r[n]=e[n]);return r}u0();j3();F3();t4();b0();w0();async function pi(t,e){return pi.inner(Dn,t,e)}(function(t){async function e(a,s,c){return await a(s,{...c,...t.call(s,c)})}t.inner=e;function r(a,s){return wy(l1e(a,s))}t.call=r;async function n(a,s){return F1(a,{...ju(s),...t.call(a,s)})}t.estimateGas=n;async function o(a,s){return J1(a,{...ju(s),...t.call(a,s)})}t.simulate=o;function i(a){let[s]=U1({abi:js,logs:a,eventName:"Approval",strict:!0});if(!s)throw new Error("`Approval` event not found.");return s}t.extractEvent=i})(pi||(pi={}));function l1e(t,e){let{amount:r,spender:n,token:o}=e,{address:i,decimals:a}=Ba(t,{token:o});return{abi:js,address:i,args:[n,vy(r,a)],functionName:"approve"}}p4();Sy();w0();async function g4(t,e){let{amount:r,token:n,throwOnReceiptRevert:o=!0}=e,{decimals:i}=Ba(t,{token:n}),a=xy(r,i),s=await pi.inner(Du,t,{...e,throwOnReceiptRevert:o}),{args:c}=pi.extractEvent(s.logs);return{...c,...a===void 0?{}:{decimals:a,formatted:yy(c.value,a)},receipt:s}}u0();j3();F3();t4();b0();w0();async function hi(t,e){return hi.inner(Dn,t,e)}(function(t){async function e(a,s,c){return await a(s,{...c,...t.call(s,c)})}t.inner=e;function r(a,s){return wy(p1e(a,s))}t.call=r;async function n(a,s){return F1(a,{...ju(s),...t.call(a,s)})}t.estimateGas=n;async function o(a,s){return J1(a,{...ju(s),...t.call(a,s)})}t.simulate=o;function i(a){let[s]=U1({abi:js,logs:a,eventName:"Transfer",strict:!0});if(!s)throw new Error("`Transfer` event not found.");return s}t.extractEvent=i})(hi||(hi={}));function p1e(t,e){let{amount:r,from:n,to:o,token:i}=e,{address:a,decimals:s}=Ba(t,{token:i}),c=vy(r,s);return n?{abi:js,address:a,args:[n,o,c],functionName:"transferFrom"}:{abi:js,address:a,args:[o,c],functionName:"transfer"}}p4();Sy();w0();async function v4(t,e){let{amount:r,token:n,throwOnReceiptRevert:o=!0}=e,{decimals:i}=Ba(t,{token:n}),a=xy(r,i),s=await hi.inner(Du,t,{...e,throwOnReceiptRevert:o}),{args:c}=hi.extractEvent(s.logs);return{...c,...a===void 0?{}:{decimals:a,formatted:yy(c.value,a)},receipt:s}}M3();Sa();pe();async function VF(t,{chain:e}){let{id:r,name:n,nativeCurrency:o,rpcUrls:i,blockExplorers:a}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:V(r),chainName:n,nativeCurrency:o,rpcUrls:i.default.http,blockExplorerUrls:a?Object.values(a).map(({url:s})=>s):void 0}]},{dedupe:!0,retryCount:0})}G3();m0();function YF(t,e){let{abi:r,args:n,bytecode:o,...i}=e,a=p0({abi:r,args:n,bytecode:o});return _a(t,{...i,...i.authorizationList?{to:null}:{},data:a})}Cf();async function ZF(t){return t.account?.type==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(r=>ei(r))}vt();pe();async function JF(t,e={}){let{account:r=t.account,chainId:n}=e,o=r?oe(r):void 0,i=n?[o?.address,[V(n)]]:[o?.address],a=await t.request({method:"wallet_getCapabilities",params:i}),s={};for(let[c,f]of Object.entries(a)){s[Number(c)]={};for(let[u,d]of Object.entries(f))u==="addSubAccount"&&(u="unstable_addSubAccount"),s[Number(c)][u]=d}return typeof n=="number"?s[n]:s}async function XF(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}vt();li();Us();Kt();Sa();R3();async function Iy(t,e){let{account:r=t.account,chainId:n,nonce:o}=e;if(!r)throw new Ot({docsPath:"/docs/eip7702/prepareAuthorization"});let i=oe(r),a=(()=>{if(e.executor)return e.executor==="self"?e.executor:oe(e.executor)})(),s={address:e.contractAddress??e.address,chainId:n,nonce:o};return typeof s.chainId>"u"&&(s.chainId=t.chain?.id??await re(t,Sr,"getChainId")({})),typeof s.nonce>"u"&&(s.nonce=await re(t,T1,"getTransactionCount")({address:i.address,blockTag:"pending"}),(a==="self"||a?.address&&Ir(a.address,i.address))&&(s.nonce+=1)),s}f0();Cf();async function QF(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>NM(r))}async function eL(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}Kt();async function tL(t,e){let{chain:r=t.chain}=e,n=e.timeout??Math.max((r?.blockTime??0)*3,5e3),o=await re(t,iy,"sendCalls")(e);return await re(t,sy,"waitForCallsStatus")({...e,id:o.id,timeout:n})}i4();m4();m0();y4();async function rL(t,e){let{id:r}=e;await t.request({method:"wallet_showCallsStatus",params:[r]})}vt();li();async function nL(t,e){let{account:r=t.account}=e;if(!r)throw new Ot({docsPath:"/docs/eip7702/signAuthorization"});let n=oe(r);if(!n.signAuthorization)throw new an({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});let o=await Iy(t,e);return n.signAuthorization(o)}vt();li();pe();async function oL(t,{account:e=t.account,message:r}){if(!e)throw new Ot({docsPath:"/docs/actions/wallet/signMessage"});let n=oe(e);if(n.signMessage)return n.signMessage({message:r});let o=typeof r=="string"?jl(r):r.raw instanceof Uint8Array?Vt(r.raw):r.raw;return t.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}vt();li();ty();pe();Ls();Kt();wa();Sa();async function iL(t,e){let{account:r=t.account,chain:n=t.chain,...o}=e;if(!r)throw new Ot({docsPath:"/docs/actions/wallet/signTransaction"});let i=oe(r);Ar({account:i,...e});let a=await re(t,Sr,"getChainId")({});n!==null&&Lu({currentChainId:a,chain:n});let c=(n?.formatters||t.chain?.formatters)?.transactionRequest?.format||on;return i.signTransaction?i.signTransaction({...o,account:i,chainId:a},{serializer:t.chain?.serializers?.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...o,account:i},"signTransaction"),chainId:V(a),from:i.address}]},{retryCount:0})}vt();li();FF();async function aL(t,e){let{account:r=t.account,domain:n,message:o,primaryType:i}=e;if(!r)throw new Ot({docsPath:"/docs/actions/wallet/signTypedData"});let a=oe(r),s={EIP712Domain:NF({domain:n}),...e.types};if($F({domain:n,message:o,primaryType:i,types:s}),a.signTypedData)return a.signTypedData({domain:n,message:o,primaryType:i,types:s});let c=MF({domain:n,message:o,primaryType:i,types:s});return t.request({method:"eth_signTypedData_v4",params:[a.address,c]},{retryCount:0})}pe();async function sL(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:V(e)}]},{retryCount:0})}async function cL(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}b0();Sy();function fL(t){return{addChain:e=>VF(t,e),deployContract:e=>YF(t,e),fillTransaction:e=>$1(t,e),getAddresses:()=>ZF(t),getCallsStatus:e=>ay(t,e),getCapabilities:e=>JF(t,e),getChainId:()=>Sr(t),getPermissions:()=>XF(t),prepareAuthorization:e=>Iy(t,e),prepareTransactionRequest:e=>Ia(t,e),requestAddresses:()=>QF(t),requestPermissions:e=>eL(t,e),sendCalls:e=>iy(t,e),sendCallsSync:e=>tL(t,e),sendRawTransaction:e=>ry(t,e),sendRawTransactionSync:e=>Ey(t,e),sendTransaction:e=>_a(t,e),sendTransactionSync:e=>Ay(t,e),showCallsStatus:e=>rL(t,e),signAuthorization:e=>nL(t,e),signMessage:e=>oL(t,e),signTransaction:e=>iL(t,e),signTypedData:e=>aL(t,e),switchChain:e=>sL(t,e),waitForCallsStatus:e=>sy(t,e),watchAsset:e=>cL(t,e),writeContract:e=>Dn(t,e),writeContractSync:e=>Du(t,e),token:{approve:v0(t,pi),approveSync:v0(t,g4),transfer:v0(t,hi),transferSync:v0(t,v4)}}}function x4(t){let{key:e="wallet",name:r="Wallet Client",transport:n}=t;return yF({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(fL)}CF();function uL({key:t,methods:e,name:r,request:n,retryCount:o=3,retryDelay:i=150,timeout:a,type:s},c){let f=uy();return{config:{key:t,methods:e,name:r,request:n,retryCount:o,retryDelay:i,timeout:a,type:s},request:PF(n,{methods:e,retryCount:o,retryDelay:i,uid:f}),value:c}}function w4(t,e={}){let{key:r="custom",methods:n,name:o="Custom Provider",retryDelay:i}=e;return({retryCount:a})=>uL({key:r,methods:n,name:o,request:t.request.bind(t),retryCount:e.retryCount??a,retryDelay:i,type:"custom"})}var dL={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};ar();I3();Ou();g0();var lL={block:sN({format(t){return{transactions:t.transactions?.map(r=>{if(typeof r=="string")return r;let n=di(r);return n.typeHex==="0x7e"&&(n.isSystemTx=r.isSystemTx,n.mint=r.mint?qe(r.mint):void 0,n.sourceHash=r.sourceHash,n.type="deposit"),n}),stateRoot:t.stateRoot}}}),transaction:aN({format(t){let e={};return t.type==="0x7e"&&(e.isSystemTx=t.isSystemTx,e.mint=t.mint?qe(t.mint):void 0,e.sourceHash=t.sourceHash,e.type="deposit"),e}}),transactionReceipt:lF({format(t){return{...t.depositNonce?{depositNonce:qe(t.depositNonce)}:{},...t.depositReceiptVersion?{depositReceiptVersion:gt(t.depositReceiptVersion)}:{},l1GasPrice:t.l1GasPrice?qe(t.l1GasPrice):null,l1GasUsed:t.l1GasUsed?qe(t.l1GasUsed):null,l1Fee:t.l1Fee?qe(t.l1Fee):null,l1FeeScalar:t.l1FeeScalar?Number(t.l1FeeScalar):null}}})};go();en();tn();pe();g1();d4();function h1e(t,e){return b1e(t)?m1e(t):IF(t,e)}var pL={transaction:h1e};function m1e(t){y1e(t);let{sourceHash:e,data:r,from:n,gas:o,isSystemTx:i,mint:a,to:s,value:c}=t,f=[e,n,s??"0x",a?Vt(a):"0x",c?Vt(c):"0x",o?Vt(o):"0x",i?"0x1":"0x",r??"0x"];return Fe(["0x7e",Ln(f)])}function b1e(t){return t.type==="deposit"||typeof t.sourceHash<"u"}function y1e(t){let{from:e,to:r}=t;if(e&&!de(e))throw new Te({address:e});if(r&&!de(r))throw new Te({address:r})}var E4={blockTime:2e3,contracts:dL,formatters:lL,serializers:pL};OF();var E0=1,Ty=l4({...E4,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...E4.contracts,disputeGameFactory:{[E0]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[E0]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[E0]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[E0]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:E0}),g1e=l4({...Ty,experimental_preconfirmationTime:200,rpcUrls:{default:{http:["https://mainnet-preconf.base.org"]}}});var v1e={route_unavailable:"This file does not support the selected payment route.",host_payment_failed:"Payment submission failed. Keep the saved purchase and check final status before retrying.",bad_request:"The request is invalid. Check its fields before retrying.",bad_deadline:"The authorization deadline is invalid or expired.",invalid_arguments:"Invalid arguments. Run annon --help.",invalid_record:"Invalid saved record. Export necessary test evidence and clear development state.",transport:"The service could not be reached. Keep saved state and retry later.",recovery_not_final:"The recovery grant is not final. Resume the saved recovery later.",invalid_signature:"The wallet did not authorize the exact requested message.",operation_failed:"Operation failed. Check configuration, funding and final purchase status before retrying. Saved encrypted records are retained.",transaction_uncertain:"Transaction submission is uncertain. Check the saved purchase and transaction hash before retrying.",quote_refused:"The 1Click quote was refused. Review the source asset and amount before retrying.",base_rpc_rate_limited:"The Base RPC is rate limiting requests. Configure a Base RPC endpoint with an API key (baseRpc).",near_rpc_rate_limited:"Configure a NEAR RPC endpoint with an API key (nearRpc).",budget_exceeded:"The persisted spending budget is exhausted.",download_limited:"Download limit reached. Wait before downloading again.",download_in_progress:"Another download is active. Wait before retrying.",rate_limited:"The host is busy. Wait before retrying.",unavailable:"The service is temporarily unavailable. Wait before retrying.",transport_required:"Configure a trusted relayer before a Base purchase.",relayer_unavailable:"Base sponsorship checks are unavailable. Retry before paying.",not_sponsored:"This listing does not qualify for Base sponsorship. Do not pay through this route.",wrong_identity:"The wallet does not control the required identity.",settlement_pending:"The purchase is still settling. Wait before retrying the saved purchase.",protocol_fee_above_max:"The advertised protocol fee exceeds maxProtocolFee. Review the fee in human configuration.",funding_refused:"File funding was refused. Correct the cause before retrying.",file_storage_low:"This file needs more purchase storage funding before a NEAR or 1Click payment.",source_changed:"The source changed between passes. Resume sell with the original plaintext and saved fileId.",quote_expired:"The 1Click quote expired. Run buy again.",storage_required:"Prepay storage with storageDeposit before register or reopen, then resume the saved operation.",unknown_file:"The configured contract has no such file. Check the file ID and deployment.",taken_down:"The moderator has taken down this file; key release is blocked.",sales_stopped:"The seller has stopped new sales. Use a saved purchase to open an earlier purchase.",unknown_moderator:"Review this file's moderator and explicitly accept it with the moderator option before buying.",price_above_max:"The registered price exceeds maxPrice. Review the current terms before buying.",untrusted_contract:"The offer names a different contract. Review that deployment and configure it explicitly.",network_mismatch:"The deployment network or USDC asset differs from the configured network. Check the configuration.",store_conflict:"Another process updated this purchase. Keep the encrypted state and check status before retrying.",file_invalid:"The file failed SDK verification. Obtain the registered file from its host.",file_mismatch:"The file or offer differs from its registered commitment. Obtain the correct file or offer.",bad_requirements:"The host offer failed SDK validation. Obtain an updated Annon offer.",not_authorized:"The host has not accepted this final grant. Check final purchase status and the resource URL."};var Ra=class extends Error{code;constructor(e,r=v1e[e]??`${e.replaceAll("_"," ")}.`,n){super(r,n),this.code=e,this.name="AnnonError"}};var _y=BigInt(4294967295),hL=BigInt(32);function x1e(t,e=!1){return e?{h:Number(t&_y),l:Number(t>>hL&_y)}:{h:Number(t>>hL&_y)|0,l:Number(t&_y)|0}}function By(t,e=!1){let r=t.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){let{h:a,l:s}=x1e(t[i],e);[n[i],o[i]]=[a,s]}return[n,o]}var w1e=t=>t/2**32|0,E1e=t=>t>>>0;function mL(t,e,r,n){let o=w1e(r),i=E1e(r);t.setUint32(e,n?i:o,n),t.setUint32(e+4,n?o:i,n)}var A4=(t,e,r)=>t>>>r,S4=(t,e,r)=>t<<32-r|e>>>r,Ws=(t,e,r)=>t>>>r|e<<32-r,Ks=(t,e,r)=>t<<32-r|e>>>r,A0=(t,e,r)=>t<<64-r|e>>>r-32,S0=(t,e,r)=>t>>>r-32|e<<64-r;function Bo(t,e,r,n){let o=(e>>>0)+(n>>>0);return{h:t+r+(o/2**32|0)|0,l:o|0}}var bL=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),yL=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,gL=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),vL=(t,e,r,n,o)=>e+r+n+o+(t/2**32|0)|0,xL=(t,e,r,n,o)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(o>>>0),wL=(t,e,r,n,o,i)=>e+r+n+o+i+(t/2**32|0)|0;function Ry(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}var Py=t=>t?`"${t}" `:"";function Qt(t,e=""){if(typeof t!="number")throw new TypeError(Py(e)+"expected number, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError(Py(e)+"expected integer >= 0, got "+t);return t}function SL(t,e=""){if(typeof t!="boolean")throw new TypeError(Py(e)+"expected boolean, got type="+typeof t);return t}function ur(t,e,r=""){if(Ry(t)&&(e===void 0||t.length===e))return t;e!==void 0&&Qt(e,"length");let n=Ry(t),o=e!==void 0?` of length ${e}`:"",i=n?`length=${t.length}`:`type=${typeof t}`,a=Py(r)+"expected Uint8Array"+o+", got "+i;throw n?new RangeError(a):new TypeError(a)}function Cy(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("expected hash wrapped by utils.createHasher");if(Qt(t.outputLen),Qt(t.blockLen),t.outputLen<1||t.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}var S1e=(t,e)=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError((e==="object"?"":`"${e}" `)+"expected object, got type="+typeof t)},EL=(t,e)=>{S1e(t,e);let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)throw new TypeError(`"${e}" expected plain object`);if(Object.hasOwn(t,"__proto__"))throw new TypeError(`"${e}.__proto__" is not allowed`)};function mi(t,e=!0){if(t.destroyed)throw new Error("hash was destroyed");if(e&&t.finished)throw new Error("digest() was already called")}function zu(t,e){ur(t,void 0,"output");let r=e.outputLen;if(!(t.length>=r))throw new RangeError('"output" expected length >= '+r)}function I4(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ro(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Oy(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function zn(t,e){return t<<32-e|t>>>e}var I1e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function T1e(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function _1e(t){for(let e=0;e<t.length;e++)t[e]=T1e(t[e]);return t}var T4=I1e?t=>t:_1e,IL=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",B1e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ky(t){if(ur(t),IL)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=B1e[t[r]];return e}function AL(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function My(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(IL)try{return Uint8Array.fromHex(t)}catch(o){throw o instanceof SyntaxError?new RangeError(o.message):o}let e=t.length,r=e/2;if(e%2)throw new RangeError("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){let a=AL(t.charCodeAt(i)),s=AL(t.charCodeAt(i+1));if(a===void 0||s===void 0){let c=t[i]+t[i+1];throw new RangeError('hex string expected, got non-hex character "'+c+'" at index '+i)}n[o]=a*16+s}return n}function _4(...t){let e=0;for(let n=0;n<t.length;n++){let o=t[n];ur(o),e+=o.length}let r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let i=t[n];r.set(i,o),o+=i.length}return r}function TL(t,e,r="opts"){return EL(t,"defaults"),e!==void 0&&EL(e,r),Object.assign(Object.create(null),t,e)}function I0(t,e={}){if(typeof t!="function")throw new TypeError('"hashCons" expected function, got type='+typeof t);e=TL({},e,"info");let r=(o,i)=>t(i).update(o).digest(),n=t(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=o=>t(o),Object.assign(r,e),Object.freeze(r)}function _L(t=32){Qt(t,"bytesLength");let e=typeof globalThis=="object"?globalThis.crypto:null;if(typeof e?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return e.getRandomValues(new Uint8Array(t))}var $y=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function BL(t,e,r){return t&e^~t&r}function RL(t,e,r){return t&e^t&r^e&r}var T0=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,r,n,o){this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(e),this.view=Oy(this.buffer)}update(e){mi(this),ur(e);let{view:r,buffer:n,blockLen:o}=this,i=e.length,a=!1;for(let s=0;s<i;){let c=Math.min(o-this.pos,i-s);if(c===o){let f=Oy(e);for(;o<=i-s;s+=o)this.process(f,s);a=!0;continue}n.set(s===0&&c===i?e:e.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===o&&(this.process(r,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){mi(this),zu(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:i}=this,{pos:a}=this;r[a++]=128,r.fill(0,a),this.padOffset>o-a&&(this.process(n,0),r.fill(0)),mL(n,o-8,this.length*8,i),this.process(n,0),this.roundClean();let s=e===r?n:Oy(e),c=this.outputLen,f=c/4,u=this.get();if(c%4||f>u.length)throw new Error("invalid outputLen");for(let d=0;d<f;d++)s.setUint32(4*d,u[d],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:r,length:n,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=a,a&&e.buffer.set(r),e}clone(){return this._cloneInto()}},PL=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var CL=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var R1e=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Pa=new Uint32Array(64),B4=class extends T0{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,r){super(64,e,8,!1),this.A=r[0]|0,this.B=r[1]|0,this.C=r[2]|0,this.D=r[3]|0,this.E=r[4]|0,this.F=r[5]|0,this.G=r[6]|0,this.H=r[7]|0}get(){let{A:e,B:r,C:n,D:o,E:i,F:a,G:s,H:c}=this;return[e,r,n,o,i,a,s,c]}set(e,r,n,o,i,a,s,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=i|0,this.F=a|0,this.G=s|0,this.H=c|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let d=0;d<16;d++,r+=4)Pa[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){let m=Pa[d-15],b=Pa[d-2],w=zn(m,7)^zn(m,18)^m>>>3,T=zn(b,17)^zn(b,19)^b>>>10;Pa[d]=T+Pa[d-7]+w+Pa[d-16]|0}let{A:n,B:o,C:i,D:a,E:s,F:c,G:f,H:u}=this;for(let d=0;d<64;d++){let m=zn(s,6)^zn(s,11)^zn(s,25),b=u+m+BL(s,c,f)+R1e[d]+Pa[d]|0,T=(zn(n,2)^zn(n,13)^zn(n,22))+RL(n,o,i)|0;u=f,f=c,c=s,s=a+b|0,a=i,i=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,c=c+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(n,o,i,a,s,c,f,u)}roundClean(){Ro(Pa)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Ro(this.buffer)}},R4=class extends B4{constructor(){super(32,PL)}};var OL=By(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),P1e=OL[0],C1e=OL[1],Ca=new Uint32Array(80),Oa=new Uint32Array(80),P4=class extends T0{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,r){super(128,e,16,!1),this.Ah=r[0]|0,this.Al=r[1]|0,this.Bh=r[2]|0,this.Bl=r[3]|0,this.Ch=r[4]|0,this.Cl=r[5]|0,this.Dh=r[6]|0,this.Dl=r[7]|0,this.Eh=r[8]|0,this.El=r[9]|0,this.Fh=r[10]|0,this.Fl=r[11]|0,this.Gh=r[12]|0,this.Gl=r[13]|0,this.Hh=r[14]|0,this.Hl=r[15]|0}get(){let{Ah:e,Al:r,Bh:n,Bl:o,Ch:i,Cl:a,Dh:s,Dl:c,Eh:f,El:u,Fh:d,Fl:m,Gh:b,Gl:w,Hh:T,Hl:P}=this;return[e,r,n,o,i,a,s,c,f,u,d,m,b,w,T,P]}set(e,r,n,o,i,a,s,c,f,u,d,m,b,w,T,P){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=a|0,this.Dh=s|0,this.Dl=c|0,this.Eh=f|0,this.El=u|0,this.Fh=d|0,this.Fl=m|0,this.Gh=b|0,this.Gl=w|0,this.Hh=T|0,this.Hl=P|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,r){for(let _=0;_<16;_++,r+=4)Ca[_]=e.getUint32(r),Oa[_]=e.getUint32(r+=4);for(let _=16;_<80;_++){let O=Ca[_-15]|0,$=Oa[_-15]|0,B=Ws(O,$,1)^Ws(O,$,8)^A4(O,$,7),N=Ks(O,$,1)^Ks(O,$,8)^S4(O,$,7),M=Ca[_-2]|0,F=Oa[_-2]|0,v=Ws(M,F,19)^A0(M,F,61)^A4(M,F,6),l=Ks(M,F,19)^S0(M,F,61)^S4(M,F,6),h=gL(N,l,Oa[_-7],Oa[_-16]),y=vL(h,B,v,Ca[_-7],Ca[_-16]);Ca[_]=y|0,Oa[_]=h|0}let{Ah:n,Al:o,Bh:i,Bl:a,Ch:s,Cl:c,Dh:f,Dl:u,Eh:d,El:m,Fh:b,Fl:w,Gh:T,Gl:P,Hh:R,Hl:k}=this;for(let _=0;_<80;_++){let O=Ws(d,m,14)^Ws(d,m,18)^A0(d,m,41),$=Ks(d,m,14)^Ks(d,m,18)^S0(d,m,41),B=d&b^~d&T,N=m&w^~m&P,M=xL(k,$,N,C1e[_],Oa[_]),F=wL(M,R,O,B,P1e[_],Ca[_]),v=M|0,l=Ws(n,o,28)^A0(n,o,34)^A0(n,o,39),h=Ks(n,o,28)^S0(n,o,34)^S0(n,o,39),y=n&i^n&s^i&s,g=o&a^o&c^a&c;R=T|0,k=P|0,T=b|0,P=w|0,b=d|0,w=m|0,{h:d,l:m}=Bo(f|0,u|0,F|0,v|0),f=s|0,u=c|0,s=i|0,c=a|0,i=n|0,a=o|0;let x=bL(v,h,g);n=yL(x,F,l,y),o=x|0}({h:n,l:o}=Bo(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:a}=Bo(this.Bh|0,this.Bl|0,i|0,a|0),{h:s,l:c}=Bo(this.Ch|0,this.Cl|0,s|0,c|0),{h:f,l:u}=Bo(this.Dh|0,this.Dl|0,f|0,u|0),{h:d,l:m}=Bo(this.Eh|0,this.El|0,d|0,m|0),{h:b,l:w}=Bo(this.Fh|0,this.Fl|0,b|0,w|0),{h:T,l:P}=Bo(this.Gh|0,this.Gl|0,T|0,P|0),{h:R,l:k}=Bo(this.Hh|0,this.Hl|0,R|0,k|0),this.set(n,o,i,a,s,c,f,u,d,m,b,w,T,P,R,k)}roundClean(){Ro(Ca,Oa)}destroy(){this.destroyed=!0,Ro(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},C4=class extends P4{constructor(){super(64,CL)}};var kL=I0(()=>new R4,$y(1));var O4=I0(()=>new C4,$y(3));function Fy(t,e,r=()=>{}){if(!Array.isArray(t))throw new TypeError(`"${e}" expected array, got type=${typeof t}`);for(let n=0;n<t.length;n++)r(t[n],`${e}[${n}]`);return t}var he=(t,e,r)=>ur(t,e,r),k4=Qt;function $L(t,e=""){if(typeof t!="string"){let r=e&&`"${e}" `;throw new TypeError(r+"expected string, got type="+typeof t)}return t}function ka(t,e="object"){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(e==="object"?"expected valid options object":`"${e}" expected object, got type=${typeof t}`);return t}function Gs(t,e){if(typeof t!="function")throw new TypeError(`"${e}" is invalid: expected function, got ${typeof t}`);return t}var _0=ky,sn=(...t)=>_4(...t),qu=t=>My(t),$a=Ry,Vs=t=>_L(t),Ny=BigInt(0),ML=BigInt(1),O1e=t=>t?`"${t}" `:"";function Tr(t,e=""){if(typeof t!="boolean")throw new TypeError(O1e(e)+"expected boolean, got type="+typeof t);return t}function Ly(t){if(typeof t=="bigint"){if(!Ma(t))throw new RangeError("positive bigint expected, got "+t)}else k4(t);return t}function bi(t,e=""){if(typeof t!="number"){let r=e&&`"${e}" `;throw new TypeError(r+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){let r=e&&`"${e}" `;throw new RangeError(r+"expected safe integer, got "+t)}}function B0(t){let e=Ly(t).toString(16);return e.length&1?"0"+e:e}function NL(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?Ny:BigInt("0x"+t)}function Po(t){return NL(ky(t))}function Ys(t){return NL(ky(R0(ur(t)).reverse()))}function Uy(t,e){if(Qt(e),e===0)throw new Error("zero output length is invalid");t=Ly(t);let r=e*2,n=t.toString(16);if(n.length>r)throw new RangeError("number is too large");return My(n.padStart(r,"0"))}function M4(t,e){return Uy(t,e).reverse()}function R0(t){return Uint8Array.from(he(t))}function Ma(t){return typeof t=="bigint"&&Ny<=t}function $4(t,e,r){return Ma(t)&&Ma(e)&&Ma(r)&&e<=t&&t<r}function Hu(t,e,r,n){if(!$4(e,r,n))throw new RangeError("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function Wu(t){if(t<Ny)throw new Error("expected non-negative bigint, got "+t);return t===Ny?0:t.toString(2).length}var P0=t=>(bi(t,"n"),(ML<<BigInt(t))-ML);function FL(t,e,r){if(Qt(t,"hashLen"),Qt(e,"qByteLen"),typeof r!="function")throw new TypeError("hmacFn must be a function");let n=P=>new Uint8Array(P),o=Uint8Array.of(),i=Uint8Array.of(0),a=Uint8Array.of(1),s=1e3,c=n(t),f=n(t),u=0,d=()=>{c.fill(1),f.fill(0),u=0},m=(...P)=>r(f,sn(c,...P)),b=(P=o)=>{f=m(i,P),c=m(),P.length!==0&&(f=m(a,P),c=m())},w=()=>{if(u++>=s)throw new Error("drbg: tried max amount of iterations");let P=0,R=[];for(;P<e;){c=m();let k=c.slice();R.push(k),P+=c.length}return sn(...R)};return(P,R)=>{d(),b(P);let k;for(;(k=R(w()))===void 0;)b();return d(),k}}function _r(t,e={},r={},n="object"){ka(t,n),ka(e,"fields"),ka(r,"optFields");function o(a,s,c){let f=n==="object"?`param "${String(a)}"`:`"${n}.${String(a)}"`,u=t[a];if(!Object.hasOwn(t,a)&&(c?u!==void 0:s!=="function"))throw new TypeError(`${f} is invalid: expected own property`);if(c&&u===void 0)return;let d=typeof u;if(d!==s||u===null)throw new TypeError(`${f} is invalid: expected ${s}, got ${d}`)}let i=(a,s)=>Object.entries(a).forEach(([c,f])=>o(c,f,s));i(e,!1),i(r,!0)}var St=BigInt(0),me=BigInt(1),Na=BigInt(2),jL=BigInt(3),N4=BigInt(4),DL=BigInt(5),k1e=BigInt(7),zL=BigInt(8),M1e=BigInt(9),$1e=BigInt(15),qL=BigInt(16),N1e=BigInt("0x10000000000000000");function Le(t,e){if(e<=St)throw new Error("mod: expected positive modulus, got "+e);let r=t%e;return r>=St?r:e+r}function HL(t,e,r){if(r<=me)throw new Error("pow: expected modulus > 1, got "+r);if(typeof e!="bigint")throw new TypeError("invalid exponent: expected bigint, got "+typeof e);if(e<St)throw new Error("invalid exponent, negatives unsupported");if(e===St)return me;if(e===me)return t;let n=t%r;if(n<St&&(n+=r),e<N1e){let s=me;for(;e>St;)e&me&&(s=s*n%r),n=n*n%r,e>>=me;return s}let o=[];for(;e>St;)o.push(Number(e&$1e)),e>>=N4;let i=new Array(16);i[0]=me,i[1]=n;for(let s=2;s<16;s++)i[s]=i[s-1]*n%r;let a=i[o[o.length-1]];for(let s=o.length-2;s>=0;s--){a=a*a%r,a=a*a%r,a=a*a%r,a=a*a%r;let c=o[s];c!==0&&(a=a*i[c]%r)}return a}function Oe(t,e,r){if(r<=me)throw new Error("pow2: expected modulus > 1, got "+r);if(e<St)throw new Error("pow2: expected non-negative exponent, got "+e);let n=t;for(;e-- >St;)n*=n,n%=r;return n}function LL(t,e){if(t===St)throw new Error("invert: expected non-zero number");if(e<=me)throw new Error("invert: expected modulus > 1, got "+e);let r=Le(t,e),n=e,o=St,i=me;for(;r!==St;){let s=n/r,c=n-r*s,f=o-i*s;n=r,r=c,o=i,i=f}if(n!==me)throw new Error("invert: does not exist");return Le(o,e)}function WL(t,e){if(e<=me)throw new Error("invertCt: expected prime modulus > 1, got "+e);let r=Le(t,e);if(r===St)throw new Error("invertCt: expected non-zero number");let n=HL(r,e-Na,e);if(Le(r*n,e)!==me)throw new Error("invertCt: does not exist");return n}function F4(t,e,r){let n=t;if(!n.eql(n.sqr(e),r))throw new Error("Cannot find square root")}function L4(t,e){if((t&me)===St)throw new Error(e+": expected odd modulus, got "+t)}function KL(t,e){let r=t,n=(r.ORDER+me)/N4,o=r.pow(e,n);return F4(r,o,e),o}function F1e(t,e){let r=t,n=(r.ORDER-DL)/zL,o=r.mul(e,Na),i=r.pow(o,n),a=r.mul(e,i),s=r.mul(r.mul(a,Na),i),c=r.mul(a,r.sub(s,r.ONE));return F4(r,c,e),c}function L1e(t){let e=Gu(t),r=GL(t),n=r(e,e.neg(e.ONE)),o=r(e,n),i=r(e,e.neg(n)),a=(t+k1e)/qL;return((s,c)=>{let f=s,u=f.pow(c,a),d=f.mul(u,n),m=f.mul(u,o),b=f.mul(u,i),w=f.eql(f.sqr(d),c),T=f.eql(f.sqr(m),c);u=f.cmov(u,d,w),d=f.cmov(b,m,T);let P=f.eql(f.sqr(d),c),R=f.cmov(u,d,P);return F4(f,R,c),R})}function GL(t){if(t<jL)throw new Error("sqrt is not defined for small field");L4(t,"tonelliShanks");let e=t-me,r=0;for(;e%Na===St;)e/=Na,r++;let n=Na,o=Gu(t);for(;C0(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return KL;let i=o.pow(n,e),a=(e+me)/Na;return function(c,f){let u=c;if(u.is0(f))return f;if(C0(u,f)!==1)throw new Error("Cannot find square root");let d=r,m=u.mul(u.ONE,i),b=u.pow(f,e),w=u.pow(f,a);for(;!u.eql(b,u.ONE);){if(u.is0(b))throw new Error("Cannot find square root: probably non-prime P");let T=1,P=u.sqr(b);for(;!u.eql(P,u.ONE);)if(T++,P=u.sqr(P),T===d)throw new Error("Cannot find square root");let R=me<<BigInt(d-T-1),k=u.pow(m,R);d=T,m=u.sqr(k),b=u.mul(b,m),w=u.mul(w,k)}return w}}function U1e(t){return L4(t,"Fp.sqrt"),t%N4===jL?KL:t%zL===DL?F1e:t%qL===M1e?L1e(t):GL(t)}var VL=(t,e)=>(Le(t,e)&me)===me,j1e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ku(t){if(ka(t,"field"),typeof t.ORDER!="bigint")throw new TypeError('param "ORDER" is invalid: expected bigint, got '+typeof t.ORDER);bi(t.BYTES,"BYTES"),bi(t.BITS,"BITS");for(let e of j1e)Gs(t[e],"field."+e);if(t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=me)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function Dy(t,e,r=!1){Ku(t),Fy(e,"nums"),Tr(r,"passZero");let n=t,o=new Array(e.length).fill(r?n.ZERO:void 0),i=e.reduce((s,c,f)=>n.is0(c)?s:(o[f]=s,n.mul(s,c)),n.ONE),a=n.inv(i);return e.reduceRight((s,c,f)=>n.is0(c)?s:(o[f]=n.mul(s,o[f]),n.mul(s,c)),a),o}function C0(t,e){Ku(t);let r=t;L4(r.ORDER,"FpLegendre");let n=(r.ORDER-me)/Na,o=r.pow(e,n),i=r.eql(o,r.ONE),a=r.eql(o,r.ZERO),s=r.eql(o,r.neg(r.ONE));if(!i&&!a&&!s)throw new Error("invalid Legendre symbol result");return i?1:a?0:-1}function D1e(t,e){if(e!==void 0&&k4(e),t<=St)throw new Error("invalid n length: expected positive n, got "+t);if(e!==void 0&&e<1)throw new Error("invalid n length: expected positive bit length, got "+e);let r=Wu(t);if(e!==void 0&&e<r)throw new Error(`invalid n length: expected nBitLength (${e}) >= bitLen(n) (${r})`);let n=e!==void 0?e:r,o=Math.ceil(n/8);return{nBitLength:n,nByteLength:o}}var UL=new WeakMap,jy=class{ORDER;BITS;BYTES;isLE;ZERO=St;ONE=me;_lengths;_mod;constructor(e,r={}){if(e<=me)throw new Error("invalid field: expected ORDER > 1, got "+e);let n;this.isLE=!1,r!=null&&typeof r=="object"&&(typeof r.BITS=="number"&&(n=r.BITS),typeof r.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:r.sqrt,enumerable:!0}),typeof r.isLE=="boolean"&&(this.isLE=r.isLE),r.allowedLengths&&(this._lengths=Object.freeze(r.allowedLengths.slice())),typeof r.modFromBytes=="boolean"&&(this._mod=r.modFromBytes));let{nBitLength:o,nByteLength:i}=D1e(e,n);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=o,this.BYTES=i,Object.freeze(this)}create(e){return Le(e,this.ORDER)}isValid(e){if(typeof e!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof e);return St<=e&&e<this.ORDER}is0(e){return e===St}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&me)===me}neg(e){return Le(-e,this.ORDER)}eql(e,r){return e===r}sqr(e){return Le(e*e,this.ORDER)}add(e,r){return Le(e+r,this.ORDER)}sub(e,r){return Le(e-r,this.ORDER)}mul(e,r){return Le(e*r,this.ORDER)}pow(e,r){return HL(e,r,this.ORDER)}div(e,r){return Le(e*LL(r,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,r){return e+r}subN(e,r){return e-r}mulN(e,r){return e*r}inv(e){return LL(e,this.ORDER)}sqrt(e){let r=UL.get(this);return r||UL.set(this,r=U1e(this.ORDER)),r(this,e)}toBytes(e){return this.isLE?M4(e,this.BYTES):Uy(e,this.BYTES)}fromBytes(e,r=!1){he(e);let{_lengths:n,BYTES:o,isLE:i,ORDER:a,_mod:s}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>o)throw new Error("Field.fromBytes: expected "+n+" bytes, got "+e.length);let f=new Uint8Array(o);f.set(e,i?0:f.length-e.length),e=f}if(e.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);let c=i?Ys(e):Po(e);if(s&&(c=Le(c,a)),!r&&!this.isValid(c))throw new Error("invalid field element: outside of range 0..ORDER");return c}invertBatch(e){return Dy(this,e,!0)}cmov(e,r,n){return Tr(n,"condition"),n?r:e}};function Gu(t,e={}){return Object.freeze(jy.prototype),new jy(t,e)}function YL(t){if(typeof t!="bigint")throw new Error("field order must be bigint");if(t<=me)throw new Error("field order must be greater than 1");let e=Wu(t-me);return Math.ceil(e/8)}function zy(t){let e=YL(t);return e+Math.ceil(e/2)}function qy(t,e,r=!1){he(t);let n=t.length,o=YL(e),i=Math.max(zy(e),16);if(n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);let a=r?Ys(t):Po(t),s=Le(a,e-me)+me;return r?M4(s,o):Uy(s,o)}var D4=BigInt(0),O0=BigInt(1),z1e=BigInt(4),U4=16,ZL=128,q1e=5,JL=2**31;function Fa(t){let e=t;if(typeof e!="function")throw new TypeError('"Point" expected constructor, got type='+typeof t);Gs(e.fromAffine,"Point.fromAffine"),Gs(e.fromBytes,"Point.fromBytes"),Gs(e.fromHex,"Point.fromHex"),ka(e.BASE,"Point.BASE"),ka(e.ZERO,"Point.ZERO"),Ku(e.Fp),Ku(e.Fn)}function Hy(t,e){Fa(t),QL(e,t);let r=Dy(t.Fp,e.map(n=>n.Z));return e.map((n,o)=>t.fromAffine(n.toAffine(r[o])))}function H1e(t,e,r=1){if(!Number.isSafeInteger(t)||t<r||t>e)throw new Error("invalid window size, expected ["+r+".."+e+"], got W="+t)}function W1e(t,e){let r=t*(4*e+128);if(r>JL)throw new Error("invalid window size: table would need ~"+Math.ceil(r/2**20)+" MiB, max "+JL/2**20+" MiB")}function z4(t,e){if(t!==void 0){Gs(t,"randomBytes");try{let r=t(e);if(!$a(r)||r.length!==e)return}catch{return}return t}}function QL(t,e){Fy(t,"points"),t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function K1e(t,e,r){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,o)=>{if(!(r===void 0?e.isValid(n):Ma(n)&&n<r))throw new Error("invalid scalar at index "+o)})}var eU=new WeakMap;function j4(t){return eU.get(t)||1}function G1e(t,e){let r=t.double(),n=[t];for(let o=1;o<e;o++)n.push(n[o-1].add(r));return n}function V1e(t,e){let r=2**e,n=r/2,o=BigInt(r-1),i=[];for(;t>D4;){let a=0;t&O0&&(a=Number(t&o),a>=n&&(a-=r),t-=BigInt(a)),i.push(a),t>>=O0}return i}function Y1e(t,e,r){let n=2**e,o=n/2,i=BigInt(n-1),a=BigInt(e),s=[];for(let c=0;c<r;c++){let f=Number(t&i);t>>=a,f>o&&(f-=n,t+=O0),s.push(f)}if(t!==D4)throw new Error("invalid wnaf");return s}function Z1e(t,e,r){let n=0;for(let i of r)n=Math.max(n,i.length);let o=t;for(let i=n-1;i>=0;i--){i!==n-1&&(o=o.double());for(let a=0;a<r.length;a++){let s=r[a][i];if(s){let c=e[a][Math.abs(s)-1>>1];o=o.add(s<0?c.negate():c)}}}return o}var Vu=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,r){Fa(e),this.randomBytes=z4(r,U4),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,r,n){let o=Math.ceil(n/r)+1,i=2**(r-1),a=[],s=e;for(let c=0;c<o;c++){let f=s;for(let u=0;u<i;u++)a.push(f),f=f.add(s);s=a[a.length-1].double()}return{W:r,bits:n,windows:o,comp:a}}wnafCachedCT(e,r){let{W:n,windows:o,comp:i}=e,a=2**(n-1),s=Y1e(r,n,o),c=this.ZERO,f=this.BASE;for(let u=0;u<o;u++){let d=s[u],m=u*a,b=Math.abs(d)-1,w=i[m];for(let P=1;P<a;P++)w=P===b?i[m+P]:w;let T=w.negate();d===0?f=f.add(i[m]):c=c.add(d<0?T:w)}return{p:c,f}}getWnafPrecomputes(e,r,n,o){let i=this.wnafPrecomputes.get(r),a=i?.find(s=>s.W===e&&s.bits===n);return a||(a=this.buildWnafTable(r,e,n),typeof o=="function"&&(a={...a,comp:o(a.comp)}),i||(i=[],this.wnafPrecomputes.set(r,i)),i.push(a)),a}assertPoint(e){if(!(e instanceof this.Point))throw new TypeError('"point" expected Point instance, got type='+typeof e)}validateMulInput(e,r){if(this.assertPoint(e),!$4(r,O0,this.Point.Fn.ORDER))throw new Error("invalid scalar")}runCT(e,r,n,o){let i=j4(e);return i===1?this.fixedWindowCT(e,r,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,o),r)}mulCT(e,r,n){return this.validateMulInput(e,r),this.runCT(e,r,this.bits,n)}mulCTBlinded(e,r,n){if(this.validateMulInput(e,r),this.randomBytes===void 0)throw new Error("randomBytes is required for scalar blinding");let o=this.Point.Fn.BITS+ZL,i=this.randomBytes(U4);if(!$a(i)||i.length!==U4)throw new Error("randomBytes returned invalid byte array");i[0]=i[0]&63|128;let a=r+Po(i)*this.Point.Fn.ORDER;return this.runCT(e,a,o,n)}fixedWindowCT(e,r,n){let o=q1e,i=1<<o,a=P0(o),s=new Array(i);s[0]=this.ZERO;for(let u=1;u<i;u++)s[u]=s[u-1].add(e);let c=Math.ceil(n/o),f=this.ZERO;for(let u=c-1;u>=0;u--){if(u!==c-1)for(let b=0;b<o;b++)f=f.double();let d=Number(r>>BigInt(u*o)&a),m=s[0];for(let b=1;b<i;b++)m=b===d?s[b]:m;f=f.add(m)}return{p:f,f}}shouldBlind(e,r){return this.randomBytes===void 0?!1:r===O0?!0:e!==this.BASE?!1:(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded)}mulSecret(e,r,n,o){return this.shouldBlind(e,n)?this.mulCTBlinded(e,r,o):this.mulCT(e,r,o)}mulUnsafe(e,r,n){if(this.assertPoint(e),!Ma(r))throw new Error("invalid scalar");let o=j4(e);if(o===1||r>=this.Point.Fn.ORDER)return Wy(this.Point,[e],[r],!0);let i=this.getWnafPrecomputes(o,e,this.bits,n);return this.wnafCachedCT(i,r).p}setWindowSize(e,r){this.assertPoint(e),H1e(r,this.bits);let n=Math.ceil((this.bits+ZL)/r)+1;W1e(n*2**(r-1),this.Point.Fp.BYTES),eU.set(e,r),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return j4(e)!==1}};function Wy(t,e,r,n=!1){if(Fa(t),QL(e,t),Tr(n,"allowOversized"),K1e(r,t.Fn,n?t.Fn.ORDER**z1e:void 0),e.length!==r.length)throw new Error("arrays of points and scalars must have equal length");let o=e.map(a=>G1e(a,4)),i=r.map(a=>V1e(a,4));return Z1e(t.ZERO,o,i)}function XL(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Ku(e),e}else return Gu(t,{isLE:r})}function Ky(t,e,r={},n){if(t!=="weierstrass"&&t!=="edwards")throw new Error('expected curve type "weierstrass" or "edwards"');if(n===void 0&&(n=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);_r(r);for(let c of["p","n","h"]){let f=e[c];if(!(Ma(f)&&f!==D4))throw new Error(`CURVE.${c} must be positive bigint`)}let o=XL(e.p,r.Fp,n),i=XL(e.n,r.Fn,n),s=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(let c of s)if(!o.isValid(e[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:o,Fn:i}}function Gy(t,e){return function(n){let o=t(n);return{secretKey:o,publicKey:e(o)}}}var Vy=BigInt(0),Yy=BigInt(1),Zy=BigInt(2),J1e=BigInt(4),tU=BigInt(8);function X1e(t,e,r,n){let o=t.sqr(r),i=t.sqr(n),a=t.add(t.mul(e.a,o),i),s=t.add(t.ONE,t.mul(e.d,t.mul(o,i)));return t.eql(a,s)}function rU(t,e={}){_r(e,{},{},"extraOpts");let r=e,n=Ky("edwards",t,r,r.FpFnLE),{Fp:o,Fn:i}=n,a=n.CURVE,{h:s}=a;if(C0(o,a.a)!==1)throw new Error("edwards: CURVE.a must be a square in Fp for complete addition formulas");if(C0(o,a.d)!==-1)throw new Error("edwards: CURVE.d must be a non-square in Fp for complete addition formulas");_r(r,{},{uvRatio:"function",randomBytes:"function"});let c=r.randomBytes===void 0?Vs:r.randomBytes,f=Zy<<BigInt(o.BYTES*8)-Yy;function u(k){if(!o.isOdd)throw new Error("Field does not have .isOdd()");return o.isOdd(k)}let d=r.uvRatio===void 0?(k,_)=>{try{return{isValid:!0,value:o.sqrt(o.div(k,_))}}catch{return{isValid:!1,value:Vy}}}:r.uvRatio;if(!X1e(o,a,a.Gx,a.Gy))throw new Error("bad curve params: generator point");let m=o.eql(a.a,o.neg(o.ONE))?k=>o.neg(k):o.eql(a.a,o.ONE)?k=>k:k=>o.mul(a.a,k);function b(k,_,O=!1){let $=O?Yy:Vy;return Hu("coordinate "+k,_,$,f),_}function w(k){if(!(k instanceof T))throw new Error("EdwardsPoint expected")}class T{static BASE=new T(a.Gx,a.Gy,o.ONE,o.mul(a.Gx,a.Gy));static ZERO=new T(o.ZERO,o.ONE,o.ONE,o.ZERO);static Fp=o;static Fn=i;X;Y;Z;T;constructor(_,O,$,B){this.X=b("x",_),this.Y=b("y",O),this.Z=b("z",$,!0),this.T=b("t",B),Object.freeze(this)}static CURVE(){return a}static fromAffine(_){if(_ instanceof T)throw new Error("extended point not allowed");let{x:O,y:$}=_||{};return b("x",O),b("y",$),new T(O,$,o.ONE,o.mul(O,$))}static fromBytes(_,O=!1){let $=o.BYTES,{a:B,d:N}=a;_=R0(he(_,$,"point")),Tr(O,"zip215");let M=R0(_),F=_[$-1];M[$-1]=F&-129;let v=Ys(M),l=O?f:o.ORDER;Hu("point.y",v,Vy,l);let h=o.sqr(v),y=o.sub(h,o.ONE),g=o.sub(o.mulN(N,h),B),{isValid:x,value:E}=d(y,g);if(!x)throw new Error("bad point: invalid y coordinate");let S=u(E),A=(F&128)!==0;if(!O&&o.is0(E)&&A)throw new Error("bad point: x=0 and x_0=1");return A!==S&&(E=o.neg(E)),T.fromAffine({x:E,y:v})}static fromHex(_,O=!1){return T.fromBytes(qu(_),O)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(_=6,O=!0){return R.setWindowSize(this,_),O||this.multiply(Zy),this}assertValidity(){let _=this,{a:O,d:$}=a;if(_.is0())throw new Error("bad point: ZERO");let{X:B,Y:N,Z:M,T:F}=_,v=o.sqr(B),l=o.sqr(N),h=o.sqr(M),y=o.sqr(h),g=o.mul(v,O),x=o.mul(o.add(g,l),h),E=o.add(y,o.mul($,o.mul(v,l)));if(!o.eql(x,E))throw new Error("bad point: equation left != right (1)");let S=o.mul(B,N),A=o.mul(M,F);if(!o.eql(S,A))throw new Error("bad point: equation left != right (2)")}equals(_){w(_);let{X:O,Y:$,Z:B}=this,{X:N,Y:M,Z:F}=_,v=o.mul(O,F),l=o.mul(N,B),h=o.mul($,F),y=o.mul(M,B);return o.eql(v,l)&&o.eql(h,y)}is0(){return this.equals(T.ZERO)}negate(){return new T(o.neg(this.X),this.Y,this.Z,o.neg(this.T))}double(){let{X:_,Y:O,Z:$}=this,B=o.sqr(_),N=o.sqr(O),M=o.mul(o.sqr($),Zy),F=m(B),v=o.addN(_,O),l=o.sub(o.subN(o.sqr(v),B),N),h=o.addN(F,N),y=o.subN(h,M),g=o.subN(F,N),x=o.mul(l,y),E=o.mul(h,g),S=o.mul(l,g),A=o.mul(y,h);return new T(x,E,A,S)}add(_){w(_);let{d:O}=a,{X:$,Y:B,Z:N,T:M}=this,{X:F,Y:v,Z:l,T:h}=_,y=o.mul($,F),g=o.mul(B,v),x=o.mul(o.mulN(M,O),h),E=o.mul(N,l),S=o.sub(o.subN(o.mulN(o.addN($,B),o.addN(F,v)),y),g),A=o.subN(E,x),p=o.addN(E,x),I=o.sub(g,m(y)),C=o.mul(S,A),L=o.mul(p,I),j=o.mul(S,I),D=o.mul(A,p);return new T(C,L,D,j)}subtract(_){return w(_),this.add(_.negate())}multiply(_){if(!i.isValidNot0(_))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:O,f:$}=R.mulSecret(this,_,s,P);return P([O,$])[0]}multiplyUnsafe(_){if(!i.isValid(_))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return _===Vy?T.ZERO:this.is0()||_===Yy?this:R.mulUnsafe(this,_,P)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return R.mulUnsafe(this,a.n).is0()}toAffine(_){let O=this,$=_;if($!=null&&typeof $!="bigint")throw new TypeError('"invertedZ" expected bigint, got type='+typeof $);let{X:B,Y:N,Z:M}=O,F=O.is0();$==null&&($=F?o.create(tU):o.inv(M));let v=o.mul(B,$),l=o.mul(N,$),h=o.mul(M,$);if(F)return{x:o.ZERO,y:o.ONE};if(!o.eql(h,o.ONE))throw new Error("invZ was invalid");return{x:v,y:l}}clearCofactor(){return s===Yy?this:s===Zy?this.double():s===J1e?this.double().double():s===tU?this.double().double().double():this.multiplyUnsafe(s)}toBytes(){let{x:_,y:O}=this.toAffine(),$=o.toBytes(O);return $[$.length-1]|=u(_)?128:0,$}toHex(){return _0(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let P=k=>Hy(T,k),R=new Vu(T,c);return R.bits>=6&&T.BASE.precompute(6),Object.freeze(T.prototype),Object.freeze(T),T}function nU(t,e,r={}){if(Fa(t),typeof e!="function")throw new Error('"hash" function param is required');let n=e,o=r;_r(o,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",zip215:"boolean",mapToCurve:"function",toMontgomery:"function",toMontgomerySecret:"function"});let{prehash:i}=o,{BASE:a,Fp:s,Fn:c}=t,f=n.outputLen,u=2*s.BYTES;if(f!==void 0&&(bi(f,"hash.outputLen"),f!==u))throw new Error(`hash.outputLen must be ${u}, got ${f}`);let d=o.randomBytes===void 0?Vs:o.randomBytes,m=o.toMontgomery,b=o.toMontgomerySecret,w=o.adjustScalarBytes===void 0?g=>g:o.adjustScalarBytes,T=o.domain===void 0?(g,x,E)=>{if(Tr(E,"phflag"),x.length||E)throw new Error("Contexts/pre-hash are not supported");return g}:o.domain;function P(g){return c.create(Ys(g))}function R(g){let x=F.secretKey;he(g,F.secretKey,"secretKey");let E=he(n(g),2*x,"hashedSecretKey"),S=w(E.slice(0,x)),A=E.slice(x,2*x),p=P(S);return{head:S,prefix:A,scalar:p}}function k(g){let{head:x,prefix:E,scalar:S}=R(g),A=a.multiply(S),p=A.toBytes();return{head:x,prefix:E,scalar:S,point:A,pointBytes:p}}function _(g){return k(g).pointBytes}function O(g=Uint8Array.of(),...x){let E=sn(...x);return P(n(T(E,he(g,void 0,"context"),!!i)))}function $(g,x,E={}){_r(E,{},{},"options"),g=R0(he(g,void 0,"message")),i&&(g=i(g));let{prefix:S,scalar:A,pointBytes:p}=k(x),I=O(E.context,S,g),C=a.multiply(I).toBytes(),L=O(E.context,C,p,g),j=c.create(I+L*A);if(!c.isValid(j))throw new Error("sign failed: invalid s");let D=sn(C,c.toBytes(j));return he(D,F.signature,"result")}let B={zip215:o.zip215};function N(g,x,E,S=B){_r(S);let{context:A}=S,p=S.zip215===void 0?!!B.zip215:S.zip215,I=F.signature;g=he(g,I,"signature"),x=he(x,void 0,"message"),E=he(E,F.publicKey,"publicKey"),p!==void 0&&Tr(p,"zip215"),i&&(x=i(x));let C=I/2,L=g.subarray(0,C),j=Ys(g.subarray(C,I)),D,z,W;try{D=t.fromBytes(E,p),z=t.fromBytes(L,p),W=a.multiplyUnsafe(j)}catch{return!1}if(!p&&D.isSmallOrder())return!1;let G=O(A,L,E,x);return z.add(D.multiplyUnsafe(G)).subtract(W).clearCofactor().is0()}let M=s.BYTES,F={secretKey:M,publicKey:M,signature:2*M,seed:M};function v(g){return g=g===void 0?d(F.seed):g,he(g,F.seed,"seed")}function l(g){return $a(g)&&g.length===F.secretKey}function h(g,x){try{return!!t.fromBytes(g,x===void 0?B.zip215:x)}catch{return!1}}let y={getExtendedPublicKey:k,randomSecretKey:v,isValidSecretKey:l,isValidPublicKey:h,toMontgomery(g){if(m===void 0)throw new Error("Montgomery conversion is not supported for this curve");return m(t.fromBytes(g))},toMontgomerySecret(g){if(b===void 0)throw new Error("Montgomery conversion is not supported for this curve");return b(g)}};return Object.freeze(F),Object.freeze(y),Object.freeze({keygen:Gy(v,_),getPublicKey:_,sign:$,verify:N,utils:y,Point:t,lengths:F})}var q4=BigInt(1),oU=BigInt(2);var Q1e=BigInt(5),eye=BigInt(8),H4=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),tye={p:H4,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:eye,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function rye(t){let e=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=H4,s=t*t%i*t%i,c=Oe(s,oU,i)*s%i,f=Oe(c,q4,i)*t%i,u=Oe(f,Q1e,i)*f%i,d=Oe(u,e,i)*u%i,m=Oe(d,r,i)*d%i,b=Oe(m,n,i)*m%i,w=Oe(b,o,i)*b%i,T=Oe(w,o,i)*b%i,P=Oe(T,e,i)*u%i;return{pow_p_5_8:Oe(P,oU,i)*t%i,b2:s}}function sU(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}var iU=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function nye(t,e){let r=H4,n=Le(e*e*e,r),o=Le(n*n*e,r),i=rye(t*o).pow_p_5_8,a=Le(t*n*i,r),s=Le(e*a*a,r),c=a,f=Le(a*iU,r),u=s===t,d=s===Le(-t,r),m=s===Le(-t*iU,r);return u&&(a=c),(d||m)&&(a=f),VL(a,r)&&(a=Le(-a,r)),{isValid:u||d,value:a}}var W4=rU(tye,{uvRatio:nye}),aU=W4.Fp;function oye(t){let{y:e}=t;return aU.toBytes(aU.div(q4+e,q4-e))}function iye(t){let e=W4.Fp.BYTES;return ur(t,e),sU(O4(t.subarray(0,e))).subarray(0,e)}function aye(t){return nU(W4,O4,Object.assign({adjustScalarBytes:sU,toMontgomery:oye,toMontgomerySecret:iye,zip215:!0},t))}var cU=aye({});function Jy(t){return Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function fU(t){return`0x${Jy(t)}`}var K4=new TextEncoder;var Xy=t=>fU(t);function Zs(t,e){if(typeof t!="string"||!new RegExp(`^0x[0-9a-f]{${e*2}}$`).test(t))throw new TypeError(`expected canonical ${e}-byte hex`);return Uint8Array.from(t.slice(2).match(/../g)??[],r=>Number.parseInt(r,16))}function Yu(t){if(typeof t!="string"||!/^(?=.{2,64}$)[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(t))throw new TypeError("invalid NEAR account id");return t}function k0(t,e){if(t===null||typeof t!="object"||Array.isArray(t)||Object.keys(t).length!==e.length||!e.every(r=>Object.hasOwn(t,r)))throw new TypeError("unexpected object fields")}var Qy=class{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,r){if(Cy(e),ur(r,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("expected Hash instance");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let i=0;i<o.length;i++)o[i]^=54;this.iHash.update(o),this.oHash=e.create();for(let i=0;i<o.length;i++)o[i]^=106;this.oHash.update(o),Ro(o)}update(e){return mi(this),this.iHash.update(e),this}digestInto(e){mi(this),zu(e,this),this.finished=!0;let r=e.subarray(0,this.outputLen);this.iHash.digestInto(r),this.oHash.update(r),this.oHash.digestInto(r),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:r,iHash:n,finished:o,destroyed:i,blockLen:a,outputLen:s,canXOF:c}=this;return e=e,e.finished=o,e.destroyed=i,e.blockLen=a,e.outputLen=s,e.canXOF=c,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},uU=(()=>{let t=((e,r,n)=>new Qy(e,r).update(n).digest());return t.create=(e,r)=>new Qy(e,r),t})();var sye=BigInt(0),G4=class extends Error{constructor(e=""){super(e)}},yi={Err:G4,_tlv:{encode:(t,e)=>{let{Err:r}=yi;if(bi(t,"tag"),t<0||t>255)throw new r("tlv.encode: wrong tag");if($L(e,"data"),e.length&1)throw new r("tlv.encode: unpadded data");let n=e.length/2,o=B0(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let i=n>127?B0(o.length/2|128):"";return B0(t)+i+o+e},decode(t,e){let{Err:r}=yi;e=he(e,void 0,"DER data");let n=0;if(t<0||t>255)throw new r("tlv.decode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let o=e[n++],i=!!(o&128),a=0;if(!i)a=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let f=e.subarray(n,n+c);if(f.length!==c)throw new r("tlv.decode: length bytes not complete");if(f[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of f)a=a<<8|u;if(n+=c,a<128)throw new r("tlv.decode(long): not minimal encoding")}let s=e.subarray(n,n+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+a)}}},_int:{encode(t){let{Err:e}=yi;if(Ly(t),t<sye)throw new e("integer: negative integers are not allowed");let r=B0(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=yi;if(t.length<1)throw new e("invalid signature integer: empty");if(t[0]&128)throw new e("invalid signature integer: negative");if(t.length>1&&t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Po(t)}},toSig(t,e){let{Err:r,_int:n,_tlv:o}=yi;if(e!==void 0&&(bi(e,"maxScalarBytes"),e<1))throw new r("invalid signature: maxScalarBytes must be positive");let i=he(t,void 0,"signature"),{v:a,l:s}=o.decode(48,i);if(s.length)throw new r("invalid signature: left bytes after parsing");let{v:c,l:f}=o.decode(2,a),{v:u,l:d}=o.decode(2,f);if(d.length)throw new r("invalid signature: left bytes after parsing");if(e!==void 0&&(c.length>e||u.length>e))throw new r("invalid signature: integer too large");return{r:n.decode(c),s:n.decode(u)}},hexFromSig(t){let{_tlv:e,_int:r}=yi;_r(t,{r:"bigint",s:"bigint"},{},"sig");let n=e.encode(2,r.encode(t.r)),o=e.encode(2,r.encode(t.s)),i=n+o;return e.encode(48,i)}},eg=(Object.freeze(yi._tlv),Object.freeze(yi._int),Object.freeze(yi));var dU=(t,e)=>(t+(t>=0?e:-e)/lU)/e;function cye(t,e,r){Hu("scalar",t,gi,r);let[[n,o],[i,a]]=e,s=dU(a*t,r),c=dU(-o*t,r),f=t-s*n-c*i,u=-s*o-c*a,d=f<gi,m=u<gi;d&&(f=-f),m&&(u=-u);let b=P0(Math.ceil(Wu(r)/2))+Js;if(f<gi||f>=b||u<gi||u>=b)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:d,k1:f,k2neg:m,k2:u}}function Z4(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function V4(t,e){_r(t);let r={};for(let n of Object.keys(e))r[n]=t[n]===void 0?e[n]:t[n];return Tr(r.lowS,"lowS"),Tr(r.prehash,"prehash"),r.format!==void 0&&Z4(r.format),r}var gi=BigInt(0),Js=BigInt(1),lU=BigInt(2),Y4=BigInt(3),fye=BigInt(4);function pU(t,e={}){let r=Ky("weierstrass",t,e),n=r.Fp,o=r.Fn,i=r.CURVE,{h:a,n:s}=i;_r(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",randomBytes:"function"});let{endo:c,allowInfinityPoint:f,clearCofactor:u,isTorsionFree:d,fromBytes:m,toBytes:b}=e,w=e.randomBytes===void 0?Vs:e.randomBytes;if(c&&(!n.is0(i.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let T=c?{beta:c.beta,basises:c.basises.map(I=>[...I])}:void 0,P=mU(n,o);function R(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function k(I,C,L){if(C.is0()){if(!f)throw new Error("bad point: ZERO");return Uint8Array.of(0)}let{x:j,y:D}=C.toAffine(),z=n.toBytes(j);if(Tr(L,"isCompressed"),L){R();let W=!n.isOdd(D);return sn(hU(W),z)}else return sn(Uint8Array.of(4),z,n.toBytes(D))}function _(I){he(I,void 0,"Point");let{publicKey:C,publicKeyUncompressed:L}=P,j=I.length,D=I[0],z=I.subarray(1);if(f&&j===1&&D===0)return{x:n.ZERO,y:n.ZERO};if(j===C&&(D===2||D===3)){let W=n.fromBytes(z);if(!n.isValid(W))throw new Error("bad point: is not on curve, wrong x");let G=M(W),K;try{K=n.sqrt(G)}catch(Z){let J=Z instanceof Error?": "+Z.message:"";throw new Error("bad point: is not on curve, sqrt error"+J)}R();let Y=n.isOdd(K);return(D&1)===1!==Y&&(K=n.neg(K)),{x:W,y:K}}else if(j===L&&D===4){let W=n.BYTES,G=n.fromBytes(z.subarray(0,W)),K=n.fromBytes(z.subarray(W,W*2));if(!F(G,K))throw new Error("bad point: is not on curve");return{x:G,y:K}}else throw new Error(`bad point: got length ${j}, expected compressed=${C} or uncompressed=${L}`)}let O=b===void 0?k:b,$=m===void 0?_:m,B=n.mul(i.b,Y4),N=n.is0(i.a)?I=>n.ZERO:I=>n.mul(i.a,I);function M(I){let C=n.sqr(I),L=n.mul(C,I);return n.add(n.add(L,n.mul(I,i.a)),i.b)}function F(I,C){let L=n.sqr(C),j=M(I);return n.eql(L,j)}if(!F(i.Gx,i.Gy))throw new Error("bad curve params: generator point");let v=n.mul(n.pow(i.a,Y4),fye),l=n.mul(n.sqr(i.b),BigInt(27));if(n.is0(n.add(v,l)))throw new Error("bad curve params: a or b");function h(I,C,L=!1){if(!n.isValid(C)||L&&n.is0(C))throw new Error(`bad point coordinate ${I}`);return typeof C=="object"&&C!==null?n.create(C):C}function y(I){if(!(I instanceof S))throw new Error("Weierstrass Point expected")}function g(I){if(!T||!T.basises)throw new Error("no endo");return cye(I,T.basises,o.ORDER)}function x(I,C,L,j){if(!o.isValid(j))throw new RangeError("invalid scalar: out of range");if(T){let{k1neg:D,k1:z,k2neg:W,k2:G}=g(j),K=new S(n.mul(L.X,T.beta),L.Y,L.Z);I.push(D?L.negate():L,W?K.negate():K),C.push(z,G)}else I.push(L),C.push(j)}let E=new WeakSet;class S{static BASE=new S(i.Gx,i.Gy,n.ONE);static ZERO=new S(n.ZERO,n.ONE,n.ZERO);static Fp=n;static Fn=o;X;Y;Z;constructor(C,L,j){this.X=h("x",C),this.Y=h("y",L,!0),this.Z=h("z",j),Object.freeze(this)}static CURVE(){return i}static fromAffine(C){let{x:L,y:j}=C||{};if(!C||!n.isValid(L)||!n.isValid(j))throw new Error("invalid affine point");if(C instanceof S)throw new Error("projective point not allowed");return n.is0(L)&&n.is0(j)?S.ZERO:new S(L,j,n.ONE)}static fromBytes(C){let L=S.fromAffine($(he(C,void 0,"point")));return L.assertValidity(),L}static fromHex(C){return S.fromBytes(qu(C))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(C=6,L=!0){return p.setWindowSize(this,C),L||this.multiply(Y4),this}assertValidity(){let C=this;if(C.is0()){if(f&&n.is0(C.X)&&n.eql(C.Y,n.ONE)&&n.is0(C.Z))return;throw new Error("bad point: ZERO")}if(E.has(C))return;let{x:L,y:j}=C.toAffine();if(!n.isValid(L)||!n.isValid(j))throw new Error("bad point: x or y not field elements");if(!F(L,j))throw new Error("bad point: equation left != right");if(!C.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");E.add(C)}hasEvenY(){let{y:C}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(C)}equals(C){y(C);let{X:L,Y:j,Z:D}=this,{X:z,Y:W,Z:G}=C,K=n.eql(n.mul(L,G),n.mul(z,D)),Y=n.eql(n.mul(j,G),n.mul(W,D));return K&&Y}negate(){return new S(this.X,n.neg(this.Y),this.Z)}double(){let{X:C,Y:L,Z:j}=this,D=n.ZERO,z=n.ZERO,W=n.ZERO,G=n.mul(C,C),K=n.mul(L,L),Y=n.mul(j,j),X=n.mul(C,L);return X=n.add(X,X),W=n.mul(C,j),W=n.add(W,W),D=N(W),z=n.mul(B,Y),z=n.add(D,z),D=n.sub(K,z),z=n.add(K,z),z=n.mul(D,z),D=n.mul(X,D),W=n.mul(B,W),Y=N(Y),X=n.sub(G,Y),X=N(X),X=n.add(X,W),W=n.add(G,G),G=n.add(W,G),G=n.add(G,Y),G=n.mul(G,X),z=n.add(z,G),Y=n.mul(L,j),Y=n.add(Y,Y),G=n.mul(Y,X),D=n.sub(D,G),W=n.mul(Y,K),W=n.add(W,W),W=n.add(W,W),new S(D,z,W)}add(C){y(C);let{X:L,Y:j,Z:D}=this,{X:z,Y:W,Z:G}=C,K=n.ZERO,Y=n.ZERO,X=n.ZERO,Z=n.mul(L,z),J=n.mul(j,W),ie=n.mul(D,G),te=n.add(L,j),Q=n.add(z,W);te=n.mul(te,Q),Q=n.add(Z,J),te=n.sub(te,Q),Q=n.add(L,D);let be=n.add(z,G);return Q=n.mul(Q,be),be=n.add(Z,ie),Q=n.sub(Q,be),be=n.add(j,D),K=n.add(W,G),be=n.mul(be,K),K=n.add(J,ie),be=n.sub(be,K),X=N(Q),K=n.mul(B,ie),X=n.add(K,X),K=n.sub(J,X),X=n.add(J,X),Y=n.mul(K,X),J=n.add(Z,Z),J=n.add(J,Z),ie=N(ie),Q=n.mul(B,Q),J=n.add(J,ie),ie=n.sub(Z,ie),ie=N(ie),Q=n.add(Q,ie),Z=n.mul(J,Q),Y=n.add(Y,Z),Z=n.mul(be,Q),K=n.mul(te,K),K=n.sub(K,Z),Z=n.mul(te,J),X=n.mul(be,X),X=n.add(X,Z),new S(K,Y,X)}subtract(C){return y(C),this.add(C.negate())}is0(){return this.equals(S.ZERO)}multiply(C){if(!o.isValidNot0(C))throw new RangeError("invalid scalar: out of range");let{p:L,f:j}=p.mulSecret(this,C,a,A);return A([L,j])[0]}multiplyUnsafe(C){let L=this,j=C;if(!o.isValid(j))throw new RangeError("invalid scalar: out of range");if(j===gi||L.is0())return S.ZERO;if(j===Js)return L;if(p.hasWindowSize(this))return p.mulUnsafe(L,j,A);let D=[],z=[];return x(D,z,L,j),Wy(S,D,z)}mulAddUnsafe(C,L,j){y(L);let D=[],z=[];return x(D,z,this,C),x(D,z,L,j),Wy(S,D,z)}toAffine(C){let L=this,j=C;if(j!=null&&!n.isValid(j))throw new RangeError('"invertedZ" expected valid field element');let{X:D,Y:z,Z:W}=L;if(n.eql(W,n.ONE))return{x:D,y:z};let G=L.is0();j==null&&(j=G?n.ONE:n.inv(W));let K=n.mul(D,j),Y=n.mul(z,j),X=n.mul(W,j);if(G)return{x:n.ZERO,y:n.ZERO};if(!n.eql(X,n.ONE))throw new Error("invZ was invalid");return{x:K,y:Y}}isTorsionFree(){return a===Js?!0:d?d(S,this):p.mulUnsafe(this,s).is0()}clearCofactor(){return a===Js?this:u?u(S,this):this.multiplyUnsafe(a)}isSmallOrder(){return a===Js?this.is0():this.clearCofactor().is0()}toBytes(C=!0){return Tr(C,"isCompressed"),this.assertValidity(),O(S,this,C)}toHex(C=!0){return _0(this.toBytes(C))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let A=I=>Hy(S,I),p=new Vu(S,w);return p.bits>=6&&S.BASE.precompute(6),Object.freeze(S.prototype),Object.freeze(S),S}function hU(t){return Uint8Array.of(t?2:3)}function mU(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function uye(t,e={}){Fa(t);let{Fn:r}=t,n=e.randomBytes===void 0?Vs:e.randomBytes,o=Object.assign(mU(t.Fp,r),{seed:Math.max(zy(r.ORDER),16)});function i(b){try{let w=r.fromBytes(b);return r.isValidNot0(w)}catch{return!1}}function a(b,w){let{publicKey:T,publicKeyUncompressed:P}=o;try{let R=b.length;return w===!0&&R!==T||w===!1&&R!==P?!1:!t.fromBytes(b).is0()}catch{return!1}}function s(b){return b=b===void 0?n(o.seed):b,qy(he(b,o.seed,"seed"),r.ORDER)}function c(b,w=!0){return t.BASE.multiply(r.fromBytes(b)).toBytes(w)}function f(b){let{secretKey:w,publicKey:T,publicKeyUncompressed:P}=o,R=r._lengths;if(!$a(b))return;let k=he(b,void 0,"key").length,_=k===T||k===P,O=k===w||!!R?.includes(k);if(!(_&&O))return _}function u(b,w,T=!0){if(f(b)===!0)throw new Error("first arg must be private key");if(f(w)===!1)throw new Error("second arg must be public key");let P=r.fromBytes(b),R=t.fromBytes(w);if(R.is0())throw new Error("invalid public key: point at infinity");return R.multiply(P).toBytes(T)}let d={isValidSecretKey:i,isValidPublicKey:a,randomSecretKey:s},m=Gy(s,c);return Object.freeze(d),Object.freeze(o),Object.freeze({getPublicKey:c,getSharedSecret:u,keygen:m,Point:t,utils:d,lengths:o})}function bU(t,e,r={}){Fa(t);let n=e;Cy(n),_r(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let o=Object.assign({},r),i=o.randomBytes===void 0?Vs:o.randomBytes,a=o.hmac===void 0?(I,C)=>uU(n,I,C):o.hmac,{Fp:s,Fn:c}=t,{ORDER:f,BITS:u}=c,d=zy(f),m=z4(i,d),{keygen:b,getPublicKey:w,getSharedSecret:T,utils:P,lengths:R}=uye(t,o),k={prehash:!0,lowS:typeof o.lowS=="boolean"?o.lowS:!0,format:"compact",extraEntropy:!1},_=f*lU+Js<s.ORDER;function O(I){let C=f>>Js;return I>C}function $(I,C){if(!c.isValidNot0(C))throw new Error(`invalid signature ${I}: out of range 1..Point.Fn.ORDER`);return C}function B(){if(!s.isOdd)throw new Error("Field doesn't support isOdd")}function N(I,C,L){return B(),(I===L?0:2)|Number(s.isOdd(C))}function M(){if(_)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function F(I,C){Z4(C);let L=R.signature,j=C==="compact"?L:C==="recovered"?L+1:void 0;return he(I,j)}class v{r;s;recovery;constructor(C,L,j){if(this.r=$("r",C),this.s=$("s",L),j!=null){if(M(),![0,1,2,3].includes(j))throw new Error("invalid recovery id");this.recovery=j}Object.freeze(this)}static fromBytes(C,L=k.format){F(C,L);let j;if(L==="der"){if(C.length>2*c.BYTES+16)throw new eg.Err("invalid signature: DER signature too long");let{r:G,s:K}=eg.toSig(he(C),c.BYTES+1);return new v(G,K)}L==="recovered"&&(j=C[0],L="compact",C=C.subarray(1));let D=R.signature/2,z=C.subarray(0,D),W=C.subarray(D,D*2);return new v(c.fromBytes(z),c.fromBytes(W),j)}static fromHex(C,L){return this.fromBytes(qu(C),L)}assertRecovery(){let{recovery:C}=this;if(C==null)throw new Error("invalid recovery id: must be present");return C}addRecoveryBit(C){return new v(this.r,this.s,C)}recoverPublicKey(C){let{r:L,s:j}=this,D=this.assertRecovery(),z=D===2||D===3?L+f:L;if(!s.isValid(z))throw new Error("invalid recovery id: sig.r+curve.n != R.x");let W=s.toBytes(z),G=t.fromBytes(sn(hU((D&1)===0),W)),K=c.inv(z),Y=h(he(C,void 0,"msgHash")),X=c.create(-Y*K),Z=c.create(j*K),J=t.BASE.mulAddUnsafe(X,G,Z);if(J.is0())throw new Error("invalid recovery: point at infinify");return J.assertValidity(),J}hasHighS(){return O(this.s)}toBytes(C=k.format){if(Z4(C),C==="der")return qu(eg.hexFromSig(this));let{r:L,s:j}=this,D=c.toBytes(L),z=c.toBytes(j);return C==="recovered"?(M(),sn(Uint8Array.of(this.assertRecovery()),D,z)):sn(D,z)}toHex(C){return _0(this.toBytes(C))}}Object.freeze(v.prototype),Object.freeze(v);let l=o.bits2int===void 0?function(C){if(C.length>8192)throw new Error("input is too large");let L=Po(C),j=C.length*8-u;return j>0?L>>BigInt(j):L}:o.bits2int,h=o.bits2int_modN===void 0?function(C){return c.create(l(C))}:o.bits2int_modN,y=P0(u);function g(I){return Hu("num < 2^"+u,I,gi,y),c.toBytes(I)}function x(I,C){return he(I,void 0,"message"),C?he(n(I),void 0,"prehashed message"):I}function E(I,C,L){let{lowS:j,prehash:D,extraEntropy:z}=V4(L,k);I=x(I,D);let W=h(I),G=c.fromBytes(C);if(!c.isValidNot0(G))throw new Error("invalid private key");let K=[g(G),g(W)];if(z!=null&&z!==!1){let J=z===!0?i(R.secretKey):z;K.push(he(J,void 0,"extraEntropy"))}let Y=sn(...K),X=W;function Z(J){let ie=l(J);if(!c.isValidNot0(ie))return;let te=t.BASE.multiply(ie).toAffine(),Q=c.create(te.x);if(Q===gi)return;let be;if(m!==void 0){let qn=Po(qy(m(d),f)),Be=c.inv(c.mul(qn,ie)),Re=c.mul(qn,X),vi=c.mul(qn,G);be=c.create(Be*c.create(Re+vi*Q))}else{let qn=WL(ie,f);be=c.create(qn*c.create(X+Q*G))}if(be===gi)return;let Ae=N(te.x,te.y,Q),_e=be;return j&&O(be)&&(_e=c.neg(be),Ae^=1),new v(Q,_e,_?void 0:Ae)}return{seed:Y,k2sig:Z}}function S(I,C,L={}){let{seed:j,k2sig:D}=E(I,C,L);return FL(n.outputLen,c.BYTES,a)(j,D).toBytes(L.format)}function A(I,C,L,j={}){let{lowS:D,prehash:z,format:W}=V4(j,k);if(L=he(L,void 0,"publicKey"),C=x(C,z),!$a(I)){let G=I instanceof v?", use sig.toBytes()":"";throw new Error("verify expects Uint8Array signature"+G)}F(I,W);try{let G=v.fromBytes(I,W),K=t.fromBytes(L);if(K.is0()||D&&G.hasHighS())return!1;let{r:Y,s:X}=G,Z=h(C),J=c.inv(X),ie=c.create(Z*J),te=c.create(Y*J),Q=t.BASE.mulAddUnsafe(ie,K,te);if(Q.is0())return!1;let be=Q.toAffine();return!(c.create(be.x)!==Y||W==="recovered"&&G.recovery!==N(be.x,be.y,Y))}catch{return!1}}function p(I,C,L={}){let{prehash:j}=V4(L,k);return C=x(C,j),v.fromBytes(I,"recovered").recoverPublicKey(C).toBytes()}return Object.freeze({keygen:b,getPublicKey:w,getSharedSecret:T,utils:P,lengths:R,Point:t,sign:S,verify:A,recoverPublicKey:p,Signature:v,hash:n})}var X4={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},dye={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]};var yU=BigInt(2);function lye(t){let e=X4.p,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),c=BigInt(88),f=t*t*t%e,u=f*f*t%e,d=Oe(u,r,e)*u%e,m=Oe(d,r,e)*u%e,b=Oe(m,yU,e)*f%e,w=Oe(b,o,e)*b%e,T=Oe(w,i,e)*w%e,P=Oe(T,s,e)*T%e,R=Oe(P,c,e)*P%e,k=Oe(R,s,e)*T%e,_=Oe(k,r,e)*u%e,O=Oe(_,a,e)*w%e,$=Oe(O,n,e)*f%e,B=Oe($,yU,e);if(!J4.eql(J4.sqr(B),t))throw new Error("Cannot find square root");return B}var J4=Gu(X4.p,{sqrt:lye}),pye=pU(X4,{Fp:J4,endo:dye}),tg=bU(pye,kL);var hye=BigInt(0),M0=BigInt(1),mye=BigInt(2),bye=BigInt(7),yye=BigInt(256),gye=BigInt(113),xU=[],wU=[],EU=[];for(let t=0,e=M0,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],xU.push(2*(5*n+r)),wU.push((t+1)*(t+2)/2%64);let o=hye;for(let i=0;i<7;i++)e=(e<<M0^(e>>bye)*gye)%yye,e&mye&&(o^=M0<<(M0<<BigInt(i))-M0);EU.push(o)}var AU=By(EU,!0),vye=AU[0],xye=AU[1],wye=(t,e,r)=>t<<r|e>>>32-r,Eye=(t,e,r)=>e<<r|t>>>32-r,Aye=(t,e,r)=>e<<r-32|t>>>64-r,Sye=(t,e,r)=>t<<r-32|e>>>64-r,gU=(t,e,r)=>r>32?Aye(t,e,r):wye(t,e,r),vU=(t,e,r)=>r>32?Sye(t,e,r):Eye(t,e,r),Zu=new Uint32Array(10);function Iye(t,e=24){if(!(t instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof t);if(t.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+t.length);if(Qt(e,"rounds"),e<1||e>24)throw new Error('"rounds" expected integer 1..24');for(let r=24-e;r<24;r++){for(let i=0;i<10;i++)Zu[i]=t[i]^t[i+10]^t[i+20]^t[i+30]^t[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,s=(i+2)%10,c=Zu[s],f=Zu[s+1],u=gU(c,f,1)^Zu[a],d=vU(c,f,1)^Zu[a+1];for(let m=0;m<50;m+=10)t[i+m]^=u,t[i+m+1]^=d}let n=t[2],o=t[3];for(let i=0;i<24;i++){let a=wU[i],s=gU(n,o,a),c=vU(n,o,a),f=xU[i];n=t[f],o=t[f+1],t[f]=s,t[f+1]=c}for(let i=0;i<50;i+=10){let a=t[i],s=t[i+1],c=t[i+2],f=t[i+3];t[i]^=~t[i+2]&t[i+4],t[i+1]^=~t[i+3]&t[i+5],t[i+2]^=~t[i+4]&t[i+6],t[i+3]^=~t[i+5]&t[i+7],t[i+4]^=~t[i+6]&t[i+8],t[i+5]^=~t[i+7]&t[i+9],t[i+6]^=~t[i+8]&a,t[i+7]^=~t[i+9]&s,t[i+8]^=~a&c,t[i+9]^=~s&f}t[0]^=vye[r],t[1]^=xye[r]}Ro(Zu)}var Q4=class t{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;canXOF;enableXOF=!1;rounds;constructor(e,r,n,o=!1,i=24){if(Qt(e,"blockLen"),Qt(r,"suffix"),Qt(i,"rounds"),SL(o,"enableXOF"),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.canXOF=o,this.rounds=i,Qt(n,"outputLen"),!(0<e&&e<200))throw new Error('"blockLen" must be 1..199');this.state=new Uint8Array(200),this.state32=I4(this.state)}clone(){return this._cloneInto()}keccak(){T4(this.state32),Iye(this.state32,this.rounds),T4(this.state32),this.posOut=0,this.pos=0}update(e){mi(this),ur(e);let{blockLen:r,state:n,state32:o}=this,i=e.length,a=r%4===0&&e.byteOffset%4===0,s=r/4,c=a&&i>=r?I4(e):void 0;for(let f=0;f<i;){if(c!==void 0&&this.pos===0&&f%4===0&&i-f>=r){for(let d=0,m=f/4;d<s;d++)o[d]^=c[m+d];f+=r,this.pos=r,this.keccak();continue}let u=Math.min(r-this.pos,i-f);for(let d=0;d<u;d++)n[this.pos++]^=e[f++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:o}=this;e[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),e[o-1]^=128,this.keccak()}writeInto(e){mi(this,!1),ur(e),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,i=e.length;o<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-o);e.set(r.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(e)}xof(e){return Qt(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(zu(e,this),this.finished)throw new Error("digest() was already called");this.writeInto(e.length===this.outputLen?e:e.subarray(0,this.outputLen)),this.destroy()}digest(){let e=new Uint8Array(this.outputLen);return this.digestInto(e),e}destroy(){this.destroyed=!0,Ro(this.state)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:a}=this;return e||=new t(r,n,o,a,i),e.blockLen=r,e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=o,e.enableXOF=a,e.canXOF=this.canXOF,e.destroyed=this.destroyed,e}},Tye=(t,e,r,n={})=>I0(()=>new Q4(e,t,r),n);var eE=Tye(1,136,32);var SU=new TextEncoder,IU=(...t)=>Uint8Array.from(t.flatMap(e=>Array.from(e)));function TU(t,e,r){return _ye(t,e)===r.toLowerCase()}function _ye(t,e){if(e.length!==65||e[64]!==27&&e[64]!==28||BigInt(`0x${Jy(e.subarray(32,64))}`)>tg.Point.Fn.ORDER/2n)return null;let n=SU.encode(t),o=eE(IU(SU.encode(`Ethereum Signed Message:
50
+ ${n.length}`),n));try{let i=IU(new Uint8Array([(e[64]??27)-27]),e.subarray(0,64)),a=tg.Point.fromBytes(tg.recoverPublicKey(i,o,{prehash:!1}));return`0x${Jy(eE(a.toBytes(!1).subarray(1)).subarray(12))}`}catch{return null}}function $0(t){k0(t,["kind","id"]);let{kind:e,id:r}=t;if(typeof r!="string")throw new TypeError("invalid identity id");if(e==="near")return{kind:e,id:Yu(r)};if(e==="evm"){let n=r.toLowerCase();return Zs(n,20),{kind:e,id:n}}if(e==="solana"){let n;if(/^[a-fA-F0-9]{64}$/.test(r))n=Zs(`0x${r.toLowerCase()}`,32);else{if(r.length<32||r.length>44)throw new TypeError("invalid Solana key");if(n=y8.decode(r),n.length!==32||y8.encode(n)!==r)throw new TypeError("invalid Solana key")}return{kind:e,id:Xy(n).slice(2)}}throw new TypeError("unknown identity kind")}function _U(t,e,r,n){try{let o=$0(t);if(typeof e!="string"||e.includes("\r")||e.endsWith(`
51
+ `))return!1;if(o.kind==="near")return r===void 0&&n===o.id;if(k0(r,["kind","sig"]),r.kind!==o.kind)return!1;let i=Zs(r.sig,o.kind==="evm"?65:64);return o.kind==="evm"?TU(e,i,o.id):cU.verify(i,K4.encode(e),Zs(`0x${o.id}`,32),{zip215:!1})}catch{return!1}}function RU(t,e){let r="provider"in t?t.provider:t,n=$0({kind:"evm",id:e}),o=x4({chain:Ty,transport:w4(r)}),i=async()=>{let a=await r.request({method:"eth_accounts"});if(!Array.isArray(a)||!a.some(s=>typeof s=="string"&&s.toLowerCase()===n.id))throw new Ra("wrong_identity","wallet does not control the selected identity")};return{identity:n,address:n.id,async authorize(a){await i();let c={kind:"evm",sig:await o.signMessage({account:n.id,message:a})};if(!_U(n,a,c))throw new Ra("invalid_signature","wallet signature does not match identity");return c},async signTypedData(a){return await i(),o.signTypedData({...a,account:n.id})}}}Object.assign(globalThis,{Buffer:ng.Buffer});var $ye=document.getElementById("pair"),Nye=document.getElementById("action"),La=document.getElementById("status"),N0=document.getElementById("approve"),rg=new URLSearchParams(location.hash.slice(1)),oE=location.pathname==="/callback",F0=oE?"":location.hash.slice(1);history.replaceState(null,"",location.pathname);var ig=async(t,e)=>{let r=await fetch(t,{method:"POST",headers:{authorization:`Bearer ${F0}`,"content-type":"application/json"},cache:"no-store",credentials:"omit",redirect:"error",body:JSON.stringify(e??{})});if(!r.ok)throw new Error("Session expired or wallet result rejected. Return to the terminal.");return r.json()},nE=new Set,og=new Map,Ju;oE?(window.opener?.postMessage({type:"annon-wallet-result",state:rg.get("state"),result:{accountId:rg.get("accountId"),publicKey:rg.get("publicKey"),signature:rg.get("signature")}},location.origin),La.textContent="Proof returned to the approval window. Return to your terminal."):window.addEventListener("message",t=>{if(t.origin!==location.origin||t.data?.type!=="annon-wallet-result")return;let e=og.get(t.data.state);e&&(og.delete(t.data.state),ig("/api/result",{id:e,result:t.data.result}).then(()=>{La.textContent="Proof verified. Return to your terminal."}).catch(r=>{La.textContent=r.message}))});async function PU(){if(!F0){La.textContent="Open the exact URL printed by your CLI.";return}try{let t=await ig("/api/action");$ye.textContent=`Pairing code: ${t.pairingCode}. Match this with your terminal.`,Ju=t.action??void 0,Nye.textContent=Ju?JSON.stringify(Ju,null,2):"Waiting for the CLI\u2026",N0.disabled=!Ju||nE.has(Ju.id),setTimeout(()=>{PU()},1e3)}catch(t){La.textContent=t.message,F0="",N0.disabled=!0}}N0.onclick=async()=>{let t=Ju;if(!(!t||nE.has(t.id)||Date.now()>=t.expiresAt)){nE.add(t.id),N0.disabled=!0;try{let e;if(t.operation.startsWith("evm.")){let r=window.ethereum;if(!r)throw new Error("Install an injected EVM wallet.");let n=await r.request({method:"eth_requestAccounts"}),o=t.account||n[0];if(!o)throw new Error("No account");let i=await r.request({method:"eth_chainId"});if(`eip155:${BigInt(String(i))}`!==t.chain)throw new Error(`Select ${t.chain} in your wallet.`);let a=RU(r,o.toLowerCase());e=t.operation==="evm.personalSign"?{signature:(await a.authorize(t.payload.message))?.sig??"",account:a.identity.id}:{signature:await a.signTypedData(t.payload)}}else{let r=t.chain==="near:mainnet"?"mainnet":"testnet",o=await(await tB({network:r,modules:[ak()]})).wallet("my-near-wallet"),i=await Bk(o),a=t.account||i[0]?.accountId;if(!a||!i.some(s=>s.accountId===a))throw new Error("Select the requested NEAR account.");if(t.operation==="near.nep413"){if(!o.signMessage)throw new Error("NEP-413 unavailable");let s=t.payload,c=crypto.randomUUID();og.set(c,t.id);let f=await o.signMessage({...s,nonce:ng.Buffer.from(s.nonce),state:c});if(!f)return;og.delete(c),e=f}else{let s=t.payload,c=await o.signAndSendTransaction({signerId:a,receiverId:s.receiverId,actions:[{functionCall:{methodName:s.method,args:ng.Buffer.from(JSON.stringify(s.args)),gas:BigInt(s.gas),deposit:BigInt(s.deposit)}}]});if(!c)return;e={txHash:c.transaction.hash}}}await ig("/api/result",{id:t.id,result:e}),La.textContent="Verified. Return to the terminal."}catch(e){La.textContent=e.message}finally{N0.disabled=!0}}};oE||(async()=>{F0||(F0=(await ig("/api/bootstrap")).capability),await PU()})().catch(t=>{La.textContent=t.message});})();
52
+ /*! Bundled license information:
53
+
54
+ mustache/mustache.js:
55
+ (*!
56
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
57
+ * http://github.com/janl/mustache.js
58
+ *)
59
+
60
+ @scure/base/lib/esm/index.js:
61
+ @scure/base/index.js:
62
+ (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
63
+
64
+ depd/lib/browser/index.js:
65
+ (*!
66
+ * depd
67
+ * Copyright(c) 2015 Douglas Christopher Wilson
68
+ * MIT Licensed
69
+ *)
70
+
71
+ @noble/hashes/esm/utils.js:
72
+ @noble/hashes/esm/utils.js:
73
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
74
+
75
+ js-sha256/src/sha256.js:
76
+ (**
77
+ * [js-sha256]{@link https://github.com/emn178/js-sha256}
78
+ *
79
+ * @version 0.9.0
80
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
81
+ * @copyright Chen, Yi-Cyuan 2014-2017
82
+ * @license MIT
83
+ *)
84
+
85
+ ieee754/index.js:
86
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
87
+
88
+ buffer/index.js:
89
+ (*!
90
+ * The buffer module from node.js, for the browser.
91
+ *
92
+ * @author Feross Aboukhadijeh <https://feross.org>
93
+ * @license MIT
94
+ *)
95
+
96
+ @noble/curves/esm/abstract/utils.js:
97
+ @noble/curves/esm/abstract/modular.js:
98
+ @noble/curves/esm/abstract/curve.js:
99
+ @noble/curves/esm/abstract/weierstrass.js:
100
+ @noble/curves/esm/_shortw_utils.js:
101
+ @noble/curves/esm/secp256k1.js:
102
+ @noble/curves/esm/abstract/utils.js:
103
+ @noble/curves/esm/abstract/modular.js:
104
+ @noble/curves/esm/abstract/curve.js:
105
+ @noble/curves/esm/abstract/edwards.js:
106
+ @noble/curves/esm/ed25519.js:
107
+ @noble/curves/utils.js:
108
+ @noble/curves/abstract/modular.js:
109
+ @noble/curves/abstract/curve.js:
110
+ @noble/curves/abstract/edwards.js:
111
+ @noble/curves/ed25519.js:
112
+ @noble/curves/abstract/der.js:
113
+ @noble/curves/abstract/weierstrass.js:
114
+ @noble/curves/secp256k1.js:
115
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
116
+ */